crud room, incident type, catalog, and sample-containers

This commit is contained in:
2026-06-26 17:06:38 +07:00
parent 75830562c4
commit e3f2e51232
23 changed files with 1505 additions and 53 deletions

View File

@@ -753,21 +753,21 @@ div select{
.pagination .page-link:hover {
color: #FFF !important; /* Your desired hover text color */
background: rgba(4,100,144,0.96) !important;
border-color: rgba(4,100,144,0.96) !important;
background: rgb(6 157 73 / 96%) !important;
border-color: rgb(6 157 73 / 96%) !important;
}
.page-item.disabled .page-link {
color: #FFF !important; /* Your desired hover text color */
background: rgba(4,100,144,0.96) !important;
border-color: rgba(4,100,144,0.96) !important;
background: rgb(6 157 73 / 96%) !important;
border-color: rgb(46 183 69 / 96%) !important;
}
/* 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:focus {
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{

View File

@@ -1,13 +1,13 @@
.select2-selection__rendered {
line-height: 25px !important;
line-height: 19px !important;
}
.select2-container .select2-selection--single{
box-shadow: none;
outline: none;
}
.select2-container .select2-selection--single, .select2-selection--multiple {
min-height: 36px !important;
min-height: 46px !important;
border-radius: 0;
border-color: #f3f3f3 !important;
}
@@ -15,7 +15,7 @@
outline: none;
}
.select2-selection__arrow {
height: 36px !important;
height: 46px !important;
}
.select2-selection__choice{
font-size: 13px !important;
@@ -87,7 +87,7 @@
content: 'hhghgh';
}
.select2-container .select2-selection--single, .main-panel .select2-selection--multiple {
padding-top: 5px !important;
padding-left: 5px !important;
}
/*.select2-container .select2-selection--single, .main-panel .select2-selection--multiple {*/
/* padding-top: 5px !important;*/
/* padding-left: 5px !important;*/
/*}*/

View File

@@ -78,7 +78,6 @@ function restore_lab(building_id){
$('#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

View File

@@ -68,7 +68,7 @@ function restore_lab(concept_id){
},
success:function(res){
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) {
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

View 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)
}
},
});
}
})

View File

@@ -81,7 +81,6 @@ function restore_lab(labid){
$('#modal-laboratory').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

View 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)
}
},
});
}
})

View 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)
}
},
});
}
})