public function HandleToDo($Do) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => 'index.php?ToDo=viewOrders'); switch (isc_strtolower($Do)) { case 'viewsales': default: if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { if (isset($_GET['searchQuery'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('SearchResults') => "index.php?ToDo=viewOrders"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders"); } if (GetSession('ordersearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('ordersearch'); $_REQUEST['searchId'] = GetSession('ordersearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customOrderSearch")); } } if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } if (GetSession('ordersearch') > 0) { $this->CustomSearch(); } else { UnsetSession('ordersearch'); $this->ManageOrders(); } if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } }
public function HandleToDo($Do) { switch (isc_strtolower($Do)) { case "deleteproductvariations": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang("ProductVariations") => "index.php?ToDo=viewProductVariations", GetLang('DeleteProductVariation') => "index.php?ToDo=deleteProductVariation"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteVariations(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editproductvariation2": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang("ProductVariations") => "index.php?ToDo=viewProductVariations", GetLang('EditProductVariation') => "index.php?ToDo=editProductVariation"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->EditVariationStep2(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editproductvariation": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang("ProductVariations") => "index.php?ToDo=viewProductVariations", GetLang('EditProductVariation') => "index.php?ToDo=editProductVariation"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->EditVariationStep1(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "addproductvariation2": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang("ProductVariations") => "index.php?ToDo=viewProductVariations", GetLang('AddProductVariation') => "index.php?ToDo=addProductVariation"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->AddVariationStep2(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "addproductvariationoption": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $this->AddVariationOptionStep1(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "addproductvariation": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang("ProductVariations") => "index.php?ToDo=viewProductVariations", GetLang('AddProductVariation') => "index.php?ToDo=addProductVariation"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->AddVariationStep1(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "viewproductvariations": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Variations)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('ProductVariations') => "index.php?ToDo=viewProductVariations"); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } $this->ViewVariations(); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "savebulkeditproducts": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Products) && gzte11(ISC_LARGEPRINT)) { if (isset($_POST['addanother'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('EditProduct') => "index.php?ToDo=editProduct"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->BulkEditProductsStep2(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "bulkeditproducts": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Products) && gzte11(ISC_LARGEPRINT)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('BulkEditProducts1') => "index.php?ToDo=bulkEditProducts"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->BulkEditProductsStep1(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "createproductview": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('CreateProductView') => "index.php?ToDo=createProductView"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CreateView(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "importproducts": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Import_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('ImportProducts') => "index.php?ToDo=importProducts"); $this->ImportProducts(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editproduct2": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Products)) { if (isset($_POST['addanother'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('EditProduct') => "index.php?ToDo=editProduct"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->EditProductStep2(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editproduct": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('EditProduct') => "index.php?ToDo=editProduct"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->EditProductStep1(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editproductvisibility": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } $this->EditVisibility(); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editproductfeatured": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Edit_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } $this->EditFeatured(); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "deleteproducts": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Delete_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteProducts(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "addproduct2": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Create_Product)) { if (isset($_POST['addanother'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('AddProduct') => "index.php?ToDo=addProduct"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->AddProductStep2(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "addproduct": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Create_Product)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('AddProduct') => "index.php?ToDo=addProduct"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->AddProductStep1(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "deletecustomproductsearch": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteCustomSearch(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "customproductsearch": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('CustomView') => "index.php?ToDo=customProductSearch"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CustomSearch(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "searchproductsredirect": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('SearchResults') => "index.php?ToDo=searchProducts"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SearchProductsRedirect(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "searchproducts": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('SearchProducts') => "index.php?ToDo=searchProducts"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SearchProducts(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "popupproductselect": $this->PopupProductSelect(); break; case "deleteproductsearchresults": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Delete_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteSearchResults(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "copyproduct": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Create_Product)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('CopyProduct') => "index.php?ToDo=copyProduct"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CopyProductStep1(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "copyproduct2": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Create_Product)) { if (isset($_POST['addanother'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('CopyProduct') => "index.php?ToDo=addProduct"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CopyProductStep2(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; default: if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Products)) { if (isset($_GET['searchQuery'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts", GetLang('SearchResults') => "index.php?ToDo=viewProducts"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Products') => "index.php?ToDo=viewProducts"); } if (GetSession('productsearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('productsearch'); $_REQUEST['searchId'] = GetSession('productsearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customProductSearch")); } } if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } if (GetSession('productsearch') > 0) { $this->CustomSearch(); } else { UnsetSession('productsearch'); $this->ManageProducts(); } if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } }
function MultiFormLogic() { global $bMultiForm, $SPECIAL_VALUES, $aServerVars, $aFileVars; global $sFormMailScript, $bGotGoBack, $bGotNextForm, $iFormIndex; global $aFieldOrder, $aCleanedValues, $aRawDataValues, $aAllRawValues; if ($SPECIAL_VALUES["multi_start"] == 1) { if (empty($SPECIAL_VALUES["this_form"])) { ErrorWithIgnore("need_this_form", GetMessage(MSG_NEED_THIS_FORM), false, false); } $bMultiForm = true; // // Start of multi-page form sequence // $a_list = array(); $a_list[0] = array("URL" => $SPECIAL_VALUES["this_form"], "ORDER" => $aFieldOrder, "CLEAN" => $aCleanedValues, "RAWDATA" => $aRawDataValues, "ALLDATA" => $aAllRawValues, "FILES" => $aFileVars); $iFormIndex = 0; // zero is the first form, which was just submitted SetSession("FormList", $a_list); SetSession("FormIndex", $iFormIndex); // // this is a fresh session, so remove any remembered values // UnsetSession("FormSavedFiles"); UnsetSession("FormKeep"); } elseif (IsSetSession("FormList")) { $bMultiForm = true; } if ($bMultiForm) { if (isset($aServerVars["PHP_SELF"]) && !empty($aServerVars["PHP_SELF"]) && isset($aServerVars["SERVER_NAME"]) && !empty($aServerVars["SERVER_NAME"])) { if (isset($aServerVars["SERVER_PORT"]) && $aServerVars["SERVER_PORT"] != 80) { if ($aServerVars["SERVER_PORT"] == 443) { // SSL port // // just use https prefix // $sFormMailScript = "https://" . $aServerVars["SERVER_NAME"] . $aServerVars["PHP_SELF"]; } else { // // use http with port number // $sFormMailScript = "http://" . $aServerVars["SERVER_NAME"] . ":" . $aServerVars["SERVER_PORT"] . $aServerVars["PHP_SELF"]; } } else { $sFormMailScript = "http://" . $aServerVars["SERVER_NAME"] . $aServerVars["PHP_SELF"]; } $iFormIndex = GetSession("FormIndex"); } else { Error("no_php_self", GetMessage(MSG_NO_PHP_SELF), false, false); } } // // If we're going forward in a multi-page form sequence, // compute a URL to return to the form we're about to display. // if ($bMultiForm && !$bGotGoBack) { // // record the data that was just submitted by the previous form // $iFormIndex = GetSession("FormIndex"); $a_list = GetSession("FormList"); $a_list[$iFormIndex]["ORDER"] = $aFieldOrder; $a_list[$iFormIndex]["CLEAN"] = $aCleanedValues; $a_list[$iFormIndex]["RAWDATA"] = $aRawDataValues; $a_list[$iFormIndex]["ALLDATA"] = $aAllRawValues; if (count($aFileVars) > 0 && !FILEUPLOADS) { SendAlert(GetMessage(MSG_FILE_UPLOAD)); } elseif (count($aFileVars) > 0 && !SaveAllUploadedFiles($aFileVars)) { Error("upload_save_failed", GetMessage(MSG_MULTI_UPLOAD), false, false); } $a_list[$iFormIndex]["FILES"] = $aFileVars; $iFormIndex++; $s_url = GetReturnLink($sFormMailScript, $iFormIndex); $a_list[$iFormIndex] = array("URL" => $s_url, "FORM" => $SPECIAL_VALUES["next_form"], "ORDER" => $aFieldOrder, "CLEAN" => $aCleanedValues, "RAWDATA" => $aRawDataValues, "ALLDATA" => $aAllRawValues, "FILES" => $aFileVars); SetSession("FormList", $a_list); SetSession("FormIndex", $iFormIndex); MultiKeep(); } }
public function HandleToDo($Do) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => 'index.php?ToDo=viewOrders'); switch (isc_strtolower($Do)) { case 'saveneworder': $this->SaveNewOrder(); break; case 'saveupdatedorder': $this->SaveUpdatedOrder(); break; case "addorder": $this->AddOrder(); break; case 'editorder': $this->EditOrder(); break; case "createorderview": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'][GetLang('CreateOrderView')] = "index.php?ToDo=createOrderView"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CreateView(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "printmultiorderinvoices": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $this->PrintMultiInvoices(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "deletecustomordersearch": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteCustomSearch(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "customordersearch": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'][GetLang('CustomView')] = "index.php?ToDo=customOrderSearch"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CustomSearch(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "searchordersredirect": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'][GetLang('SearchResults')] = "index.php?ToDo=searchOrders"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SearchOrdersRedirect(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "searchorders": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'][GetLang('SearchResults')] = "index.php?ToDo=searchOrders"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SearchOrders(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "saveupdatedordermessage": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=saveUpdatedOrderMessage"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SavedUpdatedOrderMessage(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "editordermessage": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=viewOrderMessages&orderId=" . @(int) $_GET['orderId'], GetLang('EditMessage') => "index.php?ToDo=editOrderMessage"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->EditOrderMessage(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "savenewordermessage": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=saveUpdatedOrderMessage"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SaveNewOrderMessage(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "createordermessage": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=viewOrderMessages&orderId=" . @(int) $_GET['orderId'], GetLang('CreateMessage') => "index.php?ToDo=createOrderMessage"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CreateOrderMessage(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "deleteordermessages": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=saveUpdatedOrderMessage"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteOrderMessages(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "flagordermessage": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=viewOrderMessages"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->FlagOrderMessage(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "updateordermessagestatus": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=viewOrderMessages"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->UpdateOrderMessageStatus(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "viewordermessages": if (!gzte11(ISC_LARGEPRINT)) { exit; } if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Order_Messages)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ViewMessages') => "index.php?ToDo=viewOrderMessages"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->ViewOrderMessages(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "deleteorders": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Delete_Orders)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteOrders(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "printorderinvoice": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $this->PrintInvoice(); } else { echo "<script type=\"text/javascript\">window.close();</script>"; } break; case "importordertrackingnumbers": if (gzte11(ISC_MEDIUMPRINT)) { if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Import_Order_Tracking_Numbers)) { if (!gzte11(ISC_MEDIUMPRINT)) { exit; } $this->ImportTrackingNumbers(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } break; case "viewsingleorder": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $output = ISC_ADMIN_REMOTE::GetOrderQuickView(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); echo $output; } break; case "updatemultiorderstatus": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("pageheader.popup"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); $this->updateOrderStatusBox(); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("pagefooter.popup"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "refundorder": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->RefundOrder(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; /* Added for Save and Pay -- Baskaran */ /* Added for Save and Pay -- Baskaran */ case "payorder": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('PayOrder') => "index.php?ToDo=viewOrderMessages"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->payOrder(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "paymentorder": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('PayOrder') => "index.php?ToDo=viewOrderMessages"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->PaymentOrder(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; //Wirror_20110301: confirm the order //Wirror_20110301: confirm the order case "confirmorder": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('ConfirmOrder') => 'index.php?ToDo=confirmOrder'); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->ConfirmOrder(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; /* Baskaran */ /* Baskaran */ default: if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Orders)) { if (isset($_GET['searchQuery'])) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders", GetLang('SearchResults') => "index.php?ToDo=viewOrders"); } else { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Orders') => "index.php?ToDo=viewOrders"); } if (GetSession('ordersearch') > 0) { if (!isset($_GET['searchId'])) { $_GET['searchId'] = GetSession('ordersearch'); $_REQUEST['searchId'] = GetSession('ordersearch'); } if ($_GET['searchId'] > 0) { $GLOBALS['BreadcrumEntries'] = array_merge($GLOBALS['BreadcrumEntries'], array(GetLang('CustomView') => "index.php?ToDo=customOrderSearch")); } } if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } if (GetSession('ordersearch') > 0) { $this->CustomSearch(); } else { UnsetSession('ordersearch'); $this->ManageOrders(); } if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } }
protected function DeleteCustomSearch() { if($GLOBALS['ISC_CLASS_ADMIN_CUSTOMSEARCH']->DeleteSearch($_GET['searchId'])) { // remove the saved search from the session to default to All Orders UnsetSession('ordersearch'); // Log this action $GLOBALS['ISC_CLASS_LOG']->LogAdminAction($_GET['searchId']); $this->ManageOrders(GetLang('DeleteCustomSearchSuccess'), MSG_SUCCESS); } else { $this->ManageOrders(GetLang('DeleteCustomSearchFailed'), MSG_ERROR); } }