1081 lines
42 KiB
PHP
1081 lines
42 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">Approved Medical Examination</li>
|
||
</ul>
|
||
|
||
</div>
|
||
<!-- End of breadcrumb -->
|
||
|
||
|
||
|
||
<?php include('form/send_mail.php'); ?>
|
||
|
||
|
||
<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>
|
||
<a target="_blank" id='obj'>
|
||
|
||
|
||
<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" />
|
||
|
||
<input type="hidden" name="returnPage" id="returnPage">
|
||
</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({
|
||
|
||
<?php
|
||
$color = $_REQUEST['color_ids'];
|
||
$colorIds = "";
|
||
if ($color != "") {
|
||
$colorIds = $color;
|
||
|
||
|
||
?>
|
||
|
||
|
||
|
||
url: 'approved_medical_examination_script.php?colors_ids='+'<?php echo $colorIds ?>',
|
||
|
||
<?php }else{ ?>
|
||
url: 'approved_medical_examination_script.php',
|
||
|
||
<?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: 'checkup_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: false,
|
||
align: 'left'
|
||
},
|
||
{
|
||
display: 'Employee Code',
|
||
name: 'emp_code',
|
||
width: w * .08,
|
||
sortable: false,
|
||
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: false,
|
||
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: 'Remarks',
|
||
// name: 'remarks',
|
||
// width: w * .1,
|
||
// sortable: true,
|
||
// align: 'left'
|
||
// },
|
||
{
|
||
display: 'Created By',
|
||
name: 'medical_attend',
|
||
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: "checkup_date",
|
||
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_m").val("");
|
||
$("#checkup_type_id_m").select2();
|
||
$("#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) {
|
||
|
||
currentUrl = window.location.href;
|
||
|
||
// $_SESSION['backUrl'] = $currentUrl;
|
||
|
||
// console.log("back page" + currentUrl);
|
||
|
||
// alert("back page" + $currentUrl);
|
||
//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);
|
||
|
||
$("#returnPage").val(currentUrl);
|
||
|
||
$("#flex_form_checkup").attr('method', 'POST');
|
||
|
||
$("#flex_form_checkup").attr('action', 'checkup_from_before.php');
|
||
|
||
$("#flex_form_checkup").submit();
|
||
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
function open_checkup_full_view(checkupId, empId, action, checkup_type_id) {
|
||
|
||
if (checkupId != null && checkupId != '') {
|
||
$.ajax({
|
||
url: 'medical_data.php',
|
||
|
||
data: {
|
||
checkup_id: checkupId,
|
||
empId: empId,
|
||
checkup_type_id: checkup_type_id
|
||
},
|
||
type: 'POST',
|
||
|
||
success: function(data) {
|
||
|
||
|
||
data = JSON.parse(data);
|
||
|
||
// alert(data['checkup_form']['checkup_date']);
|
||
var contant = '';
|
||
contant += '<input type="hidden" id="checkup_full_view_id" name="checkup_full_view_id" value="' + checkupId + '"><div class="mainPanel"><div class="panel-group" id="accordion"><div class="panel panel-default"><div class="panel-heading" id="panel-heading1"><span><center><u><b> </b></u> </span></div><div style="font-size:12px ;"><span><u><b>PATIENT DETAILS</b></u> </span></div> <div class="panel-body"><div class="row"><table border="0" width="100%" style="margin-bottom:5px"> <tr> <td width="33%" style="font-size:12px;"> <b>Date:</b>';
|
||
contant += data['checkup_form']['checkup_date'];
|
||
contant += '</td><td width="33%" style="font-size:12px;"><b>PME No.</b>';
|
||
contant += data['checkup_form']['ticket_no'];
|
||
contant += '</td><td style="font-size:12px;"><b>DOJ:</b>';
|
||
contant += data['checkup_form']['doj'];
|
||
contant += '</td></tr><tr><td width="33%" style="font-size:12px;"><b>DESIGNATION:</b>';
|
||
contant += data['checkup_form']['designation'];
|
||
contant += '</td><td width="33%" style="font-size:12px;"><b>DEPARTMENT:</b>';
|
||
contant += data['checkup_form']['dept'];
|
||
contant += '</td><td style="font-size:12px;"><b>DIVISION:</b>';
|
||
contant += data['checkup_form']['bu_name'];
|
||
contant += '</td></tr><tr><td width="33%" style="font-size:12px;"><b>TRADE</b>';
|
||
contant += data['checkup_form']['doj'];
|
||
contant += '</td><td width="33%" colspan="2" style="font-size:12px;"><b>EMPLOYEE ID</b>';
|
||
contant += data['checkup_form']['emp_code'];
|
||
contant += '</td></tr><tr><td width="33%" style="font-size:12px;"><b>NAME OF CANDIDATE:</b>';
|
||
contant += data['checkup_form']['patient_name'];
|
||
contant += '</td><td width="33%" style="font-size:12px;"><b>DOB:</b>';
|
||
contant += data['checkup_form']['dob'];
|
||
contant += '</td><td style="font-size:12px;"><b>AGE</b>';
|
||
contant += data['checkup_form']['age'];
|
||
contant += '</td></tr><tr><td width="42%" style="font-size:12px;"><b>FATHER’S/HUSBAND’S NAME:</b>';
|
||
contant += data['checkup_form']['father_name'];
|
||
contant += '</td><td width="33%" style="font-size:12px;"><b>GENDER:</b>';
|
||
contant += data['checkup_form']['gender'];
|
||
contant += '</td><td style="font-size:12px;"><b>BLOOD GROUP: </b>';
|
||
contant += data['checkup_form']['blood_group'];
|
||
contant += ' </td></tr></table><hr>';
|
||
|
||
for (var i = 0; i < data['sections_count']; i++) {
|
||
// alert(data['sections'][i]);
|
||
var val = data['sections'][i];
|
||
contant += '<u><b height="" class="section' + val + '" style="font-size: 15px; font-family: ' + "'Source Sans Pro'" + ', ' + "'Helvetica Neue'" + ',Helvetica, Arial, sans-serif;margin-top:10px">';
|
||
contant += data['sections-' + val];
|
||
|
||
contant += '</b></u></div><table width="100%" class="section' + val + '" style="margin-top: 10px;border-top:solid 1px ;border-bottom:solid 1px"><tr><td style="border-bottom:1px dashed #000000"><b> Test Names </b></td><td style="border-bottom:1px dashed #000000"><b>Result</b></td><td style="border-bottom:1px dashed #000000"><b class="unit' + val + '">Unit</b></td><td style="border-bottom:1px dashed #000000"><b class="range' + val + '">Ref Range</b></td></tr>';
|
||
|
||
for (var k = 0; k < (data[val + '_k'] - 1); k++) {
|
||
if (data[val + '-' + k + '-value'] != null && data[val + '-' + k + '-value'] != '') {
|
||
|
||
if (data[val + '-' + k + '-tital'] != '' && data[val + '-' + k + '-tital'] != null) {
|
||
contant += ' <tr><td colspan="4"><b style="font-size: 12px; font-weight: 600;"> <b style="font-size: 12px; font-weight: 600;"><u>';
|
||
contant += data[val + '-' + k + '-tital'];
|
||
contant += '</u></b></td></tr>';
|
||
};
|
||
|
||
|
||
contant += '<tr><td width="25%" style="font-size: 12px;"><b>' +
|
||
data[val + '-' + k + '-param_name'] + '</b></td><td width="5%" style="font-size: 12px;color:';
|
||
contant += data[val + '-' + k + '-color'] + '">';
|
||
contant += data[val + '-' + k + '-value'];
|
||
contant += '</td><td width="5%" style="font-size: 12px;color:';
|
||
contant += data[val + '-' + k + '-color'] + '">';
|
||
|
||
|
||
contant += '<span class="unit' + val + '">';
|
||
if (data[val + '-' + k + '-unit'] != null && data[val + '-' + k + '-unit'] != '') {
|
||
contant += data[val + '-' + k + '-unit'];
|
||
|
||
}
|
||
contant += '</span></td><td width="30%" style="font-size: 12px;"><span class="range' + val + '">';
|
||
if (data[val + '-' + k + '-range'] != null && data[val + '-' + k + '-range'] != '') {
|
||
contant += data[val + '-' + k + '-range'];
|
||
}
|
||
contant += '</span></td></tr>';
|
||
}
|
||
}
|
||
contant += '</table>';
|
||
|
||
}
|
||
|
||
|
||
$('#medical_full_view').html(contant);
|
||
$('#fit_state').val(data['checkup_form']['fit_unfit_status']);
|
||
$('#program_id').val(data['checkup_form']['program_id']);
|
||
$('#program_id').trigger('chosen:updated');
|
||
$('#attendedStatus').val(data['checkup_form']['attendedStatus']);
|
||
$('#approve_date').val(data['checkup_form']['approve_date']);
|
||
$('input:radio[id=program_status][value=' + data['checkup_form']['program_status'] + ']').prop('checked', true);
|
||
$('#doc_findings').val(data['checkup_form']['doc_findings']);
|
||
$('#doc_comments').val(data['checkup_form']['doc_comments']);
|
||
|
||
$('.select2').select2();
|
||
|
||
$('#modal-indent-status').modal("show");
|
||
},
|
||
error: function(data) {
|
||
BootstrapDialog.alert("Something Went Wrong Try Again after a while !");
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
function send_mail(appointmentId, dept_id) {
|
||
|
||
$.ajax({
|
||
url: 'get_checkup_email_data.php',
|
||
type: "POST",
|
||
data: {
|
||
'id': appointmentId,
|
||
|
||
},
|
||
dataType: 'json',
|
||
success: function(data) {
|
||
var app_id = appointmentId;
|
||
var Patient_name = data[4];
|
||
|
||
$("#email_form").find("#ref_identifier").val(appointmentId);
|
||
|
||
var to = dept_id;
|
||
|
||
var emailContent = "";
|
||
|
||
|
||
|
||
|
||
var app_root = '<?php echo getConfigKey('APP_ROOT') ?>';
|
||
var to_list = "" + to + ",<?php echo getConfigKey('GENERAL_EMAIL_LIST_TO_CHECKUP') ?>";
|
||
|
||
var app_roots = app_root.split(',');
|
||
var link = '';
|
||
|
||
// for (var i = 0; i < app_roots.length; i++) {
|
||
// link += "<a href=`" + app_roots[i] + "/health_card.php?checkup_id=" + app_id +
|
||
// "`>Health Card " + (i + 1) + "</a> <br>";
|
||
// }
|
||
|
||
|
||
$("#email_form").find("#ref_type").val("MEDICAL EXAMINATIONS");
|
||
$("#email_form").find("#to").val(to_list);
|
||
$("#email_form").find("#isAttachment").val("YES");
|
||
// Patient_name = Patient_name.replace(" ", "_");
|
||
var Type = "CHECKUP";
|
||
var FilePath = "DocumentPdf/"+Patient_name+"_"+Type+"_"+app_id+".pdf";
|
||
console.log(FilePath);
|
||
$("#email_form").find("#filePath").val(FilePath);
|
||
|
||
var urlCheck = "checkup_form_pdf.php?checkup_id=" + app_id + "&attachment=pdf";
|
||
// window.open(urlCheck, '_blank');
|
||
var myWindow = window.open(urlCheck, '_blank');
|
||
setTimeout(function() {
|
||
myWindow.close();
|
||
}, 1000);
|
||
|
||
|
||
$("#email_form").find("#cc").val('<?php echo getConfigKey('GENERAL_EMAIL_LIST_CC_CHECKUP') ?>');
|
||
$("#email_form").find("#subject").val(
|
||
'<?php echo getConfigKey('GENERAL_EMAIL_SUBJECT_CHECKUP') ?>');
|
||
$("#email_form").find("#email_content").text(
|
||
'<div style=\"style="text-transform: none; !important"\"><?php echo getConfigKey('GENERAL_EMAIL_TEXT_CHECKUP') ?></div>'
|
||
);
|
||
emailContent +=
|
||
"<table class='table-bordered' width='100%'><thead><tr><th>Date</th><th>Patient Name</th><th>Ticket No</th><th>Examination Type</th><th>Remarks</th></tr><thead><tbody>";
|
||
emailContent += "<tr><td>" + data[2] + "</td><td>" + data[4] + "</td><td>" + data[3] +
|
||
"</td><td>" + data[5] + "</td><td>" + data[9] + "</td></tr>";
|
||
emailContent += "</tbody></table><br>";
|
||
emailContent += link;
|
||
$("#email_form").find("#email_content").html(emailContent);
|
||
|
||
resizeChosen();
|
||
jQuery(window).on('resize', resizeChosen);
|
||
$('#modal-add-email').modal("show");
|
||
// alert(emailContent);
|
||
// window.alert("{appointmentId}");
|
||
var id = appointmentId;
|
||
|
||
},
|
||
error: function(data) {
|
||
BootstrapDialog.alert('Error In Pulling Id');
|
||
return id;
|
||
}
|
||
|
||
});
|
||
|
||
|
||
}
|
||
|
||
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 == 'KA') {
|
||
?>
|
||
|
||
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="" >Please Select Form Type</option><option value="form_33" > Form 33 </option><option value="form_32"> Form 16 </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\"> a) Hazardous process:<b style=\"font-weight:600\">" +
|
||
data.hazardous_process + "</b></p>";
|
||
|
||
content +=
|
||
"<p contenteditable=\"true\"> 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\"> (i) any employment in mines; or</p></td></tr>"
|
||
content +=
|
||
"<tr><td><p contenteditable=\"true\"> (ii)any employment below ground; or</p></td></tr>"
|
||
content +=
|
||
"<tr><td><p contenteditable=\"true\"> (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 } ?>
|
||
function send_email() {
|
||
var appointment_id;
|
||
|
||
$("#message").val($("#email_form").find("#email_content").html());
|
||
$.ajax({
|
||
url: 'send_email.php',
|
||
type: 'POST',
|
||
data: $("#email_form").serialize(),
|
||
beforeSend: function() {
|
||
$('#loader').show();
|
||
},
|
||
complete: function() {
|
||
$('#loader').hide();
|
||
},
|
||
success: function(data) {
|
||
BootstrapDialog.alert('Mail send Successfully');
|
||
$("#flex1").flexReload();
|
||
return;
|
||
},
|
||
error: function(data) {
|
||
BootstrapDialog.alert('Error in sending mail');
|
||
return;
|
||
}
|
||
});
|
||
$('.close').click();
|
||
}
|
||
</script>
|
||
|
||
<?php include('select_checkup_type_approved.php'); ?>
|
||
<?php include('form/medical_full_view.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>
|