23 lines
669 B
PHP
23 lines
669 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
$doc_id =$_REQUEST['doc_id'];
|
|
$query = "select * from checkup_section_medical_document where id = '".$doc_id."'";
|
|
error_log('doc_download'.$query);
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
error_log ( "Failed to retrieve Document Exception:" . mysqli_error($conn) . " Query::: " . $query );
|
|
exit(mysqli_error($conn));
|
|
}
|
|
$data = array();
|
|
if(mysqli_num_rows($result) > 0) {
|
|
while ($row = mysqli_fetch_assoc($result)) {
|
|
header("Content-type: " . $row["medical_doc_type"]);
|
|
echo ($row['medical_doc']);
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
echo "Data not found!";
|
|
}
|
|
|
|
?>
|