335 lines
13 KiB
PHP
335 lines
13 KiB
PHP
|
<?php //include('pdf_header_reverse.php');
|
||
|
include('includes/config/config.php');
|
||
|
include('includes/functions.php');
|
||
|
//include('pop_up_top.php');
|
||
|
$start = $_POST['injuryDate1'];
|
||
|
$end = $_POST['injuryDate2'];
|
||
|
// $month_name = "$start - $end";
|
||
|
?>
|
||
|
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
|
||
|
<style>
|
||
|
@page {
|
||
|
margin: 15px;
|
||
|
}
|
||
|
|
||
|
.btn {
|
||
|
background-color: #4CAF50;
|
||
|
border-radius: 5%;
|
||
|
/* Green */
|
||
|
border: none;
|
||
|
color: white;
|
||
|
padding: 5px 8px;
|
||
|
text-align: center;
|
||
|
text-decoration: none;
|
||
|
display: inline-block;
|
||
|
font-size: 12px;
|
||
|
margin: 4px 2px;
|
||
|
cursor: pointer;
|
||
|
}
|
||
|
|
||
|
@media print {
|
||
|
#printPageButton {
|
||
|
display: none;
|
||
|
}
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
<body>
|
||
|
<?php include('pdf_ohc_header.php'); ?>
|
||
|
<table width="100%">
|
||
|
<tr>
|
||
|
|
||
|
<td style="font-size: 15px;"><strong style="margin-left: 600px">Injury Cases Report</strong></td>
|
||
|
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="left" style="font-size: 12px"><strong>For Duration: <?php echo $start; ?> -
|
||
|
<?php echo $end; ?></strong></td>
|
||
|
<td align="right" style="font-size: 15px"><button align="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button></td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
<br>
|
||
|
<table border="1" width="100%" cellspacing="0">
|
||
|
<?php
|
||
|
$sqll = "SELECT count(*) as total FROM employee_appointment a left join patient_master b on a.emp_id=b.id WHERE a.appointment_type='I' and a.ohc_type_id='" . $_SESSION['current_ohcttype'] . "' and date(a.appointment_date) BETWEEN STR_TO_DATE('" . $start . "','%d-%m-%Y') and STR_TO_DATE('" . $end . "','%d-%m-%Y') ";
|
||
|
|
||
|
$result_sqll = mysqli_query($conn, $sqll);
|
||
|
$num_rows = mysqli_num_rows($result_sqll);
|
||
|
$row0 = mysqli_fetch_assoc($result_sqll);
|
||
|
error_log("total:" . $sqll);
|
||
|
|
||
|
$sql = "SELECT DATE_FORMAT(a.appointment_date, '%d-%m-%y') as date,a.*,b.* FROM employee_appointment a left join patient_master b on a.emp_id=b.id WHERE a.appointment_type='I' and date(a.appointment_date) BETWEEN STR_TO_DATE('" . $start . "','%d-%m-%Y') and STR_TO_DATE('" . $end . "','%d-%m-%Y') and a.ohc_type_id='" . $_SESSION['current_ohcttype'] . "' order by a.appointment_date ASC";
|
||
|
error_log('tooo' . $sql);
|
||
|
|
||
|
$result = mysqli_query($conn, $sql);
|
||
|
|
||
|
?>
|
||
|
|
||
|
<strong>
|
||
|
<tr bgcolor="#eeeeee">
|
||
|
<td align="left" width="2%">Sr.</td>
|
||
|
<td align="left" width="2%">Injury No.</td>
|
||
|
<td align="left" width="4%">Date</td>
|
||
|
<td align="left" width="3%">Time In</td>
|
||
|
<!-- <td align="left" width="3%">Time Out</td> -->
|
||
|
<!-- <td align="left" width="2%">Duration</td> -->
|
||
|
<td valign="top" align="left" width="2%">Shift</td>
|
||
|
<!-- <td valign="top" align="left" width="2%">Injury Define</td>
|
||
|
<td valign="top" align="left" width="3%">Case Type</td> -->
|
||
|
<td valign="top" align="left" width="8%">Name</td>
|
||
|
<td valign="top" align="left" width="2%">Age</td>
|
||
|
<td valign="top" align="left" width="2%">Sex</td>
|
||
|
|
||
|
<td valign="top" align="left" width="3%">Emp. No.</td>
|
||
|
<td valign="top" align="left" width="3%">Employer</td>
|
||
|
<td valign="top" align="left" width="5%">Designation</td>
|
||
|
<td valign="top" align="left" width="3%">Division</td>
|
||
|
<td valign="top" align="left" width="3%">Department</td>
|
||
|
<!-- <td valign="top" align="left" width="3%">Ute</td> -->
|
||
|
<td valign="top" align="left" width="3%">Station/Lane</td>
|
||
|
|
||
|
<!-- <td valign="top" align="left" width="5%">Blood Grp</td>
|
||
|
<td valign="top" align="left" width="5%">Mobile No.</td> -->
|
||
|
<td valign="top" align="left" width="5%">Complaints</td>
|
||
|
<!-- <td valign="top" align="left" width="3%">Body System</td> -->
|
||
|
<td valign="top" align="left" width="3%">Examination Findings</td>
|
||
|
<!-- <td valign="top" align="left" width="3%">Diagnosis</td>
|
||
|
|
||
|
<td valign="top" align="left" width="5%">Injury Location</td>
|
||
|
<td valign="top" align="left" width="5%">Injury Area Cat.</td>
|
||
|
<td valign="top" align="left" width="5%">Injury Area Type</td>
|
||
|
<td valign="top" align="left" width="5%">Injury Type</td> -->
|
||
|
<td valign="top" align="left" width="5%">Injury Body part</td>
|
||
|
<td valign="top" align="left" width="5%">Injury Classification</td>
|
||
|
<!-- <td valign="top" align="left" width="5%">Procedures(if done any)</td> -->
|
||
|
<td valign="top" align="left" width="5%">Treatment</td>
|
||
|
<td valign="top" align="left" width="5%">Referral hospital</td>
|
||
|
|
||
|
<!-- <td valign="top" align="left" width="3%">Disease Type</td> -->
|
||
|
<!-- <td valign="top" align="left" width="3%">Referred By</td> -->
|
||
|
<!-- <td valign="top" align="left" width="3%">Referred To</td> -->
|
||
|
|
||
|
<!-- <td valign="top" align="left" width="3%">Chief Complaints</td> -->
|
||
|
<!-- <td valign="top" align="left" width="3%">MIS</td> -->
|
||
|
<!-- <td valign="top" align="left" width="3%">Communicable/Non-Coummnicable</td> -->
|
||
|
<td valign="top" align="left" width="5%">Remarks</td>
|
||
|
|
||
|
|
||
|
</tr>
|
||
|
|
||
|
<?php
|
||
|
$count = 1;
|
||
|
while ($row1 = mysqli_fetch_assoc($result)) {
|
||
|
@extract($row1);
|
||
|
|
||
|
// error_log($row1['employer_contractor_id']);
|
||
|
|
||
|
?>
|
||
|
|
||
|
<tr>
|
||
|
<td><?php echo $count ?></td>
|
||
|
<td><?php echo $row1['ticket_no'] ?></td>
|
||
|
<td><?php echo $row1['date'] ?></td>
|
||
|
|
||
|
<td><?php echo date("d/M/Y H:i ", strtotime($row1['appointment_date'])) ?></td>
|
||
|
|
||
|
<td><?php echo $row1['shift_type'] ?></td>
|
||
|
|
||
|
<!-- <td><?php if ($row1['injury_def'] == 'init') {
|
||
|
echo 'Initiated';
|
||
|
} elseif ($row1['injury_def'] == 'not-init') {
|
||
|
echo 'Not Initiated';
|
||
|
} ?></td> -->
|
||
|
|
||
|
|
||
|
<!--
|
||
|
<td><?php if (strcmp($row1['case_type'], 'NEW') == 0) {
|
||
|
echo 'NEW CASE';
|
||
|
}
|
||
|
if (strcmp($row1['case_type'], 'REP') == 0) {
|
||
|
echo 'REPEAT';
|
||
|
}
|
||
|
if (strcmp($row1['case_type'], 'FUP') == 0) {
|
||
|
echo 'FOLLOW UP';
|
||
|
}
|
||
|
if (strcmp($row1['case_type'], 'MED') == 0) {
|
||
|
echo 'MEDICATION';
|
||
|
}
|
||
|
if (strcmp($row1['case_type'], 'EFUP') == 0) {
|
||
|
echo 'Executive Follow Up';
|
||
|
} ?></td> -->
|
||
|
<td><?php echo $row1['patient_name'] ?></td>
|
||
|
<td><?php
|
||
|
|
||
|
$from = new DateTime($row1['dob']);
|
||
|
|
||
|
$to = new DateTime('today');
|
||
|
|
||
|
echo $from->diff($to)->y;
|
||
|
|
||
|
?></td>
|
||
|
<td><?php if ($row1['gender'] == 'M') {
|
||
|
echo 'Male';
|
||
|
} else {
|
||
|
echo 'Female';
|
||
|
} ?></td>
|
||
|
<td><?php echo $row1['emp_code'] ?></td>
|
||
|
<td><?php echo getFieldFromTable('employer_contractor_name', 'employer_contractor', 'id', $row1['employer_contractor_id']) ?>
|
||
|
</td>
|
||
|
<td><?php echo getTableFieldValue('designation', 'designation_name', $row1['designation_id'], 'designation_id',) ?>
|
||
|
</td>
|
||
|
<td>
|
||
|
<?php echo getTableFieldValue('bussiness_unit', 'bu_name', $row1['bu_id'], 'bu_id') ?>
|
||
|
</td>
|
||
|
<td><?php echo getTableFieldValue('department', 'dept_name', $row1['dept_id'], 'dept_id') ?> </td>
|
||
|
<!-- <td><?php echo getTableFieldValue('section', 'section_name', $row1['section_id'], 'section_id') ?> </td> -->
|
||
|
|
||
|
<td><?php echo getTableFieldValue('sub_section', 'sub_section_name', $row1['sub_section_id'], 'sub_section_id') ?>
|
||
|
</td>
|
||
|
<!-- <td><?php echo $row1['blood_group'] ?></td>
|
||
|
<td><?php echo $row1['primary_phone'] ?></td> -->
|
||
|
<?php
|
||
|
$complaint_ids = $row1['complaints'];
|
||
|
$complaint_ids_array = array();
|
||
|
$complaint_ids_array = explode(",", $complaint_ids);
|
||
|
$complaints = "";
|
||
|
for ($i = 0; $i < count($complaint_ids_array); $i++) {
|
||
|
if ($i == 0) {
|
||
|
if (is_numeric($complaint_ids_array[$i])) {
|
||
|
$complaints = getTableFieldValue('complaints', 'complaint', 'complaint_id', $complaint_ids_array[$i]);
|
||
|
} else {
|
||
|
$complaints = $complaint_ids_array[$i];
|
||
|
}
|
||
|
} else {
|
||
|
if (is_numeric($complaint_ids_array[$i])) {
|
||
|
$complaints = $complaints . "," . getTableFieldValue('complaints', 'complaint', 'complaint_id', $complaint_ids_array[$i]);
|
||
|
} else {
|
||
|
$complaints = $complaints . "," . $complaint_ids_array[$i];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
<td><?php echo $complaints ?></td>
|
||
|
<!-- <td><?php echo getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $row1['ailment_systems_new']) ?>
|
||
|
</td> -->
|
||
|
<?php
|
||
|
|
||
|
$findings_ids = $row1['examination_remarks'];
|
||
|
$findings_ids_array = array();
|
||
|
$findings_ids_array = explode(",", $findings_ids);
|
||
|
$findings = "";
|
||
|
for ($i = 0; $i < count($findings_ids_array); $i++) {
|
||
|
if ($i == 0) {
|
||
|
$findings = getTableFieldValue('examination_findings', 'examination_finding', 'id', $findings_ids_array[$i]);
|
||
|
} else {
|
||
|
$findings = $findings . "," . getTableFieldValue('examination_findings', 'examination_finding', 'id', $findings_ids_array[$i]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$referral_ids = $row1['referral'];
|
||
|
$referral_ids_array = array();
|
||
|
$referral_ids_array = explode(",", $referral_ids);
|
||
|
$referral = "";
|
||
|
for ($i = 0; $i < count($referral_ids_array); $i++) {
|
||
|
if ($i == 0) {
|
||
|
$referral = getTableFieldValue('referral_point', 'referral_point_name', 'referral_point_id', $referral_ids_array[$i]);
|
||
|
} else {
|
||
|
$referral = $referral . "," . getTableFieldValue('referral_point', 'referral_point_name', 'referral_point_id', $referral_ids_array[$i]);
|
||
|
}
|
||
|
}
|
||
|
?>
|
||
|
|
||
|
<td><?php echo $findings ?></td>
|
||
|
|
||
|
<!-- <td><?php echo getTableFieldValue('ailment', 'ailment_name', 'ailment_id', $row1['ailments_new']) ?>
|
||
|
</td> -->
|
||
|
|
||
|
<!-- <td><?php echo $row1['incident_location'] ?>
|
||
|
</td> -->
|
||
|
|
||
|
<!-- <td><?php if (strcmp($row1['injury_area_cat'], 'IN') == 0) {
|
||
|
echo 'Industrial';
|
||
|
}
|
||
|
if (strcmp($row1['injury_area_cat'], 'NIN') == 0) {
|
||
|
echo 'Non-Industrial';
|
||
|
} ?></td> -->
|
||
|
|
||
|
<!-- <td><?php if (strcmp($row1['injury_area_type'], 'M') == 0) {
|
||
|
echo 'Manufacturing';
|
||
|
}
|
||
|
if (strcmp($row1['injury_area_type'], 'NM') == 0) {
|
||
|
echo 'Non-Manufacturing';
|
||
|
} ?></td> -->
|
||
|
|
||
|
<?php
|
||
|
$injury_type_ids = $row1['injury_types_new'];
|
||
|
$injury_type_ids_array = array();
|
||
|
$injury_type_ids_array = explode(",", $injury_type_ids);
|
||
|
$injury_type_names = "";
|
||
|
for ($i = 0; $i < count($injury_type_ids_array); $i++) {
|
||
|
if ($i == 0) {
|
||
|
$injury_type_names = getTableFieldValue('injury_type', 'injury_type_name', 'injury_type_id', $injury_type_ids_array[$i]);
|
||
|
} else {
|
||
|
$injury_type_names = $injury_type_names . "," . getTableFieldValue('injury_type', 'injury_type_name', 'injury_type_id', $injury_type_ids_array[$i]);
|
||
|
}
|
||
|
}
|
||
|
$injury_class_ids = $row1['injury_classes_new'];
|
||
|
$injury_class_ids_array = array();
|
||
|
$injury_class_ids_array = explode(",", $injury_class_ids);
|
||
|
$injury_class_names = "";
|
||
|
for ($i = 0; $i < count($injury_class_ids_array); $i++) {
|
||
|
if ($i == 0) {
|
||
|
$injury_class_names = getTableFieldValue('injury_class', 'inj_class_name', 'inj_class_id', $injury_class_ids_array[$i]);
|
||
|
} else {
|
||
|
$injury_class_names = $injury_class_names . "," . getTableFieldValue('injury_class', 'inj_class_name', 'inj_class_id', $injury_class_ids_array[$i]);
|
||
|
}
|
||
|
}
|
||
|
$injury_parts_ids = $row1['injury_parts_new'];
|
||
|
$injury_parts_ids_array = array();
|
||
|
$injury_parts_ids_array = explode(",", $injury_parts_ids);
|
||
|
$injury_part_names = "";
|
||
|
for ($i = 0; $i < count($injury_parts_ids_array); $i++) {
|
||
|
if ($i == 0) {
|
||
|
$injury_part_names = getTableFieldValue('injury_part', 'inj_name', 'inj_id', $injury_parts_ids_array[$i]);
|
||
|
} else {
|
||
|
$injury_part_names = $injury_part_names . "," . getTableFieldValue('injury_part', 'inj_name', 'inj_id', $injury_parts_ids_array[$i]);
|
||
|
}
|
||
|
}
|
||
|
?>
|
||
|
<!-- <td><?= $injury_type_names ?>
|
||
|
</td> -->
|
||
|
|
||
|
<td><?= $injury_part_names ?></td>
|
||
|
|
||
|
<td><?= $injury_class_names ?>
|
||
|
</td>
|
||
|
<!-- <td><?php echo $row1['injury_procedure'] ?></td> -->
|
||
|
<td><?php echo getTreatmentText($row1['appointment_id']); ?></td>
|
||
|
<td><?php
|
||
|
|
||
|
error_log($referral."dipak");
|
||
|
echo $referral; ?></td>
|
||
|
<td><?php echo $row1['remarks_rece'] ?>
|
||
|
</td>
|
||
|
|
||
|
|
||
|
|
||
|
</tr>
|
||
|
<?php
|
||
|
$count++;
|
||
|
}
|
||
|
?>
|
||
|
<tr Height="10px">
|
||
|
<td colspan="29"><b>TOTAL: <?php echo $row0['total'] ?></b></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</body>
|
||
|
|
||
|
<script>
|
||
|
$(document).ready(function() {
|
||
|
window.print();
|
||
|
|
||
|
});
|
||
|
</script>
|