|
// | Support: http://www.modernsupport.com/modernbill/ |
// +----------------------------------------------------------------------+
// | ModernGigabyte and ModernBill are trademarks of ModernGigabyte, LLC. |
// +----------------------------------------------------------------------+
// | REQUIRED SECURITY LOGIC DO NOT MODIFY NEXT 2 LINES |
// +----------------------------------------------------------------------+
require("config.php");
if (function_exists('security_check_1')||!function_exists('scf')) { die("SF"); } scf('a496eb07a568d00c9328e865d0fffa81359afcbd');
// +----------------------------------------------------------------------+
// exit if config is missing
if (!is_array($_ORDER_CONFIG)) { exit; }
// setting some defaults
$order_totals = array();
$this_page = "orderwiz.php"; // do not change
$variable_type = "text";
$pass_variable_type = "password";
$radio_variable_type = "radio";
$checkbox_variable_type = "checkbox";
$stop = TRUE;
$orderwiz = TRUE;
$cart = $_GET; //removed session bug - Drak
$internal_order = FALSE;
// Reset order_completed session
$_SESSION['saved_order'] = array();
$_SESSION['order_completed'] = FALSE;
$_SESSION['call_in_progress'] = FALSE;
$_SESSION['fraud_action'] = '';
$_SESSION['vl_results'] = '';
$_SESSION['fg_results'] = '';
// Check for banned IPs
banned_ip_check($REMOTE_ADDR);
// SET AFFILIATE ID FROM URL
if (isset($aid) && $cart['affiliate']!=$aid) {
if ($debug) { echo "
-->SET AFFILIATE ID<--
"; }
$_sql = "SELECT count(aff_code) FROM affiliate_config WHERE aff_code='$aid'";
list($num) = adodb_one_data($_sql,'N');
if ($num==1) {
$cart['affiliate'] = $aid;
$_sql = "UPDATE affiliate_config SET aff_hits = aff_hits+1 WHERE aff_code='$aid'";
$_res = adodb_query($_sql);
}
}
// SET PASSED IN ADDON VARIABLE & VALUE
if (isset($vid) && isset($vvu)) {
$_SESSION['var_id'][$vid] = $vvu;
}
// Clean form input
include($DIR."include/misc/heart/validate_functions.inc.php");
// determine case to execute
if ( ($submit_package == 'domain') ||
($submit_package == 'package' && !empty($type3_package) && !empty($billing_cycle)) ) {
$op = NULL;
/*--------------------------------------
** VALIDATE COUPON
**-------------------------------------*/
if(isset($coupon_code))
{
if ($debug) echo "
-->VALIDATE COUPON<--
";
// Reset All Packages Add-Ons
$cart[coupons] = array();
list($coupon_id,
$coupon_code,
$coupon_percent_discount,
$coupon_dollar_discount,
$coupon_comments,
$coupon_status,
$coupon_start_stamp,
$coupon_end_stamp,
$coupon_expire_string,
$coupon_count,
$coupon_max_count,
$coupon_new_only,
$coupon_misc1,
$coupon_misc2) = validate_coupon($coupon_code,$v);
// Begin add by Cyberws - check for coupon match
// Check to see if any packages match coupon
// foreach($cart[packages] as $key => $value) {
// list($pack_id) = $value;
$id_array = explode(",",$coupon_misc2);
//Check for Domain only Discount
if ($allow_domain_discount && $coupon_misc2 ==1) { $couponmatch = 1;}
if (count($id_array)==0 || in_array($type3_package,$id_array)) {
$couponmatch = 1;
}
//}
// Check to see if any addons match coupon
// foreach($cart[addons] as $key => $value) {
// list($pack_id) = $value;
// if ($coupon_misc2 == $pack_id) {
// $couponmatch = 1;
// }
//}
//Check to see if any packages or addons matched coupon and that coupon is tied to a package
if ($couponmatch != 1 and $coupon_misc2 != "") {
$coupon_id = "";
}
// Reset coupon match variable for next coupon check
$couponmatch = 0;
//End add by Cyberws
if ($coupon_id)
{
if ( ( $coupon_start_stamp <= mktime(0,0,0,date("m"),date("d"),date("Y")) ) &&
( $coupon_end_stamp >= mktime(0,0,0,date("m"),date("d"),date("Y")) ) &&
( ( $coupon_max_count == 0 ) ||
( $coupon_count < $coupon_max_count ) ) )
{
$coupon_is_valid = TRUE;
$cart[coupons][] = array($coupon_id,
$coupon_code,
$coupon_percent_discount,
$coupon_dollar_discount,
$coupon_comments,
$coupon_status,
$coupon_start_stamp,
$coupon_end_stamp,
$coupon_expire_string,
$coupon_count,
$coupon_max_count,
$coupon_new_only,
$coupon_misc1,
$coupon_misc2);
}
else
{
$error_msg = $coupon_expire_string;
$coupon_is_valid = FALSE;
}
}
if ($debug) { echo "
COUPON: $coupon_id"; } $op = 'show_total'; if ($tax_enabled && $suppress_coupon && !$set_x_State && !$x_State && !$x_Country) { $op = NULL; } } } else { $op = NULL; } _order_html_start(); _order_start_box('