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

78 lines
2.6 KiB
PHP

<?php
include('includes/config/config.php');
include('includes/functions.php');
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=excel_csr_program_report.xls');
?>
<html>
<link href="includes/css-js/admin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%">
<tr>
<div style="font-size:12px">
<td width="25%" align="left"> Run Date :
<?php echo date("d-M-Y"); ?>
</td>
<td width="50%" align="center" style="font-size:18px"><strong>
CSR Activity
</strong></td>
<td width="25%" align="left"> User :
<?php echo $username ?>
</td>
</tr>
</table>
<table border="1" style="text-align: center;">
<?php
$i = 1;
$sql = "SELECT * from csr_plan";
error_log("PDF " . $sql);
$result = mysqli_query($conn, $sql);
//echo $result;
?>
<tr bgcolor="#eeeeee">
<th width="5%" ;>Sr No.</th>
<th width="20%" ;>Year</th>
<th width="20%" ;>Total Budget</th>
<th width="12%" ;>Target Beneficiary Count</th>
<th width="12%" ;>Creater</th>
<th width="10%" ;>Status</th>
<th width="10%" ;>Remarks</th>
<!-- <th width="10%" ;>Total Participate</th>
<th width="10%" ;> Amount</th> -->
</tr>
<?php
$total_cost = 0;
while ($fetchData = mysqli_fetch_array($result)) {
$type = 'CSR Program';
$creater_uid = $row_config['creater'];
$creater_id = getTableFieldValue('tbl_users', 'emp_id', 'user_id', $creater_uid);
$creater = getTableFieldValue('patient_master', 'patient_name', 'id', $creater_id);
?>
<tr style="text-align: center;">
<td><?php echo $i ?></td>
<td><?php echo $fetchData['year'] ?></td>
<td><?php echo $fetchData['total_budget'] ?></td>
<td><?php echo $fetchData['target_beneficiary_count'] ?></td>
<td><?php echo $creater ?></td>
<td><?php echo $fetchData['status'] ?></td>
<td><?php echo $fetchData['remarks'] ?></td>
</tr>
<?php
$i++;
}
?>
<!-- <tr>
<td align="right" colspan="9">Total Amount</td>
<td align="left"><?= number_format((float)$total_cost, 2, '.', '') ?></td>
</tr> -->
</table>
</body>
</html>