<?php
/* --------------------------------------------------------------
downloads.php 2010-01-11 gm
Gambio GmbH
http://www.gambio.de
Copyright (c) 2010 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(downloads.php,v 1.2 2003/02/12); www.oscommerce.com
(c) 2003 nextcommerce (downloads.php,v 1.6 2003/08/13); www.nextcommerce.org
(c) 2003 XT-Commerce - community made shopping http://www.xt-commerce.com ($Id: downloads.php 896 2005-04-27 19:22:59Z mz $)
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
// ibclude the needed functions
if (!function_exists('xtc_date_long')) {
require_once (DIR_FS_INC.'xtc_date_long.inc.php');
}
if (!function_exists('xtc_date_short')) {
require_once (DIR_FS_INC.'xtc_date_short.inc.php');
}
$module_smarty = new Smarty;
if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
// Get last order id for checkout_success
$orders_query = xtc_db_query("select orders_id, orders_status from ".TABLE_ORDERS." where customers_id = '".$_SESSION['customer_id']."' order by orders_id desc limit 1");
$orders = xtc_db_fetch_array($orders_query);
$last_order = $orders['orders_id'];
$order_status = $orders['orders_status'];
} else {
$last_order = (int)$_GET['order_id'];
$orders_query = xtc_db_query("SELECT orders_status FROM ".TABLE_ORDERS." WHERE orders_id = '".$last_order."'");
$orders = xtc_db_fetch_array($orders_query);
$order_status = $orders['orders_status'];
}
// BOF GM_MOD
if ($order_status < DOWNLOAD_MIN_ORDERS_STATUS || $order_status == 99) {
$module_smarty->assign('dl_prevented', 'true');
}
// Now get all downloadable products in that order
$downloads_query = xtc_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from ".TABLE_ORDERS." o, ".TABLE_ORDERS_PRODUCTS." op, ".TABLE_ORDERS_PRODUCTS_DOWNLOAD." opd where o.customers_id = '".$_SESSION['customer_id']."' and o.orders_id = '".$last_order."' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");
if (xtc_db_num_rows($downloads_query) > 0) {
$jj = 0;
//<!-- list of products -->
while ($downloads = xtc_db_fetch_array($downloads_query)) {
// MySQL 3.22 does not have INTERVAL
list ($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
$download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);
$download_expiry = date('Y-m-d H:i:s', $download_timestamp);
//<!-- left box -->
// The link will appear only if:
// - Download remaining count is > 0, AND
// - The file is present in the DOWNLOAD directory, AND EITHER
// - No expiry date is enforced (maxdays == 0), OR
// - The expiry date is not reached
if (($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD.$downloads['orders_products_filename'])) && (($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) && ($order_status >= DOWNLOAD_MIN_ORDERS_STATUS)) {
$dl[$jj]['download_link'] = '<a href="'.xtc_href_link(FILENAME_DOWNLOAD, 'order='.$last_order.'&id='.$downloads['orders_products_download_id']).'">'.$downloads['products_name'].'</a>';
$dl[$jj]['pic_link'] = xtc_href_link(FILENAME_DOWNLOAD, 'order='.$last_order.'&id='.$downloads['orders_products_download_id']);
} else {
$dl[$jj]['download_link'] = $downloads['products_name'];
}
//<!-- right box -->
$dl[$jj]['date'] = xtc_date_long($download_expiry);
$dl[$jj]['date_short'] = xtc_date_short($download_expiry);
$dl[$jj]['count'] = $downloads['download_count'];
$jj ++;
}
}
$module_smarty->assign('dl', $dl);
$module_smarty->assign('language', $_SESSION['language']);
$module_smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
$module_smarty->caching = 0;
$module = $module_smarty->fetch(CURRENT_TEMPLATE.'/module/downloads.html');
$smarty->assign('downloads_content', $module);
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| klarna/ | 2013-11-12 21:06 | 0 B | 76129f60960:kunden | dxwrx-rx-r | |
| mediafinanz/ | 2013-11-12 21:07 | 13.58 KB | 76129f60960:kunden | dxwrx-rx-r | |
| order_total/ | 2013-11-12 21:06 | 170.74 KB | 76129f60960:kunden | dxwrx-rx-r | |
| payment/ | 2013-11-12 21:07 | 565.09 KB | 76129f60960:kunden | dxwrx-rx-r | |
| shipping/ | 2013-11-12 21:06 | 274.9 KB | 76129f60960:kunden | dxwrx-rx-r | |
| yatego/ | 2013-11-12 21:06 | 27.43 KB | 76129f60960:kunden | dxwrx-rx-r | |
| address_book_details.php | 2013-11-12 21:05 | 12.16 KB | 76129f60960:kunden | -xw-x----- | |
| also_purchased_products.php | 2013-11-12 21:05 | 109 B | 76129f60960:kunden | -xw-x----- | |
| checkout_new_address.php | 2013-11-12 21:05 | 12.94 KB | 76129f60960:kunden | -xw-x----- | |
| cross_selling.php | 2013-11-12 21:05 | 112 B | 76129f60960:kunden | -xw-x----- | |
| default.php | 2013-11-12 21:05 | 26.54 KB | 76129f60960:kunden | -xw-x----- | |
| downloads.php | 2013-11-12 21:05 | 4.36 KB | 76129f60960:kunden | -xw-x----- | |
| error_handler.php | 2013-11-12 21:05 | 1.87 KB | 76129f60960:kunden | -xw-x----- | |
| gift_cart.php | 2013-11-12 21:05 | 105 B | 76129f60960:kunden | -xw-x----- | |
| graduated_prices.php | 2013-11-12 21:05 | 111 B | 76129f60960:kunden | -xw-x----- | |
| metatags.php | 2013-11-12 21:05 | 4.49 KB | 76129f60960:kunden | -xw-x----- | |
| new_products.php | 2013-11-12 21:05 | 5.91 KB | 76129f60960:kunden | -xw-x----- | |
| order_details_cart.php | 2013-11-12 21:05 | 113 B | 76129f60960:kunden | -xw-x----- | |
| order_details_wishlist.php | 2013-11-12 21:05 | 113 B | 76129f60960:kunden | -xw-x----- | |
| product_attributes.php | 2013-11-12 21:05 | 113 B | 76129f60960:kunden | -xw-x----- | |
| product_info.php | 2013-11-12 21:05 | 107 B | 76129f60960:kunden | -xw-x----- | |
| product_listing.php | 2013-11-12 21:05 | 13.83 KB | 76129f60960:kunden | -xw-x----- | |
| product_navigator.php | 2013-11-12 21:05 | 112 B | 76129f60960:kunden | -xw-x----- | |
| product_reviews.php | 2013-11-12 21:05 | 110 B | 76129f60960:kunden | -xw-x----- | |
| products_media.php | 2013-11-12 21:05 | 108 B | 76129f60960:kunden | -xw-x----- | |
| products_new_main.php | 2013-11-12 21:05 | 10.21 KB | 76129f60960:kunden | -xw-x----- | |
| reviews.php | 2013-11-12 21:05 | 2.28 KB | 76129f60960:kunden | -xw-x----- | |
| specials_main.php | 2013-11-12 21:05 | 4.63 KB | 76129f60960:kunden | -xw-x----- | |
| upcoming_products.php | 2013-11-12 21:05 | 2.97 KB | 76129f60960:kunden | -xw-x----- | |