".$show_products); } else { $navigation = $lang_cat[$settings[mainpage]]; $action = "category"; $id = $settings[mainpage]; $main_content = showitems($settings[mainpage], 0, ""); } start(); } elseif ($action == "affiliates") { $show_categories = showcategories (); $navigation = "Affiliate Area"; $acheck = acheck(); $state_list = getlist ("type='2' OR type='3' OR type='4'", trim($signup[bstate])); $countries_list = getlist ("type='1'", trim($signup[bcountry])); $state_list2 = getlist ("type='2' OR type='3' OR type='4'", trim($signup[state])); $countries_list2 = getlist ("type='1'", trim($signup[country])); if ($area == "afflogin") { $result = aauthenticate ($login, $password); if ($result == "valid") { $date = date("m/d/y h:ia"); $DB_site->query("UPDATE ".$dbprefix."affiliates set lastvisit='$date' where affiliateid='$login'"); header("location: $settings[shopurl]index.php?action=affiliates"); exit; } else { header("location: $settings[shopurl]index.php?action=affiliates&area=login&invalid=1"); exit; } } elseif ($area == "logout") { $_SESSION['AUSERIN'] = ""; $_SESSION['APASSIN'] = ""; header("location: $settings[shopurl]"); exit; } elseif (($area == "account" || $area == "") && $acheck == "") { $main_content = affiliate_area(); } elseif ($area == "signup") { eval("\$main_content = \"".$templates[affiliate_form]."\";"); } elseif ($area == "submit") { $result = storenewaff(); if ($result[error] == 1) { $required = "*"; eval("\$error_display = \"".$templates[error_display]."\";"); eval("\$form = \"".$templates[affiliate_form]."\";"); $main_content = stripslashes($error_display."
".$form); } else { $lang_adduser[screen_message] = $lang_aff[screen_message]; eval("\$main_content = \"".$templates[signup_successful]."\";"); } } elseif ($area == "") { eval("\$main_content = \"".$templates[affiliate_welcome]."\";"); } else { $main_content = $acheck; } start(); } elseif ($action == "tracking") { showtracking(); } elseif ($action == "checkout") { if (islogged() != "Yes") { $navigation = $lang_los[los]; $show_categories = showcategories (); $redirect = "checkout"; eval("\$templates[login_box] = \"".$templates[login_box]."\";"); $goback = "checkout"; $signupform = userform(); eval("\$login_signup = \"".$templates[login_signup]."\";"); $main_content = stripslashes($login_signup); start(); } else { if ($cart[total_items] < 1) { header("location: $settings[shopurl]index.php?action=viewcart&error=empty"); exit; } $navigation = "Order Confirmation"; $show_categories = showcategories(""); $main_content = revieworder(); start(); } } elseif ($action == "register") { $show_categories = showcategories (""); $result = storenew(); if ($result[error] == 1) { $signupform = userform("", 3); eval("\$error_display = \"".$templates[error_display]."\";"); $main_content = stripslashes($error_display."
".$signupform); } else { eval("\$lang_adduser[screen_message] = \"".addslashes($lang_adduser[screen_message])."\";"); eval("\$main_content = \"".$templates[signup_successful]."\";"); } start(); } elseif ($action == "updateaccount") { $show_categories = showcategories (""); $result = updateaccount(); $userinfo = getuser (); if ($result[error] == 1) { $signupform = userform($userinfo[userid], 3); eval("\$error_display = \"".$templates[error_display]."\";"); $main_content = stripslashes($error_display."
".$signupform); start(); } else { header("location: $settings[shopurl]index.php?action=account&done=2"); exit; } } elseif ($action == "updatepassword") { $show_categories = showcategories (""); $result = updateaccount(2); $userinfo = getuser (); if ($result[error] == 1) { eval("\$displaypage = \"".$templates[password_change]."\";"); eval("\$error_display = \"".$templates[error_display]."\";"); $main_content = stripslashes($error_display."
".$displaypage); start(); } else { header("location: $settings[shopurl]index.php?action=account"); exit; } } elseif ($action == "addtocart") { additem($item, $quantity, $option, $fields, $fnames); if ($settings[addtocart] == "goback") { if ($subid != "" && $subid != "0") { $add = "&subid=$subid"; } header("location: $settings[shopurl]index.php?action=$prevaction&id=$previd&start=$prevstart".$add); exit; } else { $navigation = "View Cart"; $show_categories = showcategories(); $main_content = showcart(); start(); } } elseif ($action == "addtowishlist") { addwishlist($item); header("location: $settings[shopurl]index.php?action=item&id=$item"); exit; } elseif ($action == "updateorder") { if (islogged() == "Yes") { $DB_site->query("UPDATE ".$dbprefix."transaction set ucomments='".sf($ucomments)."' where userid='$userinfo[userid]' AND orderid='$orderid'"); header("location: $settings[shopurl]index.php?action=account&display=order&orderid=$orderid#status"); exit; } header("location: $settings[shopurl]index.php?action=account"); exit; } elseif ($action == "reviewform") { $navigation = "Add Review"; $show_categories = showcategories(); $item = iteminfo($itemid); eval("\$main_content .= \"".$templates[product_review_form]."\";"); start(); } elseif ($action == "addreview") { addreview($itemid); header("location: $settings[shopurl]index.php?action=item&id=$itemid&entered=1"); exit; } elseif ($action == "removefromwishlist") { remwishlist($item); header("location: $settings[shopurl]index.php?action=account&display=wishlist"); exit; } elseif ($action == "updatewishlist") { updatewishlist($itemid, $private); header("location: $settings[shopurl]index.php?action=account&display=wishlist"); exit; } elseif ($action == "viewcart") { $navigation = $lang_icons[cart]; $show_categories = showcategories(""); $main_content = showcart(); start(); } elseif ($action == "category") { $catinfo = catinfo ($id); $subcatinfo = catinfo ($subid, "sub"); if ($start == "") { $start = 0; } $show_categories = showcategories ($id); if ($subid == "" || $subid == "0") { $navigation = $catinfo[title]; $temp=$DB_site->query("SELECT * FROM ".$dbprefix."subcategory where categoryid='$id'"); $rows=$DB_site->num_rows($temp); if ($rows > 0) { $main_content = showsubcategories($id); $num = secondarylist("featured", "", "count"); if ($num > 0 && $start=="0") { $main_content .= "
".secondarylist("featured"); } $main_content .= "
".showitems($id, $start, $subid); } else { $main_content = showsubcategories($id, $subid); $main_content .= showitems($id, $start); } } else { $subs_arr = array(); cookiecrumb($subid); $prevcategory = crumbnav($subs_arr, $id); $navigation .= " ".$prevcategory; $temp=$DB_site->query("SELECT * FROM ".$dbprefix."subcategory where sub_of='$subid'"); $rows=$DB_site->num_rows($temp); if ($rows > 0) { $main_content = showsubcategories($id, $subid); $num = secondarylist("featured", "", "count"); if ($num > 0 && $start=="0") { $main_content .= "
".secondarylist("featured"); } $main_content .= "
".showitems($id, $start, $subid); } else { $main_content = showsubcategories($id, $subid); $main_content .= showitems($id, $start, $subid); } } start(); } elseif ($action == "vieworder") { $show_categories = showcategories (); $main_content = vieworder($id); start(); } elseif ($action == "userwishlist") { $navigation = $lang_index[uwish]; $show_categories = showcategories (); $wishlist_items = wishlistitems(2, $id); $userinfo=$DB_site->query_first("SELECT * FROM ".$dbprefix."user where userid='$id'"); eval("\$main_content .= \"".$templates[wishlist_userview]."\";"); start(); } elseif ($action == "updateorder") { $DB_site->query("UPDATE ".$dbprefix."transaction set ucomments='".addslashes($ucomments)."' where orderid='$id' AND userid='$userinfo[userid]' LIMIT 1"); header("location: $settings[siteurl]index.php?action=account"); exit; } elseif ($action == "sendtofriend") { $navigation = $lang_index[wltofriend]; $show_categories = showcategories (); $main_content = sendtofriend($wishlist); start(); } elseif ($action == "mailtofriend") { // sendemail($type); if ($type == "wishlist") { sendemail($type); header("location: $settings[siteurl]index.php?action=account&display=wishlist&sent=1"); } else { // header("location: $settings[siteurl]index.php?action=item&id=$tofriend[itemid]&sent=1"); echo "Sorry, this function has been disabled for security purposes."; echo "

Please click here to go back to the previous page. . ."; } exit; } elseif ($action == "login") { $result = authenticate ($login, $password); if ($result == "valid") { $date = date("m/d/y h:ia"); $DB_site->query("UPDATE ".$dbprefix."user set lastvisit='$date' where username='$login'"); if ($redirect != "") { if ($redirect2 != "") { $add = "&display=$redirect2"; } header("location: $settings[shopurl]index.php?action=$redirect".$add); } else { header("location: $settings[shopurl]index.php"); } exit; } else { header("location: $settings[shopurl]index.php?action=account&invalid=1"); exit; } } elseif ($action == "logout") { session_unset(); session_destroy(); header("location: $settings[shopurl]index.php"); exit; } elseif ($action == "advsearch") { $navigation = $lang_header[advsearch]; $show_categories = showcategories (); $main_content = advsearch(); start(); } elseif ($action == "pricelist") { pricelist(); exit; } elseif ($action == "search") { $search = strip_tags($search); $pmin = strip_tags($pmin); $pmax = strip_tags($pmax); $message = $lang_index[sresults].": \"".$search."\""; $show_categories = showcategories (); $main_content = search($search, $in); start(); } elseif ($action == "help") { $navigation = $lang_index[help]; $show_categories = showcategories (); $main_content = showfaqhelp(); start(); } elseif ($action == "getpassword") { $navigation = $lang_index[pret]; $show_categories = showcategories(); eval("\$main_content = \"".$templates[forgot_password]."
\";"); start(); } elseif ($action == "sendpassword") { $status = sendemail($retrieve[email], $type); header("location: $settings[siteurl]index.php?action=account&status=$status"); exit; } elseif ($action == "account") { $show_categories = showcategories (); if (islogged() == "Yes") { $navigation = $lang_account[aarea]; $main_content = displayaccount(); } else { $navigation = $lang_los[los]; $redirect = "account"; $redirect2 = $display; if ($invalid == 1) { $result[message] = $lang_login[invalid]; } if ($status == "notfound") { $result[message] = $lang_login[notfound]; } if ($status == "sent") { $result[message] = $lang_login[sent]; } if ($result[message] != "") { eval("\$error = \"".$templates[error_display]."
\";"); } eval("\$templates[login_box] = \"".$templates[login_box]."\";"); $goback = "account"; $signupform = userform("", 1); eval("\$login_signup = \"".$templates[login_signup]."\";"); $main_content = stripslashes($error.$login_signup); } start(); } elseif ($action == "editshippingaddress") { $show_categories = showcategories (); $navigation = "Edit Shipping Address"; if (islogged() == "Yes") { $goback = "checkout"; $main_content = userform($userinfo[userid], 2); } else { header("location: $settings[shopurl]index.php"); exit; } start(); } elseif ($action == "item") { $iteminfo = iteminfo($id); $navigation = $lang_index[vitem]." » ".shortenit($iteminfo[title],40); $cat = getcategory($id); $catid = $cat[1]; $subcatid = $cat[2]; $show_categories = showcategories ($cat[1]); $main_content = listitem($id); start(); } elseif ($action == "verify") { verify(); exit; } else { $show_categories = showcategories (); if ($templates[$action] != "") { if ($action == "submit_contact") { while (list($key, $val) = each($contact)) { $email_body .= ucwords(strip_tags(str_replace("_"," ",$key))).": ".strip_tags($val)."\n"; } $email_body .= "\nTime Stamp: ".date('m/d/Y h:ia',strtotime('now')); mail_send ($settings[contactemail], $settings[contactemail], "New Contact Request: ".$contact[subject]."", $email_body, $settings[contactemail], $settings[title]); } $navigation = ucwords(str_replace("_"," ",$action)); eval("\$main_content = \"".$templates[$action]."\";"); } else { $navigation = $lang_index[not_found]; $main_content = $lang_index[not_mess]; } start(); } echo showend(); $DB_site->close(); ?>