assign("gc_array", $gc_array); } elseif ($mode == "gc2cart") { $fill_error = (empty($purchaser) || empty($recipient)); $amount_error = (($config["Modules"]["min_gc_amount"] && $amount<$config["Modules"]["min_gc_amount"]) || ($config["Modules"]["max_gc_amount"] && $amount>$config["Modules"]["max_gc_amount"])); # # Add GC to cart # if ($send_via == "E") { # # Send via Email # $fill_error = ($fill_error || empty($recipient_email)); $giftcert = array ("purchaser" => stripslashes($purchaser), "recipient" => stripslashes($recipient), "message" => stripslashes($message), "amount" => $amount, "send_via" => $send_via, "recipient_email" => $recipient_email); } else { # # Send via Postal Mail # $fill_error = ($fill_error || empty($recipient_firstname) || empty($recipient_lastname) || empty($recipient_address) || empty($recipient_city) || empty($recipient_zipcode) || empty($recipient_state) || empty($recipient_country)); $giftcert = array ("purchaser" => stripslashes($purchaser), "recipient" => stripslashes($recipient), "message" => stripslashes($message), "amount" => $amount, "send_via" => $send_via, "recipient_firstname" => stripslashes($recipient_firstname), "recipient_lastname" => stripslashes($recipient_lastname), "recipient_address" => stripslashes($recipient_address), "recipient_city" => stripslashes($recipient_city), "recipient_zipcode" => $recipient_zipcode, "recipient_state" => $recipient_state, "recipient_country" => $recipient_country, "recipient_phone" => $recipient_phone); } # # If gcindex is empty - add # overwise - update # if (!$fill_error && !$amount_error) { if ($gcindex!="") $cart["giftcerts"][$gcindex] = $giftcert; else $cart["giftcerts"][] = $giftcert; func_header_location("cart.php"); } // else // func_header_location("giftcert.php".(isset($gcindex)?"?gcindex=$gcindex":"")); } elseif($mode == "delgc") { # # Remove GC from cart # array_splice($cart["giftcerts"],$gcindex,1); func_header_location("cart.php"); } require "../include/categories.php"; require "../include/countries.php"; require "../include/states.php"; if (!$fill_error && !$amount_error) $smarty->assign("giftcert",$cart["giftcerts"]["$gcindex"]); else { $smarty->assign("giftcert",$giftcert); $smarty->assign("fill_error",$fill_error); $smarty->assign("amount_error",$amount_error); } if ($login) $smarty->assign("userinfo", func_userinfo($login, "C")); $smarty->assign("min_gc_amount", $config["Modules"]["min_gc_amount"]); $smarty->assign("max_gc_amount", $config["Modules"]["max_gc_amount"]); x_session_save(); $smarty->assign("main","giftcert"); $smarty->display("customer/home.tpl"); ?>