[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 downloads.php

Zen Cart 源代码 downloads.php




下载文件

文件名: downloads.php
文件类型: PHP文件
文件大小: 2.5 KiB
MD5: b45ce3de05b233665dc604e99bc1b86a

downloads.php - 关闭高亮
  1. <?php
  2. /**
  3.  * downloads module - prepares information for use in downloadable files delivery
  4.  *
  5.  * @package modules
  6.  * @copyright Copyright 2003-2006 Zen Cart Development Team
  7.  * @copyright Portions Copyright 2003 osCommerce
  8.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9.  * @version $Id: downloads.php 3018 2006-02-12 21:04:04Z wilt $
  10.  */
  11. if (!defined('IS_ADMIN_FLAG')) {
  12.   die('Illegal Access');
  13. }
  14. if (!($_GET['main_page']==FILENAME_ACCOUNT_HISTORY_INFO)) {
  15.   // Get last order id for checkout_success
  16.   $orders_lookup_query = "select orders_id
  17.                     from " . TABLE_ORDERS . "
  18.                     where customers_id = '" . (int)$_SESSION['customer_id'] . "'
  19.                     order by orders_id desc limit 1";
  20.  
  21.   $orders_lookup = $db->Execute($orders_lookup_query);
  22.   $last_order = $orders_lookup->fields['orders_id'];
  23. } else {
  24.   $last_order = $_GET['order_id'];
  25. }
  26.  
  27. // Now get all downloadable products in that order
  28. $downloads_query = "select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day,
  29.                             opd.download_maxdays, op.products_name, opd.orders_products_download_id,
  30.                             opd.orders_products_filename, opd.download_count, opd.download_maxdays
  31.                      from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, "
  32. . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
  33.                      where o.customers_id = '" . (int)$_SESSION['customer_id'] . "'
  34.                      and (o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "'
  35.                      and o.orders_status <= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS_END . "')
  36.                      and o.orders_id = '" . (int)$last_order . "'
  37.                      and o.orders_id = op.orders_id
  38.                      and op.orders_products_id = opd.orders_products_id
  39.                      and opd.orders_products_filename != ''";
  40.  
  41. $downloads = $db->Execute($downloads_query);
  42.  
  43. // If there is a download in the order and they cannot get it, tell customer about download rules
  44. $downloads_check_query = $db->Execute("select o.orders_id, opd.orders_products_download_id
  45.                          from " .
  46. TABLE_ORDERS . " o, " .
  47. TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
  48.                          where
  49.                          o.orders_id = opd.orders_id
  50.                          and o.orders_id = '" . (int)$last_order . "'
  51.                          and opd.orders_products_filename != ''
  52.                          ");
  53. ?>