2024-10-16 19:18:52 +05:30
< ?
//include ('pdf_header_reverse.php');
include ( 'includes/config/config.php' );
include ( 'includes/functions.php' );
?>
< ? php
$from_date1 = date ( 'Y-m-d' , strtotime ( $_POST [ 'startdate7' ]));
error_log ( " from_date1::: " . $from_date1 );
$rec_date = date ( 'Y-m-d' , strtotime ( $from_date1 . ' - 1 days' ));
error_log ( " rec_date::: " . $rec_date );
$from_date = date ( 'Y-m-d' , strtotime ( $from_date1 ));
$ohc = $_SESSION [ 'current_ohcttype' ];
?>
< link href = " includes/css-js/admin.css " rel = " stylesheet " type = " text/css " />
< style >
@ page {
margin : 15 px ;
}
. btn {
background - color : #4CAF50;
border - radius : 50 % ;
/* Green */
border : none ;
color : white ;
padding : 5 px 8 px ;
text - align : center ;
text - decoration : none ;
display : inline - block ;
font - size : 12 px ;
margin : 4 px 2 px ;
cursor : pointer ;
}
@ media print {
#printPageButton {
display : none ;
}
}
th {
font - size : 12 px ;
font - family : - apple - system , BlinkMacSystemFont , 'Segoe UI' , Roboto , Oxygen , Ubuntu , Cantarell , 'Open Sans' , 'Helvetica Neue' , sans - serif ;
font : bold ;
}
td {
font - size : 10 px ;
font - family : ' Calibri , sans - serif ;
}
</ style >
< body >
< ? php include ( 'pdf_ohc_header.php' ); ?>
< table width = " 100% " >
< tr >
< td align = " center " style = " font-size: 15px " >< strong > Daily Respiratory Report </ strong ></ td >
</ tr >
< tr >
2024-11-19 09:59:09 +05:30
< td align = " left " style = " font-size: 12px " >< strong > For Date : < ? php echo date ( " d-M-Y " , strtotime ( $from_date )); ?> </strong></td>
2024-10-16 19:18:52 +05:30
< 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 width = " 100% " border = " 1 " cellspacing = " 0 " >
< tr style = " background-color:skyblue; height: 50px; " >
< th width = " 1% " align = " center " > Sr </ th >
< th align = " center " width = " 10% " > Patients Name </ th >
< th align = " center " width = " 5% " > Dob </ th >
< th align = " center " width = " 5% " > Emp Id </ th >
< td align = " center " width = " 3% " > Employer </ td >
< th align = " center " width = " 5% " > Designation </ th >
< th align = " center " width = " 5% " > Division </ th >
< th align = " center " width = " 5% " > Department </ th >
< th align = " center " width = " 5% " > Ute </ th >
< th align = " center " width = " 5% " > Station </ th >
< th align = " center " width = " 5% " > Contact No </ th >
< th align = " center " width = " 5% " > Supervisor </ th >
< th align = " center " width = " 5% " > Symptoms </ th >
< th align = " center " width = " 5% " > Diagnosis </ th >
< th align = " center " width = " 5% " > Temp ( 1 st ) </ th >
< th align = " center " width = " 5% " > Temp ( 2 nd ) </ th >
< th align = " center " width = " 5% " > Temp ( 3 rd ) </ th >
< th align = " center " width = " 5% " > Reporting By </ th >
< th align = " center " width = " 5% " > Advice </ th >
< th align = " center " width = " 5% " > Reffered By / RTW </ th >
< th align = " center " width = " 10% " > Remarks </ th >
</ tr >
< ? php
error_reporting ( E_ERROR | E_PARSE );
$count = 0 ;
$sql = " select e.*,p.* from employee_appointment e left join patient_master p on e.emp_id = p.id where date(e.appointment_date) = ' " . $from_date1 . " ' and e.ailment_systems_new='3' and e.ohc_type_id=' " . $ohc . " ' " ;
error_log ( " respiratory query " . $sql );
$result = mysqli_query ( $conn , $sql );
while ( $row = mysqli_fetch_assoc ( $result )) {
$count ++ ;
$dob = '' ;
if ( $row [ 'dob' ] == '' || $row [ 'dob' ] == '0000-00-00' || $row [ 'dob' ] == null ) {
$dob = 'NA' ;
} else {
$dob = $row [ 'dob' ];
}
$division = getFieldFromTable ( 'bu_name' , 'bussiness_unit' , 'bu_id' , $row [ 'bu_id' ]);
$diagnosis = getCommaSeperatedValuesForInClause ( " select ailment_name from ailment " , " ailment_id " , $row [ 'ailments_new' ]);
?>
< tr style = " height: 50px; " >
< td width = " 1% " align = " center " >< ? = $count ?> </td>
< td align = " center " width = " 10% " >< ? = $row [ 'patient_name' ] ?> </td>
< td align = " center " width = " 5% " >< ? = $dob ?> </td>
< td align = " center " width = " 5% " >< ? = $row [ 'emp_code' ] ?> </td>
< td >< ? php echo getFieldFromTable ( 'employer_contractor_name' , 'employer_contractor' , 'id' , $row [ 'employer_contractor_id' ]) ?> </td>
< td align = " center " width = " 5% " >< ? = getFieldFromTable ( 'designation_name' , 'designation' , 'designation_id' , $row [ 'designation_id' ]) ?> </td>
< ? php
if ( $division == 'Car' ) {
?>
< td align = " center " width = " 5% " style = " background-color:#4CAF50; " >< ? = $division ?> </td>
< ? php
} else if ( $division == 'Corporate' ) {
?>
< td align = " center " width = " 5% " style = " background-color:slateblue " >< ? = $division ?> </td>
< ? php
} else if ( $division == 'PWT' ) {
?>
< td align = " center " width = " 5% " style = " background-color:yellow; " >< ? = $division ?> </td>
< ? php
} else {
?>
< td align = " center " width = " 5% " style = " background-color:aliceblue; " >< ? = $division ?> </td>
< ? php
}
?>
< td align = " center " width = " 5% " >< ? = getFieldFromTable ( 'dept_name' , 'department' , 'dept_id' , $row [ 'dept_id' ]) ?> </td>
< td align = " center " width = " 5% " >< ? = getFieldFromTable ( 'section_name' , 'section' , 'section_id' , $row [ 'section_id' ]) ?> </td>
< td align = " center " width = " 5% " >< ? = getFieldFromTable ( 'sub_section_name' , 'sub_section' , 'sub_section_id' , $row [ 'sub_section_id' ]) ?> </td>
< td align = " center " width = " 5% " >< ? = $row [ 'primary_phone' ] ?> </td>
< td align = " center " width = " 5% " >< ? = getFieldFromTable ( 'patient_name' , 'patient_master' , 'id' , $row [ 'emp_mgr_code' ]) ?> </td>
< ? php
$complaint_ids = $row [ '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 align = " center " width = " 5% " >< ? = $complaints ?> </td>
< td align = " center " width = " 5% " >< ? = $diagnosis ?> </td>
< td align = " center " width = " 5% " >< ? = $row [ 'temperature' ] ?> </td>
< td align = " center " width = " 5% " ></ td >
< td align = " center " width = " 5% " ></ td >
< td align = " center " width = " 5% " ></ td >
< td align = " center " width = " 5% " ></ td >
< td align = " center " width = " 5% " ></ td >
< td align = " center " width = " 10% " ></ td >
</ tr >
< ? php
}
?>
</ table >
</ body >
< script >
$ ( document ) . ready ( function () {
window . print ();
});
</ script >