diff --git a/app/Http/Controllers/BuildingController.php b/app/Http/Controllers/BuildingController.php new file mode 100644 index 0000000..a060ef3 --- /dev/null +++ b/app/Http/Controllers/BuildingController.php @@ -0,0 +1,123 @@ +baseOrganizationId = Session::get('base_organization_id'); + $this->base = Session::get('base_organization'); + $this->model = new Building(); + } + + public function index(Request $request){ + $recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE]; + $buildings = $this->model::query()->whereIn(BaseModel::RECORD_STATUS_FIELD, $recordStatusCondition) + ->where('organization_id', $this->baseOrganizationId) + ->when(!empty($request->kword), function ($labs) use($request){ + $labs->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('building', ['buildings' => $buildings]); + } + + public function save(Request $request){ + try { + + $validator = \Validator::make($request->all(), [ + 'name_en' => 'required', + 'name_kh' => '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, + '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', + ]); + 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->building_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->building_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->building_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->building_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()]); + } + } + + +} diff --git a/app/Http/Controllers/ConceptController.php b/app/Http/Controllers/ConceptController.php new file mode 100644 index 0000000..3bdaa51 --- /dev/null +++ b/app/Http/Controllers/ConceptController.php @@ -0,0 +1,131 @@ +baseOrganizationId = Session::get('base_organization_id'); + $this->base = Session::get('base_organization'); + $this->model = new Concept(); + } + + public function index(Request $request){ + $recordStatusCondition = Auth::id()==1 ? [RecordStatusEnum::DELETE, RecordStatusEnum::ACTIVE] : [RecordStatusEnum::ACTIVE]; + $conceptCategories = $this->model::query()->groupBy('concept_category_code')->get('concept_category_code'); + $concepts = $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)."%'"); + })->when(!empty(trim($request->concept_category_code)) && $request->concept_category_code != 'all', function ($query) use($request){ + $query->where('concept_category_code', $request->concept_category_code); + })->orderBy(BaseModel::CREATED_AT, 'desc')->paginate(config('nrml.pagination.perpage', 10)); + return view('concept', ['concepts' => $concepts, 'concept_categories' => $conceptCategories]); + } + + public function save(Request $request){ + try { + + $validator = \Validator::make($request->all(), [ + 'name_en' => 'required', + 'code' => 'required', + 'concept_category_code' => 'required', + 'name_kh' => '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, + 'concept_category_code' => $request->concept_category_code, + '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', + 'code' => 'required', + 'concept_category_code' => 'required', + 'name_kh' => '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, + 'concept_category_code' => $request->concept_category_code, + 'updated_at' => date('Y-m-d H:i:s'), + 'updated_by' => Auth::id() + ); + $this->model::query()->where('id', $request->concept_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->concept_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->concept_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->concept_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()]); + } + } + + +} diff --git a/app/Http/Controllers/OrganismController.php b/app/Http/Controllers/OrganismController.php index a51d2cb..3253070 100644 --- a/app/Http/Controllers/OrganismController.php +++ b/app/Http/Controllers/OrganismController.php @@ -30,7 +30,7 @@ class OrganismController extends Controller //->where('organization_id', $this->baseOrganizationId) ->when(!empty($request->kword), function ($organisms) use($request){ $organisms->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'"); - })->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10)); + })->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('organism', ['organisms' => $organisms]); } diff --git a/app/Http/Controllers/OrganizationController.php b/app/Http/Controllers/OrganizationController.php index 457f6e7..75a88f9 100644 --- a/app/Http/Controllers/OrganizationController.php +++ b/app/Http/Controllers/OrganizationController.php @@ -35,7 +35,7 @@ class OrganizationController extends Controller ->orWhereRaw("replace(name_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'") ->orWhere('address_en','like','%'.$request->kword.'%') ->orWhere('address_kh','like','%'.$request->kword.'%'); - })->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10)); + })->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('laboratory', ['laboratories' => $labs]); } diff --git a/app/Http/Controllers/PublicationController.php b/app/Http/Controllers/PublicationController.php index 5151798..162bdb5 100644 --- a/app/Http/Controllers/PublicationController.php +++ b/app/Http/Controllers/PublicationController.php @@ -29,7 +29,7 @@ class PublicationController extends Controller ->when(!empty($request->kword), function ($publications) use($request){ $publications->whereRaw("replace(title_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'") ->orWhereRaw("replace(title_kh, ' ','') like '%".str_replace(" ","",$request->kword)."%'"); - })->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10)); + })->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('publication', ['publications' => $publications, 'labs' => $this->labs]); } diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index 290530a..c1d4e3a 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -36,7 +36,7 @@ class RoleController extends Controller ->whereNotIn('id', [UtilEnum::ADMINISTRATOR_ROLE]) ->when(!empty($request->kword), function ($roles) use($request){ $roles->whereRaw("replace(name_en, ' ','') like '%".str_replace(" ","",$request->kword)."%'"); - })->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10)); + })->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('role', ['roles' => $roles]); } diff --git a/app/Http/Controllers/SampleController.php b/app/Http/Controllers/SampleController.php index a4fbfab..c056098 100644 --- a/app/Http/Controllers/SampleController.php +++ b/app/Http/Controllers/SampleController.php @@ -97,7 +97,7 @@ class SampleController extends Controller $samples->whereIn('id', $this->filterSampleStatus($request->sample_status)); })->when(!empty($request->sample_date) && empty($request->kword) , function ($samples) use($request){ $samples->whereDate('admission_date', date('Y-m-d',strtotime($request->sample_date))); - })->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('labis.pagination.perpage', 10)); + })->orderBy(BaseModel::CREATED_AT_FIELD,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('sample', ['samples' => $samples]); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 6537c3c..5a5b3f9 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -53,7 +53,7 @@ class UserController extends Controller ->orWhereRaw("REPLACE(email,' ','') LIKE ?", [$keyword]); })->where('id', '!=', UtilEnum::ADMINISTRATOR_USER); }) - ->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10)); + ->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('user_account', ['users' => $users, 'roles' => $roles, 'organizations' => $this->organizations]); } @@ -69,7 +69,7 @@ class UserController extends Controller ->when(!empty($request->kword), function($users) use ($request) { $users->whereRaw("replace(name, ' ','') like '%".str_replace(" ","",$request->kword)."%'") ->orWhereRaw("replace(email, ' ','') like '%".str_replace(" ","",$request->kword)."%'"); - })->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('labis.pagination.perpage', 10)); + })->orderBy(BaseModel::CREATED_AT,'desc')->paginate(config('nrml.pagination.perpage', 10)); return view('user_account', ['users' => $users, 'roles' => $roles, 'labs' => $this->labs]); } diff --git a/app/Models/Building.php b/app/Models/Building.php new file mode 100644 index 0000000..f84fe13 --- /dev/null +++ b/app/Models/Building.php @@ -0,0 +1,40 @@ + [ - 'perpage' => 20, - ], - - 'auto_complete_items' => [ - 'Positive ', - 'Negative ', - 'Normal ', - 'Abnormal', - 'POSITIVE ', - 'NEGATIVE ', - 'Trace', - '(1+)', - '(2+)', - '(3+)', - ], - 'baseManagerMenus' =>[ - 'department', - 'sample-type', - 'test', - 'comment', - 'organism', - 'antibiotic', - 'quantity', - 'ward', - 'hospital-service', - 'patient-type', - 'physician', - 'lab-users' - ], - - 'administrator' => [ - 'concept-code', - 'publication', - 'hospital', - 'user', - 'role', - 'clone-hospital' - ], - - 'sample' => [ - 'sample', - 'requested' - ], - - -]; diff --git a/config/nrml.php b/config/nrml.php new file mode 100644 index 0000000..bb08f43 --- /dev/null +++ b/config/nrml.php @@ -0,0 +1,9 @@ + [ + 'perpage' => 20, + ] + +]; diff --git a/lang/en/general.php b/lang/en/general.php index be3cf0c..2b4b2b3 100644 --- a/lang/en/general.php +++ b/lang/en/general.php @@ -92,8 +92,9 @@ return [ 'sample_entry_by' => 'Entered By', 'modify_by' => 'Modified By', + 'code' => 'Code' + - 'apply_to_all_test' => 'Apply to all tests' diff --git a/lang/kh/general.php b/lang/kh/general.php index 7764477..76f2889 100644 --- a/lang/kh/general.php +++ b/lang/kh/general.php @@ -89,6 +89,6 @@ return [ 'sample_entry_by' => 'បញ្ចូលលទ្ធផលដោយ', 'modify_by' => 'កែប្រែលទ្ធផលដោយ', - 'apply_to_all_test' => 'កំណត់គ្រប់តេស្តទាំងអស់' + 'code' => 'លេខកូដ' ]; diff --git a/public/storage/assets/css/overwrite.css b/public/storage/assets/css/overwrite.css index d3c32ef..de8939c 100644 --- a/public/storage/assets/css/overwrite.css +++ b/public/storage/assets/css/overwrite.css @@ -469,7 +469,6 @@ Lab & User Profile border-color: #d3d5d7 !important; } .nav .menu-icon{ - /*color: #3b86d1 !important;*/ color: #12931d !important; } .sidebar .nav.sub-menu .nav-item::before { @@ -536,10 +535,15 @@ input[type=number] { } .sidebar .nav.sub-menu .nav-item::before { - width: 5px; - height: 5px; - border-radius: 50px !important; - background: #469f37; + width: 6px; + height: 6px; + border-radius: 0px !important; + background: #ffffff; + border: 1px solid #12931d; +} + +.sidebar .nav-item:has(.nav-link.active)::before { + background: #12931d; } .modal-header .modal-title{ @@ -614,11 +618,6 @@ div select{ } -.sidebar .nav.sub-menu .nav-item .nav-link.active { - font-weight: 450 !important; - border-right: 5px solid #1460ab !important; -} - .nav-tabs .nav-link { border-top-left-radius: 0 !important; diff --git a/public/storage/assets/css/overwrite.select2.css b/public/storage/assets/css/overwrite.select2.css index 8e18aa6..81e0c2f 100644 --- a/public/storage/assets/css/overwrite.select2.css +++ b/public/storage/assets/css/overwrite.select2.css @@ -1,13 +1,13 @@ .select2-selection__rendered { - line-height: 18px !important; + line-height: 25px !important; } .select2-container .select2-selection--single{ box-shadow: none; outline: none; } .select2-container .select2-selection--single, .select2-selection--multiple { - min-height: 46px !important; + min-height: 36px !important; border-radius: 0; border-color: #f3f3f3 !important; } @@ -15,7 +15,7 @@ outline: none; } .select2-selection__arrow { - height: 46px !important; + height: 36px !important; } .select2-selection__choice{ font-size: 13px !important; @@ -86,3 +86,8 @@ .select2-selection .select2-selection--multiple:after { content: 'hhghgh'; } + +.select2-container .select2-selection--single, .main-panel .select2-selection--multiple { + padding-top: 5px !important; + padding-left: 5px !important; +} diff --git a/public/storage/assets/js/admin/building.js b/public/storage/assets/js/admin/building.js new file mode 100644 index 0000000..d4ce91a --- /dev/null +++ b/public/storage/assets/js/admin/building.js @@ -0,0 +1,115 @@ + +$("#btnSave").on('click',function(e){ + e.preventDefault(); + let building_id = $('#building_id').val(); + url = parseInt(building_id) === 0 ? save_url : update_url; + $.ajax({ + url: url, + type:"POST", + data:{ + "_token": csrf_token, + building_id : building_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(building_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, + building_id : building_id, + }, + success:function(res){ + handleMessage(res.success, res.message) + setTimeout(function () {location.reload()}, messageDuration) + } + }) + + } + }); +} + +function restore_lab(building_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, + building_id : building_id, + }, + success:function(res){ + handleMessage(res.success, res.message) + setTimeout(function () {location.reload()}, messageDuration) + } + }) + + } + }); +} + +$('#modal-building').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 + $('#shareable_lab_result').prop("checked", false) + 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="building_id"]').val(0); + modal.find('.modal-title').html(modal_add_title); + }else if(action === "edit"){ + building_id = button.data('building_id'); + modal.find('.modal-body input[name="building_id"]').val(building_id); + modal.find('.modal-title').html(modal_edit_title); + //e.preventDefault(); + $.ajax({ + url: get_url, + type:"POST", + data:{ + "_token": csrf_token, + building_id: building_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) + } + }, + }); + } +}) + diff --git a/public/storage/assets/js/admin/concept.js b/public/storage/assets/js/admin/concept.js new file mode 100644 index 0000000..47a2d17 --- /dev/null +++ b/public/storage/assets/js/admin/concept.js @@ -0,0 +1,118 @@ + +$("#btnSave").on('click',function(e){ + e.preventDefault(); + let concept_id = $('#concept_id').val(); + url = parseInt(concept_id) === 0 ? save_url : update_url; + $.ajax({ + url: url, + type:"POST", + data:{ + "_token": csrf_token, + concept_id : concept_id, + name_en: $('#name-en').val(), + name_kh: $('#name-kh').val(), + code: $('#code').val(), + concept_category_code: $('#concept_category_code').val(), + description: $('#description').val(), + }, + success:function(res){ + handleMessage(res.success, res.message) + setTimeout(function () {location.reload()}, messageDuration) + } + }); +}); + +function delete_lab(concept_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, + concept_id : concept_id, + }, + success:function(res){ + handleMessage(res.success, res.message) + setTimeout(function () {location.reload()}, messageDuration) + } + }) + + } + }); +} + +function restore_lab(concept_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, + concept_id : concept_id, + }, + success:function(res){ + handleMessage(res.success, res.message) + setTimeout(function () {location.reload()}, messageDuration) + } + }) + + } + }); +} + +$('#modal-concept').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 + $('#shareable_lab_result').prop("checked", false) + 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="concept_category_code"]').val("").trigger('change'); + modal.find('.modal-body input[name="concept_id"]').val(0); + modal.find('.modal-title').html(modal_add_title); + }else if(action === "edit"){ + concept_id = button.data('concept_id'); + modal.find('.modal-body input[name="concept_id"]').val(concept_id); + modal.find('.modal-title').html(modal_edit_title); + //e.preventDefault(); + $.ajax({ + url: get_url, + type:"POST", + data:{ + "_token": csrf_token, + concept_id: concept_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 select[name="concept_category_code"]').val(data.concept_category_code).trigger('change'); + modal.find('.modal-body textarea[name="description"]').val(data.description); + } else{ + handleMessage(res.success, res.message) + } + }, + }); + } +}) + diff --git a/resources/views/building.blade.php b/resources/views/building.blade.php new file mode 100644 index 0000000..773fc29 --- /dev/null +++ b/resources/views/building.blade.php @@ -0,0 +1,165 @@ + + + + @include('layout.header') + + + +
+@include('layout.navbar') + + @include('layout.breadscrum') +
+ + @include('layout.sidebar') + + +
+
+
+
+
+
+

{{__('អគារ')}}

+
+
+
+
+
+
+ +
+ + +
+
+
+
+

+
+
+ + + + + + + + + + + + + @foreach($buildings as $k=>$building) + + + + + + + + + @endforeach + +
{{__('laboratory.table_no')}}{{__('laboratory.table_action')}}{{__('general.code')}}{{__('laboratory.table_name_en')}}{{__('laboratory.table_name_kh')}}{{__('laboratory.table_status')}}
{{($k+1) + (($_GET['page'] ?? 1) * 20) - 20}} +
+ + @if($building->record_status_id==0) + + @else + + @endif +
+
{{$building->code}}{{$building->name_en}}{{$building->name_kh}} + +
+
+
+ +
+ {!! $buildings->links('pagination.custom') !!} +
+
+
+
+
+
+ +
+
+ + + @include('layout.footer') +
+
+
+@include('layout.common_script') + + + + + + + diff --git a/resources/views/concept.blade.php b/resources/views/concept.blade.php new file mode 100644 index 0000000..bd59083 --- /dev/null +++ b/resources/views/concept.blade.php @@ -0,0 +1,186 @@ + + + + @include('layout.header') + + + +
+@include('layout.navbar') + + @include('layout.breadscrum') +
+ + @include('layout.sidebar') + + +
+
+
+
+
+
+

{{__('បញ្ជីគម្រូ')}}

+
+
+
+
+
+
+ +
+ + + +
+
+
+
+

+
+
+ + + + + + + + + + + + + + @foreach($concepts as $k=>$concept) + + + + + + + + + + @endforeach + +
{{__('laboratory.table_no')}}{{__('laboratory.table_action')}}{{__('general.code')}}{{__('laboratory.table_name_en')}}{{__('laboratory.table_name_kh')}}{{__('Category')}}{{__('laboratory.table_status')}}
{{($k+1) + (($_GET['page'] ?? 1) * 20) - 20}} +
+ + @if($concept->record_status_id==0) + + @else + + @endif +
+
{{$concept->code}}{{$concept->name_en}}{{$concept->name_kh}}{{$concept->concept_category_code}} + +
+
+
+ +
+ {!! $concepts->links('pagination.custom') !!} +
+
+
+
+
+
+ +
+
+ + + @include('layout.footer') +
+
+
+@include('layout.common_script') + + + + + + + diff --git a/resources/views/layout/header.blade.php b/resources/views/layout/header.blade.php index f2beda6..f9890d5 100644 --- a/resources/views/layout/header.blade.php +++ b/resources/views/layout/header.blade.php @@ -42,12 +42,14 @@ font-size: {{ Config::get('app.locale') == 'kh' ? '1rem' : '14px' }} !important; } .nav .menu-icon { - color: #12931d !important; -} + color: #12931d !important; + } .dropdown-item p{ font-size: {{ Config::get('app.locale') == 'kh' ? '1.1rem' : '0.875rem' }} !important; } .select2-container--default .select2-dropdown { font-size: {{ Config::get('app.locale') == 'kh' ? '1.1rem' : '0.875rem' }} !important; } + + diff --git a/resources/views/layout/sidebar.blade.php b/resources/views/layout/sidebar.blade.php index 48303b6..b434ea9 100644 --- a/resources/views/layout/sidebar.blade.php +++ b/resources/views/layout/sidebar.blade.php @@ -61,15 +61,15 @@ - -