csrtechnew.ohctech.in/beneficiary_enquiry_excel.php
2025-04-14 13:28:09 +05:30

75 lines
2.4 KiB
PHP

<?php //include('pdf_header.php');
include('includes/config/config.php');
include ('includes/functions.php');
//include('pop_up_top.php');
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=excel_beneficiary_enquiry.xls');
?>
<table border="1">
<?php
$ohc_type_id = "ohc_type_id = " . $_SESSION['current_ohcttype'] ;
$sql = "SELECT * FROM beneficiary_enquiry WHERE $ohc_type_id AND addmission_status != 'enroll'";
//echo $sql;
$result = mysqli_query($conn, $sql);
?><tr>
<td width="3%">Sr.</td>
<td width="7%">Date of Enquiry</td>
<td width="10%">Beneficiary Name</td>
<td width="10%">Program</td>
<td width="10%">Gender</td>
<td width="10%">State</td>
<td width="10%">Tehsil</td>
<td width="10%">District</td>
<td width="10%">Village</td>
<td width="10%">Date of Birth</td>
<td width="10%">Trainees No</td>
<td width="10%">Perents No</td>
<td width="10%">Education</td>
<td width="10%">Reference Form</td>
</tr>
<?php
while($row=mysqli_fetch_array($result)){
$state = getFieldFromTable('name','states','id',$row['village']);
$tehsil = getFieldFromTable('name','tehsils','id',$row['tehsil']);
$district = getFieldFromTable('name','districts','id',$row['district']);
$village = getFieldFromTable('village','patient_master','id',$row['patient_id']);
$subject_name = getCommaSeperatedValuesForInClause("SELECT name FROM courses", "id", $row['subject']);
$dob = date_format(date_create($row['dob']), "d-m-Y");
$doe = date_format(date_create($row['doe']), "d-m-Y");
?>
<tr>
<td><?php echo $count?></td>
<td><?php echo $doe?></td>
<td><?php echo $row['beneficiary_name']?></td>
<td><?php echo $subject_name?></td>
<td><?php echo $row['gender']?></td>
<td><?php echo $state?></td>
<td><?php echo $tehsil?></td>
<td><?php echo $district?></td>
<td><?php echo $village?></td>
<td><?php echo $dob?></td>
<td><?php echo $row['trainees_no']?></td>
<td><?php echo $row['perents_no']?></td>
<td><?php echo $row['education']?></td>
<td><?php echo $row['reference_form']?></td>
</tr>
<?php
}
?>
</table>
<?php
//include('pdf_footer.php');
?>