$admindir = 'admin/'; require 'includes/application_top.php'; require $admindir . 'includes/ipdfbill/pdfbill_lib.php'; //security checks if (!isset($_SESSION['customer_id'])) { xtc_redirect(xtc_href_link(FILENAME_LOGIN, '', 'SSL')); } if (!isset($_GET['oID']) || isset($_GET['oID']) && !is_numeric($_GET['oID'])) { xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); } $customer_info_query = xtc_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $_GET['oID'] . "'"); $customer_info = xtc_db_fetch_array($customer_info_query); if ($customer_info['customers_id'] != $_SESSION['customer_id']) { xtc_redirect(xtc_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); } $pdffile = $admindir . get_pdf_invoice_filename($_GET['oID']); $pdffile_downloadname = get_pdf_invoice_download_filename($_GET['oID']); /* echo "pdffflie=$pdffile<br>\n"; echo "pdffile_downloadname=$pdffile_downloadname<br>\n"; exit; */ $fp = fopen($pdffile, 'rb'); $template = fread($fp, filesize($pdffile)); fclose($fp); //HTTP-Header ausgeben header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"{$pdffile_downloadname}\""); header("Content-type: application/pdf"); //das fertige PDF ausgeben echo $template;
</div> <div class="smallText col-xs-6"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_ORDER_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], xtc_get_all_get_params(array('page', 'oID', 'action'))); ?> </div> </div> </div> <!-- EOC ORDERS LISTING --> <?php $heading = array(); $contents = array(); switch ($action) { case 'delete': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>'); // --- bof -- ipdfbill -------- $pdffile = get_pdf_invoice_filename($oID); if (file_exists($pdffile)) { $pdf_delinfo = PDFBILL_MSG_DELINFO_PDF; } // --- eof -- ipdfbill -------- $contents = array('form' => xtc_draw_form('orders', FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm')); // --- bof -- ipdfbill -------- $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br /><br /><b>' . $oInfo->customers_name . '</b><br /><b>' . TABLE_HEADING_ORDERS_ID . '</b>: ' . $oInfo->orders_id); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . $pdf_delinfo . '<br /><br /><b>' . $oInfo->customers_name . '</b><br /><b>' . TABLE_HEADING_ORDERS_ID . '</b>: ' . $oInfo->orders_id); // --- eof -- ipdfbill -------- $contents[] = array('text' => '<br />' . xtc_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY); // Paypal Express Modul if (defined('TABLE_PAYPAL')) { $db_installed = false; $tables = xtc_db_query('SHOW TABLES FROM `' . DB_DATABASE . '`'); while ($row = mysqli_fetch_row($tables)) {
<?php //require('includes/application_top.php'); //require('includes/pdfbill/pdfbill_lib.php'); if ($_GET['file'] != '') { $pdffile = $_GET['file']; $pdffile_downloadname = basename($_GET['file']); } else { $pdffile = get_pdf_invoice_filename($_GET['oID']); $pdffile_downloadname = get_pdf_invoice_download_filename($_GET['oID']); } $fp = fopen($pdffile, 'rb'); $template = fread($fp, filesize($pdffile)); fclose($fp); //HTTP-Header ausgeben header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"{$pdffile_downloadname}\""); header("Content-type: application/pdf"); //das fertige PDF ausgeben echo $template;