function regRegisterAdminSlave($admin_login, $admin_pass, $actions = array()) { $actions[] = 100; $actions = xEscSQL(serialize($actions)); // $q_count = db_query( "select COUNT(*) FROM ".CUSTOMERS_TABLE." WHERE Login='******'" ); // $count = db_fetch_row( $q_count ); // $count = $count[0]; db_query("delete from " . CUSTOMERS_TABLE . " where Login='******'"); if (CONF_DEFAULT_CUSTOMER_GROUP == '0') { $custgroupID = "NULL"; } else { $custgroupID = CONF_DEFAULT_CUSTOMER_GROUP; } $admin_pass = cryptPasswordCrypt($admin_pass, null); $currencyID = CONF_DEFAULT_CURRENCY; db_query("insert into " . CUSTOMERS_TABLE . " (Login, cust_password, Email, first_name, last_name, subscribed4news, " . " custgroupID, addressID, reg_datetime, CID, actions ) values " . "('" . xToText($admin_login) . "','" . xEscSQL($admin_pass) . "', " . " '-', '-', '-', 0, " . (int) $custgroupID . ", NULL, " . " '" . xEscSQL(get_current_time()) . "', " . (int) $currencyID . ", '" . $actions . "')"); $errorCode = 0; $zoneID = "50"; $state = ""; $countryID = "1"; $defaultAddressID = regAddAddress("-", "-", $countryID, $zoneID, $state, "-", "-", $admin_login, $errorCode); regSetDefaultAddressIDByLogin($admin_login, $defaultAddressID); return true; }
} } if (!isset($error)) { $cust_password = $cust_password1; $registerResult = regRegisterCustomer($login, $cust_password, $Email, $first_name, $last_name, $subscribed4news, $additional_field_values, $affiliationLogin); if ($registerResult) { if (isset($order)) { $addressID = regAddAddress($receiver_first_name, $receiver_last_name, $countryID, $zoneID, $state, $city, $address, $login, $errorCode); $billingAddressID = $addressID; if (!isset($_POST["billing_address_check"])) { $billingAddressID = regAddAddress($payer_first_name, $payer_last_name, $billingCountryID, $billingZoneID, $billingState, $billingCity, $billingAddress, $login, $errorCode); } regSetDefaultAddressIDByLogin($login, $addressID); } else { $addressID = regAddAddress($first_name, $last_name, $countryID, $zoneID, $state, $city, $address, $login, $errorCode); regSetDefaultAddressIDByLogin($login, $addressID); } regEmailNotification($smarty_mail, $login, $cust_password, $Email, $first_name, $last_name, $subscribed4news, $additional_field_values, $countryID, $zoneID, $state, $city, $address, 0); if (!CONF_ENABLE_REGCONFIRMATION) { regAuthenticate($login, $cust_password); } $RedirectURL = ''; if (isset($order)) { if (isset($billingAddressID)) { $RedirectURL = "index.php?order2_shipping=yes&shippingAddressID=" . regGetDefaultAddressIDByLogin($login) . "&defaultBillingAddressID=" . $billingAddressID; } else { $RedirectURL = "index.php?order2_shipping=yes&shippingAddressID=" . regGetDefaultAddressIDByLogin($login); } } elseif (isset($order_without_billing_address)) { $RedirectURL = "index.php?order2_shipping=yes&shippingAddressID=" . regGetDefaultAddressIDByLogin($login); } else {
<?php if (isset($address_book) && isset($_SESSION["log"])) { if (isset($_GET["delete"])) { $aID = (int) $_GET["delete"]; if (regGetAddressByLogin($aID, $_SESSION["log"])) { redDeleteAddress($aID); } } if (isset($_POST["save"])) { $aID = (int) $_POST["DefaultAddress"]; if (regGetAddressByLogin($aID, $_SESSION["log"])) { regSetDefaultAddressIDByLogin($_SESSION["log"], $aID); } } $addresses = regGetAllAddressesByLogin($_SESSION["log"]); for ($i = 0; $i < count($addresses); $i++) { $addresses[$i]["addressStr"] = regGetAddressStr($addresses[$i]["addressID"]); } $defaultAddressID = regGetDefaultAddressIDByLogin($_SESSION["log"]); $smarty->assign("defaultAddressID", $defaultAddressID); $smarty->assign("addresses", $addresses); $smarty->assign("main_content_template", "address_book.tpl"); }