";
CloseTable();
include("footer.php");
}
function cartOrderStatusClassAdd(){
global $prefix, $db, $admin_file;
include("header.php");
cartadminMenu();
OpenTable();
echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_ADD."
";
CloseTable();
echo " ";
OpenTable();
echo "";
CloseTable();
include("footer.php");
}
function cartOrderStatusClassInsert($statusType, $statusLabel, $statusInfo){
global $prefix, $db, $admin_file;
$db->sql_query("INSERT INTO ".$prefix."_cart_orders_status VALUES (NULL, '$statusType', '$statusLabel', '$statusInfo', '0')");
header("Location: ".$admin_file.".php?op=CartOrderStatusClassList");
}
function cartOrderStatusClassEdit($statusID){
global $prefix, $db, $admin_file;
$statusresult = $db->sql_query("select statusLabel, statusInfo from ".$prefix."_cart_orders_status where statusID='$statusID'");
list($statusLabel, $statusInfo) = $db->sql_fetchrow($statusresult);
include("header.php");
cartadminMenu();
OpenTable();
echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_EDIT."
";
CloseTable();
echo " ";
OpenTable();
echo "";
CloseTable();
include("footer.php");
}
function cartOrderStatusClassUpdate($statusID, $statusLabel, $statusInfo){
global $prefix, $db, $admin_file;
$db->sql_query("UPDATE ".$prefix."_cart_orders_status SET statusLabel='$statusLabel', statusInfo='$statusInfo' WHERE statusID='$statusID'");
header("Location: ".$admin_file.".php?op=CartOrderStatusClassList");
}
function cartOrderStatusClassRemove($statusID){
global $prefix, $db, $admin_file;
$statusresult = $db->sql_query("select statusLabel, statusInfo, statusType from ".$prefix."_cart_orders_status where statusID='$statusID'");
list($statusLabel, $statusInfo, $statusType) = $db->sql_fetchrow($statusresult);
include("header.php");
cartadminMenu();
OpenTable();
echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_DELETE."
";
CloseTable();
echo " ";
OpenTable();
echo "";
CloseTable();
include("footer.php");
}
function cartOrderStatusClassDelete($statusID, $statusSwapID){
global $prefix, $db, $admin_file;
$statusresult = $db->sql_query("select statusType from ".$prefix."_cart_orders_status where statusID='$statusID'");
list($statusType) = $db->sql_fetchrow($statusresult);
$db->sql_query("DELETE FROM ".$prefix."_cart_orders_status WHERE statusID='$statusID'");
if($statusType == 1){
$db->sql_query("UPDATE ".$prefix."_cart_orders SET orderStatus='$statusSwapID' where orderStatus='$statusID'");
} else {
$db->sql_query("UPDATE ".$prefix."_cart_orders SET orderSubStatus='$statusSwapID' where orderStatus='$statusID'");
}
header("Location: ".$admin_file.".php?op=CartOrderStatusClassList");
}
function cartOrderStatusClassDefault($status_id_1, $status_id_2){
global $prefix, $db, $admin_file;
$db->sql_query("UPDATE ".$prefix."_cart_orders_status SET status_default=1 WHERE statusID = '$status_id_1' AND statusType=1");
$db->sql_query("UPDATE ".$prefix."_cart_orders_status SET status_default=0 WHERE statusID != '$status_id_1' AND statusType=1");
$db->sql_query("UPDATE ".$prefix."_cart_orders_status SET status_default=1 WHERE statusID = '$status_id_2' AND statusType=2");
$db->sql_query("UPDATE ".$prefix."_cart_orders_status SET status_default=0 WHERE statusID != '$status_id_2' AND statusType=2");
header("Location: ".$admin_file.".php?op=CartOrderStatusClassList");
}
##############
# Cases
##############
switch ($op) {
case "CartOrderStatusClassList":
cartOrderStatusClassList();
break;
case "CartOrderStatusClassAdd":
cartOrderStatusClassAdd();
break;
case "CartOrderStatusClassInsert":
cartOrderStatusClassInsert($statusType, $statusLabel, $statusInfo);
break;
case "CartOrderStatusClassEdit":
cartOrderStatusClassEdit($statusID);
break;
case "CartOrderStatusClassUpdate":
cartOrderStatusClassUpdate($statusID, $statusLabel, $statusInfo);
break;
case "CartOrderStatusClassRemove":
cartOrderStatusClassRemove($statusID);
break;
case "CartOrderStatusClassDelete":
cartOrderStatusClassDelete($statusID, $statusSwapID);
break;
case "CartOrderStatusClassDefault":
cartOrderStatusClassDefault($status_id_1, $status_id_2);
break;
}
} else {
include("header.php");
GraphicAdmin();
OpenTable();
echo "
"._ERROR."
You do not have administration permission for the Emporium module