add pdf download
This commit is contained in:
@@ -14,21 +14,23 @@ function priceid_kuri($id){
|
|||||||
function file_kuri($hash) {
|
function file_kuri($hash) {
|
||||||
|
|
||||||
|
|
||||||
$price = db_get("SELECT `pricename` FROM price WHERE `pricehash` = $hash LIMIT 1");
|
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
|
||||||
|
|
||||||
if (!isset($price['price_id'])){
|
if (!isset($price['price_id'])){
|
||||||
header("HTTP/1.0 404 Not Found");
|
header("HTTP/1.0 404 Not Found");
|
||||||
|
echo "file not found";
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $price['price_id'];
|
$id = $price['price_id'];
|
||||||
$pdfile = "/vhosts/an/httpdocs/files/pdf/pdf/$id.pdf";
|
$pdfile = "/vhosts/an/httpdocs/pub/files/pdf/pdf/$id.pdf";
|
||||||
|
|
||||||
$request = $_SERVER['REQUEST_URI'];
|
$request = $_SERVER['REQUEST_URI'];
|
||||||
$filename = basename($request);
|
$filename = basename($request);
|
||||||
|
|
||||||
if (!file_exists($pdfile)) {
|
if (!file_exists($pdfile)) {
|
||||||
header("HTTP/1.0 404 Not Found");
|
header("HTTP/1.0 404 Not Found");
|
||||||
|
echo "file not found";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user