diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /frontend/payments/getPdf.php | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
Diffstat (limited to 'frontend/payments/getPdf.php')
-rw-r--r-- | frontend/payments/getPdf.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/frontend/payments/getPdf.php b/frontend/payments/getPdf.php new file mode 100644 index 0000000..df2aa5d --- /dev/null +++ b/frontend/payments/getPdf.php @@ -0,0 +1,35 @@ +<?php
+
+# Skripta za downloadanje pdf-jev (ker ga izvedemo preko lepega linka "www.1ka.si/payment/hash")
+
+
+include_once '../../function.php';
+global $site_path;
+
+if(isset($_GET['hash'])){
+
+ // Decode hash
+ $hash = $_GET['hash'];
+ $params = unserialize(urldecode(base64_decode($hash)));
+
+ // Vrnemo predracun
+ if($params['type'] == 'predracun' || $params['type'] == 'racun'){
+
+ $pdf_name = "1ka_".$params['type']."_".$params['id'].".pdf";
+
+ if($params['type'] == 'predracun')
+ $pdf_folder = $site_path."/frontend/payments/cebelica/predracuni/";
+ else
+ $pdf_folder = $site_path."/frontend/payments/cebelica/racuni/";
+
+ $pdf_path = $pdf_folder . $pdf_name;
+
+ header('Content-type: application/pdf');
+ header('Content-Disposition: attachment; filename="'.$pdf_name.'"');
+
+ readfile($pdf_path);
+ }
+}
+
+
+?>
|