ohctech_p8/monthly_bio_medical_waste_report.php
2024-10-16 19:18:52 +05:30

279 lines
7.4 KiB
PHP

<?php session_start();
// error_log($_REQUEST['patient_id']);
// error_log('Abcde');
include ('log_entry.php');
include_once ("includes/functions.php");
$start = date('Y-m-d', strtotime($_POST['startDate_bm']));
$end = date('Y-m-d', strtotime($_POST['endDate_bm']));
$year = date('Y', strtotime($_POST['endDate_bm']));
$month = date('M', strtotime($_POST['endDate_bm']));
?>
<?php $sql = "SELECT a.waste_id,a.dis_agncy,SUM(a.plant_yellow_qty) AS plant_yellow_qty ,
SUM(a.plant_white_qty) AS plant_white_qty,
SUM(a.plant_blue_qty) AS plant_blue_qty ,
SUM(a.plant_red_qty) AS plant_red_qty,a.collected_by,a.vehicle_no,a.challan_no
,a.approved_by,a.surveillance_by,a.ohc_type_id,a.remark,
b.agency_name,b.agency_address,e.emp_sign,e.image_type,e.qualification,
e.registration_no
FROM `bio_medical_waste_new` a LEFT JOIN disposal_agency b ON a.dis_agncy =
b.agency_id LEFT JOIN employee_signature e ON a.approved_by = e.emp_id WHERE
waste_gen_date between '$start' AND '$end' order by waste_gen_date ASC";
error_log("BIO-WASTE:" . $sql);
$result1 = mysqli_query($conn, $sql);
$row1 = mysqli_fetch_assoc($result1);
$doc_name = getFieldFromTable('patient_name', 'patient_master', 'id', $row1['approved_by']);
$query = "select * from company_profile";
//echo $query;
$result = mysqli_query($conn, $query);
$row_for_company = mysqli_fetch_array($result);
@extract($row_for_company);
?>
<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>
@page {
margin: 20px;
}
.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>
<div align="right">
<button align="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
</div>
<table>
<tr>
<td colspan="12"><u>
<h3 style="font-weight: 800;margin-left: 220px">Monthly report of bio medical waste generation</h3>
</u></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>1.Particulars of the applicant</td>
</tr>
<tr>
<td width="50%">&nbsp;&nbsp;&nbsp;&nbsp;i. Name of the authorized person (occupier/operator) :</td>
<td><?php echo $doc_name ?></td>
</tr>
<tr>
<td width="50%">&nbsp;&nbsp;&nbsp;&nbsp;ii. Name and address of institution:</td>
<td><?php echo $row_for_company['company_name'] ?>,<?php echo $row_for_company['address'] ?></td>
</tr>
</table>
<br>
<table>
<tr>
<td>2. Category of waste (as per schedule-I of the rule) generated and quantity for the month of:
<?php echo $month ?>-<?php echo $year ?>
</td>
</tr>
</table>
<br>
<table border="1" cellspacing="0" width="100%">
<tr>
<th><strong>Category</strong></th>
<th><strong>Waste Quantity</strong></th>
</tr>
<tr>
<td>Yellow- (Category-1,2,3&6)</td>
<td align="right"><?php echo $row1['plant_yellow_qty'] ?>gms</td>
</tr>
<tr>
<td>Red (Category-3,6&7)</td>
<td align="right"><?php echo $row1['plant_red_qty'] ?>gms</td>
</tr>
<tr>
<td>Blue (Category-7)</td>
<td align="right"><?php echo $row1['plant_blue_qty'] ?>gms</td>
</tr>
<tr>
<td>White Translucent (Category-4)</td>
<td align="right"><?php echo $row1['plant_white_qty'] ?>gms</td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>3. Brief details of the treatment facility:</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;In case off-site facility:</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i. Name of the operator:</td>
<td><?php echo getFieldFromTable('collector_name', 'bio_wast_collector', 'collector_id', $row1['collected_by']); ?>
</td>
</tr>
<tr>
<td width="40%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ii. Name and address of the facility:</td>
<td><?php echo $row1['agency_name'] ?>,<?php echo $row1['agency_address'] ?></td>
</tr>
</table>
<br>
<br>
<table>
<tr>
<td>4. Category-wise quantity of waste treated:</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i. Incineration/Burial (Yellow ): </td>
<td><strong><?php echo $row1['plant_yellow_qty'] ?>gms</strong></td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ii. Autoclave/Microwave </td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a) Red :</td>
<td><strong><?php echo $row1['plant_red_qty'] ?>gms</strong></td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b) Blue :</td>
<td><strong><?php echo $row1['plant_blue_qty'] ?>gms</strong></td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c) White Translucent :</td>
<td><strong><?php echo $row1['plant_white_qty'] ?>gms</strong></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td width="30%">5. Mode of treatment with details: </td>
<td><strong>Waste is handed over to the authorized disposal agency
(i.e. <?php echo $row1['agency_name'] ?>)
</strong></td>
</tr>
</table>
<br>
<table>
<tr>
<td>6. Any other information:</td>
</tr>
</table>
<br>
<table>
<td>7. Certified that the above report is for the period from <strong><?php echo $_POST['startDate_bm'] ?> to
<?php echo $_POST['endDate_bm'] ?></strong></td>
</table>
<br>
<table width="100%">
<tr>
<td width="80%"></td>
<td><img src="data:<?php echo $row1['image_type'] ?>;base64,<?php echo base64_encode($row1['emp_sign']) ?>"
style="width: 200px; height: 61px;" /></td>
</tr>
<tr>
<tr>
<td><strong>Date :<?php echo date('d-m-Y'); ?></strong></td>
</tr>
<?php $complaint_ids = $row_for_company['address'];
$complaint_ids_array = array();
$complaint_ids_array = explode(",", $complaint_ids);
error_log('agency addr' . print_r($complaint_ids_array, true));
$complaints = "";
for ($i = 0; $i < count($complaint_ids_array); $i++) {
if ($i > count($complaint_ids_array) - 3) {
$complaints = $complaints . "," . $complaint_ids_array[$i];
}
}
?>
<td><strong>Place : <?php echo $complaints ?></strong></td>
<td align="right"><strong>Signature:</strong></td>
</tr>
<tr>
<td><strong>Designation : Head Medical Services</strong></td>
<td align="right"><b style="font-size: 15px"><?php echo $doc_name . " ," . $row1['qualification']; ?></b></td>
</tr>
<tr>
<td></td>
<td align="right"><strong>KMC Reg No:
<?php echo $row1['registration_no'] ?></strong></td>
</tr>
<tr>
<td></td>
<td align="right"><strong>Factory Medical Officer</strong></td>
</tr>
</table>
<br>
<script>
$(document).ready(function () {
window.print();
});
</script>