pathogen
This commit is contained in:
143
app/Http/Controllers/PathogenController.php
Normal file
143
app/Http/Controllers/PathogenController.php
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<?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\Pathogen;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
|
||||||
|
class PathogenController 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 Pathogen();
|
||||||
|
$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();
|
||||||
|
$pathogens = $this->model::with(['riskGroup', 'bsl', 'pathogenType'])->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition)
|
||||||
|
->when(!empty($request->kword), function ($query) use($request){
|
||||||
|
$query->whereRaw("replace(scientific_name, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(common_name, ' ','') like '%".str_replace(" ","",$request->kword)."%'")
|
||||||
|
->orWhereRaw("replace(strain, ' ','') like '%".str_replace(" ","",$request->kword)."%'");
|
||||||
|
})->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10));
|
||||||
|
return view('pathogen', ['pathogens' => $pathogens, 'concepts' => $concepts]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save(Request $request){
|
||||||
|
try {
|
||||||
|
|
||||||
|
$validator = \Validator::make($request->all(), [
|
||||||
|
'pathogen_category_concept_id' => 'required',
|
||||||
|
'scientific_name' => 'required',
|
||||||
|
'common_name' => 'required',
|
||||||
|
'risk_group_concept_id' => 'required',
|
||||||
|
'biosafety_level_concept_id' => 'required',
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return response()->json(['success' => false, 'message' => __('building.create_fail'), 'errors' => $validator->errors()->all()]);
|
||||||
|
}
|
||||||
|
$data = array(
|
||||||
|
'pathogen_category_concept_id' => $request->pathogen_category_concept_id,
|
||||||
|
'scientific_name' => $request->scientific_name,
|
||||||
|
'common_name' => $request->common_name,
|
||||||
|
'risk_group_concept_id' => $request->risk_group_concept_id,
|
||||||
|
'biosafety_level_concept_id' => $request->biosafety_level_concept_id,
|
||||||
|
'infectious_dose' => $request->infectious_dose,
|
||||||
|
'transmission_mode' => $request->transmission_mode,
|
||||||
|
'storage_requirement' => $request->storage_requirement,
|
||||||
|
'min_temp' => $request->min_temp,
|
||||||
|
'max_temp' => $request->max_temp,
|
||||||
|
'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(), [
|
||||||
|
'pathogen_category_concept_id' => 'required',
|
||||||
|
'scientific_name' => 'required',
|
||||||
|
'common_name' => 'required',
|
||||||
|
'risk_group_concept_id' => 'required',
|
||||||
|
'biosafety_level_concept_id' => 'required',
|
||||||
|
]);
|
||||||
|
if ($validator->fails()) return response()->json(['errors' => $validator->errors()->all()]);
|
||||||
|
$data = array(
|
||||||
|
'pathogen_category_concept_id' => $request->pathogen_category_concept_id,
|
||||||
|
'scientific_name' => $request->scientific_name,
|
||||||
|
'common_name' => $request->common_name,
|
||||||
|
'risk_group_concept_id' => $request->risk_group_concept_id,
|
||||||
|
'biosafety_level_concept_id' => $request->biosafety_level_concept_id,
|
||||||
|
'infectious_dose' => $request->infectious_dose,
|
||||||
|
'transmission_mode' => $request->transmission_mode,
|
||||||
|
'storage_requirement' => $request->storage_requirement,
|
||||||
|
'min_temp' => $request->min_temp,
|
||||||
|
'max_temp' => $request->max_temp,
|
||||||
|
'updated_at' => date('Y-m-d H:i:s'),
|
||||||
|
'updated_by' => Auth::id()
|
||||||
|
);
|
||||||
|
$this->model::query()->where('id', $request->pathogen_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->pathogen_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->pathogen_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->pathogen_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()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
use App\Enums\RecordStatusEnum;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
|
|
||||||
class Organism extends BaseModel
|
|
||||||
{
|
|
||||||
public $timestamps = false;
|
|
||||||
use HasFactory;
|
|
||||||
/**
|
|
||||||
* The table associated with the model.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $fillable = ['name_en', 'weight', 'is_bold', 'organization_id'];
|
|
||||||
|
|
||||||
public static function boot()
|
|
||||||
{
|
|
||||||
parent::boot();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function lab(){
|
|
||||||
return $this->belongsTo('App\Models\Organization', 'organization_id','id');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
51
app/Models/Pathogen.php
Normal file
51
app/Models/Pathogen.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?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 Pathogen 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 = [
|
||||||
|
'pathogen_category_concept_id','scientific_name', 'common_name', 'risk_group_concept_id',
|
||||||
|
'biosafety_level_concept_id', 'infectious_dose', 'transmission_mode', 'storage_requirement', 'min_temp', 'max_temp',
|
||||||
|
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 pathogenType(){
|
||||||
|
return $this->belongsTo(Concept::class, 'pathogen_category_concept_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function riskGroup(){
|
||||||
|
return $this->belongsTo(Concept::class, 'risk_group_concept_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bsl(){
|
||||||
|
return $this->belongsTo(Concept::class, 'biosafety_level_concept_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
use App\Enums\RecordStatusEnum;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Support\Facades\Session;
|
|
||||||
|
|
||||||
class SampleType extends BaseModel
|
|
||||||
{
|
|
||||||
public $timestamps = false;
|
|
||||||
use HasFactory;
|
|
||||||
/**
|
|
||||||
* The table associated with the model.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
|
|
||||||
protected $table='sample_types';
|
|
||||||
|
|
||||||
protected $fillable = ['name_en', 'weight', 'department_id','tube','description','organization_id','bg_color','color', 'enter_form_id', 'preview_form_id'];
|
|
||||||
|
|
||||||
public static function boot()
|
|
||||||
{
|
|
||||||
parent::boot();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function department(){
|
|
||||||
return $this->belongsTo(Department::class, 'department_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testSamples(){
|
|
||||||
return $this->hasMany(TestSample::class, 'sample_type_id')
|
|
||||||
->where([BaseModel::RECORD_STATUS_FIELD => RecordStatusEnum::ACTIVE])
|
|
||||||
//->where('organization_id', Session::get('base_organization_id'))
|
|
||||||
->orderBy('weight');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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)
|
||||||
if(res.success) {setTimeout(function () {location.reload()}, messageDuration)}
|
if(res.success == true) {setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
128
public/storage/assets/js/admin/pathogen.js
Normal file
128
public/storage/assets/js/admin/pathogen.js
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
|
||||||
|
$("#btnSave").on('click',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
let pathogen_id = $('#pathogen_id').val();
|
||||||
|
url = parseInt(pathogen_id) === 0 ? save_url : update_url;
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
pathogen_id : pathogen_id,
|
||||||
|
pathogen_category_concept_id: $('#pathogen_category_concept_id').val(),
|
||||||
|
scientific_name: $('#scientific_name').val(),
|
||||||
|
common_name: $('#common_name').val(),
|
||||||
|
risk_group_concept_id: $('#risk_group_concept_id').val(),
|
||||||
|
biosafety_level_concept_id: $('#biosafety_level_concept_id').val(),
|
||||||
|
infectious_dose: $('#infectious_dose').val(),
|
||||||
|
transmission_mode: $('#transmission_mode').val(),
|
||||||
|
storage_requirement: $('#storage_requirement').val(),
|
||||||
|
min_temp: $('#min_temp').val(),
|
||||||
|
max_temp: $('#max_temp').val(),
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success){ setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function delete_lab(pathogen_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,
|
||||||
|
pathogen_id : pathogen_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success) {setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function restore_lab(pathogen_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,
|
||||||
|
pathogen_id : pathogen_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
handleMessage(res.success, res.message)
|
||||||
|
if(res.success) { setTimeout(function () {location.reload()}, messageDuration)}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#modal-pathogen').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 input[name="pathogen_id"]').val(0);
|
||||||
|
modal.find('.modal-body select[name="pathogen_category_concept_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-body select[name="risk_group_concept_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-body select[name="biosafety_level_concept_id"]').val("").trigger('change');
|
||||||
|
modal.find('.modal-title').html(modal_add_title);
|
||||||
|
}else if(action === "edit"){
|
||||||
|
pathogen_id = button.data('pathogen_id');
|
||||||
|
modal.find('.modal-body input[name="pathogen_id"]').val(pathogen_id);
|
||||||
|
modal.find('.modal-title').html(modal_edit_title);
|
||||||
|
//e.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
url: get_url,
|
||||||
|
type:"POST",
|
||||||
|
data:{
|
||||||
|
"_token": csrf_token,
|
||||||
|
pathogen_id: pathogen_id,
|
||||||
|
},
|
||||||
|
success:function(res){
|
||||||
|
if(res.success) {
|
||||||
|
let data = res.data;
|
||||||
|
modal.find('.modal-body input[name="scientific_name"]').val(data.scientific_name);
|
||||||
|
modal.find('.modal-body input[name="common_name"]').val(data.common_name);
|
||||||
|
modal.find('.modal-body input[name="infectious_dose"]').val(data.infectious_dose);
|
||||||
|
modal.find('.modal-body input[name="transmission_mode"]').val(data.transmission_mode);
|
||||||
|
modal.find('.modal-body input[name="storage_requirement"]').val(data.storage_requirement);
|
||||||
|
modal.find('.modal-body input[name="min_temp"]').val(data.min_temp);
|
||||||
|
modal.find('.modal-body input[name="max_temp"]').val(data.max_temp);
|
||||||
|
modal.find('.modal-body select[name="risk_group_concept_id"]').val(data.risk_group_concept_id).trigger('change');
|
||||||
|
modal.find('.modal-body select[name="pathogen_category_concept_id"]').val(data.pathogen_category_concept_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)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
@@ -79,16 +79,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item {{ in_array(request()->segment(1), ['concept', 'sample-container']) ? 'active' : '' }}">
|
<li class="nav-item {{ in_array(request()->segment(1), ['concept', 'sample-container', 'pathogen']) ? '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', 'sample-container']) ? 'show' : '' }}" id="catalog">
|
<div class="collapse {{ in_array(request()->segment(1), ['concept', 'sample-container', 'pathogen']) ? '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 {{request()->segment(1)=='pathogen' ? 'active':''}}" href="{{url('pathogen')}}">ប្រភេទមេរោគ/ជាតិពុល</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 {{request()->segment(1)=='sample-container' ? 'active':''}}" href="{{url('sample-container')}}">ប្រភេទទីបផ្ទុកសំណាក</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
226
resources/views/pathogen.blade.php
Normal file
226
resources/views/pathogen.blade.php
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
<!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('pathogen/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-pathogen" 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">{{__('ឈ្មោះវិទ្យាសាស្ត្រ')}}</th>
|
||||||
|
<th class="py-2">{{__('ឈ្មោះទូទៅ')}}</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($pathogens as $k=>$pathogen)
|
||||||
|
<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-pathogen_id="{{$pathogen->id}}" data-toggle="modal" data-target="#modal-pathogen" data-backdrop="static"><i class="typcn typcn-edit"></i></button>
|
||||||
|
@if($pathogen->record_status_id==0)
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-primary" title="Restore" onclick="restore_lab({{$pathogen->id}})"><i class="typcn typcn-plus"></i></button>
|
||||||
|
@else
|
||||||
|
<button type="button" class="btn btn-sm btn-inverse-danger " title="Delete" onclick="delete_lab({{$pathogen->id}})"><i class="mdi mdi-close-circle"></i></button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="py-1">{{$pathogen->scientific_name}}</td>
|
||||||
|
<td class="py-1">{{$pathogen->common_name}}</td>
|
||||||
|
<td class="py-1">{{$pathogen->pathogenType->name}}</td>
|
||||||
|
<td class="py-1">{{$pathogen->riskGroup->name}}</td>
|
||||||
|
<td class="py-1">{{$pathogen->bsl->name}}</td>
|
||||||
|
<td class="py-1 text-center">
|
||||||
|
<i class="mdi {{$pathogen->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">
|
||||||
|
{!! $pathogens->links('pagination.custom') !!}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Modal Laboratory -->
|
||||||
|
<div class="modal mt-5 fade modal-primary" id="modal-pathogen">
|
||||||
|
<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="pathogen_id" id="pathogen_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="scientific_name" id="scientific_name" value="" />
|
||||||
|
</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="common_name" id="common_name" 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="pathogen_category_concept_id" id="pathogen_category_concept_id" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
@foreach(collect($concepts)->where('concept_category_code', 'MATERIALS') 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="risk_group_concept_id" id="risk_group_concept_id" style="width: 100% !important;">
|
||||||
|
<option></option>
|
||||||
|
@foreach(collect($concepts)->where('concept_category_code', 'RISK_GROUP') 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="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-kh">{{__('របៀបចម្លង')}} <span class="text-danger"></span> </label>
|
||||||
|
<input type="text" class="form-control" name="transmission_mode" id="transmission_mode" 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="min_temp" id="min_temp" 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="max_temp" id="max_temp" value="" placeholder="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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" name="storage_requirement" id="storage_requirement" value="" placeholder=""/>
|
||||||
|
</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('pathogen.save')}}";
|
||||||
|
var update_url = "{{url('pathogen.update')}}";
|
||||||
|
var delete_url = "{{url('pathogen.delete')}}";
|
||||||
|
var restore_url = "{{url('pathogen.restore')}}";
|
||||||
|
var get_url = "{{url('pathogen.get')}}";
|
||||||
|
|
||||||
|
let modal_add_title = "Add Pathogen";
|
||||||
|
let modal_edit_title = "Add Pathogen";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script src="{{url(env("APP_URL").'storage/assets/js/admin/pathogen.js?_').time()}}"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ use App\Http\Controllers\DashboardController;
|
|||||||
use App\Http\Controllers\IncidentTypeController;
|
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\PathogenController;
|
||||||
use App\Http\Controllers\PatientController;
|
use App\Http\Controllers\PatientController;
|
||||||
use App\Http\Controllers\PatientTypeController;
|
use App\Http\Controllers\PatientTypeController;
|
||||||
use App\Http\Controllers\PhysicianController;
|
use App\Http\Controllers\PhysicianController;
|
||||||
@@ -154,6 +155,14 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::post('sample-container.delete', [ContainerTypeController::class, 'delete'])->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::post('sample-container.restore', [ContainerTypeController::class, 'restore'])->middleware(VerifyBaseLab::class);
|
||||||
|
|
||||||
|
Route::get('pathogen', [PathogenController::class, 'index'])->name('pathogen')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::get('pathogen/search', [PathogenController::class, 'index'])->name('pathogen.search')->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('pathogen.save', [PathogenController::class, 'save'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('pathogen.get', [PathogenController::class, 'get'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('pathogen.update', [PathogenController::class, 'update'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('pathogen.delete', [PathogenController::class, 'delete'])->middleware(VerifyBaseLab::class);
|
||||||
|
Route::post('pathogen.restore', [PathogenController::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);
|
||||||
Route::get('user/search', [UserController::class, 'index'])->name('user.search')->middleware(VerifyBaseLab::class);
|
Route::get('user/search', [UserController::class, 'index'])->name('user.search')->middleware(VerifyBaseLab::class);
|
||||||
|
|||||||
Reference in New Issue
Block a user