$t->set_vars($db->Record); $t->set_block("payment_info", $payment_info); $t->parse("payment_info", false); $t->global_parse("payment_info_block", false, false, true); } else { $t->set_var("payment_info_block", ""); } $current_date = va_time(); $cc_start_years = get_db_values("SELECT start_year AS year_value, start_year AS year_description FROM " . $table_prefix . "cc_start_years", array(array("", YEAR_MSG))); if (sizeof($cc_start_years) < 2) { $cc_start_years = array(array("", YEAR_MSG)); for ($y = 7; $y >= 0; $y--) { $cc_start_years[] = array($current_date[YEAR] - $y, $current_date[YEAR] - $y); } } $cc_expiry_years = get_db_values("SELECT expiry_year AS year_value, expiry_year AS year_description FROM " . $table_prefix . "cc_expiry_years", array(array("", YEAR_MSG))); if (sizeof($cc_expiry_years) < 2) { $cc_expiry_years = array(array("", YEAR_MSG)); for ($y = 0; $y <= 7; $y++) { $cc_expiry_years[] = array($current_date[YEAR] + $y, $current_date[YEAR] + $y); } } set_options($cc_start_years, $cc_start_year, "cc_start_year"); set_options($cc_expiry_years, $cc_expiry_year, "cc_expiry_year"); $cc_months = array_merge(array(array("", MONTH_MSG)), $months); set_options($cc_months, $cc_start_month, "cc_start_month"); set_options($cc_months, $cc_expiry_month, "cc_expiry_month"); $r->set_parameters(); $intro_text = trim($cc_info["intro_text"]); $intro_text = get_translation($intro_text); $intro_text = get_currency_message($intro_text, $currency);
$sql .= " ORDER BY site_id DESC "; $r->set_value($key, get_db_value($sql)); } // check data for categories columns $cc_eg->set_value("category_id", 0); $cc_eg->change_property("column_id", USE_IN_SELECT, true); $cc_eg->change_property("column_id", USE_IN_WHERE, false); $cc_eg->change_property("category_id", USE_IN_WHERE, true); $cc_eg->change_property("category_id", USE_IN_SELECT, true); $columns_number = $cc_eg->get_db_values(); } if ($columns_number == 0) { $columns_number = 5; } // set parameters $r->set_parameters(); $t->set_var("rp", htmlspecialchars($return_page)); // set categories columns $t->set_var("cc_number", $columns_number); $cc_eg->set_parameters_all($columns_number); // set styles for tabs $tabs = array("general" => array("title" => ADMIN_GENERAL_MSG), "tax" => array("title" => TAX_SETTINGS_MSG), "appearance" => array("title" => PROD_APPEARANCE_MSG), "merchants_affiliates" => array("title" => MERCHANTS_AFFILIATES_MSG), "points" => array("title" => POINTS_AND_CREDITS_MSG), "images" => array("title" => IMAGES_MSG), "google_base" => array("title" => GOOGLE_BASE_SETTINGS_MSG), "import_export" => array("title" => IMPORT_EXPORT_MSG), "fast_checkout" => array("title" => FAST_CHECKOUT_MSG), "table_view" => array("title" => TABLE_VIEW_MSG), "keywords" => array("title" => KEYWORDS_SEARCH_MSG)); parse_admin_tabs($tabs, $tab, 6); // multisites if ($sitelist) { $sites = get_db_values("SELECT site_id,site_name FROM " . $table_prefix . "sites ORDER BY site_id ", ""); set_options($sites, $param_site_id, "param_site_id"); $t->parse("sitelist", false); } include_once "./admin_footer.php"; $t->pparse("main");
$csv_delimiter = substr($default_columns, $start_delimiter + 13, $end_delimiter - $start_delimiter - 13); } if (strpos($default_columns, "related_delimiter")) { $start_delimiter = strpos($default_columns, "related_delimiter"); $end_delimiter = strpos($default_columns, "related_delimiter", $start_delimiter + 17); $related_delimiter = substr($default_columns, $start_delimiter + 17, $end_delimiter - $start_delimiter - 17); } set_options($delimiters, $csv_delimiter, "delimiter"); set_options($delimiters, $csv_delimiter, "delimiter_bottom"); set_options($related_delimiters, $related_delimiter, "related_delimiter"); set_options($related_delimiters, $related_delimiter, "related_delimiter_bottom"); $t->set_var("table_name", $table_name); $template_id = get_param("template_id"); $sql = " SELECT template_id, template_name FROM " . $table_prefix . "export_templates "; $sql .= " WHERE table_name=" . $db->tosql($table, TEXT); $export_templates = get_db_values($sql, array(array("", BASIC_EXPORT_MSG))); set_options($export_templates, $template_id, "template_id"); $total_columns = 0; $export_columns = array(); if ($template_id) { $sql = " SELECT field_title, field_source FROM " . $table_prefix . "export_fields "; $sql .= " WHERE template_id=" . $db->tosql($template_id, INTEGER); $sql .= " ORDER BY field_order "; $db->query($sql); while ($db->next_record()) { $column_title = $db->f("field_title"); $column_source = $db->f("field_source"); $export_columns[] = array("source" => $column_source, "title" => $column_title, "checked" => "checked"); } } else { foreach ($db_columns as $column_name => $column_info) {
$records_per_page = 1000; $total_pages = ceil($total_records / $records_per_page); $error = ''; if (!$total_records && $show_stats == 0) { echo NO_PRODUCTS_EXPORT_MSG; exit; } else { if (!$total_records && $show_stats == 1) { $error = NO_PRODUCTS_EXPORT_MSG . '<br />'; } } if (!$error) { //forming google types array $google_types_arr = array(); $tsql = 'SELECT * FROM ' . $table_prefix . 'google_base_types'; $tmp_arr = get_db_values($tsql, false); for ($i = 0; $i < count($tmp_arr); $i++) { $google_types_arr[$tmp_arr[$i][0]] = $tmp_arr[$i][1]; } //tmp data $xml_string = ''; //start buffering; ob_start(); // force download header data if (!$write_to_file && $show_stats == 0) { header("Pragma: private"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=" . $google_base_filename);
} elseif ($control_type == "RADIOBUTTON") { $r->add_radio($param_name, TEXT, "", $section_name . ": " . $param_title); } elseif ($control_type == "LISTBOX") { $r->add_select($param_name, TEXT, "", $section_name . ": " . $param_title); } else { $r->add_textbox($param_name, TEXT, $section_name . ": " . $param_title); } if ($control_type == "CHECKBOXLIST" || $control_type == "RADIOBUTTON" || $control_type == "LISTBOX") { if ($pp_row["options_values_sql"]) { $sql = $pp_row["options_values_sql"]; } else { $sql = " SELECT property_value_id, property_value FROM " . $table_prefix . "user_profile_values "; $sql .= " WHERE property_id=" . $db->tosql($pp_row["property_id"], INTEGER) . " AND hide_value=0"; $sql .= " ORDER BY property_value_id "; } $r->change_property($param_name, VALUES_LIST, get_db_values($sql, "")); } if ($pp_row["required"] == 1) { $r->change_property($param_name, REQUIRED, true); } if ($pp_row["validation_regexp"]) { $r->change_property($param_name, REGEXP_MASK, $pp_row["validation_regexp"]); if ($pp_row["regexp_error"]) { $r->change_property($param_name, REGEXP_ERROR, $pp_row["regexp_error"]); } } $r->change_property($param_name, USE_IN_SELECT, false); $r->change_property($param_name, USE_IN_INSERT, false); $r->change_property($param_name, USE_IN_UPDATE, false); } }
$fast_checkout_postcode_show = get_setting_value($vars, "fast_checkout_postcode_show", 0); $fast_checkout_postcode_required = get_setting_value($vars, "fast_checkout_postcode_required", 0); $user_id = get_session("session_user_id"); if ($fast_checkout_country_show) { $countries = get_db_values("SELECT country_id,country_name FROM " . $table_prefix . "countries WHERE show_for_user=1 ORDER BY country_order, country_name ", array(array("", SELECT_COUNTRY_MSG))); set_options($countries, $user_details["country_id"], "fast_checkout_country_id"); if ($fast_checkout_country_required == 1) { $t->set_var("country_required", "*"); } $t->parse("fast_checkout_country_select", false); } else { $t->set_var("fast_checkout_country_id_value", htmlspecialchars($user_details["country_id"])); $t->parse("fast_checkout_country_hidden", false); } if ($fast_checkout_state_show) { $states = get_db_values("SELECT state_id,state_name FROM " . $table_prefix . "states WHERE show_for_user=1 ORDER BY state_name ", array(array("", SELECT_STATE_MSG))); set_options($states, $user_details["state_id"], "fast_checkout_state_id"); if ($fast_checkout_state_required == 1) { $t->set_var("state_required", "*"); } $t->parse("fast_checkout_state_select", false); } else { $t->set_var("fast_checkout_state_id_value", htmlspecialchars($user_details["state_id"])); $t->parse("fast_checkout_state_hidden", false); } if ($fast_checkout_postcode_show) { $t->set_var("fast_checkout_postcode", $user_details["postal_code"]); if ($fast_checkout_postcode_required == 1) { $t->set_var("postcode_required", "*"); } $t->parse("fast_checkout_postcode_textbox", false);
$r->add_textbox("shipping_expecting_date", DATETIME); $r->add_textbox("tax_name", TEXT); $r->add_textbox("tax_percent", NUMBER); $r->add_textbox("tax_total", NUMBER); $r->add_textbox("tax_prices_type", NUMBER); $r->add_textbox("vouchers_amount", NUMBER); $r->add_textbox("credit_amount", NUMBER); $r->add_textbox("processing_fee", NUMBER); $r->add_textbox("order_total", NUMBER); $r->add_textbox("total_points_amount", NUMBER); $r->add_textbox("total_reward_points", NUMBER); $r->add_textbox("total_reward_credits", NUMBER); $r->add_textbox("order_placed_date", DATETIME); $companies = get_db_values("SELECT company_id,company_name FROM " . $table_prefix . "companies ", array(array("", SELECT_COMPANY_MSG))); $states = get_db_values("SELECT state_id,state_name FROM " . $table_prefix . "states WHERE show_for_user=1 ORDER BY state_name ", array(array("", SELECT_STATE_MSG))); $countries = get_db_values("SELECT country_id,country_name FROM " . $table_prefix . "countries WHERE show_for_user=1 ORDER BY country_order, country_name ", array(array("", SELECT_COUNTRY_MSG))); // get phone codes $phone_codes = get_phone_codes(); $r->add_textbox("name", TEXT, NAME_MSG); $r->change_property("name", USE_SQL_NULL, false); $r->add_textbox("first_name", TEXT, FIRST_NAME_FIELD); $r->change_property("first_name", USE_SQL_NULL, false); $r->add_textbox("last_name", TEXT, LAST_NAME_FIELD); $r->change_property("last_name", USE_SQL_NULL, false); $r->add_select("company_id", INTEGER, $companies, COMPANY_SELECT_FIELD); $r->add_textbox("company_name", TEXT, COMPANY_NAME_FIELD); $r->add_textbox("email", TEXT, EMAIL_FIELD); $r->change_property("email", USE_SQL_NULL, false); $r->change_property("email", REGEXP_MASK, EMAIL_REGEXP); $r->add_textbox("address1", TEXT, STREET_FIRST_FIELD); $r->add_textbox("address2", TEXT, STREET_SECOND_FIELD);