sql_fetchrow($db->sql_query("SELECT title, admins FROM ".$prefix."_modules WHERE title='Shopping_Cart'")); $row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM ".$prefix."_authors WHERE aid='$aid'")); $admins = explode(",", $row['admins']); $auth_user = 0; for ($i=0; $i < sizeof($admins); $i++) { if ($row2['name'] == "$admins[$i]" AND $row['admins'] != "") { $auth_user = 1; } } if ($row2['radminsuper'] == 1 || $auth_user == 1) { $shipoptdir = "modules/Shopping_Cart/admin/shipping/"; include("modules/Shopping_Cart/admin/includes/functions.php"); ##################################### # Order Status Manager ##################################### function cartOrderStatusClassList(){ global $prefix, $db, $bgcolor2, $admin_file; include("header.php"); cartadminMenu(); OpenTable(); echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_ORDERSTATUSLIST."
"; CloseTable(); echo "
"; OpenTable(); echo ""; echo ""; echo ""; echo ""; echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSOPTIONS."
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_ADD."
"._EMPORIUM_ADMIN_PRODUCTAVAIL_DEFAULTAVAIL.": "; echo " "; echo "
"; CloseTable(); echo "
"; OpenTable(); echo ""; echo ""; $statusresult = $db->sql_query("select statusID, statusLabel, status_default from ".$prefix."_cart_orders_status where statusType='1' order by statusLabel"); $numrows = $db->sql_numrows($statusresult); if($numrows != 0){ while (list($statusID, $statusLabel, $status_default) = $db->sql_fetchrow($statusresult)) { if($status_default == '1'){ $bgcolor = "bgcolor=\"$bgcolor2\""; } else { $bgcolor = ''; } echo ""; echo ""; echo ""; echo ""; echo ""; } } else { echo ""; echo ""; echo ""; } echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSLIST.""._EMPORIUM_ADMIN_FUNCTIONS."
$statusLabel[ "._EMPORIUM_ADMIN_EDIT." | "._EMPORIUM_ADMIN_DELETE." ]
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_NOSTATUS."
"; echo "
"; echo ""; echo ""; $statusresult = $db->sql_query("select statusID, statusLabel, status_default from ".$prefix."_cart_orders_status where statusType='2' order by statusLabel"); $numrows = $db->sql_numrows($statusresult); if($numrows != 0){ while (list($statusID, $statusLabel, $status_default) = $db->sql_fetchrow($statusresult)) { if($status_default == '1'){ $bgcolor = "bgcolor=\"$bgcolor2\""; } else { $bgcolor = ''; } echo ""; echo ""; echo ""; echo ""; echo ""; } } else { echo ""; echo ""; echo ""; } echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_SUBSTATUSLIST.""._EMPORIUM_ADMIN_FUNCTIONS."
$statusLabel[ "._EMPORIUM_ADMIN_EDIT." | "._EMPORIUM_ADMIN_DELETE." ]
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_NOSTATUS."
"; 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 "
" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_ADD."

" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSTYPE.":
" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSLABEL.":
" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSINFO.":

" ."
" ."
"; 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 "
" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_EDIT."

" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSLABEL.":
" .""._EMPORIUM_ADMIN_ORDERS_OSTATUS_STATUSINFO.":

" ."
" ."
"; 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 "
"; echo "
"._EMPORIUM_ADMIN_ORDERS_OSTATUS_SWAPSTATUS."

"; echo "$statusLabel -> "; echo ""; 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
"; CloseTable(); include("footer.php"); } ?>