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

284 lines
7.1 KiB
PHP

<?php session_start();
include('log_entry.php');
include_once("includes/functions.php");
include("includes/config/config.php");
?>
<?php $queryc = "select * from company_profile ";
$resultc = mysqli_query($conn, $queryc);
$row_company = mysqli_fetch_array($resultc);
@extract($row_company);
$data = $_REQUEST['appointment_idpdf'];
error_log("check:".$data);
if (is_numeric($data)) {
$appointment_id_pdf = $_REQUEST['appointment_idpdf'];
error_log("id1:" . $appointment_id_pdf);
} else {
$id = $_REQUEST['appointment_id_pdf'];
$appointment_id_pdf = base64_decode($id);
error_log("id:" . $appointment_id_pdf);
}
$sql_employee_appointment = "select a.*,p.patient_name, p.dept_id, p.emp_code, p.father_name, p.designation_id,employer_contractor_id,bu_id,
patient_cat_id, gender,blood_group,emp_cadre from employee_appointment a, patient_master p where a.emp_id=p.id
and appointment_id='" . $appointment_id_pdf . "'";
error_log("form-24444444444444" . $sql_employee_appointment);
$res_emp_appoint = mysqli_query($conn, $sql_employee_appointment);
$rows_emp_appoint = mysqli_fetch_array($res_emp_appoint);
@extract($rows_emp_appoint);
$patient_name = $rows_emp_appoint['patient_name'];
//echo $query;
$doc_user_id = ($rows_emp_appoint['doctor_last_attended'] != null || 0 || "") ? $rows_emp_appoint['doctor_last_attended'] : $rows_emp_appoint['modified_by'];
$doc_emp_id = getTableFieldValue('tbl_users', 'emp_id', 'user_id', $doc_user_id, '');
$doc_name = getTableFieldValue('patient_master', 'patient_name', 'id', $doc_emp_id, '');
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_array($result);
@extract($row);
$sql_doc_details = "select * from employee_signature where emp_id='$doc_emp_id'";
$result_doc_details = mysqli_query($conn, $sql_doc_details);
$row_doc_details = mysqli_fetch_array($result_doc_details);
$employee_code = $rows_emp_appoint['emp_code'];
$father_name = $rows_emp_appoint['father_name'];
if ($rows_emp_appoint['IsEmergency'] == 1) {
$ans = "Yes";
} else {
$ans = "No";
}
date_default_timezone_set('Asia/Kolkata');
$date = date('Y-m-d H:i:s');
$currentDate = date_format(date_create($date), "d-M-Y h:i:sa ");
$ailment_names = $rows_emp_appoint['ailments_new'];
$ailment_system_name = $rows_emp_appoint['ailment_systems_new'];
$injury_part_names = $rows_emp_appoint['injury_parts_new'];
$health_advices = $rows_emp_appoint['health_advices_new']; //getCommaSeperatedValuesForInClause("select health_advice_name from health_advice ","health_advice_id",$rows_emp_appoint['health_advices']);
$tests = $rows_emp_appoint['recommended_tests_new']; //getCommaSeperatedValuesForInClause("select section_name from checkup_form_section ","section_id",$rows_emp_appoint['tests']);
?>
<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>
<div align="right">
<button align="center" id="printPageButton" class="btn btn-success" onClick="window.print();">Print</button>
</div>
<table width="100%">
<tr>
<td rowspan="4">
<center><img src="data:image/jpeg;base64,<?php echo base64_encode($row_company['company_logo']) ?>" style="width: 300px; height: 130px;float: left;" /></center>
</td>
<td width="40%" align="right">
<div style="text-align:center;border: 1px solid black;">
<!-- <p>OCCUPATIONAL HEALTH CENTER</p> -->
<p><?php echo $row_company['company_name'] ?></p>
<p><?php echo $row_company['address'] ?></p>
<!-- <p>WEST BENGAL- 721301</p> -->
</div>
</td>
</tr>
</table>
<br>
<center>
<h4 style="text-decoration: underline;">SAFETY INCIDENT REPORT</h4>
</center>
<table width="100%">
<tr>
<td>REPORT DATE TIME: </td>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"><?php echo date("d-M-Y H:i:s", strtotime($rows_emp_appoint['appointment_date'])) ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>INCIDENT DATE TIME: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo date("d-M-Y H:i:s", strtotime($rows_emp_appoint['injury_time'])) ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>INCIDENT LOCATION: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo $rows_emp_appoint['incident_location'] ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>COMPANY/DIVISION: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo getTableFieldValue('bussiness_unit', 'bu_name', 'bu_id', $rows_emp_appoint['bu_id']) ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>CONTRACTOR NAME: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo getTableFieldValue('employer_contractor', 'employer_contractor_name', 'id', $rows_emp_appoint['employer_contractor_id']) ?></td>
</tr>
</table>
<br>
<!-- <table width="100%">
<tr>
<td >BRANCH: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"></td>
</tr>
</table>
<br> -->
<table width="100%">
<tr>
<td>LOCATION/BRANCH AREA: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"><?php echo $rows_emp_appoint['branch_area'] ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>NAME OF INJURED PERSON: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo $rows_emp_appoint['patient_name'] ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>INCIDENT OCCURRED AT DEPARTMENT: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo getTableFieldValue('department', 'dept_name', 'dept_id', $rows_emp_appoint['dept']) ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>CATEGORY: </td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo getTableFieldValue('injury_class', 'inj_class_name', 'inj_class_id', $rows_emp_appoint['injury_classes_new']) ?></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>SUB CATEGORY</td>
</tr>
<tr>
<td style="border: 1px solid black;height: 20px" width="100%"> <?php echo getTableFieldValue('injury_type', 'injury_type_name', 'injury_type_id', $rows_emp_appoint['injury_types_new']) ?></td>
</tr>
</table>
<br>
<table width="100%">
x <td>DESCRIPTION: :</td>
</tr>
<tr>
<td style="border: 1px solid black;height: 40px" width="100%"><?php echo $rows_emp_appoint['remarks_rece']?></td>
</tr>
</table>
<br>