142 lines
5.0 KiB
PHP
142 lines
5.0 KiB
PHP
|
<?php
|
||
|
include('includes/config/config.php');
|
||
|
include('includes/functions.php');
|
||
|
include('excel_ohc_header.php');
|
||
|
header("Content-type:application/octet-stream");
|
||
|
|
||
|
header("Content-type: application/x-msdownload");
|
||
|
header("Content-Disposition: attachment; filename=vaccination_report_excel.xls");
|
||
|
header("Pragma: no-cache");
|
||
|
header("Expires: 0");
|
||
|
|
||
|
$year=$_POST['vaccine_year'];
|
||
|
$vac_names=strtoupper ($_POST['vac_name']);
|
||
|
|
||
|
|
||
|
$vac_ids=handleDynamicMasterInsert ( "vaccine_master", "vaccine_name", "id", $vac_names);
|
||
|
|
||
|
error_log("vac_id " .count($vac_ids));
|
||
|
?>
|
||
|
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<?php $sql_comp = "select * from company_profile where company_id=5";
|
||
|
|
||
|
$result_comp = mysqli_query($conn, $sql_comp);
|
||
|
|
||
|
$row_comp = mysqli_fetch_array($result_comp); ?>
|
||
|
|
||
|
|
||
|
<table width="100%">
|
||
|
<tr>
|
||
|
<div style="font-size:12px">
|
||
|
<td width="100%" align="center" style="font-size:20px"><strong><?=$row_comp['company_name']?></strong>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="2" align="center"><strong><?=$row_comp['address']?></strong></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="2" align="center"><strong>VACCINATION REPORT OF(
|
||
|
<?php for($i=0;$i<count($vac_ids);$i++ ){
|
||
|
|
||
|
if($i !=count($vac_ids)-1){
|
||
|
echo getTableFieldValue("vaccine_master","vaccine_name","id", $vac_ids[$i]).",";}
|
||
|
else{ echo getTableFieldValue("vaccine_master","vaccine_name","id", $vac_ids[$i]);}
|
||
|
|
||
|
}
|
||
|
|
||
|
?>)</strong></td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
</table>
|
||
|
<table border="1" cellspacing="0" width="100%">
|
||
|
|
||
|
<tr>
|
||
|
<th><strong>SR.NO.</th>
|
||
|
<th><strong>NAME</th>
|
||
|
<th><strong>GENDER</th>
|
||
|
|
||
|
<th><strong>DOB</th>
|
||
|
<th><strong>CATEGORY</th>
|
||
|
<th><strong>EMPLOYER</th>
|
||
|
|
||
|
<th><strong>EMP. CODE</th>
|
||
|
<th><strong>DESIGNATION</th>
|
||
|
<th><strong>DIVISION</th>
|
||
|
<th><strong>DEPARTMENT</th>
|
||
|
<th><strong>UTE</th>
|
||
|
<th><strong>STATION</th>
|
||
|
<th><strong>CONTACT NO</th>
|
||
|
<th><strong>VACCINE NAME</th>
|
||
|
<th><strong>1<sup>st</sup> DOSE</th>
|
||
|
<th><strong>1<sup>st</sup> Vaccination Center</th>
|
||
|
<th><strong>2<sup>nd</sup> DOSE</th>
|
||
|
<th><strong>2<sup>nd</sup> Vaccination Center</th>
|
||
|
<th><strong>3<sup>rd</sup> DOSE</th>
|
||
|
<th><strong>3<sup>rd</sup> Vaccination Center</th>
|
||
|
<th><strong>REMARKS</strong></th>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
|
||
|
<?php
|
||
|
$vac_ids = join("','",$vac_ids);
|
||
|
$sql_med = "select a.vac_d1,a.vac_center1,a.vac_center2,a.vac_center3,a.vac_d2,a.vac_d3,a.remarks,b.*,c.vaccine_name from vaccination_details a left join patient_master b on a.emp_id=b.id left join vaccine_master c on a.vac_id=c.id where c.id in ('$vac_ids') ";
|
||
|
|
||
|
error_log("VACCINATION QUERY:".$sql_med);
|
||
|
|
||
|
$result_med = mysqli_query($conn,$sql_med);
|
||
|
|
||
|
$count = 1;
|
||
|
|
||
|
while($row_med = mysqli_fetch_assoc($result_med)){
|
||
|
extract($row_med);
|
||
|
|
||
|
if($row_med['vac_d3'] == '0000-00-00'){
|
||
|
$row_med['vac_d3'] = 'NA';
|
||
|
}
|
||
|
if($row_med['vac_d2'] == '0000-00-00'){
|
||
|
$row_med['vac_d2'] = 'NA';
|
||
|
}
|
||
|
if($row_med['vac_d1'] == '0000-00-00'){
|
||
|
$row_med['vac_d1'] = 'NA';
|
||
|
}
|
||
|
?>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td><?=$count?></td>
|
||
|
<td><?=$row_med['patient_name']?></td>
|
||
|
<td><?=$row_med['gender']?></td>
|
||
|
<td><?=date_format(date_create($row_med['dob']),"d-M-Y ")?></td>
|
||
|
<td><?=getTableFieldValue('patient_category', 'patient_cat_name', 'patient_cat_id',$row_med['patient_cat_id'] );?>
|
||
|
</td>
|
||
|
<td><?=getTableFieldValue('employer_contractor', 'employer_contractor_name', 'id',$row_med['employer_contractor_id']);?>
|
||
|
</td>
|
||
|
<td><?=$row_med['emp_code']?></td>
|
||
|
|
||
|
<td><?=getFieldFromTable('designation_name','designation','designation_id',$row_med['designation_id'])?>
|
||
|
</td>
|
||
|
<td><?php echo getTableFieldValue('bussiness_unit','bu_name','bu_id',$row_med['bu_id'])?></td>
|
||
|
<td><?=getFieldFromTable('dept_name','department','dept_id',$row_med['dept_id'])?></td>
|
||
|
<td><?=getTableFieldValue('section', 'section_name', 'section_id',$row_med['section_id']); ?></td>
|
||
|
<td><?=getTableFieldValue('sub_section', 'sub_section_name', 'sub_section_id',$row_med['sub_section_id']); ?>
|
||
|
</td>
|
||
|
<td><?=$row_med['primary_phone']?></td>
|
||
|
<td><?=$row_med['vaccine_name']?></td>
|
||
|
<td><?=date_format(date_create($row_med['vac_d1']),"d-M-Y ")?></td>
|
||
|
<td><?=$row_med['vac_center1']?></td>
|
||
|
<td><?=date_format(date_create($row_med['vac_d2']),"d-M-Y ")?></td>
|
||
|
<td><?=$row_med['vac_center2']?></td>
|
||
|
<td><?=date_format(date_create($row_med['vac_d3']),"d-M-Y ")?></td>
|
||
|
<td><?=$row_med['vac_center3']?></td>
|
||
|
<td><?=$row_med['remarks']?></td>
|
||
|
</tr>
|
||
|
|
||
|
<?php $count++;}?>
|
||
|
|
||
|
</table>
|
||
|
</body>
|