$r->add_checkbox("notes_index", INTEGER); $r->add_textbox("notes_rank", INTEGER); $r->add_select("notes_type", INTEGER, $keywords_types); $r->add_checkbox("meta_title_index", INTEGER); $r->add_textbox("meta_title_rank", INTEGER); $r->add_select("meta_title_type", INTEGER, $keywords_types); $r->add_checkbox("meta_description_index", INTEGER); $r->add_textbox("meta_description_rank", INTEGER); $r->add_select("meta_description_type", INTEGER, $keywords_types); $r->add_checkbox("meta_keywords_index", INTEGER); $r->add_textbox("meta_keywords_rank", INTEGER); $r->add_select("meta_keywords_type", INTEGER, $keywords_types); $r->get_form_values(); // categories columns $ip = new VA_Record($table_prefix . "categories_columns", "categories_columns"); $ip->add_where("column_id", INTEGER); $ip->add_hidden("category_id", INTEGER); $ip->change_property("category_id", USE_IN_INSERT, true); $ip->add_textbox("column_order", INTEGER, ADMIN_ORDER_MSG); $ip->change_property("column_order", REQUIRED, true); $ip->add_textbox("column_code", TEXT, CODE_MSG); $ip->change_property("column_code", REQUIRED, true); $ip->change_property("column_code", MAX_LENGTH, 64); $ip->add_textbox("column_title", TEXT, TITLE_MSG); $ip->change_property("column_title", REQUIRED, true); $ip->change_property("column_title", MAX_LENGTH, 255); $ip->add_textbox("column_html", TEXT, HTML_MSG); $columns_number = get_param("cc_number"); $cc_eg = new VA_EditGrid($ip, "categories_columns"); $cc_eg->order_by = " ORDER BY column_order "; $cc_eg->get_form_values($columns_number);
$sql .= " ORDER BY site_id ASC "; } else { $sql .= " AND site_id=1 "; } $db->query($sql); while ($db->next_record()) { $cc_info[$db->f("setting_name")] = $db->f("setting_value"); } $cc_number_security = get_setting_value($cc_info, "cc_number_security", 0); $cc_code_security = get_setting_value($cc_info, "cc_code_security", 0); $r = new VA_Record($table_prefix . "orders"); $r->errors = $order_errors; if ($payment_error == 1) { $r->errors .= $error_message; } $r->add_where("order_id", INTEGER); $r->add_textbox("cc_name", TEXT, CC_NAME_FIELD); $r->add_textbox("cc_first_name", TEXT, CC_FIRST_NAME_FIELD); $r->add_textbox("cc_last_name", TEXT, CC_LAST_NAME_FIELD); $r->add_textbox("cc_number", TEXT, CC_NUMBER_FIELD); $r->parameters["cc_number"][MIN_LENGTH] = 10; $r->add_textbox("cc_start_date", DATETIME, CC_START_DATE_FIELD); $r->change_property("cc_start_date", VALUE_MASK, array("MM", " / ", "YYYY")); $r->add_textbox("cc_expiry_date", DATETIME, CC_EXPIRY_DATE_FIELD); $r->change_property("cc_expiry_date", VALUE_MASK, array("MM", " / ", "YYYY")); $credit_cards = get_db_values("SELECT credit_card_id, credit_card_name FROM " . $table_prefix . "credit_cards", array(array("", PLEASE_CHOOSE_MSG))); $r->add_select("cc_type", INTEGER, $credit_cards, CC_TYPE_FIELD); $issue_numbers = get_db_values("SELECT issue_number AS issue_value, issue_number AS issue_description FROM " . $table_prefix . "issue_numbers", array(array("", NOT_AVAILABLE_MSG))); $r->add_select("cc_issue_number", INTEGER, $issue_numbers, CC_ISSUE_NUMBER_FIELD); $r->add_textbox("cc_security_code", TEXT, CC_SECURITY_CODE_FIELD); $r->add_textbox("pay_without_cc", TEXT, PAY_WITHOUT_CC_FIELD);
$t->set_var("user_profile_href", get_custom_friendly_url("user_profile.php")); $t->set_var("user_profile_url", $user_profile_url); $t->set_var("user_upload_href", get_custom_friendly_url("user_upload.php")); $t->set_var("user_home_href", get_custom_friendly_url("user_home.php")); $t->set_var("referer", $referer); $t->set_var("referrer", $referer); $t->set_var("HTTP_REFERER", $referer); $t->set_var("initial_ip", $initial_ip); $t->set_var("cookie_ip", $cookie_ip); $t->set_var("visit_number", $visit_number); $t->set_var("login_desc", $login_desc); $t->set_var("short_description_editor", $short_description_editor); $t->set_var("full_description_editor", $full_description_editor); $subscribe = get_param("subscribe"); $r = new VA_Record($table_prefix . "users"); $r->add_where("user_id", INTEGER); $r->add_hidden("type", INTEGER); $r->add_textbox("user_type_id", INTEGER, "User Type"); $r->change_property("user_type_id", REQUIRED, true); $r->change_property("user_type_id", USE_IN_UPDATE, false); $r->add_textbox("is_approved", INTEGER); $r->add_textbox("registration_last_step", INTEGER); $r->add_textbox("registration_total_steps", INTEGER); $r->add_textbox("login", TEXT); $r->change_property("login", USE_IN_UPDATE, false); $r->change_property("login", SHOW, false); // subscription information $r->add_textbox("subscription_id", INTEGER, SUBSCRIPTION_MSG); $r->change_property("subscription_id", USE_SQL_NULL, false); $r->change_property("subscription_id", USE_IN_UPDATE, false); if ($is_subscription && !$user_id && !$new_user_id) {
$r->set_value("date_added", va_time()); $r->insert_record(); if ($db_type == "mysql") { $new_template_id = get_db_value(" SELECT LAST_INSERT_ID() "); $r->set_value("template_id", $new_template_id); } elseif ($db_type == "access") { $new_template_id = get_db_value(" SELECT @@IDENTITY "); $r->set_value("template_id", $new_template_id); } elseif ($db_type == "db2") { $new_template_id = get_db_value(" SELECT PREVVAL FOR seq_" . $table_prefix . "export_templates FROM " . $table_prefix . "export_templates"); $r->set_value("template_id", $new_template_id); } if (strlen($new_template_id)) { // start adding fields $fld = new VA_Record($table_prefix . "export_fields"); $fld->add_where("field_id", INTEGER); $fld->add_textbox("template_id", INTEGER); $fld->set_value("template_id", $new_template_id); $fld->add_textbox("field_order", INTEGER); $fld->add_textbox("field_title", TEXT); $fld->add_textbox("field_source", TEXT); $field_order = 0; $total_columns = get_param("total_columns"); for ($col = 1; $col <= $total_columns; $col++) { $field_title = get_param("column_title_" . $col); $field_source = get_param("field_source_" . $col); $column_checked = get_param("db_column_" . $col); if ($column_checked) { // if there is column title we can save this field even if it source empty $field_order++; $fld->set_value("field_order", $field_order);
$oc->set_value("discount_amount", $order_coupon["discount_amount"]); $oc->set_value("discount_tax_amount", $order_coupon["discount_tax_amount"]); $oc->insert_record(); } foreach ($gift_vouchers as $voucher_id => $voucher_info) { if (isset($voucher_info["amount"]) && $voucher_info["amount"] > 0) { $oc->set_value("coupon_id", $voucher_id); $oc->set_value("coupon_code", $voucher_info["code"]); $oc->set_value("coupon_title", $voucher_info["title"]); $oc->set_value("discount_amount", $voucher_info["amount"]); $oc->set_value("discount_tax_amount", 0); $oc->insert_record(); } } $oi = new VA_Record($table_prefix . "orders_items"); $oi->add_where("order_item_id", INTEGER); $oi->add_textbox("order_id", INTEGER); $oi->set_value("order_id", $order_id); $oi->add_textbox("site_id", INTEGER); $oi->change_property("site_id", USE_SQL_NULL, false); if (isset($site_id)) { $oi->set_value("site_id", $site_id); } else { $oi->set_value("site_id", 1); } $oi->add_textbox("top_order_item_id", INTEGER); $oi->change_property("top_order_item_id", USE_SQL_NULL, false); $oi->add_textbox("user_id", INTEGER); $oi->set_value("user_id", $user_id); $oi->add_textbox("user_type_id", INTEGER); $oi->set_value("user_type_id", $user_type_id);