csrtechnew.ohctech.in/enroll_candidates_reports_pdf.php

150 lines
5.6 KiB
PHP
Raw Permalink Normal View History

2025-04-14 13:28:09 +05:30
<?php //include('pdf_header_reverse.php');
include('includes/config/config.php');
include('includes/functions.php');
//include('pop_up_top.php');
// $startDate = date('Y-m-d', strtotime($_POST['startDate_enroll']));
// $endDate = date('Y-m-d', strtotime($_POST['endDate_enroll']));
// $from_date = date('d-m-Y', strtotime($from_date1));
// error_log("end date ".$endDate);
$batch_id = $_POST['batch_name'];
$ohc = $_POST['ohc_id9'];
error_log("batch_id ".$batch_id);
if ($batch_id == 'All') {
$sql = "
SELECT pm.*, eb.beneficiary_id, te.batch_id, eb.kit_issue, eb.shoes_issue
FROM patient_master pm
INNER JOIN training_batch_enrollment_beneficiary eb ON pm.id = eb.beneficiary_id
INNER JOIN training_batch_enrollment te ON eb.batch_pri_tbl_id = te.id
WHERE te.ohc_type_id = $ohc
AND pm.village IN (
SELECT village
FROM patient_master
WHERE id = pm.id
)
ORDER BY te.batch_id;
";
} else {
$sql = "
SELECT pm.*, eb.beneficiary_id, te.batch_id,eb.kit_issue,eb.shoes_issue
FROM patient_master pm
INNER JOIN training_batch_enrollment_beneficiary eb ON pm.id = eb.beneficiary_id
INNER JOIN training_batch_enrollment te ON eb.batch_pri_tbl_id = te.id
WHERE te.batch_id = '$batch_id'
AND te.ohc_type_id = $ohc
AND pm.village IN (
SELECT village
FROM patient_master
WHERE id = pm.id
)
ORDER BY te.batch_id;
";
}
error_log($sql . "get sql");
$result = mysqli_query($conn, $sql);
?>
<style>
@page {
margin: 15px;
}
.btn {
background-color: #4CAF50;
border-radius: 5%;
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;
}
}
.table-fixed {
table-layout: fixed;
width: 100%;
}
.table-fixed td {
word-wrap: break-word;
}
</style>
<body>
<?php include('pdf_current_ohc_header.php');
?>
<table width="100%">
<tr>
<td align="center" style="font-size: 15px;"><strong style="text-align: center;">Enrolled Candidates Report</strong></td>
</tr>
<tr>
<td align="right" style="font-size: 12px"><strong>Selected Location : <?= getFieldFromTable('ohc_type_name', 'ohc_type', 'ohc_type_id', $ohc) ?></strong></strong></td>
</tr>
</table>
<br>
<table border="1" width="100%" cellspacing="0" class="table-fixed">
<tr bgcolor="#eeeeee">
<td style="width: 5%; font-size: 10px;">Sr.</td>
<td style="width: 15%; font-size: 10px;">Name</td>
<td style="width: 10%; font-size: 10px;">Trade</td>
<td style="width: 10%; font-size: 10px;">Batch Name</td>
<td style="width: 10%; font-size: 10px;">Batch Start Date</td>
<td style="width: 10%; font-size: 10px;">Batch End Date</td>
<td style="width: 10%; font-size: 10px;">Date Of Birth</td>
<td style="width: 10%; font-size: 10px;">Permanent Address City/Village</td>
<td style="width: 10%; font-size: 10px;">Permanent Address Tehsil</td>
<td style="width: 10%; font-size: 10px;">Aadhar Linked/Trainees Contace No.</td>
<td style="width: 10%; font-size: 10px;">Trainees Contact No.</td>
<td style="width: 10%; font-size: 10px;">Emergency Contact No.(Parent)</td>
<td style="width: 10%; font-size: 10px;">Kit Status</td>
<td style="width: 10%; font-size: 10px;">Safety Shoes Size</td>
</tr>
<?php
$count = 1;
while ($row1 = mysqli_fetch_assoc($result)) {
extract($row1);
?>
<tr>
<td style="font-size: 10px;"><?php echo $count ?></td>
<td style="font-size: 10px;"><?php echo $row1['patient_name'] ?></td>
<td style="font-size: 10px;"><?php echo getFieldFromTable('name', 'courses', 'id', getFieldFromTable('training_program_id', 'training_batch_master', 'batch_id', $row1['batch_id'])) ?></td>
<td style="font-size: 10px;"><?php echo getFieldFromTable('batch_name', 'training_batch_master', 'batch_id', $row1['batch_id']) ?></td>
<td style="font-size: 10px;"><?php echo date('d-m-Y', strtotime(getFieldFromTable('start_date', 'training_batch_master', 'batch_id', $row1['batch_id']))) ?></td>
<td style="font-size: 10px;"><?php echo date('d-m-Y', strtotime(getFieldFromTable('end_date', 'training_batch_master', 'batch_id', $row1['batch_id']))) ?></td>
<td style="font-size: 10px;"><?php echo date('d-m-Y', strtotime($row1['dob'])) ?></td>
<td style="font-size: 10px;"><?php echo getFieldFromTable('village', 'village', 'id', $row1['village']) ?></td>
<td style="font-size: 10px;"><?php echo getFieldFromTable('name', 'tehsils', 'id', $row1['tehsil']) ?></td>
<td style="font-size: 10px;"><?php echo $row1['aadhar_phone'] ?></td>
<td style="font-size: 10px;"><?php echo $row1['primary_phone'] ?></td>
<td style="font-size: 10px;"><?php echo $row1['secondary_contact_no'] ?></td>
<td style="font-size: 10px;"><?php echo $row1['kit_issue'] ?></td>
<td style="font-size: 10px;"><?php echo $row1['shoes_issue'] ?></td>
</tr>
<?php
$count++;
}
?>
</table>
</body>
<script>
$(document).ready(function() {
window.print();
});
</script>