| [ Index ] |
PHP Cross Reference of osCMax 2.0.4 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 $Id: create_order_process.php 3 2006-05-27 04:59:07Z user $ 4 5 osCMax Power E-Commerce 6 http://oscdox.com 7 8 Copyright 2006 osCMax2005 osCMax, 2002 osCommerce 9 10 Released under the GNU General Public License 11 */ 12 13 require ('includes/application_top.php'); 14 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ORDER_PROCESS); 15 // if ($HTTP_POST_VARS['action'] != 'process') { 16 // tep_redirect(tep_href_link(FILENAME_CREATE_ORDER, '', 'SSL')); 17 //} 18 $customer_id = tep_db_prepare_input($HTTP_POST_VARS['customers_id']); 19 $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); 20 $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); 21 $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); 22 $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); 23 $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); 24 $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']); 25 $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']); 26 $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']); 27 $password = tep_db_prepare_input($HTTP_POST_VARS['password']); 28 $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']); 29 $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); 30 $company = tep_db_prepare_input($HTTP_POST_VARS['company']); 31 $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); 32 $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); 33 $city = tep_db_prepare_input($HTTP_POST_VARS['city']); 34 $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); 35 $state = tep_db_prepare_input($HTTP_POST_VARS['state']); 36 $country = tep_db_prepare_input($HTTP_POST_VARS['country']); 37 $format_id = "1"; 38 $size = "1"; 39 $payment_method = DEFAULT_PAYMENT_METHOD; 40 $new_value = "1"; 41 $error = false; // reset error flag 42 $temp_amount = "0"; 43 $temp_amount = number_format($temp_amount, 2, '.', ''); 44 45 $currency_text = DEFAULT_CURRENCY . ", 1"; 46 if(IsSet($HTTP_POST_VARS['Currency'])) 47 { 48 $currency_text = tep_db_prepare_input($HTTP_POST_VARS['Currency']); 49 } 50 51 $currency_array = explode(",", $currency_text); 52 53 $currency = $currency_array[0]; 54 $currency_value = $currency_array[1]; 55 ?> 56 <?php 57 58 $sql_data_array = array('customers_id' => $customer_id, 59 'customers_name' => $firstname . ' ' . $lastname, 60 'customers_company' => $company, 61 'customers_street_address' => $street_address, 62 'customers_suburb' => $suburb, 63 'customers_city' => $city, 64 'customers_postcode' => $postcode, 65 'customers_state' => $state, 66 'customers_country' => $country, 67 'customers_telephone' => $telephone, 68 'customers_email_address' => $email_address, 69 'customers_address_format_id' => $format_id, 70 'delivery_name' => $firstname . ' ' . $lastname, 71 'delivery_company' => $company, 72 'delivery_street_address' => $street_address, 73 'delivery_suburb' => $suburb, 74 'delivery_city' => $city, 75 'delivery_postcode' => $postcode, 76 'delivery_state' => $state, 77 'delivery_country' => $country, 78 'delivery_address_format_id' => $format_id, 79 'billing_name' => $firstname . ' ' . $lastname, 80 'billing_company' => $company, 81 'billing_street_address' => $street_address, 82 'billing_suburb' => $suburb, 83 'billing_city' => $city, 84 'billing_postcode' => $postcode, 85 'billing_state' => $state, 86 'billing_country' => $country, 87 'billing_address_format_id' => $format_id, 88 'date_purchased' => 'now()', 89 'orders_status' => DEFAULT_ORDERS_STATUS_ID, 90 'currency' => $currency, 91 'currency_value' => $currency_value, 92 'payment_method' => $payment_method 93 ); 94 95 96 97 98 99 //old 100 tep_db_perform(TABLE_ORDERS, $sql_data_array); 101 $insert_id = tep_db_insert_id(); 102 103 104 $sql_data_array = array('orders_id' => $insert_id, 105 //Comment out line you don't need 106 //'new_value' => $new_value, //for 2.2 107 'orders_status_id' => $new_value, //for MS1 or MS2 108 'date_added' => 'now()'); 109 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); 110 111 112 $sql_data_array = array('orders_id' => $insert_id, 113 'title' => TEXT_SUBTOTAL, 114 'text' => $temp_amount, 115 'value' => "0.00", 116 'class' => "ot_subtotal", 117 'sort_order' => "1"); 118 tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); 119 120 121 $sql_data_array = array('orders_id' => $insert_id, 122 'title' => TEXT_DISCOUNT, 123 'text' => $temp_amount, 124 'value' => "0.00", 125 'class' => "ot_customer_discount", 126 'sort_order' => "2"); 127 tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); 128 129 $sql_data_array = array('orders_id' => $insert_id, 130 'title' => TEXT_DELIVERY, 131 'text' => $temp_amount, 132 'value' => "0.00", 133 'class' => "ot_shipping", 134 'sort_order' => "3"); 135 tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); 136 137 $sql_data_array = array('orders_id' => $insert_id, 138 'title' => TEXT_TAX, 139 'text' => $temp_amount, 140 'value' => "0.00", 141 'class' => "ot_tax", 142 'sort_order' => "4"); 143 tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); 144 145 $sql_data_array = array('orders_id' => $insert_id, 146 'title' => TEXT_TOTAL, 147 'text' => $temp_amount, 148 'value' => "0.00", 149 'class' => "ot_total", 150 'sort_order' => "5"); 151 tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); 152 153 154 tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $insert_id, 'SSL')); 155 156 157 require (DIR_WS_INCLUDES . 'application_bottom.php'); 158 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Fri Jan 1 13:43:16 2010 | Cross-referenced by PHPXref 0.7 |