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

156 lines
5.7 KiB
PHP

<?php include('pdf_header.php'); ?>
<?php include('includes/config/config.php'); ?>
<?php include_once("includes/functions.php"); ?>
<style>
.main_container {
/* border: 5px solid black; */
height: 800px;
width: 1200px;
margin: auto;
padding: 20px;
border-radius: 10px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th,
td {
padding: 10px;
text-align: left;
border: 2px solid black;
}
th {
background-color: #4CAF50;
color: white;
}
.header-cell {
text-align: center;
}
</style>
<div class="main_container">
<?php
$queryc = "SELECT * FROM company_profile";
$resultc = mysqli_query($conn, $queryc);
$row_company = mysqli_fetch_array($resultc);
@extract($row_company);
?>
<table style="border: none; width: 100%;">
<tr>
<td width="20%" class="header-cell" style="border: none;">
<?php if (isset($row_company['company_logo']) && $row_company['company_logo'] != null) { ?>
<img src="data:<?php echo $row_company['image_type']; ?>;base64,<?php echo base64_encode($row_company['company_logo']); ?>" style="width: 150px; height: 60px;">
<?php } ?>
</td>
<td width="60%" class="header-cell" style="border: none;">
<div>
<b style="font-size: 15px;">
<?php echo htmlspecialchars($row_company['company_name']); ?><br>
<?php echo htmlspecialchars($row_for_ohc['ohc_type_name']); ?><br><br>
<span style="font-size: 12px;">Vocational Training Institute</span>
</b>
</div>
</td>
<td width="20%" class="header-cell" style="border: none;">
<?php if (isset($row_company['right_com_logo']) && $row_company['right_com_logo'] != null) { ?>
<img src="data:<?php echo $row_company['right_image_type']; ?>;base64,<?php echo base64_encode($row_company['right_com_logo']); ?>" style="width: 150px; height: 60px;">
<?php } ?>
</td>
</tr>
<tr>
<td colspan="3" class="header-cell" style="border: none;">
<h3 style="margin-top: 20px;">Exam Date Sheet</h3>
</td>
</tr>
</table>
<?php
$ohcid = $_REQUEST['dohc_id'];
$batch_name = $_REQUEST['dbatch_name'];
$schedule = $_REQUEST['schedule'];
$time = $_REQUEST['time'];
$note = $_REQUEST['note'];
error_log("Check_form_request_data : " . $ohcid . '/' . $batch_name . '/' . $schedule);
?>
<table>
<tr>
<td width="20%"><strong>Batch Name:</strong> </td>
<td width="30%"><?php echo getFieldFromTable('batch_name', 'training_batch_master', 'batch_id', $batch_name); ?></td>
<td width="20%"><strong>Exam Center Name:</strong> </td>
<td width="30%"><?= getFieldFromTable('ohc_type_name', 'ohc_type', 'ohc_type_id', $ohcid) ?></td>
</tr>
<tr>
<td width="20%"><strong>Course Name:</strong></td>
<td width="30%"><?php echo getFieldFromTable('name', 'courses', 'id', getFieldFromTable('training_program_id', 'training_batch_master', 'batch_id', $batch_name)); ?></td>
<td width="20%"><strong>Exam Timing:</strong></td>
<td width="30%">
<?php
if($time == 'First Half'){
echo $time.'(10:00 To 12:30)';
}else if($time == 'Second Half'){
echo $time.'(01:00 To 03:30)';
}
?>
</td>
</tr>
</table>
<table>
<thead>
<tr align="center">
<th width="2%" style="text-align: center;">Sr.</th>
<th width="10%" style="text-align: center;">Subject Name</th>
<th width="10%" style="text-align: center;">Exam Type</th>
<th width="10%" style="text-align: center;">Exam Date</th>
</tr>
</thead>
<tbody>
<?php
$sr = 1;
foreach ($schedule as $i) {
?>
<tr>
<td style="text-align: center;"><?= $sr ?></td>
<td style="text-align: center;"><?= getFieldFromTable('subject_name', 'subjects', 'subject_id', getFieldFromTable('subject_id', 'exam_schedule', 'id', $i)) ?></td>
<td style="text-align: center;"><?= getFieldFromTable('exam_type', 'exam_schedule', 'id', $i) ?></td>
<td style="text-align: center;">
<?php
$exam_date = getFieldFromTable('date_of_exam', 'exam_schedule', 'id', $i);
if ($exam_date && $exam_date !== '00') {
echo date('d-m-Y', strtotime($exam_date)); // Change the format as needed
} else {
echo 'NA'; // Show nothing if date is "00" or not set
}
?>
</td>
</tr>
<?php
$sr++;
}
?>
<tr>
<td style="color: red;"><strong >Note : </strong></td>
<td colspan="4" style="color: red;"><?= $note ?></td>
</tr>
</tbody>
</table>
<div style="margin-left: 70%;">
<strong style="color: #4CAF50;">For,Vocational Skill Training Institute</strong>
<br><br><br><br>
<span style="margin-left: 30%;color: #4CAF50;">Principal</span>
</div>
</div>