175 lines
5.4 KiB
PHP
175 lines
5.4 KiB
PHP
<div class="modal fade" id="modal-barcode" name="modal-barcode" role="dialog" aria-hidden="true">
|
|
<form role="form" id="barcode_form" name="barcode_form" action="#" method="post">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="widget-header">
|
|
<h5 class="widget-title">Generate Barcode</h5>
|
|
<div class="widget-toolbar">
|
|
<div class="widget-menu">
|
|
<a href="#" class="close" data-action="close" data-dismiss="modal">
|
|
<i class="ace-icon fa fa-times"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-sm-4 form-group">
|
|
|
|
<label for="ailment">Check Up Category</label>
|
|
<select class="form-control select2" name="checkup_section_id[]" id="checkup_section_id" multiple="" onchange="showParams()">
|
|
|
|
<?php echo generateOption('checkup_form_section', 'section_name', 'section_id', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
|
|
<input type="hidden" name="emp_id" id="emp_id">
|
|
<input type="hidden" name="checkup_id" id="checkup_id">
|
|
<input type="hidden" name="device_id" id="device_id">
|
|
<input type="hidden" name="appointment_lab_id" id="appointment_lab_id">
|
|
<input type="hidden" name="followup_lab_id" id="followup_lab_id">
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4 form-group">
|
|
<label for="ailment">Checkup Parameters</label>
|
|
<select class="form-control chosen-select" name="param_name[]" id="param_name" multiple>
|
|
<?php echo generateOption('checkup_parameter', 'parameter_name', 'checkup_parameter_id', '', ''); ?>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-sm-4 form-group">
|
|
<label for="ailment">Barcode Count</label>
|
|
<input type="number" name="barcode_count" id="barcode_count">
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="widget-toolbox padding-8 clearfix">
|
|
<button type="button" class="btn btn-info btn-sm save_button" onclick="save_device_order();"><i class="ace-icon fa fa-floppy-o bigger-110"></i>Save</button>
|
|
|
|
<button type="button" class="btn btn-danger btn-sm save_button" onclick="generate_code();"><i class="ace-icon fa fa-bookmark bigger-110"></i>Generate Barcode</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
function generate_code() {
|
|
$("#barcode_form").attr('method', 'POST');
|
|
|
|
$("#barcode_form").attr('action', 'generate_barcode.php');
|
|
|
|
$("#barcode_form").attr('target', '_blank');
|
|
|
|
|
|
$("#barcode_form").submit();
|
|
}
|
|
|
|
|
|
|
|
function save_device_order() {
|
|
|
|
$.ajax({
|
|
url: 'save_device_order.php',
|
|
type: "POST",
|
|
data: $("#barcode_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Device Order Successfully.');
|
|
// $("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
|
|
}
|
|
|
|
function showParams() {
|
|
|
|
var section_id = $("#checkup_section_id").val();
|
|
var appointment_lab_id = $("#appointment_lab_id").val();
|
|
var followup_lab_id = $("#followup_lab_id").val();
|
|
|
|
console.log("section id " + section_id);
|
|
$.ajax({
|
|
url: 'select_checkup_parameters.php',
|
|
|
|
type: 'POST',
|
|
|
|
data: {
|
|
section_id: section_id,
|
|
appointment_lab_id:appointment_lab_id,
|
|
followup_lab_id:followup_lab_id,
|
|
},
|
|
|
|
// dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
var dt = JSON.parse(data);
|
|
|
|
|
|
// console.log("DATA::" + dt.count);
|
|
|
|
var checkup_cat = "";
|
|
|
|
for (var i = 0; i < dt.count; i++) {
|
|
|
|
|
|
|
|
// console.log("DATA ii::" + dt[i]);
|
|
|
|
|
|
// var param = data[i].checkup_parameter_id;
|
|
// console.log("PARAMS::".param);
|
|
// var dataarray = param.split(",");
|
|
|
|
checkup_cat += "<option value='" + dt[i].checkup_parameter_id + "' selected>" +
|
|
dt[i].device_param_code + "</option>"
|
|
|
|
|
|
$("#device_id").val(dt[i].device_id);
|
|
|
|
}
|
|
|
|
$("#param_name").html(checkup_cat);
|
|
|
|
|
|
$("#param_name").trigger('chosen:updated');
|
|
// $(".select2").select2();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
error: function(data) {
|
|
|
|
BootstrapDialog.alert('Error');
|
|
|
|
return;
|
|
|
|
}
|
|
});
|
|
}
|
|
</script>
|