<?php
/* --------------------------------------------------------------
order_quantity_checker.php 2011-09-30 mb
Gambio GmbH
http://www.gambio.de
Copyright (c) 2011 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
?><?php
if(defined('_GM_VALID_CALL') === false) die('x0');
$error = '';
if(is_numeric($_GET['id'])){
$products_id = $_GET['id'];
$qty = gm_convert_qty($_GET['qty']);
$get_products_data = xtc_db_query("SELECT gm_min_order, gm_graduated_qty FROM products WHERE products_id = '" . (int)$products_id . "'");
if(xtc_db_num_rows($get_products_data) == 1){
$products_data = xtc_db_fetch_array($get_products_data);
if(empty($products_data['gm_min_order'])) $products_data['gm_min_order'] = 1;
if(empty($products_data['gm_graduated_qty'])) $products_data['gm_graduated_qty'] = 1;
if($qty < $products_data['gm_min_order']) $error .= GM_ORDER_QUANTITY_CHECKER_MIN_ERROR_1 . str_replace('.', ',', (double)$products_data['gm_min_order']) . GM_ORDER_QUANTITY_CHECKER_MIN_ERROR_2;
$result = $qty / $products_data['gm_graduated_qty'];
$result = round($result, 4); // workaround for next if-case to avoid calculating failure
if((int)$result != $result) $error .= GM_ORDER_QUANTITY_CHECKER_GRADUATED_ERROR_1 . str_replace('.', ',', (double)$products_data['gm_graduated_qty']) . GM_ORDER_QUANTITY_CHECKER_GRADUATED_ERROR_2;
}
}
echo $error;
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| admin_fav_master.php | 2013-11-12 21:02 | 1.63 KB | 76129f60960:kunden | -xw-x----- | |
| admin_lang_edit.php | 2013-11-12 21:02 | 1.72 KB | 76129f60960:kunden | -xw-x----- | |
| admin_leftboxes.php | 2013-11-12 21:02 | 1.74 KB | 76129f60960:kunden | -xw-x----- | |
| attribute_images.php | 2013-11-12 21:02 | 2.06 KB | 76129f60960:kunden | -xw-x----- | |
| attributes_calculator.php | 2013-11-12 21:02 | 4.75 KB | 76129f60960:kunden | -xw-x----- | |
| attributes_weight_calculator.php | 2013-11-12 21:02 | 1.56 KB | 76129f60960:kunden | -xw-x----- | |
| callback_service.php | 2013-11-12 21:02 | 2.03 KB | 76129f60960:kunden | -xw-x----- | |
| guestbook.php | 2013-11-12 21:02 | 7.63 KB | 76129f60960:kunden | -xw-x----- | |
| live_search.php | 2013-11-12 21:02 | 3.58 KB | 76129f60960:kunden | -xw-x----- | |
| mega_flyover.php | 2013-11-12 21:02 | 1.66 KB | 76129f60960:kunden | -xw-x----- | |
| order_quantity_checker.php | 2013-11-12 21:02 | 1.52 KB | 76129f60960:kunden | -xw-x----- | |
| product_images.php | 2013-11-12 21:02 | 3.82 KB | 76129f60960:kunden | -xw-x----- | |
| products_images_popup.php | 2013-11-12 21:02 | 3.16 KB | 76129f60960:kunden | -xw-x----- | |
| tell_a_friend.php | 2013-11-12 21:02 | 577 B | 76129f60960:kunden | -xw-x----- | |