366 lines
12 KiB
PHP
366 lines
12 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
|
|
<li class="#">Home</li>
|
|
<li class="#">Patient Management</li>
|
|
<li class="active">Device Result</li>
|
|
</ul>
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="page-content">
|
|
<div id="flexigridDiv" class="table-responsive">
|
|
|
|
<form name="f1" method="post" action="" id="flex_form_health_advice">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="flex_health_advice_id" id="flex_health_advice_id" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div><!-- /.page-content -->
|
|
<div id="myModal" class="modal fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="modal-title">Edit Test Result</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>
|
|
<label for="" id="code-label"></label>
|
|
<input type="text" id="test-result" name="test-result" value="" class="form-control">
|
|
<input type="hidden" name="accession_number" id="accession_number" value="">
|
|
<input type="hidden" name="code" id="code" value="">
|
|
<input type="hidden" name="result_id" id="result_id" value="">
|
|
</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-success" data-dismiss="modal" onclick="save_edit();">Save</button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><!-- /.main-content -->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var w = screen.width * .90;
|
|
var h = 0;
|
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
|
$("#flex1").flexigrid({
|
|
url: 'device_result_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: 'Select',
|
|
name: 'checkbox',
|
|
width: w * .07,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Sr',
|
|
name: 'count',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Accession Number',
|
|
name: 'accession_number',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Online Test Code',
|
|
name: 'online_testcode',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Patient Name',
|
|
name: 'patient_id',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Emp Code',
|
|
name: 'emp_code',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Test Result',
|
|
name: 'test_result',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
// {
|
|
// display: 'Sample Type',
|
|
// name: 'sampletype',
|
|
// width: w * .1,
|
|
// sortable: true,
|
|
// align: 'left'
|
|
// },
|
|
{
|
|
display: 'Device Name',
|
|
name: 'device_name',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Date',
|
|
name: 'insert_datetime',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: '',
|
|
name: '',
|
|
width: w * .3,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
|
|
],
|
|
buttons: [
|
|
|
|
{
|
|
name: 'Bulk Delete',
|
|
bclass: 'print',
|
|
onpress: bulk_delete
|
|
},
|
|
// {
|
|
// separator: true
|
|
// },
|
|
// {
|
|
// name: 'Excel',
|
|
// bclass: 'print_excel',
|
|
// onpress: excel
|
|
// },
|
|
// {
|
|
// separator: true
|
|
// }
|
|
],
|
|
searchitems: [
|
|
|
|
{
|
|
display: 'Emp Code',
|
|
name: 'emp_code',
|
|
isdefault: true
|
|
},
|
|
{
|
|
display: 'Accession Number',
|
|
name: 'accession_number',
|
|
},
|
|
{
|
|
display: 'Device Name',
|
|
name: 'device_name',
|
|
},
|
|
{
|
|
display: 'Online TestCode Name',
|
|
name: 'online_testcode'
|
|
}
|
|
],
|
|
sortname: "result_id",
|
|
sortorder: "desc",
|
|
usepager: true, //pagination
|
|
|
|
useRp: true,
|
|
rp: 50, //records per page
|
|
showTableToggleBtn: false, //toggle button for the whole table
|
|
resizable: true,
|
|
//width: w,
|
|
height: h,
|
|
singleSelect: true
|
|
});
|
|
});
|
|
|
|
|
|
function pdf() {
|
|
window.open('health_advice_pdf.php');
|
|
}
|
|
|
|
function excel() {
|
|
window.location = 'health_advice_excel.php';
|
|
}
|
|
|
|
function showOverlay() {
|
|
var overlay = document.createElement('div');
|
|
overlay.className = 'overlay';
|
|
document.body.appendChild(overlay);
|
|
}
|
|
|
|
function hideOverlay() {
|
|
var overlay = document.querySelector('.overlay');
|
|
if (overlay) {
|
|
overlay.parentNode.removeChild(overlay);
|
|
}
|
|
}
|
|
|
|
|
|
let checkboxArr = [];
|
|
|
|
function bulk_delete() {
|
|
// BootstrapDialog.alert("Please wait deleting selected data will take some time do not press anywhere else");
|
|
showOverlay();
|
|
checkboxArr = [];
|
|
document.querySelectorAll('.checkbox').forEach((component) => {
|
|
if (component.checked) {
|
|
checkboxArr.push(component.getAttribute('value'));
|
|
}
|
|
});
|
|
// console.log(checkboxArr);
|
|
if (checkboxArr.length == 0) {
|
|
BootstrapDialog.alert("select some records to delete");
|
|
hideOverlay();
|
|
} else {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'delete_device_result_data.php',
|
|
data: {
|
|
checkupIds: checkboxArr
|
|
},
|
|
success: function(data) {
|
|
if (data == 400) {
|
|
BootstrapDialog.alert("Something went wrong while deleting the data. try again!!!");
|
|
} else if (data == 200) {
|
|
BootstrapDialog.alert("Deleted Successfully");
|
|
$("#flex1").flexReload();
|
|
hideOverlay();
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert("Something went wrong while sending for approval");
|
|
hideOverlay();
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
function delete_data(result_id, code, result, accession_number) {
|
|
|
|
BootstrapDialog.confirm('Hi, are you sure?', function(result) {
|
|
if (result) {
|
|
if (accession_number != null && accession_number != '' && code != null && code != '') {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'delete_device_result.php',
|
|
data: {
|
|
result_id: result_id,
|
|
code: code,
|
|
accession_number: accession_number
|
|
},
|
|
success: function(data) {
|
|
|
|
BootstrapDialog.alert("Deleted Successfully..");
|
|
$("#flex1").flexReload();
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert("Error Saving Data");
|
|
}
|
|
})
|
|
} else {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'delete_device_result.php',
|
|
data: {
|
|
result_id: result_id,
|
|
code: code
|
|
},
|
|
success: function(data) {
|
|
|
|
BootstrapDialog.alert("Deleted Successfully..");
|
|
$("#flex1").flexReload();
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert("Error Saving Data");
|
|
}
|
|
})
|
|
}
|
|
} else {
|
|
BootstrapDialog.alert("Aborting Delete...");
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function edit_device_result(result_id, code, result, accession_number) {
|
|
$("#code-label").text(code);
|
|
$("#code").val(code);
|
|
$("#accession_number").val(accession_number);
|
|
$("#result_id").val(result_id);
|
|
$("#test-result").val(result);
|
|
$("#myModal").modal();
|
|
}
|
|
|
|
function save_edit() {
|
|
var test_result = $("#test-result").val();
|
|
var code = $("#code").val();
|
|
var accession_number = $("#accession_number").val();
|
|
var result_id = $("#result_id").val();
|
|
|
|
if (test_result == '' || test_result == null) {
|
|
BootstrapDialog.alert("Enter Some Value To Save ");
|
|
return false;
|
|
} else {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'save_updated_device_result.php',
|
|
data: {
|
|
test_result: test_result,
|
|
code: code,
|
|
accession_number: accession_number,
|
|
result_id: result_id
|
|
},
|
|
success: function(data) {
|
|
|
|
BootstrapDialog.alert("Updated Successfully..");
|
|
$("#flex1").flexReload();
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert("Error Saving Data");
|
|
}
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
<?php include('techsyn_footer.php'); ?>
|