ohctech_p8/getSupDocLink.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

29 lines
700 B
PHP

<?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 * FROM checkup_section_medical_document WHERE 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['medical_doc_name'] . '"');
ob_clean();
echo $row['medical_doc'];
die;
} else {
echo "Document not found";
}
}