getUserEmail($be->getCurrentUser()); include("iCart/Cart.class"); include("iCart/CartItem.class"); include("iCart/CartProduct.class"); include("iCart/CartUI.class"); html_header(); if ($addform=="Add to iCart" || $addform=="add" || $addform=="Add to PurchaseCart") { //echo "checker" . $check . " actions " . $action; //echo "selection0 " . $selection[0]; //echo "
Selection1 " . $selection[1]; //echo "
count " . count($selection); $sel = array(); for ($o=0; $o < count($selection); $o++) { $pieces = explode (",", $selection[$o]); $productID = $pieces[0]; $pageID = $pieces[1]; $pageType = $pieces[2]; $companyID = $pieces[3]; $categoryLevel = $pieces[4]; $db = new DB_Plastics(); $data = "$companyID::$productID"; $query = "select * from ECCarts where Data='$data' and CartID='$cartID'"; $db->query($query); if (!$db->next_record()) { $sn = snGenerate("", $lang); $query = "INSERT INTO ECCarts (SN, CartID, Date, Type, Data) VALUES ('$sn', '$cartID', NOW(), 'CartProduct', '$data')"; $db->query($query); $message = "The selected product(s) have been added to the PurchaseCart. Back to iCatalog."; } else { $sn = $db->f("SN"); $message = "The selected product(s) have previously been added to the PurchaseCart. Back to iCatalog."; }; $sel[] = $sn; } }; if($executeRequest != "") { // this is aliases $execute2action = array( "rfi" => "inquiry", "rfs" => "sample", "rfq" => "quote" ); if(strlen($executeRequest) == 3) // expanding request type $executeRequest = $execute2action[$executeRequest]; $set_selection = 1; $selection = $sel; $naked = ""; $action = $executeRequest; $select = "selected"; // after this, code get pars to execute request through iCart }; // initializing cart $post = 0; $cart = new Cart(); $ui = new CartUI(); // executing cart action $cart->action($action, $expand, $select, $more); // executing user interface action $ui->action($action, $expand, $select, $more); // rendering cart if($showcart != "0") { $cart->show(); $ui->show(); } // post-executing action if($post) $cart->action($action, $expand, $select, $more); // opening post pars window if($terence_comment) { include("etc/debug.phtml"); openPostWindow(); }; html_finish(); ?>