crud room, incident type, catalog, and sample-containers
This commit is contained in:
134
app/Http/Controllers/ContainerTypeController.php
Normal file
134
app/Http/Controllers/ContainerTypeController.php
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
use App\Enums\RecordStatusEnum;
|
||||||
|
use App\Http\Controllers\Helper\GlobalController;
|
||||||
|
use App\Models\BaseModel;
|
||||||
|
use App\Models\Concept;
|
||||||
|
use App\Models\ContainerType;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
|
||||||
|
class ContainerTypeController extends Controller
|
||||||
|
{
|
||||||
|
protected $model;
|
||||||
|
protected $baseOrganizationId;
|
||||||
|
protected $conceptModel;
|
||||||
|
|
||||||
|
public function __construct(){
|
||||||
|
$this->baseOrganizationId = Session::get('base_organization_id');
|
||||||
|
$this->base = Session::get('base_organization');
|
||||||
|
$this->model = new ContainerType();
|
||||||
|
$this->conceptModel = new Concept();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request){
|
||||||
|
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
|
||||||
|
$concepts = $this->conceptModel::query()->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)->get();
|
||||||
|
$containerTypes = $this->model::with(['containerName', 'sampleType'])->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
|
||||||
|
->when(!empty($request->kword), function ($query) use($request){
|
||||||
|
$query->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||||
|
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||||
|
return view('sample_container', ['containerTypes' => $containerTypes, 'concepts' => $concepts]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(Request $request){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'cap_color' => 'required',
|
||||||
|
'container_type_concept_id' => 'required',
|
||||||
|
'sample_type_concept_id' => 'required',
|
||||||
|
'volume_ml' => 'integer|required'
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return response()->json(['success' => false, 'message' => __('building.create_fail'), 'errors' => $validator->errors()->all()]);
|
||||||
|
}
|
||||||
|
$data = array(
|
||||||
|
'container_type_concept_id' => $request->container_type_concept_id,
|
||||||
|
'sample_type_concept_id' => $request->sample_type_concept_id,
|
||||||
|
'additive' => $request->additive,
|
||||||
|
'cap_color' => $request->cap_color,
|
||||||
|
'volume_ml' => $request->volume_ml,
|
||||||
|
'storage_temp' => $request->storage_temp,
|
||||||
|
'sterile' => $request->sterile,
|
||||||
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
|
'created_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->insert($data);
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.create_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.create_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function update(Request $request){
|
||||||
|
try {
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'cap_color' => 'required',
|
||||||
|
'container_type_concept_id' => 'required',
|
||||||
|
'sample_type_concept_id' => 'required',
|
||||||
|
'volume_ml' => 'integer|required'
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) return response()->json(['errors' => $validator->errors()->all()]);
|
||||||
|
$data = array(
|
||||||
|
'container_type_concept_id' => $request->container_type_concept_id,
|
||||||
|
'sample_type_concept_id' => $request->sample_type_concept_id,
|
||||||
|
'additive' => $request->additive,
|
||||||
|
'cap_color' => $request->cap_color,
|
||||||
|
'volume_ml' => $request->volume_ml,
|
||||||
|
'storage_temp' => $request->storage_temp,
|
||||||
|
'sterile' => $request->sterile,
|
||||||
|
'updated_at' => date('Y-m-d H:i:s'),
|
||||||
|
'updated_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->where('id', $request->container_type_id)->update($data);
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.update_success')]);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.update_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get(Request $request){
|
||||||
|
try{
|
||||||
|
$lab = $this->model::query()->where('id', $request->container_type_id)->get()->first();
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.get_success'), 'data' => $lab]);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.get_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(Request $request){
|
||||||
|
try{
|
||||||
|
$this->model::query()->where('id', $request->container_type_id)->update(array(
|
||||||
|
BaseModel::DELETED_AT_FIELD => date('Y-m-d H:i:s'),
|
||||||
|
BaseModel::DELETED_BY_FIELD => Auth::id(),
|
||||||
|
BaseModel::RECORD_STATUS_FIELD => RecordStatusEnum::DELETE
|
||||||
|
));
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.delete_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.delete_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restore(Request $request){
|
||||||
|
try{
|
||||||
|
$this->model::query()->where('id', $request->container_type_id)->update(array(BaseModel::RECORD_STATUS_FIELD=> RecordStatusEnum::ACTIVE));
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.restore_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.restore_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
123
app/Http/Controllers/IncidentTypeController.php
Normal file
123
app/Http/Controllers/IncidentTypeController.php
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
use App\Enums\RecordStatusEnum;
|
||||||
|
use App\Http\Controllers\Helper\GlobalController;
|
||||||
|
use App\Models\BaseModel;
|
||||||
|
use App\Models\IncidentType;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
|
||||||
|
class IncidentTypeController extends Controller
|
||||||
|
{
|
||||||
|
protected $model;
|
||||||
|
protected $baseOrganizationId;
|
||||||
|
|
||||||
|
public function __construct(){
|
||||||
|
$this->base = Session::get('base_organization');
|
||||||
|
$this->model = new IncidentType();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request){
|
||||||
|
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
|
||||||
|
$incidentTypes = $this->model::query()->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
|
||||||
|
->when(!empty($request->kword), function ($query) use($request){
|
||||||
|
$query->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(code, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||||
|
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||||
|
return view('incident_type', ['incidentTypes' => $incidentTypes]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(Request $request){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'name_en' => 'required',
|
||||||
|
'name_kh' => 'required',
|
||||||
|
'code' => 'required',
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return response()->json(['success' => false, 'message' => __('building.create_fail'), 'errors' => $validator->errors()->all()]);
|
||||||
|
}
|
||||||
|
$data = array(
|
||||||
|
'name_en' => $request->name_en,
|
||||||
|
'name_kh' => $request->name_kh,
|
||||||
|
'code' => $request->code,
|
||||||
|
'description' => $request->description,
|
||||||
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
|
'created_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->insert($data);
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.create_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.create_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function update(Request $request){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'name_en' => 'required',
|
||||||
|
'name_kh' => 'required',
|
||||||
|
'code' => 'required',
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) return response()->json(['errors' => $validator->errors()->all()]);
|
||||||
|
$data = array(
|
||||||
|
'name_en' => $request->name_en,
|
||||||
|
'name_kh' => $request->name_kh,
|
||||||
|
'code' => $request->code,
|
||||||
|
'description' => $request->description,
|
||||||
|
'updated_at' => date('Y-m-d H:i:s'),
|
||||||
|
'updated_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->where('id', $request->incident_type_id)->update($data);
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.update_success')]);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.update_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get(Request $request){
|
||||||
|
try{
|
||||||
|
$lab = $this->model::query()->where('id', $request->incident_type_id)->get()->first();
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.get_success'), 'data' => $lab]);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.get_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(Request $request){
|
||||||
|
try{
|
||||||
|
$this->model::query()->where('id', $request->incident_type_id)->update(array(
|
||||||
|
BaseModel::DELETED_AT_FIELD => date('Y-m-d H:i:s'),
|
||||||
|
BaseModel::DELETED_BY_FIELD => Auth::id(),
|
||||||
|
BaseModel::RECORD_STATUS_FIELD => RecordStatusEnum::DELETE
|
||||||
|
));
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.delete_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.delete_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restore(Request $request){
|
||||||
|
try{
|
||||||
|
$this->model::query()->where('id', $request->incident_type_id)->update(array(BaseModel::RECORD_STATUS_FIELD=> RecordStatusEnum::ACTIVE));
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.restore_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.restore_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
147
app/Http/Controllers/RoomController.php
Normal file
147
app/Http/Controllers/RoomController.php
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
use App\Enums\RecordStatusEnum;
|
||||||
|
use App\Http\Controllers\Helper\GlobalController;
|
||||||
|
use App\Models\BaseModel;
|
||||||
|
use App\Models\Building;
|
||||||
|
use App\Models\Concept;
|
||||||
|
use App\Models\Room;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
|
||||||
|
class RoomController extends Controller
|
||||||
|
{
|
||||||
|
protected $model;
|
||||||
|
protected $baseOrganizationId;
|
||||||
|
protected $buildingModel;
|
||||||
|
protected $conceptModel;
|
||||||
|
|
||||||
|
public function __construct(){
|
||||||
|
$this->baseOrganizationId = Session::get('base_organization_id');
|
||||||
|
$this->base = Session::get('base_organization');
|
||||||
|
$this->model = new Room();
|
||||||
|
$this->buildingModel = new Building();
|
||||||
|
$this->conceptModel = new Concept();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request){
|
||||||
|
$recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE];
|
||||||
|
$buildings = $this->buildingModel::query()->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)
|
||||||
|
->where('organization_id', $this->baseOrganizationId)->get();
|
||||||
|
$concepts = $this->conceptModel::query()->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE)->get();
|
||||||
|
$rooms = $this->model::with(['building', 'bsl'])->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
|
||||||
|
->where('organization_id', $this->baseOrganizationId)
|
||||||
|
->when(!empty($request->kword), function ($query) use($request){
|
||||||
|
$query->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(code, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||||
|
})->when(!empty(trim($request->building_id)), function ($query) use($request){
|
||||||
|
$query->where('building_id', $request->building_id);
|
||||||
|
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||||
|
return view('room', ['rooms' => $rooms, 'buildings' => $buildings, 'concepts' => $concepts]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(Request $request){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'name_en' => 'required',
|
||||||
|
'name_kh' => 'required',
|
||||||
|
'building_id' => 'required',
|
||||||
|
'code' => 'required',
|
||||||
|
'biosafety_level_concept_id' => 'required'
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return response()->json(['success' => false, 'message' => __('building.create_fail'), 'errors' => $validator->errors()->all()]);
|
||||||
|
}
|
||||||
|
$data = array(
|
||||||
|
'name_en' => $request->name_en,
|
||||||
|
'name_kh' => $request->name_kh,
|
||||||
|
'code' => $request->code,
|
||||||
|
'description' => $request->description,
|
||||||
|
'building_id' => $request->building_id,
|
||||||
|
'biosafety_level_concept_id' => $request->biosafety_level_concept_id,
|
||||||
|
'temperature_range' => $request->temperature_range,
|
||||||
|
'organization_id' => $this->baseOrganizationId,
|
||||||
|
'created_at' => date('Y-m-d H:i:s'),
|
||||||
|
'created_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->insert($data);
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.create_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.create_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function update(Request $request){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'name_en' => 'required',
|
||||||
|
'name_kh' => 'required',
|
||||||
|
'building_id' => 'required',
|
||||||
|
'code' => 'required',
|
||||||
|
'biosafety_level_concept_id' => 'required'
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) return response()->json(['errors' => $validator->errors()->all()]);
|
||||||
|
$data = array(
|
||||||
|
'name_en' => $request->name_en,
|
||||||
|
'name_kh' => $request->name_kh,
|
||||||
|
'code' => $request->code,
|
||||||
|
'description' => $request->description,
|
||||||
|
'building_id' => $request->building_id,
|
||||||
|
'biosafety_level_concept_id' => $request->biosafety_level_concept_id,
|
||||||
|
'temperature_range' => $request->temperature_range,
|
||||||
|
'updated_at' => date('Y-m-d H:i:s'),
|
||||||
|
'updated_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->where('id', $request->room_id)->update($data);
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.update_success')]);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.update_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get(Request $request){
|
||||||
|
try{
|
||||||
|
$lab = $this->model::query()->where('id', $request->room_id)->get()->first();
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.get_success'), 'data' => $lab]);
|
||||||
|
} catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.get_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete(Request $request){
|
||||||
|
try{
|
||||||
|
$this->model::query()->where('id', $request->room_id)->update(array(
|
||||||
|
BaseModel::DELETED_AT_FIELD => date('Y-m-d H:i:s'),
|
||||||
|
BaseModel::DELETED_BY_FIELD => Auth::id(),
|
||||||
|
BaseModel::RECORD_STATUS_FIELD => RecordStatusEnum::DELETE
|
||||||
|
));
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.delete_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.delete_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restore(Request $request){
|
||||||
|
try{
|
||||||
|
$this->model::query()->where('id', $request->room_id)->update(array(BaseModel::RECORD_STATUS_FIELD=> RecordStatusEnum::ACTIVE));
|
||||||
|
return response()->json(['success' => true, 'message' => __('laboratory.restore_success')]);
|
||||||
|
}
|
||||||
|
catch (\Exception $e){
|
||||||
|
return response()->json(['success' => false, 'message' => __('laboratory.restore_fail'), 'errors' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
48
app/Models/ContainerType.php
Normal file
48
app/Models/ContainerType.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
use App\Enums\RecordStatusEnum;
|
||||||
|
use App\Models\Traits\HasLocalizedName;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
use App\Traits\AuditLogTrait;
|
||||||
|
|
||||||
|
class ContainerType extends BaseModel
|
||||||
|
{
|
||||||
|
public $timestamps = false;
|
||||||
|
use HasFactory;
|
||||||
|
use HasLocalizedName;
|
||||||
|
use AuditLogTrait;
|
||||||
|
/**
|
||||||
|
* The table associated with the model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $appends = ['name'];
|
||||||
|
|
||||||
|
protected $primaryKey = 'id';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'container_type_concept_id','sample_type_concept_id', 'additive', 'cap_color', 'volume_ml', 'storage_temp', 'sterile',
|
||||||
|
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||||
|
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||||
|
];
|
||||||
|
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sampleType(){
|
||||||
|
return $this->belongsTo(Concept::class, 'sample_type_concept_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function containerName(){
|
||||||
|
return $this->belongsTo(Concept::class, 'container_type_concept_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
40
app/Models/IncidentType.php
Normal file
40
app/Models/IncidentType.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
use App\Enums\RecordStatusEnum;
|
||||||
|
use App\Models\Traits\HasLocalizedName;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
use App\Traits\AuditLogTrait;
|
||||||
|
|
||||||
|
class IncidentType extends BaseModel
|
||||||
|
{
|
||||||
|
public $timestamps = false;
|
||||||
|
use HasFactory;
|
||||||
|
use HasLocalizedName;
|
||||||
|
use AuditLogTrait;
|
||||||
|
/**
|
||||||
|
* The table associated with the model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $appends = ['name'];
|
||||||
|
|
||||||
|
protected $primaryKey = 'id';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'code', 'name_en','name_kh', 'description',
|
||||||
|
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||||
|
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||||
|
];
|
||||||
|
|
||||||
|
public static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ class Room extends BaseModel
|
|||||||
|
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'code', 'name_en','name_kh', 'description', 'organization_id',
|
'code', 'name_en','name_kh', 'description', 'biosafety_level_concept_id', 'building_id', 'temperature_range', 'organization_id',
|
||||||
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||||
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||||
];
|
];
|
||||||
@@ -36,5 +36,13 @@ class Room extends BaseModel
|
|||||||
parent::boot();
|
parent::boot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function building(){
|
||||||
|
return $this->belongsTo(Building::class, 'building_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bsl(){
|
||||||
|
return $this->belongsTo(Concept::class, 'biosafety_level_concept_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
return [
|
return [
|
||||||
|
|
||||||
'pagination' => [
|
'pagination' => [
|
||||||
'perpage' => 20,
|
'perpage' => 14,
|
||||||
]
|
]
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -753,21 +753,21 @@ div select{
|
|||||||
|
|
||||||
.pagination .page-link:hover {
|
.pagination .page-link:hover {
|
||||||
color: #FFF !important; /* Your desired hover text color */
|
color: #FFF !important; /* Your desired hover text color */
|
||||||
background: rgba(4,100,144,0.96) !important;
|
background: rgb(6 157 73 / 96%) !important;
|
||||||
border-color: rgba(4,100,144,0.96) !important;
|
border-color: rgb(6 157 73 / 96%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-item.disabled .page-link {
|
.page-item.disabled .page-link {
|
||||||
color: #FFF !important; /* Your desired hover text color */
|
color: #FFF !important; /* Your desired hover text color */
|
||||||
background: rgba(4,100,144,0.96) !important;
|
background: rgb(6 157 73 / 96%) !important;
|
||||||
border-color: rgba(4,100,144,0.96) !important;
|
border-color: rgb(46 183 69 / 96%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Optional: Ensure the hover/focus states for the disabled item are also the same */
|
/* Optional: Ensure the hover/focus states for the disabled item are also the same */
|
||||||
.page-item.disabled .page-link:hover,
|
.page-item.disabled .page-link:hover,
|
||||||
.page-item.disabled .page-link:focus {
|
.page-item.disabled .page-link:focus {
|
||||||
color: #FFF !important; /* Your desired hover text color */
|
color: #FFF !important; /* Your desired hover text color */
|
||||||
background: rgba(4,100,144,0.96) !important;
|
background: rgb(6 157 73 / 96%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-wrapper .card-body .card-title i{
|
.content-wrapper .card-body .card-title i{
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
.select2-selection__rendered {
|
.select2-selection__rendered {
|
||||||
line-height: 25px !important;
|
line-height: 19px !important;
|
||||||
}
|
}
|
||||||
.select2-container .select2-selection--single{
|
.select2-container .select2-selection--single{
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.select2-container .select2-selection--single, .select2-selection--multiple {
|
.select2-container .select2-selection--single, .select2-selection--multiple {
|
||||||
min-height: 36px !important;
|
min-height: 46px !important;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-color: #f3f3f3 !important;
|
border-color: #f3f3f3 !important;
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.select2-selection__arrow {
|
.select2-selection__arrow {
|
||||||
height: 36px !important;
|
height: 46px !important;
|
||||||
}
|
}
|
||||||
.select2-selection__choice{
|
.select2-selection__choice{
|
||||||
font-size: 13px !important;
|
font-size: 13px !important;
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
content: 'hhghgh';
|
content: 'hhghgh';
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-container .select2-selection--single, .main-panel .select2-selection--multiple {
|
/*.select2-container .select2-selection--single, .main-panel .select2-selection--multiple {*/
|
||||||
padding-top: 5px !important;
|
/* padding-top: 5px !important;*/
|
||||||
padding-left: 5px !important;
|
/* padding-left: 5px !important;*/
|
||||||
}
|
/*}*/
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ function restore_lab(building_id){
|
|||||||
$('#modal-building').on('show.bs.modal', function (event) {
|
$('#modal-building').on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
var action = button.data('action') // Extract info from data-* attributes
|
var action = button.data('action') // Extract info from data-* attributes
|
||||||
$('#shareable_lab_result').prop("checked", false)
|
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
if(action === "new"){
|
if(action === "new"){
|
||||||
// Clear inputs
|
// Clear inputs
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function restore_lab(concept_id){
|
|||||||
},
|
},
|
||||||
success:function(res){
|
success:function(res){
|
||||||
handleMessage(res.success, res.message)
|
handleMessage(res.success, res.message)
|
||||||
setTimeout(function () {location.reload()}, messageDuration)
|
if(res.success) {setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -79,7 +79,6 @@ function restore_lab(concept_id){
|
|||||||
$('#modal-concept').on('show.bs.modal', function (event) {
|
$('#modal-concept').on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
var action = button.data('action') // Extract info from data-* attributes
|
var action = button.data('action') // Extract info from data-* attributes
|
||||||
$('#shareable_lab_result').prop("checked", false)
|
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
if(action === "new"){
|
if(action === "new"){
|
||||||
// Clear inputs
|
// Clear inputs
|
||||||
|
|||||||
114
public/storage/assets/js/admin/incident_type.js
Normal file
114
public/storage/assets/js/admin/incident_type.js
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
|
||||||
|
$("#btnSave").on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let incident_type_id = $('#incident_type_id').val();
|
||||||
|
url = parseInt(incident_type_id) === 0 ? save_url : update_url;
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
incident_type_id : incident_type_id,
|
||||||
|
name_en: $('#name-en').val(),
|
||||||
|
name_kh: $('#name-kh').val(),
|
||||||
|
code: $('#code').val(),
|
||||||
|
description: $('#description').val(),
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
setTimeout(function () {location.reload()}, messageDuration)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function delete_lab(incident_type_id){
|
||||||
|
Swal.fire({
|
||||||
|
text: confirm_delete_record,
|
||||||
|
icon: 'question',
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonClass:'danger',
|
||||||
|
confirmButtonText: confirm_ok_delete,
|
||||||
|
cancelButtonText: confirm_cancel
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
$.ajax({
|
||||||
|
url: delete_url,
|
||||||
|
method:'POST',
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
incident_type_id : incident_type_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
setTimeout(function () {location.reload()}, messageDuration)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore_lab(incident_type_id){
|
||||||
|
Swal.fire({
|
||||||
|
text: confirm_restore_record,
|
||||||
|
icon: 'question',
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonClass:'danger',
|
||||||
|
confirmButtonText: confirm_ok_restore,
|
||||||
|
cancelButtonText: confirm_cancel_restore,
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
$.ajax({
|
||||||
|
url: restore_url,
|
||||||
|
method:'POST',
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
incident_type_id : incident_type_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
setTimeout(function () {location.reload()}, messageDuration)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#modal-incident-type').on('show.bs.modal', function (event) {
|
||||||
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
|
var action = button.data('action') // Extract info from data-* attributes
|
||||||
|
var modal = $(this);
|
||||||
|
if(action === "new"){
|
||||||
|
// Clear inputs
|
||||||
|
modal.find('.modal-body input').val("");
|
||||||
|
modal.find('.modal-body textarea').val("");
|
||||||
|
modal.find('.modal-body input[name="incident_type_id"]').val(0);
|
||||||
|
modal.find('.modal-title').html(modal_add_title);
|
||||||
|
}else if(action === "edit"){
|
||||||
|
incident_type_id = button.data('incident_type_id');
|
||||||
|
modal.find('.modal-body input[name="incident_type_id"]').val(incident_type_id);
|
||||||
|
modal.find('.modal-title').html(modal_edit_title);
|
||||||
|
//e.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
url: get_url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
incident_type_id: incident_type_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
if(res.success) {
|
||||||
|
let data = res.data;
|
||||||
|
modal.find('.modal-body input[name="name_en"]').val(data.name_en);
|
||||||
|
modal.find('.modal-body input[name="name_kh"]').val(data.name_kh);
|
||||||
|
modal.find('.modal-body input[name="code"]').val(data.code);
|
||||||
|
modal.find('.modal-body textarea[name="description"]').val(data.description);
|
||||||
|
} else{
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
@@ -81,7 +81,6 @@ function restore_lab(labid){
|
|||||||
$('#modal-laboratory').on('show.bs.modal', function (event) {
|
$('#modal-laboratory').on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
var action = button.data('action') // Extract info from data-* attributes
|
var action = button.data('action') // Extract info from data-* attributes
|
||||||
$('#shareable_lab_result').prop("checked", false)
|
|
||||||
var modal = $(this);
|
var modal = $(this);
|
||||||
if(action === "new"){
|
if(action === "new"){
|
||||||
// Clear inputs
|
// Clear inputs
|
||||||
|
|||||||
122
public/storage/assets/js/admin/room.js
Normal file
122
public/storage/assets/js/admin/room.js
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
|
||||||
|
$("#btnSave").on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let room_id = $('#room_id').val();
|
||||||
|
url = parseInt(room_id) === 0 ? save_url : update_url;
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
room_id : room_id,
|
||||||
|
name_en: $('#name-en').val(),
|
||||||
|
name_kh: $('#name-kh').val(),
|
||||||
|
code: $('#code').val(),
|
||||||
|
building_id: $('#building_id').val(),
|
||||||
|
biosafety_level_concept_id: $('#biosafety_level_concept_id').val(),
|
||||||
|
temperature_range: $('#temperature_range').val(),
|
||||||
|
description: $('#description').val(),
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success){ setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function delete_lab(room_id){
|
||||||
|
Swal.fire({
|
||||||
|
text: confirm_delete_record,
|
||||||
|
icon: 'question',
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonClass:'danger',
|
||||||
|
confirmButtonText: confirm_ok_delete,
|
||||||
|
cancelButtonText: confirm_cancel
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
$.ajax({
|
||||||
|
url: delete_url,
|
||||||
|
method:'POST',
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
room_id : room_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
setTimeout(function () {location.reload()}, messageDuration)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore_lab(room_id){
|
||||||
|
Swal.fire({
|
||||||
|
text: confirm_restore_record,
|
||||||
|
icon: 'question',
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonClass:'danger',
|
||||||
|
confirmButtonText: confirm_ok_restore,
|
||||||
|
cancelButtonText: confirm_cancel_restore,
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
$.ajax({
|
||||||
|
url: restore_url,
|
||||||
|
method:'POST',
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
room_id : room_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
setTimeout(function () {location.reload()}, messageDuration)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#modal-room').on('show.bs.modal', function (event) {
|
||||||
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
|
var action = button.data('action') // Extract info from data-* attributes
|
||||||
|
var modal = $(this);
|
||||||
|
if(action === "new"){
|
||||||
|
// Clear inputs
|
||||||
|
modal.find('.modal-body input').val("");
|
||||||
|
modal.find('.modal-body textarea').val("");
|
||||||
|
modal.find('.modal-body select[name="building_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-body select[name="biosafety_level_concept_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-body input[name="room_id"]').val(0);
|
||||||
|
modal.find('.modal-title').html(modal_add_title);
|
||||||
|
}else if(action === "edit"){
|
||||||
|
room_id = button.data('room_id');
|
||||||
|
modal.find('.modal-body input[name="room_id"]').val(room_id);
|
||||||
|
modal.find('.modal-title').html(modal_edit_title);
|
||||||
|
//e.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
url: get_url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
room_id: room_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
if(res.success) {
|
||||||
|
let data = res.data;
|
||||||
|
modal.find('.modal-body input[name="name_en"]').val(data.name_en);
|
||||||
|
modal.find('.modal-body input[name="name_kh"]').val(data.name_kh);
|
||||||
|
modal.find('.modal-body input[name="code"]').val(data.code);
|
||||||
|
modal.find('.modal-body input[name="temperature_range"]').val(data.temperature_range);
|
||||||
|
modal.find('.modal-body textarea[name="description"]').val(data.description);
|
||||||
|
modal.find('.modal-body select[name="building_id"]').val(data.building_id).trigger('change');
|
||||||
|
modal.find('.modal-body select[name="biosafety_level_concept_id"]').val(data.biosafety_level_concept_id).trigger('change');
|
||||||
|
} else{
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
122
public/storage/assets/js/admin/sample_container.js
Normal file
122
public/storage/assets/js/admin/sample_container.js
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
|
||||||
|
$("#btnSave").on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let container_type_id = $('#container_type_id').val();
|
||||||
|
url = parseInt(container_type_id) === 0 ? save_url : update_url;
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
container_type_id : container_type_id,
|
||||||
|
container_type_concept_id: $('#container_type_concept_id').val(),
|
||||||
|
sample_type_concept_id: $('#sample_type_concept_id').val(),
|
||||||
|
additive: $('#additive').val(),
|
||||||
|
cap_color: $('#cap_color').val(),
|
||||||
|
volume_ml: $('#volume_ml').val(),
|
||||||
|
storage_temp: $('#storage_temp').val(),
|
||||||
|
sterile: $('input[name="sterile"]:checked').attr('data-id'),
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success){ setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function delete_lab(container_type_id){
|
||||||
|
Swal.fire({
|
||||||
|
text: confirm_delete_record,
|
||||||
|
icon: 'question',
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonClass:'danger',
|
||||||
|
confirmButtonText: confirm_ok_delete,
|
||||||
|
cancelButtonText: confirm_cancel
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
$.ajax({
|
||||||
|
url: delete_url,
|
||||||
|
method:'POST',
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
container_type_id : container_type_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success) {setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore_lab(container_type_id){
|
||||||
|
Swal.fire({
|
||||||
|
text: confirm_restore_record,
|
||||||
|
icon: 'question',
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonClass:'danger',
|
||||||
|
confirmButtonText: confirm_ok_restore,
|
||||||
|
cancelButtonText: confirm_cancel_restore,
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.value) {
|
||||||
|
$.ajax({
|
||||||
|
url: restore_url,
|
||||||
|
method:'POST',
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
container_type_id : container_type_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success) { setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#modal-sample-container').on('show.bs.modal', function (event) {
|
||||||
|
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||||
|
var action = button.data('action') // Extract info from data-* attributes
|
||||||
|
var modal = $(this);
|
||||||
|
if(action === "new"){
|
||||||
|
// Clear inputs
|
||||||
|
modal.find('.modal-body input').val("");
|
||||||
|
modal.find('.modal-body select[name="container_type_concept_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-body select[name="sample_type_concept_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-body input[name="container_type_id"]').val(0);
|
||||||
|
modal.find('.modal-body input[name="cap_color"]').val(0);
|
||||||
|
modal.find('.modal-title').html(modal_add_title);
|
||||||
|
}else if(action === "edit"){
|
||||||
|
container_type_id = button.data('container_type_id');
|
||||||
|
modal.find('.modal-body input[name="container_type_id"]').val(container_type_id);
|
||||||
|
modal.find('.modal-title').html(modal_edit_title);
|
||||||
|
//e.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
url: get_url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
container_type_id: container_type_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
if(res.success) {
|
||||||
|
let data = res.data;
|
||||||
|
modal.find('.modal-body input[name="additive"]').val(data.additive);
|
||||||
|
modal.find('.modal-body select[name="cap_color"]').val(data.cap_color);
|
||||||
|
modal.find('.modal-body input[name="volume_ml"]').val(data.volume_ml);
|
||||||
|
modal.find('.modal-body input[name="storage_temp"]').val(data.storage_temp);
|
||||||
|
modal.find('.modal-body input:checkbox[name="sterile"]').filter("[data-id=" + data.sterile + "]").prop('checked', true);
|
||||||
|
modal.find('.modal-body select[name="container_type_concept_id"]').val(data.container_type_concept_id).trigger('change');
|
||||||
|
modal.find('.modal-body select[name="sample_type_concept_id"]').val(data.sample_type_concept_id).trigger('change');
|
||||||
|
} else{
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
@@ -111,17 +111,17 @@
|
|||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
||||||
<input type="text" class="form-control form-control-sm" name="code" id="code" value="" />
|
<input type="text" class="form-control" name="code" id="code" value="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||||
<input type="text" class="form-control form-control-sm" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
<input type="text" class="form-control" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control form-control-sm rounded-right-0" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
<input type="text" class="form-control " name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<select class="form-control rounded-left-0 rounded-right-0" name="concept_category_code" style="width: 250px !important;">
|
<select class="form-control rounded-left-0 rounded-right-0" name="concept_category_code" style="width: 250px !important;">
|
||||||
<option value="all">- All Category -</option>
|
<option value="all">- All Category -</option>
|
||||||
@foreach($concept_categories as $concept_category)
|
@foreach($concept_categories as $concept_category)
|
||||||
<option value="{{$concept_category->concept_category_code}}">{{$concept_category->concept_category_code}}</option>
|
<option {{@$_GET['concept_category_code']==$concept_category->concept_category_code? 'selected':''}} value="{{$concept_category->concept_category_code}}">{{$concept_category->concept_category_code}}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('general.btn_search')}}</button>
|
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('general.btn_search')}}</button>
|
||||||
@@ -54,10 +54,9 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr class="bg-gradient-light">
|
<tr class="bg-gradient-light">
|
||||||
<th class="py-2" width="50px">{{__('laboratory.table_no')}}</th>
|
<th class="py-2" width="50px">{{__('laboratory.table_no')}}</th>
|
||||||
<th class="py-2 text-center" width="100px">{{__('laboratory.table_action')}}</th>
|
<th class="py-2 text-center" width="170px">{{__('laboratory.table_action')}}</th>
|
||||||
<th class="py-2" width="120px">{{__('general.code')}}</th>
|
<th class="py-2" width="150px">{{__('general.code')}}</th>
|
||||||
<th class="py-2">{{__('laboratory.table_name_en')}}</th>
|
<th class="py-2">{{__('ឈ្មោះ')}}</th>
|
||||||
<th class="py-2">{{__('laboratory.table_name_kh')}}</th>
|
|
||||||
<th class="py-2">{{__('Category')}}</th>
|
<th class="py-2">{{__('Category')}}</th>
|
||||||
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -77,8 +76,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="py-1">{{$concept->code}}</td>
|
<td class="py-1">{{$concept->code}}</td>
|
||||||
<td class="py-1">{{$concept->name_en}}</td>
|
<td class="py-1">{{$concept->name}}</td>
|
||||||
<td class="py-1">{{$concept->name_kh}}</td>
|
|
||||||
<td class="py-1">{{$concept->concept_category_code}}</td>
|
<td class="py-1">{{$concept->concept_category_code}}</td>
|
||||||
<td class="py-1 text-center">
|
<td class="py-1 text-center">
|
||||||
<i class="mdi {{$concept->record_status_id == 1 ? 'mdi-check-circle text-primary' : 'mdi-checkbox-blank-circle-outline'}}"></i>
|
<i class="mdi {{$concept->record_status_id == 1 ? 'mdi-check-circle text-primary' : 'mdi-checkbox-blank-circle-outline'}}"></i>
|
||||||
@@ -119,19 +117,19 @@
|
|||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
||||||
<input type="text" class="form-control form-control-sm" name="code" id="code" value="" />
|
<input type="text" class="form-control" name="code" id="code" value="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||||
<input type="text" class="form-control form-control-sm" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
<input type="text" class="form-control " name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control form-control-sm rounded-right-0" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
<input type="text" class="form-control" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
|
|||||||
165
resources/views/incident_type.blade.php
Normal file
165
resources/views/incident_type.blade.php
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
@include('layout.header')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="row" id="x" style="display: none;">
|
||||||
|
<div class="col-12">
|
||||||
|
<span class="d-flex align-items-center purchase-popup">
|
||||||
|
<i class="typcn typcn-delete-outline" id="bannerClose"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-scroller">
|
||||||
|
@include('layout.navbar')
|
||||||
|
<!-- partial -->
|
||||||
|
@include('layout.breadscrum')
|
||||||
|
<div class="container-fluid page-body-wrapper">
|
||||||
|
|
||||||
|
@include('layout.sidebar')
|
||||||
|
|
||||||
|
<!-- partial -->
|
||||||
|
<div class="main-panel">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 grid-margin stretch-card">
|
||||||
|
<div class="card" style="min-height: 80vh;">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title"><i class="mdi mdi-dots-vertical menu-icon"></i> ប្រភេទឧប្បត្តិហេតុ</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<form method="get" action="{{url('incident-type/search')}}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control form-control-md rounded-left-25 rounded-right-0" value="{{isset($_GET['kword']) ? $_GET['kword'] : ''}}" name="kword" id="kword" placeholder="{{__('laboratory.search_placeholder')}}">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('general.btn_search')}}</button>
|
||||||
|
<button class="btn btn-md btn-inverse-success waves-effect rounded-25 px-4 ml-3" type="button" data-action="new" data-toggle="modal" data-target="#modal-incident-type" data-backdrop="static"><i class="typcn typcn-plus"></i> {{__('general.btn_add_new')}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form> <hr class="my-3 d-none">
|
||||||
|
<div class="col-sm-12 p-0 mb-1 mt-3">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-striped table-hover" id="lab_dt">
|
||||||
|
<thead>
|
||||||
|
<tr class="bg-gradient-light">
|
||||||
|
<th class="py-2" width="50px">{{__('laboratory.table_no')}}</th>
|
||||||
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_action')}}</th>
|
||||||
|
<th class="py-2" width="120px">{{__('general.code')}}</th>
|
||||||
|
<th class="py-2">{{__('laboratory.table_name_kh')}}</th>
|
||||||
|
<th class="py-2">{{__('laboratory.table_name_en')}}</th>
|
||||||
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($incidentTypes as $k=>$incidentType)
|
||||||
|
<tr>
|
||||||
|
<td class="py-1 text-center">{{($k+1) + (($_GET['page'] ?? 1) * 20) - 20}}</td>
|
||||||
|
<td class="text-center py-1">
|
||||||
|
<div class="btn-group" role="group" aria-label="Basic example" >
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary mr-2" title="Edit" data-action="edit" data-incident_type_id="{{$incidentType->id}}" data-toggle="modal" data-target="#modal-incident-type" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
|
||||||
|
@if($incidentType->record_status_id==0)
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$incidentType->id}})"><i class="typcn typcn-plus"></i></button>
|
||||||
|
@else
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$incidentType->id}})"><i class="mdi mdi-close-circle"></i></button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="py-1">{{$incidentType->code}}</td>
|
||||||
|
<td class="py-1">{{$incidentType->name_kh}}</td>
|
||||||
|
<td class="py-1">{{$incidentType->name_en}}</td>
|
||||||
|
<td class="py-1 text-center">
|
||||||
|
<i class="mdi {{$incidentType->record_status_id == 1 ? 'mdi-check-circle text-primary' : 'mdi-checkbox-blank-circle-outline'}}"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="float-right mt-3">
|
||||||
|
{!! $incidentTypes->links('pagination.custom') !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Modal Laboratory -->
|
||||||
|
<div class="modal mt-5 fade modal-primary" id="modal-incident-type">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h6 class="modal-title">{{__('_')}}</h6>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" class="mdi mdi-close"></span></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<form method="post" action="#" id="form" onkeydown="return event.key != 'Enter';">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" class="form-control" name="incident_type_id" id="incident_type_id" value="0" />
|
||||||
|
<div class="form-vertical">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
||||||
|
<input type="text" class="form-control form-control-sm" name="code" id="code" value="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||||
|
<input type="text" class="form-control form-control-sm" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control form-control-sm rounded-right-0" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('បរិយាយ')}} </label>
|
||||||
|
<textarea class="form-control" name="description" id="description"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success rounded-25" id="btnSave"><i class="fa fa-floppy-o"></i> <span class="save">{{__('lang.save')}}</span><span class="update" style="display: none">{{__('lang.update')}}</span></button>
|
||||||
|
<button type="button" class="btn btn-secondary rounded-25 ml-2" data-dismiss='modal'>{{__('lang.cancel')}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@include('layout.footer')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@include('layout.common_script')
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var save_url = "{{url('incident-type.save')}}";
|
||||||
|
var update_url = "{{url('incident-type.update')}}";
|
||||||
|
var delete_url = "{{url('incident-type.delete')}}";
|
||||||
|
var restore_url = "{{url('incident-type.restore')}}";
|
||||||
|
var get_url = "{{url('incident-type.get')}}";
|
||||||
|
|
||||||
|
let modal_add_title = "Add Incident Type";
|
||||||
|
let modal_edit_title = "Add Incident Type";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script src="{{url(env("APP_URL").'storage/assets/js/admin/incident_type.js?_').time()}}"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
@@ -111,17 +111,17 @@
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||||
<input type="text" class="form-control form-control-sm" name="name_kh" id="lab-name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
<input type="text" class="form-control" name="name_kh" id="lab-name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
||||||
|
|
||||||
<div class="input-group" id="testItem">
|
<div class="input-group" id="testItem">
|
||||||
<div class="form-group" style="flex:1 !important;">
|
<div class="form-group" style="flex:1 !important;">
|
||||||
<input type="text" class="form-control form-control-sm rounded-right-0" name="name_en" id="lab-name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
<input type="text" class="form-control rounded-right-0" name="name_en" id="lab-name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<input type="text" class="form-control form-control-sm rounded-left-0" style="width: 100px !important;" name="code" id="lab-code" value="" maxlength="10" placeholder="{{__('lab_profile.short_name')}}">
|
<input type="text" class="form-control rounded-left-0" style="width: 100px !important;" name="code" id="lab-code" value="" maxlength="10" placeholder="{{__('lab_profile.short_name')}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -131,12 +131,12 @@
|
|||||||
|
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('laboratory.phone')}} </label>
|
<label for="lab-name-kh">{{__('laboratory.phone')}} </label>
|
||||||
<input type="text" class="form-control form-control-sm" name="phone_number" id="phone-number" value="" placeholder="{{__('laboratory.phone')}}"/>
|
<input type="text" class="form-control" name="phone_number" id="phone-number" value="" placeholder="{{__('laboratory.phone')}}"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="lab-name-kh">{{__('lab_profile.emial')}} </label>
|
<label for="lab-name-kh">{{__('lab_profile.emial')}} </label>
|
||||||
<input type="email" class="form-control form-control-sm" name="email" id="email" value="" placeholder="{{__('lab_profile.emial')}}"/>
|
<input type="email" class="form-control" name="email" id="email" value="" placeholder="{{__('lab_profile.emial')}}"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -146,13 +146,13 @@
|
|||||||
<div class="row form-group mb-1">
|
<div class="row form-group mb-1">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<label for="address-kh" class="control-label">{{__('laboratory.form_address_kh')}}</label>
|
<label for="address-kh" class="control-label">{{__('laboratory.form_address_kh')}}</label>
|
||||||
<input type="text" class="form-control form-control-sm" name="address_kh" id="address-kh" value="" placeholder="{{__('laboratory.form_address_kh')}}">
|
<input type="text" class="form-control" name="address_kh" id="address-kh" value="" placeholder="{{__('laboratory.form_address_kh')}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-1">
|
<div class="form-group mb-1">
|
||||||
<label for="address-en">{{__('laboratory.form_address_en')}}</label>
|
<label for="address-en">{{__('laboratory.form_address_en')}}</label>
|
||||||
<input type="text" class="form-control form-control-sm" name="address_en" id="address-en" value="" placeholder="{{__('laboratory.form_address_en')}}">
|
<input type="text" class="form-control" name="address_en" id="address-en" value="" placeholder="{{__('laboratory.form_address_en')}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,48 +48,48 @@
|
|||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<li class="nav-item {{ in_array(request()->segment(1), ['laboratory-profile', 'department', 'sample-type', 'test', 'comment', 'organism', 'antibiotic', 'quantity', 'sample-source', 'patient-type', 'physician', 'lab-users']) ? 'active' : '' }}">
|
<li class="nav-item {{ in_array(request()->segment(1), ['incident-type']) ? 'active' : '' }}">
|
||||||
<a class="nav-link" data-toggle="collapse" href="#incident-record" aria-expanded="false" aria-controls="incident-record">
|
<a class="nav-link" data-toggle="collapse" href="#incident-record" aria-expanded="false" aria-controls="incident-record">
|
||||||
<i class="mdi mdi-oil-temperature menu-icon"></i>
|
<i class="mdi mdi-oil-temperature menu-icon"></i>
|
||||||
<span class="menu-title text-uppercase">កត់ត្រាឧប្បត្តិហេតុ</span>
|
<span class="menu-title text-uppercase">កត់ត្រាឧប្បត្តិហេតុ</span>
|
||||||
<i class="menu-arrow"></i>
|
<i class="menu-arrow"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="collapse {{ in_array(request()->segment(1), ['laboratory-profile', 'department', 'sample-type', 'test', 'comment', 'organism', 'antibiotic', 'quantity', 'sample-source', 'patient-type', 'physician', 'lab-users']) ? 'show' : '' }}" id="incident-record">
|
<div class="collapse {{ in_array(request()->segment(1), ['incident-type']) ? 'show' : '' }}" id="incident-record">
|
||||||
<ul class="nav flex-column sub-menu">
|
<ul class="nav flex-column sub-menu">
|
||||||
|
<li class="nav-item"> <a class="nav-link" href="">តារាងឧប្បត្តិហេតុ</a></li>
|
||||||
|
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='incident-type' ? 'active':''}}" href="{{url('incident-type')}}">ប្រភេទឧប្បត្តិហេតុ</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item {{ in_array(request()->segment(1), ['building']) ? 'active' : '' }}">
|
<li class="nav-item {{ in_array(request()->segment(1), ['building', 'room']) ? 'active' : '' }}">
|
||||||
<a class="nav-link" data-toggle="collapse" href="#lab-manager" aria-expanded="false" aria-controls="lab_manager">
|
<a class="nav-link" data-toggle="collapse" href="#lab-manager" aria-expanded="false" aria-controls="lab_manager">
|
||||||
<i class="fa fa-folder-open-o menu-icon"></i>
|
<i class="fa fa-folder-open-o menu-icon"></i>
|
||||||
<span class="menu-title text-uppercase">គ្រប់គ្រងសម្ភារៈ និងបរិក្ខារ</span>
|
<span class="menu-title text-uppercase">គ្រប់គ្រង</span>
|
||||||
<i class="menu-arrow"></i>
|
<i class="menu-arrow"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="collapse {{ in_array(request()->segment(1), ['building']) ? 'show' : '' }}" id="lab-manager">
|
<div class="collapse {{ in_array(request()->segment(1), ['building', 'room']) ? 'show' : '' }}" id="lab-manager">
|
||||||
<ul class="nav flex-column sub-menu">
|
<ul class="nav flex-column sub-menu">
|
||||||
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='building' ? 'active':''}}" href="{{url('building')}}">អគារ</a></li>
|
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='building' ? 'active':''}}" href="{{url('building')}}">អគារ</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">បន្ទប់</a></li>
|
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='room' ? 'active':''}}" href="{{url('room')}}">បន្ទប់សុវត្ថិភាព</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">ទូរបង្កក</a></li>
|
<li class="nav-item"> <a class="nav-link" href="">ទូររក្សាសំណាក</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">ធ្នើ</a></li>
|
<li class="nav-item"> <a class="nav-link" href="">ធ្នើ</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">ប្រអប់សំណាក</a></li>
|
<li class="nav-item"> <a class="nav-link" href="">ប្រអប់សំណាក</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item {{ in_array(request()->segment(1), ['concept']) ? 'active' : '' }}">
|
<li class="nav-item {{ in_array(request()->segment(1), ['concept', 'sample-container']) ? 'active' : '' }}">
|
||||||
<a class="nav-link" data-toggle="collapse" href="#catalog" aria-expanded="false" aria-controls="catalog">
|
<a class="nav-link" data-toggle="collapse" href="#catalog" aria-expanded="false" aria-controls="catalog">
|
||||||
<i class="mdi mdi-cards-variant menu-icon"></i>
|
<i class="mdi mdi-cards-variant menu-icon"></i>
|
||||||
<span class="menu-title text-uppercase">គ្រប់គ្រងបញ្ជីគម្រូ</span>
|
<span class="menu-title text-uppercase">បញ្ជីគម្រូ</span>
|
||||||
<i class="menu-arrow"></i>
|
<i class="menu-arrow"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="collapse {{ in_array(request()->segment(1), ['concept']) ? 'show' : '' }}" id="catalog">
|
<div class="collapse {{ in_array(request()->segment(1), ['concept', 'sample-container']) ? 'show' : '' }}" id="catalog">
|
||||||
<ul class="nav flex-column sub-menu">
|
<ul class="nav flex-column sub-menu">
|
||||||
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='concept' ? 'active':''}}" href="{{url('concept')}}">បញ្ជីគម្រូ</a></li>
|
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='concept' ? 'active':''}}" href="{{url('concept')}}">បញ្ជីគម្រូ</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">ប្រភេទសារពាង្គកាយ/មេរោគ</a></li>
|
<li class="nav-item"> <a class="nav-link" href="">ប្រភេទមេរោគ/ជាតិពុល</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">ប្រភេទសំណាក</a></li>
|
<li class="nav-item"> <a class="nav-link {{request()->segment(1)=='sample-container' ? 'active':''}}" href="{{url('sample-container')}}">ប្រភេទទីបផ្ទុកសំណាក</a></li>
|
||||||
<li class="nav-item"> <a class="nav-link" href="">ប្រភពសំណាក</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
197
resources/views/room.blade.php
Normal file
197
resources/views/room.blade.php
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
@include('layout.header')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="row" id="x" style="display: none;">
|
||||||
|
<div class="col-12">
|
||||||
|
<span class="d-flex align-items-center purchase-popup">
|
||||||
|
<i class="typcn typcn-delete-outline" id="bannerClose"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-scroller">
|
||||||
|
@include('layout.navbar')
|
||||||
|
<!-- partial -->
|
||||||
|
@include('layout.breadscrum')
|
||||||
|
<div class="container-fluid page-body-wrapper">
|
||||||
|
|
||||||
|
@include('layout.sidebar')
|
||||||
|
|
||||||
|
<!-- partial -->
|
||||||
|
<div class="main-panel">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 grid-margin stretch-card">
|
||||||
|
<div class="card" style="min-height: 80vh;">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title"><i class="mdi mdi-dots-vertical menu-icon"></i> បន្ទប់សុវត្ថិភាព</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<form method="get" action="{{url('room/search')}}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control form-control-md rounded-left-25 rounded-right-0" value="{{isset($_GET['kword']) ? $_GET['kword'] : ''}}" name="kword" id="kword" placeholder="{{__('laboratory.search_placeholder')}}">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('general.btn_search')}}</button>
|
||||||
|
<button class="btn btn-md btn-inverse-success waves-effect rounded-25 px-4 ml-3" type="button" data-action="new" data-toggle="modal" data-target="#modal-room" data-backdrop="static"><i class="typcn typcn-plus"></i> {{__('general.btn_add_new')}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form> <hr class="my-3 d-none">
|
||||||
|
<div class="col-sm-12 p-0 mb-1 mt-3">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-striped table-hover" id="lab_dt">
|
||||||
|
<thead>
|
||||||
|
<tr class="bg-gradient-light">
|
||||||
|
<th class="py-2" width="50px">{{__('laboratory.table_no')}}</th>
|
||||||
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_action')}}</th>
|
||||||
|
<th class="py-2" width="120px">{{__('general.code')}}</th>
|
||||||
|
<th class="py-2">{{__('ឈ្មោះ')}}</th>
|
||||||
|
<th class="py-2">{{__('អគារ')}}</th>
|
||||||
|
<th class="py-2">{{__('កម្រិតជីវសុវត្ថិភាព')}}</th>
|
||||||
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($rooms as $k=>$room)
|
||||||
|
<tr>
|
||||||
|
<td class="py-1 text-center">{{($k+1) + (($_GET['page'] ?? 1) * 20) - 20}}</td>
|
||||||
|
<td class="text-center py-1">
|
||||||
|
<div class="btn-group" role="group" aria-label="Basic example" >
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary mr-2" title="Edit" data-action="edit" data-room_id="{{$room->id}}" data-toggle="modal" data-target="#modal-room" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
|
||||||
|
@if($room->record_status_id==0)
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$room->id}})"><i class="typcn typcn-plus"></i></button>
|
||||||
|
@else
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$room->id}})"><i class="mdi mdi-close-circle"></i></button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="py-1">{{$room->code}}</td>
|
||||||
|
<td class="py-1">{{$room->name}}</td>
|
||||||
|
<td class="py-1">{{$room->building->name}}</td>
|
||||||
|
<td class="py-1">{{$room->bsl->name}}</td>
|
||||||
|
<td class="py-1 text-center">
|
||||||
|
<i class="mdi {{$room->record_status_id == 1 ? 'mdi-check-circle text-primary' : 'mdi-checkbox-blank-circle-outline'}}"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="float-right mt-3">
|
||||||
|
{!! $rooms->links('pagination.custom') !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Modal Laboratory -->
|
||||||
|
<div class="modal mt-5 fade modal-primary" id="modal-room">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h6 class="modal-title">{{__('_')}}</h6>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" class="mdi mdi-close"></span></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<form method="post" action="#" id="form" onkeydown="return event.key != 'Enter';">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" class="form-control" name="room_id" id="room_id" value="0" />
|
||||||
|
<div class="form-vertical">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('លេខកូដ')}} <span class="text-danger"></span> </label>
|
||||||
|
<input type="text" class="form-control" name="code" id="code" value="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('អគារ')}} <span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control select2" name="building_id" id="building_id" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
@foreach($buildings as $building)
|
||||||
|
<option value="{{$building->id}}">{{$building->name}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('laboratory.table_name_kh')}} <span class="text-danger">*</span> </label>
|
||||||
|
<input type="text" class="form-control" name="name_kh" id="name-kh" value="" placeholder="{{__('laboratory.table_name_kh')}}"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('laboratory.table_name_en')}} <span class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control" name="name_en" id="name-en" value="" placeholder="{{__('laboratory.table_name_en')}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('កម្រិតជីវសុវត្ថិភាព')}} <span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control select2" name="biosafety_level_concept_id" id="biosafety_level_concept_id" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
@foreach(collect($concepts)->where('concept_category_code', 'BIOSAFETY_LEVEL') as $concept)
|
||||||
|
<option value="{{$concept->id}}">{{$concept->name}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('កម្រិតស៊ីតុណ្ហភាព')}} <span class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control" name="temperature_range" id="temperature_range" value="" placeholder="0C - 24C">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('បរិយាយ')}} </label>
|
||||||
|
<textarea class="form-control" name="description" id="description"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success rounded-25" id="btnSave"><i class="fa fa-floppy-o"></i> <span class="save">{{__('lang.save')}}</span><span class="update" style="display: none">{{__('lang.update')}}</span></button>
|
||||||
|
<button type="button" class="btn btn-secondary rounded-25 ml-2" data-dismiss='modal'>{{__('lang.cancel')}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@include('layout.footer')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@include('layout.common_script')
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var save_url = "{{url('room.save')}}";
|
||||||
|
var update_url = "{{url('room.update')}}";
|
||||||
|
var delete_url = "{{url('room.delete')}}";
|
||||||
|
var restore_url = "{{url('room.restore')}}";
|
||||||
|
var get_url = "{{url('room.get')}}";
|
||||||
|
|
||||||
|
let modal_add_title = "Add Room";
|
||||||
|
let modal_edit_title = "Add Room";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script src="{{url(env("APP_URL").'storage/assets/js/admin/room.js?_').time()}}"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
212
resources/views/sample_container.blade.php
Normal file
212
resources/views/sample_container.blade.php
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
@include('layout.header')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="row" id="x" style="display: none;">
|
||||||
|
<div class="col-12">
|
||||||
|
<span class="d-flex align-items-center purchase-popup">
|
||||||
|
<i class="typcn typcn-delete-outline" id="bannerClose"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-scroller">
|
||||||
|
@include('layout.navbar')
|
||||||
|
<!-- partial -->
|
||||||
|
@include('layout.breadscrum')
|
||||||
|
<div class="container-fluid page-body-wrapper">
|
||||||
|
|
||||||
|
@include('layout.sidebar')
|
||||||
|
|
||||||
|
<!-- partial -->
|
||||||
|
<div class="main-panel">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 grid-margin stretch-card">
|
||||||
|
<div class="card" style="min-height: 80vh;">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title"><i class="mdi mdi-dots-vertical menu-icon"></i> ឧបករណ៍ផ្ទុកសំណាក</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<form method="get" action="{{url('sample-container/search')}}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control form-control-md rounded-left-25 rounded-right-0" value="{{isset($_GET['kword']) ? $_GET['kword'] : ''}}" name="kword" id="kword" placeholder="{{__('laboratory.search_placeholder')}}">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button class="btn btn-md btn-inverse-secondary rounded-right-25 px-3" type="submit"><i class="fa fa-search"></i> {{__('general.btn_search')}}</button>
|
||||||
|
<button class="btn btn-md btn-inverse-success waves-effect rounded-25 px-4 ml-3" type="button" data-action="new" data-toggle="modal" data-target="#modal-sample-container" data-backdrop="static"><i class="typcn typcn-plus"></i> {{__('general.btn_add_new')}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form> <hr class="my-3 d-none">
|
||||||
|
<div class="col-sm-12 p-0 mb-1 mt-3">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-striped table-hover" id="lab_dt">
|
||||||
|
<thead>
|
||||||
|
<tr class="bg-gradient-light">
|
||||||
|
<th class="py-2" width="50px">{{__('laboratory.table_no')}}</th>
|
||||||
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_action')}}</th>
|
||||||
|
<th class="py-2" width="120px">{{__('general.code')}}</th>
|
||||||
|
<th class="py-2">{{__('ឈ្មោះ')}}</th>
|
||||||
|
<th class="py-2">{{__('អគារ')}}</th>
|
||||||
|
<th class="py-2">{{__('កម្រិតជីវសុវត្ថិភាព')}}</th>
|
||||||
|
<th class="py-2 text-center" width="100px">{{__('laboratory.table_status')}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($containerTypes as $k=>$containerType)
|
||||||
|
<tr>
|
||||||
|
<td class="py-1 text-center">{{($k+1) + (($_GET['page'] ?? 1) * 20) - 20}}</td>
|
||||||
|
<td class="text-center py-1">
|
||||||
|
<div class="btn-group" role="group" aria-label="Basic example" >
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary mr-2" title="Edit" data-action="edit" data-container_type_id="{{$containerType->id}}" data-toggle="modal" data-target="#modal-sample-container" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
|
||||||
|
@if($containerType->record_status_id==0)
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$containerType->id}})"><i class="typcn typcn-plus"></i></button>
|
||||||
|
@else
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$containerType->id}})"><i class="mdi mdi-close-circle"></i></button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="py-1">{{$containerType->containerName->code}}</td>
|
||||||
|
<td class="py-1">{{$containerType->containerName->name}}</td>
|
||||||
|
<td class="py-1"></td>
|
||||||
|
<td class="py-1"></td>
|
||||||
|
<td class="py-1 text-center">
|
||||||
|
<i class="mdi {{$containerType->record_status_id == 1 ? 'mdi-check-circle text-primary' : 'mdi-checkbox-blank-circle-outline'}}"></i>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="float-right mt-3">
|
||||||
|
{!! $containerTypes->links('pagination.custom') !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Modal Laboratory -->
|
||||||
|
<div class="modal mt-5 fade modal-primary" id="modal-sample-container">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h6 class="modal-title">{{__('_')}}</h6>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" class="mdi mdi-close"></span></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<form method="post" action="#" id="form" onkeydown="return event.key != 'Enter';">
|
||||||
|
@csrf
|
||||||
|
<input type="hidden" class="form-control" name="container_type_id" id="container_type_id" value="0" />
|
||||||
|
<div class="form-vertical">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('ឧបករណ៍ផ្ទុកសំណាក')}} <span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control select2" name="container_type_concept_id" id="container_type_concept_id" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
@foreach(collect($concepts)->where('concept_category_code', 'CONTAINER_TYPE') as $concept)
|
||||||
|
<option value="{{$concept->id}}">{{$concept->name}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('ប្រភេទសំណាក')}} <span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control select2" name="sample_type_concept_id" id="sample_type_concept_id" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
@foreach(collect($concepts)->where('concept_category_code', 'SAMPLE_TYPE') as $concept)
|
||||||
|
<option value="{{$concept->id}}">{{$concept->name}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('សារធាតុបន្ថែម')}} <span class="text-danger"></span> </label>
|
||||||
|
<input type="text" class="form-control" name="additive" id="additive" value="" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('ពណ៌គម្រប')}} <span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control" name="cap_color" id="cap_color" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
<option value="Red">Red</option>
|
||||||
|
<option value="Yellow">Yellow</option>
|
||||||
|
<option value="Purple">Purple</option>
|
||||||
|
<option value="Pink">Pink</option>
|
||||||
|
<option value="Green">Green</option>
|
||||||
|
<option value="Light Green">Light Green</option>
|
||||||
|
<option value="Gray">Gray</option>
|
||||||
|
<option value="Black">Black</option>
|
||||||
|
<option value="Blue">Blue</option>
|
||||||
|
<option value="White">White</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-kh">{{__('បរិមាណ(គិតជាមីលីលីត)')}} <span class="text-danger">*</span> </label>
|
||||||
|
<input type="number" class="form-control" name="volume_ml" id="volume_ml" value="" placeholder=""/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<label for="lab-name-en">{{__('សីតុណ្ហភាពរក្សាទុក(អង្សាសេ)')}} <span class="text-danger">*</span></label>
|
||||||
|
<input type="number" class="form-control" name="storage_temp" id="storage_temp" value="" placeholder="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group mb-1">
|
||||||
|
<div class="form-check col-sm-12">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input type="checkbox" class="form-check-input" name="sterile" data-id="1"> {{__('ស្ទេរីល')}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success rounded-25" id="btnSave"><i class="fa fa-floppy-o"></i> <span class="save">{{__('lang.save')}}</span><span class="update" style="display: none">{{__('lang.update')}}</span></button>
|
||||||
|
<button type="button" class="btn btn-secondary rounded-25 ml-2" data-dismiss='modal'>{{__('lang.cancel')}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@include('layout.footer')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@include('layout.common_script')
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var save_url = "{{url('sample-container.save')}}";
|
||||||
|
var update_url = "{{url('sample-container.update')}}";
|
||||||
|
var delete_url = "{{url('sample-container.delete')}}";
|
||||||
|
var restore_url = "{{url('sample-container.restore')}}";
|
||||||
|
var get_url = "{{url('sample-container.get')}}";
|
||||||
|
|
||||||
|
let modal_add_title = "Add Sample Container";
|
||||||
|
let modal_edit_title = "Add Sample Container";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script src="{{url(env("APP_URL").'storage/assets/js/admin/sample_container.js?_').time()}}"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
@@ -5,8 +5,10 @@ use App\Http\Controllers\BaseController;
|
|||||||
use App\Http\Controllers\BuildingController;
|
use App\Http\Controllers\BuildingController;
|
||||||
use App\Http\Controllers\CommentController;
|
use App\Http\Controllers\CommentController;
|
||||||
use App\Http\Controllers\ConceptController;
|
use App\Http\Controllers\ConceptController;
|
||||||
|
use App\Http\Controllers\ContainerTypeController;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Controllers\DashboardController;
|
use App\Http\Controllers\DashboardController;
|
||||||
|
use App\Http\Controllers\IncidentTypeController;
|
||||||
use App\Http\Controllers\InvoiceController;
|
use App\Http\Controllers\InvoiceController;
|
||||||
use App\Http\Controllers\OrganismController;
|
use App\Http\Controllers\OrganismController;
|
||||||
use App\Http\Controllers\PatientController;
|
use App\Http\Controllers\PatientController;
|
||||||
@@ -15,6 +17,7 @@ use App\Http\Controllers\PhysicianController;
|
|||||||
use App\Http\Controllers\QuantityController;
|
use App\Http\Controllers\QuantityController;
|
||||||
use App\Http\Controllers\ReportController;
|
use App\Http\Controllers\ReportController;
|
||||||
use App\Http\Controllers\RoleController;
|
use App\Http\Controllers\RoleController;
|
||||||
|
use App\Http\Controllers\RoomController;
|
||||||
use App\Http\Controllers\SampleController;
|
use App\Http\Controllers\SampleController;
|
||||||
use App\Http\Controllers\SampleSourceController;
|
use App\Http\Controllers\SampleSourceController;
|
||||||
use App\Http\Controllers\SampleTypeController;
|
use App\Http\Controllers\SampleTypeController;
|
||||||
@@ -111,7 +114,6 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::post('laboratory.delete', [OrganizationController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
Route::post('laboratory.delete', [OrganizationController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
Route::post('laboratory.restore', [OrganizationController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
Route::post('laboratory.restore', [OrganizationController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
|
|
||||||
Route::get('building', [BuildingController::class, 'index'])->name('building')->middleware(VerifyBaseLab::class);
|
Route::get('building', [BuildingController::class, 'index'])->name('building')->middleware(VerifyBaseLab::class);
|
||||||
Route::get('building/search', [BuildingController::class, 'index'])->name('building.search')->middleware(VerifyBaseLab::class);
|
Route::get('building/search', [BuildingController::class, 'index'])->name('building.search')->middleware(VerifyBaseLab::class);
|
||||||
Route::post('building.save', [BuildingController::class, 'save'])->middleware(VerifyBaseLab::class);
|
Route::post('building.save', [BuildingController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||||
@@ -120,6 +122,14 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::post('building.delete', [BuildingController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
Route::post('building.delete', [BuildingController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
Route::post('building.restore', [BuildingController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
Route::post('building.restore', [BuildingController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
|
Route::get('room', [RoomController::class, 'index'])->name('room')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::get('room/search', [RoomController::class, 'index'])->name('room.search')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('room.save', [RoomController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('room.get', [RoomController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('room.update', [RoomController::class, 'update'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('room.delete', [RoomController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('room.restore', [RoomController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
Route::get('concept', [ConceptController::class, 'index'])->name('concept')->middleware(VerifyBaseLab::class);
|
Route::get('concept', [ConceptController::class, 'index'])->name('concept')->middleware(VerifyBaseLab::class);
|
||||||
Route::get('concept/search', [ConceptController::class, 'index'])->name('concept.search')->middleware(VerifyBaseLab::class);
|
Route::get('concept/search', [ConceptController::class, 'index'])->name('concept.search')->middleware(VerifyBaseLab::class);
|
||||||
Route::post('concept.save', [ConceptController::class, 'save'])->middleware(VerifyBaseLab::class);
|
Route::post('concept.save', [ConceptController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||||
@@ -128,6 +138,21 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::post('concept.delete', [ConceptController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
Route::post('concept.delete', [ConceptController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
Route::post('concept.restore', [ConceptController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
Route::post('concept.restore', [ConceptController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
|
Route::get('incident-type', [IncidentTypeController::class, 'index'])->name('incident-type')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::get('incident-type/search', [IncidentTypeController::class, 'index'])->name('incident-type.search')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('incident-type.save', [IncidentTypeController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('incident-type.get', [IncidentTypeController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('incident-type.update', [IncidentTypeController::class, 'update'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('incident-type.delete', [IncidentTypeController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('incident-type.restore', [IncidentTypeController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
|
Route::get('sample-container', [ContainerTypeController::class, 'index'])->name('sample-container')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::get('sample-container/search', [ContainerTypeController::class, 'index'])->name('sample-container.search')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('sample-container.save', [ContainerTypeController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('sample-container.get', [ContainerTypeController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('sample-container.update', [ContainerTypeController::class, 'update'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('sample-container.delete', [ContainerTypeController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('sample-container.restore', [ContainerTypeController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
Route::get('user', [UserController::class, 'index'])->name('user')->middleware(VerifyBaseLab::class);
|
Route::get('user', [UserController::class, 'index'])->name('user')->middleware(VerifyBaseLab::class);
|
||||||
Route::get('lab-users', [UserController::class, 'labUsers'])->name('lab_user')->middleware(VerifyBaseLab::class);
|
Route::get('lab-users', [UserController::class, 'labUsers'])->name('lab_user')->middleware(VerifyBaseLab::class);
|
||||||
|
|||||||
Reference in New Issue
Block a user