csrtechnew.ohctech.in/get_rrwhs_doc.php

40 lines
1.4 KiB
PHP
Raw Normal View History

2025-04-14 13:28:09 +05:30
<?php
include('includes/config/config.php');
$emp_id = $_GET['emp_id'];
$docs_select_query = "SELECT * FROM employee_docs WHERE emp_id=" . $emp_id;
$docs_result = mysqli_query($conn, $docs_select_query);
echo '<h4 class="text-center font-weight-bold">Uploaded Documents</h4>';
echo '<table class="table table-bordered text-center">
<thead>
<tr>
<th>S.No.</th>
<th>Document Name</th>
<th>Document Description</th>
<th>Uploaded Date</th>
<th>Download link</th>
<th>Edit/Delete</th>
</tr>
</thead>
<tbody>';
if (mysqli_num_rows($docs_result) == 0) {
echo "<tr><td colspan='6'>No Files Found</td></tr>";
} else {
$count = 0;
while ($row_docs = mysqli_fetch_assoc($docs_result)) {
$count++;
echo "<tr>
<td>{$count}</td>
<td>{$row_docs['doc_name']}</td>
<td>{$row_docs['doc_desc']}</td>
<td>" . date("d-M-Y", strtotime($row_docs['last_modified'])) . "</td>
<td><a href='data:{$row_docs['doc_type']};base64," . base64_encode($row_docs['document']) . "' download><span class='glyphicon glyphicon-download-alt'></span></a></td>
<td><a href='#' onclick='deletedocs({$row_docs['doc_id']});'><span class='glyphicon glyphicon-trash'></span></a></td>
</tr>";
}
}
echo '</tbody></table>';
?>