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

274 lines
8.9 KiB
PHP

<?php session_start();
// error_log($_REQUEST['patient_id']);
// error_log('Abcde');
include('log_entry.php');
include_once("includes/functions.php");
// include_once("pdf_ohc_header.php");
?>
<?php $sql_for_fitness = "select g.*,DATEDIFF(g.date_return,g.date_absent) absencedays, e.file_name,f.state, e.emp_sign as sign, e.qualification,e.registration_no,e.emp_id as sign_id, f.ohc_type_name, f.ohc_logo, f.icon_text, f.image_type from ohc_type f, sickness g left join employee_signature e on g.doctor_last_attended=e.emp_id where g.sickness_id = '" . $_REQUEST['flex_sickness_id'] . "' ";
//echo $sql_for_fitness;
//print_r($_POST);
$result_for_fitness = mysqli_query($conn, $sql_for_fitness);
$row_for_fitness = mysqli_fetch_assoc($result_for_fitness);
@extract($row_for_fitness);
$sickness = getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $row_for_fitness['sickness_name']);
$ticket_no = ($row_for_fitness['ticket_no']);
error_log("daysdays" . $ticket_no);
$from_date = strtoupper(date_format(date_create($row_for_fitness['from_date']), "d-M-Y "));
$to_date = strtoupper(date_format(date_create($row_for_fitness['to_date']), "d-M-Y "));
// $time=$to_date=strtoupper(date_format(date_create($row_for_fitness['sickness_date']),"d-M-Y tt-mm"));
$date_return = strtoupper(date_format(date_create($row_for_fitness['date_return']), "d-M-Y "));
$justifiable_from = strtoupper(date_format(date_create($row_for_fitness['justifiable_from']), "d-M-Y "));
$justifiable_to = strtoupper(date_format(date_create($row_for_fitness['justifiable_to']), "d-M-Y "));
$not_justifiable_from = strtoupper(date_format(date_create($row_for_fitness['not_justifiable_from']), "d-M-Y "));
$not_justifiable_to = strtoupper(date_format(date_create($row_for_fitness['not_justifiable_to']), "d-M-Y "));
$appointment_date = strtoupper(date_format(date_create($row_for_fitness['sickness_date']), "d-M-Y H:i:sa"));
error_log("xcvbm" . $appointment_date);
$doc_id = $row_for_fitness['doctor_last_attended'];
$mod_id = $row_for_fitness['modified_by'];
if ($doc_id != 0) {
$doc_name = getFieldFromTable('patient_name', 'patient_master', 'id', $doc_id);
} else {
$doc_name = getFieldFromTable('patient_name', 'patient_master', 'id', $doc_id);
}
error_log("doc:" . $doc_name);
// $days=SELECT DATEDIFF(date_return, from_date) daysDiff from sicknessORDER BY daysDiff DESC;
// $result_for_days = @mysqli_query($conn,$days);
// error_log("daysdays".$result_for_days);
$query_for_patient = "select UPPER(a.patient_name) as patient_name,a.emp_code,b.dept_name,c.designation_name from patient_master a left join department b on a.dept_id=b.dept_id left join designation c on a.designation_id = c.designation_id where a.id='" . $row_for_fitness['emp_id'] . "' ";
//echo $query_for_patient;
$result_for_patient = @mysqli_query($conn, $query_for_patient);
$row_for_patient = @mysqli_fetch_array($result_for_patient);
// echo $row_emp_sign['modified_by'];
$query_for_company = "select company_name, company_logo,address,image_type from company_profile ";
//echo $query_for_company;
$result_for_company = @mysqli_query($conn, $query_for_company);
if ($row_for_company = @mysqli_fetch_array($result_for_company)) {
@extract($row_for_company);
}
error_log("asasasasasasas" . $row_for_patient['patient_name']);
$query_sign_master = "select * from employee_signature where emp_id='" . $row_for_fitness['doctor_last_attended'] . "' ";
error_log("sssssssssssssssssss" . $query_sign_master);
$result_sign_master = @mysqli_query($conn, $query_sign_master);
$row_sign_master = @mysqli_fetch_array($result_sign_master);
$appr_doc_sign_img = $row_sign_master['emp_sign'];
error_log("aaaaaaaaaaaaaavvvvvvvvvvvvvvvv" . $appr_doc_sign_img);
$appr_doc_image_type = $row_sign_master['image_type'];
?>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style type="text/css">
@page {
margin: 20px;
}
.btn {
background-color: #4CAF50;
border-radius: 5%;
/* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
@media print {
#printPageButton {
display: none;
}
</style>
<table width="100%">
<tr>
<td width="20%"><img src="data:<?php echo $row_for_company['image_type'] ?>;base64,<?php echo base64_encode($row_for_company['company_logo']) ?>" style="width: 150px; height: 60px; margin: 0px; padding: 0px;">
</td>
<td width="40%">
<div>
<strong style="margin-left: 60px; font-size: 15px;">
<?php echo $row_for_company['company_name'] ?>
</strong>
<!-- <strong style="margin-left: 75px">MEDICAL DEPARTMENT</strong> -->
<b style="margin-left: 30px; text-align: center;">
<pre><?php echo $row_for_company['address'] ?></pre>
</b>
</div>
</td>
<td width="35%">
<!-- <strong>OHC Mob.</strong> -->
<!-- <?php echo $row_for_company['primary_phone'] ?><br> -->
<pre><strong><?php echo $row_for_company['ohc_details'] ?></strong></pre><br>
<!-- <b style="font-size: 12px">Email: </b><span style="font-size: 12px"> -->
<!-- <?php echo strtolower($row_for_company['primary_email']) ?> -->
<!-- </span> -->
</td>
</tr>
<tr rowspan="2">
<td colspan="1"></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="2"></td>
</tr>
</table>
<br>
<table cellspacing="0" align="center" width="90%">
<tr>
<td align="center"><b style="font-size: 20px;font-weight: 800;text-decoration: underline;">UNFIT
CERTIFICATE</b></td>
</tr>
</table>
<br>
<br>
<table align="center" width="90%">
<tr>
<td align="none" style="border: none !important;"><b style="font-weight: 1200;">
<b><?php echo $row_for_fitness['ticket_no'] ?></b>
<br><br>
</tr>
<tr>
<td align="none" style="border: none !important;"><b style="font-weight: 1200;">Certified that Mr/Mrs:</b>
<?php echo $row_for_patient['patient_name'] ?><b style="font-weight: 1200;">
P.No: </b><?php echo $row_for_patient['emp_code'] ?> Dept.: </b>
<?php echo $row_for_patient['dept_name'] ?> <b style="font-weight: 1200;"> Design
</b><?php echo $row_for_patient['designation_name'] ?><b style="font-weight: 1200;"> reported for medical treatment
</b> on </b>
<?php echo date("d-M-Y", strtotime($row_for_fitness['date_absent'])) ?><b style="font-weight: 1200;"> at </b>
<?php echo date("H:ia", strtotime($row_for_fitness['sickness_date'])) ?>
. He has been advised rest for </b>
<?php echo $absencedays ?><b style="font-weight: 1200;">
days</b>
<b style="font-weight: 1200">from</b>
<?php echo date("d-M-Y", strtotime($row_for_fitness['date_absent'])) ?><b style="font-weight: 1200"> to </b>
<?php echo date("d-M-Y", strtotime($row_for_fitness['to_date'])) ?>.
</td>
</tr>
</table>
<table align="center" width="90%">
<tr>
<td style="border: none !important;"><b style="font-weight: 1200;">Remarks </b><?php echo $row_for_fitness['comments'] ?></td>
</tr>
</table>
<br>
<br>
<table align="center" width="90%">
<tr><img src="data:<?php echo $row_sign_master['doc_sign_image_type'] ?>;base64,<?php echo base64_encode($row_sign_master['emp_sign']) ?>" style="width: 160px; height: 30px;margin-left: 40px;" /></tr>
<tr>
<br>
<tr>
<!-- <td align="right" style="font-weight: 1200;border: none !important;">Date: <?php echo date("d-M-Y", strtotime($row_for_fitness['approval_date'])) ?></td> -->
<td align="left" style="font-weight: 1200;border: none !important;">Signature of Medical Officer</td>
</tr>
<tr>
<td><strong><?php echo $doc_name ?></strong></td>
</tr>
<tr>
<td align="left">Form No. : TML/F/MED/07</td>
<td align="right">Date
<?php echo date("d-M-Y", strtotime($row_for_fitness['approval_date'])) ?>
</td>
</tr>
<tr>
<td align="left">Rev.: 01</td>
</tr>
</table>
<div align="center">
<button align="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
</div>
<script>
$(document).ready(function() {
window.print();
});
</script>