$customer_max_order = DEFAULT_MAX_ORDER;
 $customers_status = DEFAULT_CUSTOMERS_STATUS_ID;
 $time = mktime();
 $wishlist_link_id = '';
 for ($x = 3; $x < 10; $x++) {
     $wishlist_link_id .= substr($time, $x, 1) . oos_create_random_value(1, $type = 'chars');
 }
 $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_status' => $customers_status, 'customers_login' => 1, 'customers_max_order' => $customer_max_order, 'customers_password' => oos_encrypt_password($password), 'customers_wishlist_link_id' => $wishlist_link_id, 'customers_default_address_id' => 1);
 if (ACCOUNT_GENDER == '1') {
     $sql_data_array['customers_gender'] = $gender;
 }
 if (ACCOUNT_NUMBER == '1') {
     $sql_data_array['customers_number'] = $number;
 }
 if (ACCOUNT_DOB == '1') {
     $sql_data_array['customers_dob'] = oos_date_raw($dob);
 }
 if (ACCOUNT_VAT_ID == '1') {
     $sql_data_array['customers_vat_id'] = $vat_id;
     if (ACCOUNT_COMPANY_VAT_ID_CHECK == '1' && $vatid_check_error === false) {
         $sql_data_array['customers_vat_id_status'] = 1;
     } else {
         $sql_data_array['customers_vat_id_status'] = 0;
     }
 }
 oos_db_perform($oostable['customers'], $sql_data_array);
 $customer_id = $dbconn->Insert_ID();
 $sql_data_array = array('customers_id' => $customer_id, 'address_book_id' => 1, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country);
 if (ACCOUNT_GENDER == '1') {
     $sql_data_array['entry_gender'] = $gender;
 }
Example #2
0
        $customers_id = oos_db_prepare_input($_GET['cID']);
        $sql_data_array = array('customers_firstname' => $customers_firstname,
                                'customers_lastname' => $customers_lastname,
                                'customers_email_address' => $customers_email_address,
                                'customers_telephone' => $customers_telephone,
                                'customers_fax' => $customers_fax,
                                'customers_newsletter' => $customers_newsletter,
                                'customers_max_order' => $customers_max_order);

        if (ACCOUNT_GENDER == '1') $sql_data_array['customers_gender'] = $customers_gender;
        if (ACCOUNT_NUMBER == '1') $sql_data_array['customers_number'] = $customers_number;
        if (ACCOUNT_VAT_ID == '1') {
          $sql_data_array['customers_vat_id'] = $customers_vat_id;
          $sql_data_array['customers_vat_id_status'] = $customers_vat_id_status;
        }
        if (ACCOUNT_DOB == '1') $sql_data_array['customers_dob'] = oos_date_raw($customers_dob);

        oos_db_perform($oostable['customers'], $sql_data_array, 'update', "customers_id = '" . intval($customers_id) . "'");

        $customers_infotable = $oostable['customers_info'];
        $dbconn->Execute("UPDATE $customers_infotable SET customers_info_date_account_last_modified = '" . date("Y-m-d H:i:s", time()) . "' WHERE customers_info_id = '" . intval($customers_id) . "'");

        if ($entry_zone_id > 0) $entry_state = '';

        $sql_data_array = array('entry_firstname' => $customers_firstname,
                                'entry_lastname' => $customers_lastname,
                                'entry_street_address' => $entry_street_address,
                                'entry_postcode' => $entry_postcode,
                                'entry_city' => $entry_city,
                                'entry_country_id' => $entry_country_id);
                     $where_str .= "   (pd.products_name LIKE '%" . addslashes($search_keywords[$i]) . "%'\n                              OR p.products_model LIKE '%" . addslashes($search_keywords[$i]) . "%'\n                              OR p.products_ean LIKE '%" . addslashes($search_keywords[$i]) . "%'\n                              OR m.manufacturers_name LIKE '%" . addslashes($search_keywords[$i]) . "%'";
                     if (isset($_GET['search_in_description']) && $_GET['search_in_description'] == '1') {
                         $where_str .= " OR pd.products_description LIKE '%" . addslashes($search_keywords[$i]) . "%'";
                     }
                     $where_str .= ')';
                     break;
             }
         }
         $where_str .= " )";
     }
 }
 if (isset($_GET['dfrom']) && oos_is_not_null($_GET['dfrom']) && $_GET['dfrom'] != DOB_FORMAT_STRING) {
     $where_str .= " AND p.products_date_added >= '" . oos_date_raw($dfrom_to_check) . "'";
 }
 if (isset($_GET['dto']) && oos_is_not_null($_GET['dto']) && $_GET['dto'] != DOB_FORMAT_STRING) {
     $where_str .= " AND p.products_date_added <= '" . oos_date_raw($dto_to_check) . "'";
 }
 $rate = $oCurrencies->get_value($_SESSION['currency']);
 if ($rate) {
     $pfrom = oos_var_prep_for_os($_GET['pfrom'] / $rate);
     $pto = oos_var_prep_for_os($_GET['pto'] / $rate);
 }
 if ($_SESSION['member']->group['show_price_tax'] == 1) {
     if ($pfrom) {
         $where_str .= " AND (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . oos_db_input($pfrom) . ")";
     }
     if ($pto) {
         $where_str .= " AND (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . oos_db_input($pto) . ")";
     }
 } else {
     if ($pfrom) {