111 lines
3.6 KiB
PHP
111 lines
3.6 KiB
PHP
<?php
|
|
|
|
include('includes/config/config.php');
|
|
include('includes/functions.php');
|
|
|
|
|
|
$start_date = date('d-m-Y', strtotime($_POST['startDate2']));
|
|
$end_date = date('d-m-Y', strtotime($_POST['endDate2']));
|
|
$exam_type = $_POST['exam_type'];
|
|
$bu_id = $_POST['bu_id'];
|
|
|
|
|
|
error_log($start_date);
|
|
error_log($end_date);
|
|
error_log('exam_type' . $exam_type);
|
|
error_log('bu_id' . $bu_id);
|
|
?>
|
|
|
|
|
|
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
|
|
|
|
|
|
|
|
<?php include('pdf_ohc_header.php') ?>
|
|
|
|
|
|
<table width="100%">
|
|
|
|
<tr>
|
|
<td align="center" style="font-size: 18px">
|
|
<strong>Health Index Record of
|
|
<?php if ($bu_id == 'all') { ?>All <?php } else {
|
|
echo getTableFieldValue('bussiness_unit', 'bu_name', 'bu_id', $bu_id);
|
|
} ?> Division</strong>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="center" style="font-size: 13px;padding-top: 10px;">
|
|
<strong>(For <?= getTableFieldValue('checkup_type', 'checkup_type_name', 'checkup_type_id', $exam_type) ?>)</strong>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="right" style="font-size: 15px">
|
|
<button align="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<table border="1" width="100%" cellspacing="0">
|
|
|
|
<tr bgcolor="#eeeeee">
|
|
<td width="3%">Sr.</td>
|
|
<td align="left" width="15%">Ticket No</td>
|
|
<td align="left" width="8%">Check Up Date</td>
|
|
<td align="left" width="15%">Patient Name</td>
|
|
<td align="left" width="5%">Emp Code</td>
|
|
<td align="left" width="10%">DOB</td>
|
|
<td align="left" width="10%">Designation</td>
|
|
<td align="left" width="10%">Plant</td>
|
|
<td valign="top" align="left" width="8%">Health Index</td>
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
if ($bu_id == "all") {
|
|
|
|
$sql = "SELECT cf.*, p.* FROM checkup_form cf LEFT JOIN patient_master p ON cf.emp_id = p.id WHERE cf.checkup_type_id = '" . $exam_type . "' AND DATE(cf.checkup_date) BETWEEN STR_TO_DATE('" . $start_date . "', '%d-%m-%Y') AND STR_TO_DATE('" . $end_date . "', '%d-%m-%Y') ORDER BY cf.checkup_date ASC";
|
|
} else {
|
|
|
|
$sql = "SELECT cf.*, p.* FROM checkup_form cf LEFT JOIN patient_master p ON cf.emp_id = p.id WHERE p.bu_id='" . $bu_id . "' AND cf.checkup_type_id = '" . $exam_type . "' AND DATE(cf.checkup_date) BETWEEN STR_TO_DATE('" . $start_date . "', '%d-%m-%Y') AND STR_TO_DATE('" . $end_date . "', '%d-%m-%Y') ORDER BY cf.checkup_date ASC";
|
|
}
|
|
error_log("Query: " . $sql);
|
|
|
|
|
|
$result = mysqli_query($conn, $sql);
|
|
|
|
$count = 1;
|
|
while ($row1 = mysqli_fetch_assoc($result)) {
|
|
|
|
extract($row1);
|
|
?>
|
|
<tr>
|
|
<td><?php echo $count ?></td>
|
|
<td><?php echo $row1['ticket_no'] ?></td>
|
|
<td><?php echo date('d-m-Y', strtotime($row1['checkup_date'])) ?></td>
|
|
<td><?php echo $row1['patient_name'] ?></td>
|
|
<td><?php echo $row1['emp_code'] ?></td>
|
|
<td><?php echo date('d-m-Y', strtotime($row1['dob'])) ?></td>
|
|
<td><?php echo getTableFieldValue('designation', 'designation_name', 'designation_id', $row1['designation_id']) ?></td>
|
|
<td><?php echo getTableFieldValue('plant_master', 'plant_name', 'plant_id', $row1['plant_id']) ?></td>
|
|
<td><?php echo $row1['health_index'] ?></td>
|
|
</tr>
|
|
<?php
|
|
$count++;
|
|
}
|
|
?>
|
|
</table>
|
|
</body>
|
|
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
|
|
window.print();
|
|
});
|
|
</script>
|