163 lines
6.1 KiB
PHP
163 lines
6.1 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('includes/functions.php');
|
|
|
|
$ohc = $_POST['ohc'];
|
|
$year = $_POST['year'];
|
|
$type = isset($_GET['type']) ? $_GET['type'] : ''; // Get the type parameter
|
|
error_log("Check_type : " . $type);
|
|
error_log("Check_Roll_code : " . $_SESSION['RoleId']);
|
|
|
|
if ($type === 'excel') {
|
|
header("Content-Type: application/vnd.ms-excel");
|
|
header("Content-Disposition: attachment; filename=annual_report.xls");
|
|
header("Pragma: no-cache");
|
|
header("Expires: 0");
|
|
}
|
|
?>
|
|
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
font-family: Arial, sans-serif;
|
|
font-size: 12px; /* Reduced overall font size */
|
|
}
|
|
|
|
h1 {
|
|
text-align: center;
|
|
font-size: 16px; /* Reduced heading size */
|
|
margin: 10px 0; /* Reduced margin */
|
|
}
|
|
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
th, td {
|
|
border: 1px solid #ddd;
|
|
text-align: left;
|
|
font-size: 8px; /* Ensured table font size is smaller */
|
|
}
|
|
|
|
th {
|
|
background-color: #f2f2f2;
|
|
}
|
|
|
|
tr:nth-child(even) {
|
|
background-color: #f9f9f9;
|
|
}
|
|
|
|
tr:hover {
|
|
background-color: #e2e2e2;
|
|
}
|
|
|
|
/* Media query for smaller screens */
|
|
@media (max-width: 768px) {
|
|
th, td {
|
|
font-size: 10px; /* Smaller font size for smaller screens */
|
|
padding: 4px; /* Reduced padding for smaller screens */
|
|
}
|
|
h1 {
|
|
font-size: 14px; /* Smaller heading for small screens */
|
|
}
|
|
}
|
|
|
|
/* Ensure the container does not scroll */
|
|
.container {
|
|
overflow-x: auto; /* Allow horizontal scroll if necessary */
|
|
}
|
|
</style>
|
|
|
|
<?php
|
|
if ($type === 'excel') {
|
|
// No additional header for Excel
|
|
} else {
|
|
include('pdf_ohc_header.php');
|
|
}
|
|
?>
|
|
|
|
<div class="container">
|
|
<h1>Beneficiary Report</h1>
|
|
|
|
<table>
|
|
<tr>
|
|
<th>Sr.</th>
|
|
<th>Beneficiary Name</th>
|
|
<th>Beneficiary Category</th>
|
|
<th>Age/Birth Date</th>
|
|
<th>Gender</th>
|
|
<th>Disability</th>
|
|
<th>Marital Status</th>
|
|
<th>Category</th>
|
|
<th>Religion</th>
|
|
<th>Ration Card Type</th>
|
|
<th>Ration Card Number</th>
|
|
<th>Aadhar Number</th>
|
|
<th>Aadhar Linked Phone</th>
|
|
<th>Email</th>
|
|
<th>Status</th>
|
|
<th>Activation Date</th>
|
|
<th>Activation Status</th>
|
|
<th>Address</th>
|
|
<th>Qualification</th>
|
|
<th>Experience</th>
|
|
<th>Benefit Program Eligibility</th>
|
|
<th>Distribution Center</th>
|
|
</tr>
|
|
|
|
<?php
|
|
session_start(); // Ensure session is started
|
|
|
|
$ohc_type_id = "ohc_type_id = " . $_SESSION['current_ohcttype'];
|
|
error_log("Check Role_type : " . $_SESSION['role_type']);
|
|
|
|
$sql = "SELECT * FROM patient_master WHERE $ohc_type_id AND beneficiary_type='" . $_SESSION['role_type'] . "'";
|
|
|
|
// Execute the SQL query
|
|
$result = mysqli_query($conn, $sql);
|
|
|
|
if ($result) {
|
|
$sr = 1;
|
|
while ($rowOfEmployee = mysqli_fetch_assoc($result)) {
|
|
$category_name = getFieldFromTable('category_name', 'beneficiary_category', 'id', $rowOfEmployee['beneficiary_category']);
|
|
$qualification = getFieldFromTable('qualification', 'qualification', 'id', $rowOfEmployee['qualification']);
|
|
$program_name = getFieldFromTable('program_name', 'program_master', 'program_id', $rowOfEmployee['benefit_program_eligibility']);
|
|
$village = getFieldFromTable('village', 'village', 'id', $rowOfEmployee['village']);
|
|
$tehsil = getFieldFromTable('name', 'tehsils', 'id', $rowOfEmployee['tehsil']);
|
|
$district = getFieldFromTable('name', 'districts', 'id', $rowOfEmployee['district']);
|
|
$state = getFieldFromTable('name', 'states', 'id', $rowOfEmployee['state']);
|
|
$pin_code = $rowOfEmployee['pin_code'];
|
|
|
|
echo "<tr>";
|
|
echo "<td>" . htmlspecialchars($sr++) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['patient_name']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($category_name) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['dob']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['gender']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['disability']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['marital_status']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['caste']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['religion']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['economic_category']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['rc_number']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['aadhar_card']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['aadhar_phone']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['email_id']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['admission_status']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['activation_date']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['pending_status']) . "</td>";
|
|
echo "<td>" . htmlspecialchars("$village, $tehsil, $district, $state, $pin_code") . "</td>";
|
|
echo "<td>" . htmlspecialchars($qualification) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['experience']) . "</td>";
|
|
echo "<td>" . htmlspecialchars($program_name) . "</td>";
|
|
echo "<td>" . htmlspecialchars($rowOfEmployee['distribution_center']) . "</td>"; // Ensure this variable is defined
|
|
echo "</tr>";
|
|
}
|
|
} else {
|
|
echo "<tr><td colspan='20'>Error fetching data: " . mysqli_error($conn) . "</td></tr>";
|
|
}
|
|
?>
|
|
</table>
|
|
</div>
|