2024-10-16 19:18:52 +05:30
|
|
|
<?php
|
|
|
|
include('includes/config/config.php');
|
|
|
|
include('includes/functions.php');
|
|
|
|
include('log_entry.php');
|
|
|
|
|
|
|
|
if (isset($_REQUEST['id'])) {
|
|
|
|
$id = mysqli_real_escape_string($conn, $_REQUEST['id']);
|
|
|
|
|
|
|
|
$sql = "SELECT bill_file,bill_file_name,bill_file_type FROM calibration_item_tbl WHERE calibration_id = $id";
|
|
|
|
|
|
|
|
error_log("doc query " . $sql);
|
|
|
|
|
|
|
|
$result = $conn->query($sql);
|
|
|
|
|
|
|
|
if ($result->num_rows > 0) {
|
|
|
|
$row = $result->fetch_assoc();
|
|
|
|
|
|
|
|
header('Content-Type: application/octet-stream');
|
|
|
|
header('Content-Disposition: attachment; filename="' . $row['bill_file_name'] . '"');
|
|
|
|
|
|
|
|
|
|
|
|
ob_clean();
|
|
|
|
echo $row['bill_file'];
|
2024-11-02 18:03:13 +05:30
|
|
|
die;
|
2024-10-16 19:18:52 +05:30
|
|
|
} else {
|
|
|
|
echo "Document not found";
|
|
|
|
}
|
|
|
|
}
|