ESH/approved_medical_examination.php
2024-10-23 18:28:06 +05:30

821 lines
30 KiB
PHP

<?php include('techsyn_header.php');
include('image_popup.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="#"><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a>
</li>
<li class="">Patient Visit</li>
<li class="active">Aproved Medical Examination</li>
</ul>
</div>
<!-- End of breadcrumb -->
<div class="page-content">
<form name="flex_medical_form" method="post" action="" id="flex_medical_form">
<div id="flex1" style="width: 100%">
<input type="hidden" name="checkup_id" id="checkup_id">
<input type="hidden" name="emp_id" id="emp_id">
</div>
</form>
<form name="export_form" method="post" id="export_form" action="">
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_approved_medical_examination.php" />
<input type="hidden" name="excel_action" id="excel_action" value="excel_approved_medical_examination.php" />
</form>
<form name="f1" method="post" action="" id="flex_form_checkup">
<div id="flex1" style="width:100%">
</div>
<input type="hidden" name="flex_checkup_id" id="flex_checkup_id" />
<input type="hidden" name="emp_id_history" id="emp_id_history" />
<input type="hidden" name="checkup_type_id_db" id="checkup_type_id_db" />
<input type="hidden" name="toPage" id="toPage" />
</form>
</div>
</div>
<!-- /.page-content -->
</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: 'approved_medical_examination_script.php',
dataType: 'json',
colModel: [
{
display: 'Sr',
name: 'count',
width: w * .04,
sortable: false,
align: 'left'
},
{
display: 'Actions',
name: '',
width: w * .1,
sortable: false,
align: 'left'
},
{
display: 'Other Doc',
name: 'other_doc',
width: w * .1,
sortable: false,
align: 'left'
},
{
display: 'Examination Date',
name: 'medical_entry_date',
width: w * .10,
sortable: true,
align: 'left'
},
{
display: 'Ticket No',
name: 'ticket_no',
width: w * .09,
sortable: false,
align: 'left'
},
{
display: 'Patient Name',
name: 'patient_name',
width: w * .08,
sortable: true,
align: 'left'
},
{
display: 'Employee Code',
name: 'emp_code',
width: w * .08,
sortable: true,
align: 'left'
},
{
display: 'Examination Type',
name: 'checkup_type_id',
width: w * .1,
sortable: true,
align: 'left'
},
{
display: 'Test Categeries',
name: 'test_cat',
width: w * .35,
sortable: true,
align: 'left'
},
// {
// display: 'Health Risk',
// name: 'health_risk',
// width: w * .35,
// sortable: true,
// align: 'left'
// },
// {
// display: 'Health Advices',
// name: 'health_advices',
// width: w * .35,
// sortable: true,
// align: 'left'
// },
// {
// display: 'Abnormality ',
// name: 'abnormality',
// width: w * .12,
// sortable: true,
// align: 'left'
// },
// {
// display: 'Form 32',
// name: 'count',
// width: w * .1,
// sortable: false,
// align: 'left'
// },
// {
// display: 'Form 32 PDF',
// name: 'count',
// width: w * .1,
// sortable: false,
// align: 'left'
// },
// {
// display: 'Generate/Edit Form',
// name: '',
// width: w * .11,
// sortable: false,
// align: 'left'
// },
// {
// display: 'Form pdf',
// name: '',
// width: w * .08,
// sortable: false,
// align: 'left'
// },
{
display: 'Generate/Edit Form',
name: '',
width: w * .11,
sortable: false,
align: 'left'
},
{
display: 'Form pdf',
name: '',
width: w * .08,
sortable: false,
align: 'left'
},
{
display: 'Remarks',
name: 'remarks',
width: w * .1,
sortable: true,
align: 'left'
},
{
display: 'Approval Date',
name: 'approval_date',
width: w * .10,
sortable: true,
align: 'left'
},
// {display: 'Test Status', name: 'test_status', width: w*.10, sortable: true, align: 'left'},
// {display: 'Pdf Link', name: '', width: w*.04, sortable: false, align: 'left'},
// {display: 'Form O/ Form 32 /Form 33', name: '', width: w*.1, sortable: false, align: 'left'},
// {display: 'Doc Upload', name: '', width: w*.1, sortable: false, align: 'left'},
// {display: 'Download Certificate', name: '', width: w*.15, sortable: false, align: 'left'},
],
buttons: [
{
name: 'PDF',
bclass: 'print',
onpress: pdf
},
{
separator: true
},
{
name: 'Excel',
bclass: 'print_excel',
onpress: excel
},
// {separator: true},
// {name: 'Download Template', bclass: 'print_excel', onpress : download_template},
// {separator: true},
// {name: 'Upload Excel', bclass: 'print_excel', onpress : upload_excel},
// {separator: true},
// {name: 'Download Excel', bclass: 'print_excel', onpress : download_excel},
],
searchitems: [{
display: 'Emp Code',
name: 'emp_id',
isdefault: true
},
{
display: 'Patient Name',
name: 'patient_name',
},
{
display: 'Examination Date(DD/MM/YYYY)',
name: 'checkup_date',
},
{
display: 'Examination Date Range(DD/MM/YYYY)-(DD/MM/YYYY)',
name: 'medical_entry_date_between',
},
{
display: 'Approval Date Range(DD/MM/YYYY)-(DD/MM/YYYY)',
name: 'approval_date_between',
},
{
display: 'Approval Date (DD/MM/YYYY)',
name: 'approval_date'
}
],
sortname: "a.last_modified",
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() {
console.log("click");
$("#checkup_type_id_pdf").val("");
$("#start_date_pdf").val("");
$("#end_date_pdf").val("");
$('#modal-select-checkup-type-dd-pdf').modal("show");
//window.open('pdf_manage_item.php');
// window.open('ajax_pdf.php', 'Approved Medical Examination List');
}
function excel() {
console.log("click");
$("#checkup_type_id_excel").val("");
$("#start_date_excel").val("");
$("#end_date_excel").val("");
$('#modal-select-checkup-type-dd-ss').modal("show");
}
function upload_excel() {
window.location = 'upload_excel_medical.php';
}
function download_template() {
window.location = 'templates/medical_Report_new.xlsx';
}
function open_checkup(checkupId, empId, action, checkup_type_id) {
//window.location = 'checkup.php?checkup_id='+checkupId+'';
console.log(checkupId + ':' + empId + ' ; ' + action + ' : ' + checkup_type_id);
if (checkupId != null && checkupId != '') {
$("#flex_checkup_id").val(checkupId);
$("#checkup_type_id_db").val(checkup_type_id);
$("#emp_id_history").val(empId);
$("#toPage").val(action);
$("#flex_form_checkup").attr('method', 'POST');
$("#flex_form_checkup").attr('action', 'checkup_from_before.php');
$("#flex_form_checkup").submit();
}
}
function delete_checkup(checkupId, empId, action, checkup_type_id) {
if (checkupId != null || checkupId != '') {
$.ajax({
url: 'delete_checkup_form.php',
type: 'POST',
data: {
checkupId: checkupId,
empId: empId,
checkup_type_id: checkup_type_id
},
success: function(data) {
let result = JSON.parse(data);
if (result == 1) {
BootstrapDialog.alert("Deleted Successfully");
$("#flex1").flexReload();
}
},
error: function(data) {
BootstrapDialog.alert("Something Went Wrong Try Again after a while !");
}
});
}
}
<?php $ohc_state_code = getFieldFromTable('state', 'ohc_type', 'ohc_type_id', $_SESSION['current_ohcttype']);
// $form_names = getFieldFromTable('form_names', 'state_form_master', 'state_code', $ohc_state_code);
// error_log("form names " . $form_names);
// $forms = explode(',', $form_names);
// error_log("form array " . print_r($forms, true));
if ($ohc_state_code == 'MH') {
?>
function form_generation(checkup_id, patient_id, task) {
BootstrapDialog.show({
title: 'Form Generation',
message: '<select class="form-control" id="form_generation_type" style="margin-left:100px;width:60%"><option value="form_32">Form 7</option></select>',
buttons: [{
label: 'Submit',
action: function() {
$(".close").click();
open_form_generation(checkup_id, $("#form_generation_type").val());
}
}]
});
}
function form_generation_for_pdf(form_type) {
// alert(form_type);
var form_generate_type = "";
var content = "";
var form_data_array = [];
if (form_type == 'form_33') {
form_generate_type = 'Form 33';
$('#form_33 p').each(function(index) {
if (index <= 22)
form_data_array[index] = ($(this).text())
});
} else if (form_type == 'form_O') {
$('#form_0_pdf p').each(function(index) {
if (index <= 16)
form_data_array[index] = ($(this).text())
});
form_generate_type = 'Form O';
}
console.log(form_data_array);
BootstrapDialog.show({
title: 'Form Generation Pdf',
message: 'Are You Confirm To Generate ' + form_generate_type,
buttons: [{
label: 'Submit',
action: function(dialog) {
dialog.close();;
if (form_type == 'form_33') {
$.ajax({
url: 'save_form_generation_type.php',
type: 'POST',
data: {
form_type: $("#form_type").val(),
checkup_id: $("#checkup_id").val(),
form_data_array: form_data_array
},
success: function(data) {
}
});
generateFormPdf()
} else {
$.ajax({
url: 'save_form_generation_type.php',
type: 'POST',
data: {
form_type: $("#form_type_O").val(),
checkup_id: $("#checkup_id_O").val(),
form_data_array: form_data_array
},
success: function(data) {
}
});
generateFormPdfO()
}
}
}, {
label: 'Close',
action: function(dialogItself) {
dialogItself.close();
}
}]
});
}
var function_calling_count = 0;
var function_calling_count_o = 0;
function open_form_generation(checkup_id, form_generation_type) {
$("#valid_date").html("");
$("#checkup_id").val(checkup_id);
$("#form_type").val(form_generation_type);
$("#checkup_id_O").val(checkup_id);
$("#form_type_O").val(form_generation_type);
$.ajax({
url: 'get_medical_examination_patient_details.php',
type: 'POST',
data: {
checkup_id: checkup_id
},
success: function(data) {
var data = $.parseJSON(data);
if (data != null) {
var gender = "";
var gender_call = "";
var gender_call_2 = "";
// alert(data.gender);
if (data.gender == 'Female') {
gender = 'Female';
gender_call = "She";
gender_call_2 = "her";
} else if (data.gender == 'Male') {
gender = 'Male';
gender_call = "He";
gender_call_2 = "his"
} else {
gender = 'Others';
gender_call = "He/She";
gender_call_2 = "his/her";
}
var dob = data.dob;
var dt = new Date();
var year = dt.getFullYear();
console.log(dob, year);
// var year = dob.getFullYear();
// var year1 = getFullYear();
var age = year - dob;
if (form_generation_type == 'form_33') {
var content = "";
if (function_calling_count > 0) {
$("table[id='header_table'] > tbody > tr:first-child").remove();
$('#table_body > tbody > tr:first').remove();
//$("#doc_no").html();
}
// $("#doc_no").html(data.document_no);
$("#header_table> tbody > tr:first").before("<tr><td >SL NO <b>" + data.serial_no +
" </b></td><td align=\"right\">Date <b style=\"font-weight:600\">" + data
.approval_date + "</b> </td></tr>")
content +=
"<tr><td><p contenteditable=\"true\">1. Serial number in the register of adult workers: <b>" +
data.serial_no + "</b> </p><br>";
content +=
"<p contenteditable=\"true\">2. Name of person examined: <b style=\"font-weight:600\">" +
data
.patient_name + "</b> </p><br>";
content +=
"<p contenteditable=\"true\">3. Father`s Name: <b style=\"font-weight:600\">" + data
.father_name + "</b></p><br>";
content += "<p contenteditable=\"true\">4. Sex: <b style=\"font-weight:600\">" + data
.gender + "</b></p><br>";
content += "<p contenteditable=\"true\">5. Residence: <b style=\"font-weight:600\">" +
data.village + " ," + data
.post + "," + data.ps + "</b></p><br>";
content +=
"<p contenteditable=\"true\">6. Date of birth, if available: <b style=\"font-weight:600\">" +
data.birth + "</b></p><br>";
content +=
"<p contenteditable=\"true\">7. Name & address of the factory: GUJARAT HEAVY CHEMICAL LTD.,SUTRAPADA, ANURAG NAGAR,GUJARAT </p><br>";
content +=
"<p contenteditable=\"true\">8. The worker is employed/proposed:</p>";
content +=
"<p contenteditable=\"true\">&nbsp;&nbsp;&nbsp;&nbsp;a) Hazardous process:<b style=\"font-weight:600\">" +
data.hazardous_process + "</b></p>";
content +=
"<p contenteditable=\"true\">&nbsp;&nbsp;&nbsp;&nbsp;b) Dangerous operation:<b style=\"font-weight:600\">" +
data.dangerous_operation + "</b></p><br>";
content +=
"<p contenteditable=\"true\">I certify that I have personally examined the above named person whose identification marks are ……… " +
data.identi_mark +
"……..and who is desirous of being employed in above mentioned process/operation and that his/her,age, as can be ascertained from my examination, is ……… " +
age + "……years.</p><br>"
content +=
"<p contenteditable=\"true\"> In my opinion he/she is fit for employment in the Said manufacturing process/operation.</p><br>";
let doc_finding = "";
if (data.fit_status == 'ufit') {
doc_finding = data.doc_finding;
}
content +=
"<p contenteditable=\"true\">In my opinion he/she is unfit for employment in the said manufacturing process/operation for the reason ………" +
doc_finding +
"…………He/She is referred for further examination to the Certifying Surgeon.</p><br>"
content +=
"<p contenteditable=\"true\"> The serial number of previous certificate is …………………………….................</p></td></tr><br>"
var imageContent = "";
var stampContent = "";
imageContent = "<img class=\"editable img-responsive\" id=\"avatar\" src=\"data:" +
data.image_type + ";base64," + data.emp_sign +
"\" style=\"display: block; width: 180px; height: 25px;\" />"
function_calling_count++;
$('#header_table tr').eq(4).after(content);
$("#profile-picture").html(imageContent);
$('#form_genaration').modal({
keyboard: true
});
$('#form_genaration').modal("show");
} else if (form_generation_type == 'form_32') {
$("#checkup_id32").val(checkup_id);
$('#form32').modal("show");
} else {
var content = "";
if (function_calling_count_o > 0) {
// $("table[id='header_table'] > tbody > tr:first-child").remove();
$('#table_body_form_o>tbody> tr:first').remove();
//$("#doc_no").html();
$('#form_header>tbody> tr:last').remove();
}
content +=
"<tr><td colspan=\"2\" align=\"left\"><p contenteditable=\"true\">Certificate No: ................</p></td></tr>";
content += " <tr><td><p contenteditable=\"true\"> Certified that Shri/Smt.* " + data
.patient_name + " "
content += " employed as ...." + data.designation +
" .... in..................Mine, Form B No. .................. has been examined "
content += " for an initial/periodical medical examination.He/she* appears to be " +
getAge(new Date(data.dob)) + " years of age."
content +=
"The findings of the examining authority are given in the attached sheet. It is considered that Shri/Smt.* ...." +
data
.patient_name + "..... </p></td></tr>"
// if (data.fit_status == 'fit') {
content +=
"<tr><td><p contenteditable=\"true\">(a)* is medically fit for any employment in mines</p></td></tr>"
let finding = "";
if (data.fit_status == 'ufit') {
finding = data.doc_finding;
console.log(finding);
}
content += "<tr><td><p contenteditable=\"true\">(b)* is suffering from.......... " +
finding + " ...................and medically unfit for</p></td></tr>"
content +=
"<tr><td><p contenteditable=\"true\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(i) any employment in mines; or</p></td></tr>"
content +=
"<tr><td><p contenteditable=\"true\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(ii)any employment below ground; or</p></td></tr>"
content +=
"<tr><td><p contenteditable=\"true\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(iii) any employment or work.............................. </p></td></tr>"
finding = "";
let checkup_names = "";
if (data.fit_status == 'tfit') {
finding = data.doc_finding;
checkup_names = data.checkup_test_names;
}
content += "<tr><td><p contenteditable=\"true\">(c)* is suffering from...... <b>" +
finding +
"</b> .............. he/she should get this disability* cured/controlled and should be again examined within a period of....................month.He/She will appear for re-examination with the result of test of ..... <b>" +
checkup_names +
"</b> ............and the opinion of............Specialist from................. . He/She may be permitted/not* permitted to carry on his duties during this period.</p></td></tr>"
$('#table_body_form_o> tbody > tr:first').before(content);
var imageContent = "";
imageContent = "<img class=\"editable img-responsive\" id=\"avatar\" src=\"data:" +
data.image_type + ";base64," + data.emp_sign +
"\" style=\"display: block; width: 180px; height: 25px;\" />"
$("#doctor_name_id").html("Doctor Name : " + data.doctor_name);
$("#qualification_id").html("Qualification : " + data.qualification);
$("#registration_no_id").html("Registration No : " + data.registration_no);
//$("#doc_no_o").html(data.document_no);
function_calling_count_o++;
$("#profile-picture1").html(imageContent);
$('#form_genaration_0').modal({
keyboard: true
});
$('#form_genaration_0').modal("show");
}
}
},
error: function(data) {
BootstrapDialog.alert(" Error In Saving Foward Status ");
}
});
}
function generateFormPdf() {
var content = $("#form_33").html();
var content1 = content.replace(/(\r\n|\n|\r)/gm, " ");
$("#htmlText").val(content1);
document.form_pdf.action = "pdf_dynamic.php";
document.form_pdf.method = "POST";
document.getElementById("form_pdf").submit();
}
function generateFormPdfO() {
var content = $("#form_0_pdf_body").html();
$("#htmlText").val(content);
document.form_pdf.action = "pdf_dynamic.php";
document.form_pdf.method = "POST";
document.getElementById("form_pdf").submit();
}
<?php } ?>
</script>
<?php include('select_checkup_type_approved.php'); ?>
<?php //include('select_checkup_type_approved_pdf.php');
?>
<?php include_once('form/form_33.php'); ?>
<?php include_once('form/form_32.php'); ?>
<?php include_once('form/form_o.php'); ?>
<?php include('techsyn_footer.php'); ?>
<style>
#form_genaration {
overflow-y: scroll;
}
#form_genaration_0 {
overflow-y: scroll;
}
#form_genaration_32 {
overflow-y: scroll;
}
#modal-dialog1 {
padding: 15px;
width: 80%;
}
.tbl1 {
border: 2px solid black;
border-collapse: collapse;
font-weight: 800;
padding: 15px;
}
.tbl1 td {
font-size: 12px;
border: 1px solid black;
border-collapse: collapse;
padding: 4px
}
.tbl4 td {
font-size: 12px;
font-weight: 900;
border-collapse: collapse;
padding: 4px
}
.tbl3 td {
font-size: 10px;
/*font-weight:900;*/
/*border-collapse: collapse;*/
padding: 5px
}
.vertical_show {
writing-mode: vertical-lr;
width: 50px;
transform: rotate(180deg);
transform: rotate(180deg);
}
.horizontal_write {
writing-mode: horizontal-tb;
width: 50px;
}
</style>