| [ Index ] |
PHP Cross Reference of osCMax 2.0.4 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 $Id: edit_orders_ajax.php v5.0.5 08/27/2007 djmonkey1 Exp $ 4 5 osCommerce, Open Source E-Commerce Solutions 6 http://www.oscommerce.com 7 8 Copyright (c) 2007 osCommerce 9 10 Released under the GNU General Public License 11 12 For Order Editor support or to post bug reports, feature requests, etc, please visit the Order Editor support thread: 13 http://forums.oscommerce.com/index.php?showtopic=54032 14 15 */ 16 17 require ('includes/application_top.php'); 18 19 // output a response header 20 header('Content-type: text/html; charset=' . CHARSET . ''); 21 22 // include the appropriate functions & classes 23 include ('order_editor/functions.php'); 24 include ('order_editor/cart.php'); 25 include ('order_editor/order.php'); 26 include ('order_editor/shipping.php'); 27 include ('order_editor/http_client.php'); 28 include(DIR_WS_LANGUAGES . $language. '/' . FILENAME_ORDERS_EDIT); 29 30 31 // Include currencies class 32 require (DIR_WS_CLASSES . 'currencies.php'); 33 $currencies = new currencies(); 34 35 //$action 36 //all variables are sent by $_GET only or by $_POST only, never together 37 if (sizeof($_GET) > 0) { 38 $action = $_GET['action']; 39 } elseif (sizeof($_POST) > 0) { 40 $action = $_POST['action']; 41 } 42 43 //1. Update most the orders table 44 if ($action == 'update_order_field') { 45 tep_db_query("UPDATE " . TABLE_ORDERS . " SET " . $_GET['field'] . " = '" . oe_iconv($_GET['new_value']) . "' WHERE orders_id = '" . $_GET['oID'] . "'"); 46 47 48 //generate responseText 49 echo $_GET['field']; 50 51 52 } 53 54 //2. Update the orders_products table for qty, tax, name, or model 55 if ($action == 'update_product_field') { 56 57 if ($_GET['field'] == 'products_quantity') { 58 // Update Inventory Quantity 59 $order_query = tep_db_query(" 60 SELECT products_id, products_quantity 61 FROM " . TABLE_ORDERS_PRODUCTS . " 62 WHERE orders_id = '" . $_GET['oID'] . "' 63 AND orders_products_id = '" . $_GET['pid'] . "'"); 64 $orders_product_info = tep_db_fetch_array($order_query); 65 66 // stock check 67 68 if ($_GET['new_value'] != $orders_product_info['products_quantity']){ 69 $quantity_difference = ($_GET['new_value'] - $orders_product_info['products_quantity']); 70 if (STOCK_LIMITED == 'true'){ 71 tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET 72 products_quantity = products_quantity - " . $quantity_difference . ", 73 products_ordered = products_ordered + " . $quantity_difference . " 74 WHERE products_id = '" . $orders_product_info['products_id'] . "'"); 75 } else { 76 tep_db_query ("UPDATE " . TABLE_PRODUCTS . " SET 77 products_ordered = products_ordered + " . $quantity_difference . " 78 WHERE products_id = '" . $orders_product_info['products_id'] . "'"); 79 } //end if (STOCK_LIMITED == 'true'){ 80 } //end if ($_GET['new_value'] != $orders_product_info['products_quantity']){ 81 }//end if ($_GET['field'] = 'products_quantity' 82 83 tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS . " SET " . $_GET['field'] . " = '" . oe_iconv($_GET['new_value']) . "' WHERE orders_products_id = '" . $_GET['pid'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 84 85 86 87 //generate responseText 88 echo $_GET['field']; 89 90 } 91 92 //3. Update the orders_products table for price and final_price (interdependent values) 93 if ($action == 'update_product_value_field') { 94 tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS . " SET products_price = '" . tep_db_input(tep_db_prepare_input($_GET['price'])) . "', final_price = '" . tep_db_input(tep_db_prepare_input($_GET['final_price'])) . "' WHERE orders_products_id = '" . $_GET['pid'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 95 96 //generate responseText 97 echo TABLE_ORDERS_PRODUCTS; 98 99 } 100 101 //4. Update the orders_products_attributes table 102 if ($action == 'update_attributes_field') { 103 104 tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " SET " . $_GET['field'] . " = '" . oe_iconv($_GET['new_value']) . "' WHERE orders_products_attributes_id = '" . $_GET['aid'] . "' AND orders_products_id = '" . $_GET['pid'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 105 106 if (isset($_GET['final_price'])) { 107 108 tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS . " SET final_price = '" . tep_db_input(tep_db_prepare_input($_GET['final_price'])) . "' WHERE orders_products_id = '" . $_GET['pid'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 109 110 } 111 112 //generate responseText 113 echo $_GET['field']; 114 115 } 116 117 //5. Update the orders_products_download table 118 if ($action == 'update_downloads') { 119 tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " SET " . $_GET['field'] . " = '" . tep_db_input(tep_db_prepare_input($_GET['new_value'])) . "' WHERE orders_products_download_id = '" . $_GET['did'] . "' AND orders_products_id = '" . $_GET['pid'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 120 121 //generate responseText 122 echo $_GET['field']; 123 124 } 125 126 //6. Update the currency of the order 127 if ($action == 'update_currency') { 128 tep_db_query("UPDATE " . TABLE_ORDERS . " SET currency = '" . tep_db_input(tep_db_prepare_input($_GET['currency'])) . "', currency_value = '" . tep_db_input(tep_db_prepare_input($_GET['currency_value'])) . "' WHERE orders_id = '" . $_GET['oID'] . "'"); 129 130 //generate responseText 131 echo $_GET['currency']; 132 133 }//end if ($action == 'update_currency') { 134 135 136 //7. Update most any field in the orders_products table 137 if ($action == 'delete_product_field') { 138 139 // Update Inventory Quantity 140 $order_query = tep_db_query(" 141 SELECT products_id, products_quantity 142 FROM " . TABLE_ORDERS_PRODUCTS . " 143 WHERE orders_id = '" . $_GET['oID'] . "' 144 AND orders_products_id = '" . $_GET['pid'] . "'"); 145 $order = tep_db_fetch_array($order_query); 146 147 //update quantities first 148 if (STOCK_LIMITED == 'true'){ 149 tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET 150 products_quantity = products_quantity + " . $order['products_quantity'] . ", 151 products_ordered = products_ordered - " . $order['products_quantity'] . " 152 WHERE products_id = '" . (int)$order['products_id'] . "'"); 153 } else { 154 tep_db_query ("UPDATE " . TABLE_PRODUCTS . " SET 155 products_ordered = products_ordered - " . $order['products_quantity'] . " 156 WHERE products_id = '" . (int)$order['products_id'] . "'"); 157 } 158 159 tep_db_query("DELETE FROM " . TABLE_ORDERS_PRODUCTS . " 160 WHERE orders_id = '" . $_GET['oID'] . "' 161 AND orders_products_id = '" . $_GET['pid'] . "'"); 162 163 tep_db_query("DELETE FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " 164 WHERE orders_id = '" . $_GET['oID'] . "' 165 AND orders_products_id = '" . $_GET['pid'] . "'"); 166 167 tep_db_query("DELETE FROM " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " 168 WHERE orders_id = '" . $_GET['oID'] . "' 169 AND orders_products_id = '" . $_GET['pid'] . "'"); 170 171 //generate responseText 172 echo TABLE_ORDERS_PRODUCTS; 173 174 } 175 176 177 //8. Update the orders_status_history table 178 if ($action == 'delete_comment') { 179 180 tep_db_query("DELETE FROM " . TABLE_ORDERS_STATUS_HISTORY . " WHERE orders_status_history_id = '" . $_GET['cID'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 181 182 //generate responseText 183 echo TABLE_ORDERS_STATUS_HISTORY; 184 185 } 186 187 188 //9. Update the orders_status_history table 189 if ($action == 'update_comment') { 190 191 tep_db_query("UPDATE " . TABLE_ORDERS_STATUS_HISTORY . " SET comments = '" . oe_iconv($_GET['comment']) . "' WHERE orders_status_history_id = '" . $_GET['cID'] . "' AND orders_id = '" . $_GET['oID'] . "'"); 192 193 //generate responseText 194 echo TABLE_ORDERS_STATUS_HISTORY; 195 196 } 197 198 199 //10. Reload the shipping and order totals block 200 if ($action == 'reload_totals') { 201 202 $oID = $_POST['oID']; 203 $shipping = array(); 204 205 if (is_array($_POST['update_totals'])) { 206 foreach($_POST['update_totals'] as $total_index => $total_details) { 207 extract($total_details, EXTR_PREFIX_ALL, "ot"); 208 if ($ot_class == "ot_shipping") { 209 210 $shipping['cost'] = $ot_value; 211 $shipping['title'] = $ot_title; 212 $shipping['id'] = $ot_id; 213 214 } // end if ($ot_class == "ot_shipping") 215 } //end foreach 216 } //end if is_array 217 218 if (tep_not_null($shipping['id'])) { 219 tep_db_query("UPDATE " . TABLE_ORDERS . " SET shipping_module = '" . $shipping['id'] . "' WHERE orders_id = '" . $_POST['oID'] . "'"); 220 } 221 222 $order = new manualOrder($oID); 223 $order->adjust_zones(); 224 225 $cart = new manualCart(); 226 $cart->restore_contents($oID); 227 $total_count = $cart->count_contents(); 228 $total_weight = $cart->show_weight(); 229 230 // Get the shipping quotes 231 $shipping_modules = new shipping; 232 $shipping_quotes = $shipping_modules->quote(); 233 234 if (DISPLAY_PRICE_WITH_TAX == 'true') {//extract the base shipping cost or the ot_shipping module will add tax to it again 235 $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_')); 236 $tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); 237 $order->info['total'] -= ( $order->info['shipping_cost'] - ($order->info['shipping_cost'] / (1 + ($tax /100))) ); 238 $order->info['shipping_cost'] = ($order->info['shipping_cost'] / (1 + ($tax /100))); 239 } 240 241 //this is where we call the order total modules 242 require ( 'order_editor/order_total.php'); 243 $order_total_modules = new order_total(); 244 $order_totals = $order_total_modules->process(); 245 246 $current_ot_totals_array = array(); 247 $current_ot_titles_array = array(); 248 $written_ot_totals_array = array(); 249 $written_ot_titles_array = array(); 250 //how many weird arrays can I make today? 251 252 $current_ot_totals_query = tep_db_query("select class, title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order"); 253 while ($current_ot_totals = tep_db_fetch_array($current_ot_totals_query)) { 254 $current_ot_totals_array[] = $current_ot_totals['class']; 255 $current_ot_titles_array[] = $current_ot_totals['title']; 256 } 257 258 259 tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "'"); 260 261 $j=1; //giving something a sort order of 0 ain't my bag baby 262 $new_order_totals = array(); 263 264 if (is_array($_POST['update_totals'])) { //1 265 foreach($_POST['update_totals'] as $total_index => $total_details) { //2 266 extract($total_details, EXTR_PREFIX_ALL, "ot"); 267 if (!strstr($ot_class, 'ot_custom')) { //3 268 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { //4 269 270 if ($order_totals[$i]['code'] == 'ot_tax') { //5 271 $new_ot_total = ((in_array($order_totals[$i]['title'], $current_ot_titles_array)) ? false : true); 272 } else { //within 5 273 $new_ot_total = ((in_array($order_totals[$i]['code'], $current_ot_totals_array)) ? false : true); 274 } //end 5 if ($order_totals[$i]['code'] == 'ot_tax') 275 276 if ( ( ($order_totals[$i]['code'] == 'ot_tax') && ($order_totals[$i]['code'] == $ot_class) && ($order_totals[$i]['title'] == $ot_title) ) || ( ($order_totals[$i]['code'] != 'ot_tax') && ($order_totals[$i]['code'] == $ot_class) ) ) { //6 277 //only good for components that show up in the $order_totals array 278 279 if ($ot_title != '') { //7 280 $new_order_totals[] = array('title' => $ot_title, 281 'text' => (($ot_class != 'ot_total') ? $order_totals[$i]['text'] : '<b>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</b>'), 282 'value' => (($order_totals[$i]['code'] != 'ot_total') ? $order_totals[$i]['value'] : $order->info['total']), 283 'code' => $order_totals[$i]['code'], 284 'sort_order' => $j); 285 $written_ot_totals_array[] = $ot_class; 286 $written_ot_titles_array[] = $ot_title; 287 $j++; 288 } else { //within 7 289 290 $order->info['total'] += ($ot_value*(-1)); 291 $written_ot_totals_array[] = $ot_class; 292 $written_ot_titles_array[] = $ot_title; 293 294 } //end 7 295 296 } elseif ( ($new_ot_total) && (!in_array($order_totals[$i]['title'], $current_ot_titles_array)) ) { //within 6 297 298 $new_order_totals[] = array('title' => $order_totals[$i]['title'], 299 'text' => $order_totals[$i]['text'], 300 'value' => $order_totals[$i]['value'], 301 'code' => $order_totals[$i]['code'], 302 'sort_order' => $j); 303 $current_ot_totals_array[] = $order_totals[$i]['code']; 304 $current_ot_titles_array[] = $order_totals[$i]['title']; 305 $written_ot_totals_array[] = $ot_class; 306 $written_ot_titles_array[] = $ot_title; 307 $j++; 308 //echo $order_totals[$i]['code'] . "<br>"; for debugging- use of this results in errors 309 310 } elseif ($new_ot_total) { //also within 6 311 $order->info['total'] += ($order_totals[$i]['value']*(-1)); 312 $current_ot_totals_array[] = $order_totals[$i]['code']; 313 $written_ot_totals_array[] = $ot_class; 314 $written_ot_titles_array[] = $ot_title; 315 }//end 6 316 }//end 4 317 } elseif ( (tep_not_null($ot_value)) && (tep_not_null($ot_title)) ) { // this modifies if (!strstr($ot_class, 'ot_custom')) { //3 318 $new_order_totals[] = array('title' => $ot_title, 319 'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']), 320 'value' => $ot_value, 321 'code' => 'ot_custom_' . $j, 322 'sort_order' => $j); 323 $order->info['total'] += $ot_value; 324 $written_ot_totals_array[] = $ot_class; 325 $written_ot_titles_array[] = $ot_title; 326 $j++; 327 } //end 3 328 329 //save ot_skippy from certain annihilation 330 if ( (!in_array($ot_class, $written_ot_totals_array)) && (!in_array($ot_title, $written_ot_titles_array)) && (tep_not_null($ot_value)) && (tep_not_null($ot_title)) && ($ot_class != 'ot_tax') && ($ot_class != 'ot_loworderfee') ) { //7 331 //this is supposed to catch the oddball components that don't show up in $order_totals 332 333 $new_order_totals[] = array( 334 'title' => $ot_title, 335 'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']), 336 'value' => $ot_value, 337 'code' => $ot_class, 338 'sort_order' => $j); 339 //$current_ot_totals_array[] = $order_totals[$i]['code']; 340 //$current_ot_titles_array[] = $order_totals[$i]['title']; 341 $written_ot_totals_array[] = $ot_class; 342 $written_ot_titles_array[] = $ot_title; 343 $j++; 344 345 } //end 7 346 } //end 2 347 } else {//within 1 348 // $_POST['update_totals'] is not an array => write in all order total components that have been generated by the sundry modules 349 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { //8 350 $new_order_totals[] = array('title' => $order_totals[$i]['title'], 351 'text' => $order_totals[$i]['text'], 352 'value' => $order_totals[$i]['value'], 353 'code' => $order_totals[$i]['code'], 354 'sort_order' => $j); 355 $j++; 356 357 } //end 8 358 359 } //end if (is_array($_POST['update_totals'])) { //1 360 361 362 for ($i=0, $n=sizeof($new_order_totals); $i<$n; $i++) { 363 $sql_data_array = array('orders_id' => $oID, 364 'title' => oe_iconv($new_order_totals[$i]['title']), 365 'text' => $new_order_totals[$i]['text'], 366 'value' => $new_order_totals[$i]['value'], 367 'class' => $new_order_totals[$i]['code'], 368 'sort_order' => $new_order_totals[$i]['sort_order']); 369 tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); 370 } 371 372 373 $order = new manualOrder($oID); 374 $shippingKey = $order->adjust_totals($oID); 375 $order->adjust_zones(); 376 377 $cart = new manualCart(); 378 $cart->restore_contents($oID); 379 $total_count = $cart->count_contents(); 380 $total_weight = $cart->show_weight(); 381 382 383 384 ?> 385 386 <table width="100%"> 387 <tr><td> 388 389 <table border="0" width="100%" cellspacing="0" cellpadding="0"> 390 <tr> 391 <td valign="top" width="100%"> 392 <br> 393 <div> 394 <a href="javascript:openWindow('<?php echo tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_POST['oID'] . '&step=1'); ?>','addProducts');"><?php echo tep_image_button('button_add_article.gif', TEXT_ADD_NEW_PRODUCT); ?></a><input type="hidden" name="subaction" value=""> 395 </div> 396 <br> 397 </td> 398 399 400 <!-- order_totals bof //--> 401 <td align="right" rowspan="2" valign="top" nowrap class="dataTableRow" style="border: 1px solid #C9C9C9;"> 402 <table border="0" cellspacing="0" cellpadding="2"> 403 <tr class="dataTableHeadingRow"> 404 <td class="dataTableHeadingContent" width="15" nowrap onMouseover="ddrivetip('<?php echo oe_html_no_quote(HINT_TOTALS); ?>')"; onMouseout="hideddrivetip()"><img src="images/icon_info.gif" border="0" width="13" height="13"></td> 405 <td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_OT_TOTALS; ?></td> 406 <td class="dataTableHeadingContent" colspan="2" nowrap><?php echo TABLE_HEADING_OT_VALUES; ?></td> 407 </tr> 408 <?php 409 for ($i=0; $i<sizeof($order->totals); $i++) { 410 411 $id = $order->totals[$i]['class']; 412 413 if ($order->totals[$i]['class'] == 'ot_shipping') { 414 if (tep_not_null($order->info['shipping_id'])) { 415 $shipping_module_id = $order->info['shipping_id']; 416 } else { 417 //here we could create logic to attempt to determine the shipping module used if it's not in the database 418 $shipping_module_id = ''; 419 } 420 } else { 421 $shipping_module_id = ''; 422 } //end if ($order->totals[$i]['class'] == 'ot_shipping') { 423 424 $rowStyle = (($i % 2) ? 'dataTableRowOver' : 'dataTableRow'); 425 if ((!strstr($order->totals[$i]['class'], 'ot_custom')) && ($order->totals[$i]['class'] != 'ot_shipping')) { 426 echo ' <tr class="' . $rowStyle . '">' . "\n"; 427 if ($order->totals[$i]['class'] != 'ot_total') { 428 echo ' <td class="dataTableContent" valign="middle" height="15"><span id="update_totals['.$i.']"><a href="javascript:setCustomOTVisibility(\'update_totals['.($i+1).']\', \'visible\', \'update_totals['.$i.']\');">' . tep_image('order_editor/images/plus.gif', IMAGE_ADD_NEW_OT) . '</a></span></td>' . "\n"; 429 } else { 430 echo ' <td class="dataTableContent" valign="middle"> </td>' . "\n"; 431 } 432 433 echo ' <td align="right" class="dataTableContent"><input name="update_totals['.$i.'][title]" value="' . trim($order->totals[$i]['title']) . '" readonly="readonly"></td>' . "\n"; 434 435 if ($order->info['currency'] != DEFAULT_CURRENCY) echo ' <td class="dataTableContent"> </td>' . "\n"; 436 echo ' <td align="right" class="dataTableContent" nowrap>' . $order->totals[$i]['text'] . '<input name="update_totals['.$i.'][value]" type="hidden" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"></td>' . "\n" . 437 ' </tr>' . "\n"; 438 } else { 439 if ($i % 2) { 440 echo ' <tr class="' . $rowStyle . '" id="update_totals['.$i.']" style="visibility: hidden; display: none;">' . "\n" . 441 ' <td class="dataTableContent" valign="middle" height="15"><a href="javascript:setCustomOTVisibility(\'update_totals['.($i).']\', \'hidden\', \'update_totals['.($i-1).']\');">' . tep_image('order_editor/images/minus.gif', IMAGE_REMOVE_NEW_OT) . '</a></td>' . "\n"; 442 } else { 443 echo ' <tr class="' . $rowStyle . '">' . "\n" . 444 ' <td class="dataTableContent" valign="middle" height="15"><span id="update_totals['.$i.']"><a href="javascript:setCustomOTVisibility(\'update_totals['.($i+1).']\', \'visible\', \'update_totals['.$i.']\');">' . tep_image('order_editor/images/plus.gif', IMAGE_ADD_NEW_OT) . '</a></span></td>' . "\n"; 445 } 446 447 echo ' <td align="right" class="dataTableContent"><input name="update_totals['.$i.'][title]" id="'.$id.'[title]" value="' . trim($order->totals[$i]['title']) . '" onChange="obtainTotals()"></td>' . "\n" . 448 ' <td align="right" class="dataTableContent"><input name="update_totals['.$i.'][value]" id="'.$id.'[value]" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '" size="6" onChange="obtainTotals()"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"><input name="update_totals['.$i.'][id]" type="hidden" value="' . $shipping_module_id . '" id="' . $id . '[id]"></td>' . "\n"; 449 if ($order->info['currency'] != DEFAULT_CURRENCY) echo ' <td align="right" class="dataTableContent" nowrap>' . $order->totals[$i]['text'] . '</td>' . "\n"; 450 echo ' </tr>' . "\n"; 451 } 452 } 453 ?> 454 </table></td> 455 <!-- order_totals_eof //--> 456 </tr> 457 <tr> 458 <td valign="bottom"> 459 460 <?php 461 if (sizeof($shipping_quotes) > 0) { 462 ?> 463 <!-- shipping_quote bof //--> 464 <table border="0" width="550" cellspacing="0" cellpadding="2" style="border: 1px solid #C9C9C9;"> 465 <tr class="dataTableHeadingRow"> 466 <td class="dataTableHeadingContent" colspan="3"><?php echo TABLE_HEADING_SHIPPING_QUOTES; ?></td> 467 </tr> 468 <?php 469 $r = 0; 470 for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) { 471 for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) { 472 $r++; 473 if (!isset($shipping_quotes[$i]['tax'])) $shipping_quotes[$i]['tax'] = 0; 474 $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow'); 475 echo ' <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" . 476 477 ' <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" . 478 479 ' <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">' . "\n" . 480 481 ' <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" . 482 483 ' <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" . 484 485 ' <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" . 486 487 ' <td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 488 489 ' <td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 490 ' </tr>'; 491 } 492 } 493 ?> 494 <tr class="dataTableHeadingRow"> 495 <td class="dataTableHeadingContent" colspan="3"><?php echo sprintf(TEXT_PACKAGE_WEIGHT_COUNT, $shipping_num_boxes . ' x ' . $shipping_weight, $total_count); ?></td> 496 </tr> 497 </table> 498 <!-- shipping_quote_eof //--> 499 <?php 500 } else { 501 echo AJAX_NO_QUOTES; 502 } 503 ?> 504 </td> 505 </tr> 506 </table> 507 508 509 </td></tr> 510 </table> 511 512 513 <?php }//end if ($action == 'reload_shipping') { 514 515 516 //11. insert new comments 517 if ($action == 'insert_new_comment') { 518 519 //orders status 520 $orders_statuses = array(); 521 $orders_status_array = array(); 522 $orders_status_query = tep_db_query("SELECT orders_status_id, orders_status_name 523 FROM " . TABLE_ORDERS_STATUS . " 524 WHERE language_id = '" . (int)$languages_id . "'"); 525 526 while ($orders_status = tep_db_fetch_array($orders_status_query)) { 527 $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 528 'text' => $orders_status['orders_status_name']); 529 530 $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; 531 } 532 533 // UPDATE STATUS HISTORY & SEND EMAIL TO CUSTOMER IF NECESSARY ##### 534 535 $check_status_query = tep_db_query(" 536 SELECT customers_name, customers_email_address, orders_status, date_purchased 537 FROM " . TABLE_ORDERS . " 538 WHERE orders_id = '" . $_GET['oID'] . "'"); 539 540 $check_status = tep_db_fetch_array($check_status_query); 541 542 if (($check_status['orders_status'] != $_GET['status']) || (tep_not_null($_GET['comments']))) { 543 544 tep_db_query("UPDATE " . TABLE_ORDERS . " SET 545 orders_status = '" . tep_db_input($_GET['status']) . "', 546 last_modified = now() 547 WHERE orders_id = '" . $_GET['oID'] . "'"); 548 549 // Notify Customer ? 550 $customer_notified = '0'; 551 if (isset($_GET['notify']) && ($_GET['notify'] == 'true')) { 552 $notify_comments = ''; 553 if (isset($_GET['notify_comments']) && ($_GET['notify_comments'] == 'true')) { 554 $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, oe_iconv($_GET['comments'])) . "\n\n"; 555 } 556 $email = STORE_NAME . "\n" . 557 EMAIL_SEPARATOR . "\n" . 558 EMAIL_TEXT_ORDER_NUMBER . ' ' . $_GET['oID'] . "\n" . 559 EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $_GET['oID'], 'SSL') . "\n" . 560 EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . 561 sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$_GET['status']]) . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE2); 562 563 tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); 564 565 $customer_notified = '1'; 566 } 567 568 tep_db_query("INSERT into " . TABLE_ORDERS_STATUS_HISTORY . " 569 (orders_id, orders_status_id, date_added, customer_notified, comments) 570 values ('" . tep_db_input($_GET['oID']) . "', 571 '" . tep_db_input($_GET['status']) . "', 572 now(), 573 " . tep_db_input($customer_notified) . ", 574 '" . oe_iconv($_GET['comments']) . "')"); 575 } 576 577 ?> 578 <table style="border: 1px solid #C9C9C9;" cellspacing="0" cellpadding="2" class="dataTableRow" id="commentsTable"> 579 <tr class="dataTableHeadingRow"> 580 <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_DELETE; ?></td> 581 <td class="dataTableHeadingContent" align="left" width="10"> </td> 582 <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_DATE_ADDED; ?></td> 583 <td class="dataTableHeadingContent" align="left" width="10"> </td> 584 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></td> 585 <td class="dataTableHeadingContent" align="left" width="10"> </td> 586 <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_STATUS; ?></td> 587 <td class="dataTableHeadingContent" align="left" width="10"> </td> 588 <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_COMMENTS; ?></td> 589 </tr> 590 <?php 591 $r = 0; 592 $orders_history_query = tep_db_query("SELECT orders_status_history_id, orders_status_id, date_added, customer_notified, comments 593 FROM " . TABLE_ORDERS_STATUS_HISTORY . " 594 WHERE orders_id = '" . tep_db_prepare_input($_GET['oID']) . "' 595 ORDER BY date_added"); 596 if (tep_db_num_rows($orders_history_query)) { 597 while ($orders_history = tep_db_fetch_array($orders_history_query)) { 598 599 $r++; 600 $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow'); 601 602 echo ' <tr class="' . $rowClass . '" id="commentRow' . $orders_history['orders_status_history_id'] . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')">' . "\n" . 603 ' <td class="smallText" align="center"><div id="do_not_delete"><input name="update_comments[' . $orders_history['orders_status_history_id'] . '][delete]" type="checkbox" onClick="updateCommentsField(\'delete\', \'' . $orders_history['orders_status_history_id'] . '\', this.checked, \'\', this)"></div></td>' . "\n" . 604 ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . 605 ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . 606 ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . 607 ' <td class="smallText" align="center">'; 608 if ($orders_history['customer_notified'] == '1') { 609 echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n"; 610 } else { 611 echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n"; 612 } 613 echo ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . 614 ' <td class="smallText" align="left">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n"; 615 echo ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . 616 ' <td class="smallText" align="left">' . 617 618 tep_draw_textarea_field("update_comments[" . $orders_history['orders_status_history_id'] . "][comments]", "soft", "40", "5", 619 "" . tep_db_output($orders_history['comments']) . "", "onChange=\"updateCommentsField('update', '" . $orders_history['orders_status_history_id'] . "', 'false', encodeURIComponent(this.value))\"") . '' . "\n" . 620 621 ' </td>' . "\n"; 622 623 echo ' </tr>' . "\n"; 624 625 } 626 } else { 627 echo ' <tr>' . "\n" . 628 ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . 629 ' </tr>' . "\n"; 630 } 631 632 ?> 633 634 </table> 635 636 <?php } // end if ($action == 'insert_new_comment') { 637 638 //12. insert shipping method when one doesn't already exist 639 if ($action == 'insert_shipping') { 640 641 $order = new manualOrder($_GET['oID']); 642 643 $Query = "INSERT INTO " . TABLE_ORDERS_TOTAL . " SET 644 orders_id = '" . $_GET['oID'] . "', 645 title = '" . $_GET['title'] . "', 646 text = '" . $currencies->format($_GET['value'], true, $order->info['currency'], $order->info['currency_value']) ."', 647 value = '" . $_GET['value'] . "', 648 class = 'ot_shipping', 649 sort_order = '" . $_GET['sort_order'] . "'"; 650 tep_db_query($Query); 651 652 tep_db_query("UPDATE " . TABLE_ORDERS . " SET shipping_module = '" . $_GET['id'] . "' WHERE orders_id = '" . $_GET['oID'] . "'"); 653 654 $order = new manualOrder($_GET['oID']); 655 $shippingKey = $order->adjust_totals($_GET['oID']); 656 $order->adjust_zones(); 657 658 $cart = new manualCart(); 659 $cart->restore_contents($_GET['oID']); 660 $total_count = $cart->count_contents(); 661 $total_weight = $cart->show_weight(); 662 663 // Get the shipping quotes 664 $shipping_modules = new shipping; 665 $shipping_quotes = $shipping_modules->quote(); 666 667 ?> 668 669 <table width="100%"> 670 <tr><td> 671 672 <table border="0" width="100%" cellspacing="0" cellpadding="0"> 673 <tr> 674 <td valign="top" width="100%"> 675 <br> 676 <div> 677 <a href="javascript:openWindow('<?php echo tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_GET['oID'] . '&step=1'); ?>','addProducts');"><?php echo tep_image_button('button_add_article.gif', TEXT_ADD_NEW_PRODUCT); ?></a><input type="hidden" name="subaction" value=""> 678 </div> 679 <br> 680 </td> 681 682 683 <!-- order_totals bof //--> 684 <td align="right" rowspan="2" valign="top" nowrap class="dataTableRow" style="border: 1px solid #C9C9C9;"> 685 <table border="0" cellspacing="0" cellpadding="2"> 686 <tr class="dataTableHeadingRow"> 687 <td class="dataTableHeadingContent" width="15" nowrap onMouseover="ddrivetip('<?php echo oe_html_no_quote(HINT_TOTALS); ?>')"; onMouseout="hideddrivetip()"><img src="images/icon_info.gif" border="0" width="13" height="13" onLoad="reloadTotals()"></td> 688 <td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_OT_TOTALS; ?></td> 689 <td class="dataTableHeadingContent" colspan="2" nowrap><?php echo TABLE_HEADING_OT_VALUES; ?></td> 690 </tr> 691 <?php 692 for ($i=0; $i<sizeof($order->totals); $i++) { 693 694 $id = $order->totals[$i]['class']; 695 696 if ($order->totals[$i]['class'] == 'ot_shipping') { 697 $shipping_module_id = $order->info['shipping_id']; 698 } else { 699 $shipping_module_id = ''; 700 } //end if ($order->totals[$i]['class'] == 'ot_shipping') { 701 702 $rowStyle = (($i % 2) ? 'dataTableRowOver' : 'dataTableRow'); 703 if ( ($order->totals[$i]['class'] == 'ot_total') || ($order->totals[$i]['class'] == 'ot_subtotal') || ($order->totals[$i]['class'] == 'ot_tax') || ($order->totals[$i]['class'] == 'ot_loworderfee') ) { 704 echo ' <tr class="' . $rowStyle . '">' . "\n"; 705 if ($order->totals[$i]['class'] != 'ot_total') { 706 echo ' <td class="dataTableContent" valign="middle" height="15"><span id="update_totals['.$i.']"><a href="javascript:setCustomOTVisibility(\'update_totals['.($i+1).']\', \'visible\', \'update_totals['.$i.']\');">' . tep_image('order_editor/images/plus.gif', IMAGE_ADD_NEW_OT) . '</a></span></td>' . "\n"; 707 } else { 708 echo ' <td class="dataTableContent" valign="middle"> </td>' . "\n"; 709 } 710 711 echo ' <td align="right" class="dataTableContent"><input name="update_totals['.$i.'][title]" value="' . trim($order->totals[$i]['title']) . '" readonly="readonly"></td>' . "\n"; 712 713 if ($order->info['currency'] != DEFAULT_CURRENCY) echo ' <td class="dataTableContent"> </td>' . "\n"; 714 echo ' <td align="right" class="dataTableContent" nowrap>' . $order->totals[$i]['text'] . '<input name="update_totals['.$i.'][value]" type="hidden" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"></td>' . "\n" . 715 ' </tr>' . "\n"; 716 } else { 717 if ($i % 2) { 718 echo ' <tr class="' . $rowStyle . '" id="update_totals['.$i.']" style="visibility: hidden; display: none;">' . "\n" . 719 ' <td class="dataTableContent" valign="middle" height="15"><a href="javascript:setCustomOTVisibility(\'update_totals['.($i).']\', \'hidden\', \'update_totals['.($i-1).']\');">' . tep_image('order_editor/images/minus.gif', IMAGE_REMOVE_NEW_OT) . '</a></td>' . "\n"; 720 } else { 721 echo ' <tr class="' . $rowStyle . '">' . "\n" . 722 ' <td class="dataTableContent" valign="middle" height="15"><span id="update_totals['.$i.']"><a href="javascript:setCustomOTVisibility(\'update_totals['.($i+1).']\', \'visible\', \'update_totals['.$i.']\');">' . tep_image('order_editor/images/plus.gif', IMAGE_ADD_NEW_OT) . '</a></span></td>' . "\n"; 723 } 724 725 echo ' <td align="right" class="dataTableContent"><input name="update_totals['.$i.'][title]" id="'.$id.'[title]" value="' . trim($order->totals[$i]['title']) . '" onChange="obtainTotals()"></td>' . "\n" . 726 ' <td align="right" class="dataTableContent"><input name="update_totals['.$i.'][value]" id="'.$id.'[value]" value="' . number_format($order->totals[$i]['value'], 2, '.', '') . '" size="6" onChange="obtainTotals()"><input name="update_totals['.$i.'][class]" type="hidden" value="' . $order->totals[$i]['class'] . '"><input name="update_totals['.$i.'][id]" type="hidden" value="' . $shipping_module_id . '" id="' . $id . '[id]"></td>' . "\n"; 727 if ($order->info['currency'] != DEFAULT_CURRENCY) echo ' <td align="right" class="dataTableContent" nowrap>' . $order->totals[$i]['text'] . '</td>' . "\n"; 728 echo ' </tr>' . "\n"; 729 } 730 } 731 ?> 732 </table></td> 733 <!-- order_totals_eof //--> 734 </tr> 735 <tr> 736 <td valign="bottom"> 737 738 <?php 739 if (sizeof($shipping_quotes) > 0) { 740 ?> 741 <!-- shipping_quote bof //--> 742 <table border="0" width="550" cellspacing="0" cellpadding="2" style="border: 1px solid #C9C9C9;"> 743 <tr class="dataTableHeadingRow"> 744 <td class="dataTableHeadingContent" colspan="3"><?php echo TABLE_HEADING_SHIPPING_QUOTES; ?></td> 745 </tr> 746 <?php 747 $r = 0; 748 for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) { 749 for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) { 750 $r++; 751 if (!isset($shipping_quotes[$i]['tax'])) $shipping_quotes[$i]['tax'] = 0; 752 $rowClass = ((($r/2) == (floor($r/2))) ? 'dataTableRowOver' : 'dataTableRow'); 753 echo ' <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" . 754 755 ' <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" . 756 757 ' <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'].'">' . "\n" . 758 759 ' <input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">' . "\n" . 760 761 ' <input type="hidden" id="update_shipping['.$r.'][value]" name="update_shipping['.$r.'][value]" value="'.tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']).'">' . "\n" . 762 763 ' <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" . 764 765 '<td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . 766 767 '<td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . 768 ' </tr>'; 769 } 770 } 771 ?> 772 <tr class="dataTableHeadingRow"> 773 <td class="dataTableHeadingContent" colspan="3"><?php echo sprintf(TEXT_PACKAGE_WEIGHT_COUNT, $shipping_num_boxes . ' x ' . $shipping_weight, $total_count); ?></td> 774 </tr> 775 </table> 776 <!-- shipping_quote_eof //--> 777 778 <?php 779 } else { 780 echo AJAX_NO_QUOTES; 781 } 782 ?> 783 </td> 784 </tr> 785 </table> 786 787 788 </td></tr> 789 </table> 790 791 <?php } //end if ($action == 'insert_shipping') { 792 793 //13. new order email 794 795 if ($action == 'new_order_email') { 796 797 $order = new manualOrder($_GET['oID']); 798 799 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 800 //loop all the products in the order 801 $products_ordered_attributes = ''; 802 if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) { 803 for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { 804 $products_ordered_attributes .= "\n\t" . $order->products[$i]['attributes'][$j]['option'] . ' ' . $order->products[$i]['attributes'][$j]['value']; 805 } 806 } 807 808 $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . $products_model . ' = ' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . $products_ordered_attributes . "\n"; 809 } 810 811 //Build the email 812 $email_order = STORE_NAME . "\n" . 813 EMAIL_SEPARATOR . "\n" . 814 EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$_GET['oID'] . "\n" . 815 EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$_GET['oID'], 'SSL') . "\n" . 816 EMAIL_TEXT_DATE_MODIFIED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; 817 818 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 819 EMAIL_SEPARATOR . "\n" . 820 $products_ordered . 821 EMAIL_SEPARATOR . "\n"; 822 823 for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) { 824 $email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n"; 825 } 826 827 if ($order->content_type != 'virtual') { 828 $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 829 EMAIL_SEPARATOR . "\n" . 830 $order->delivery['name'] . "\n"; 831 if ($order->delivery['company']) { 832 $email_order .= $order->delivery['company'] . "\n"; 833 } 834 $email_order .= $order->delivery['street_address'] . "\n"; 835 if ($order->delivery['suburb']) { 836 $email_order .= $order->delivery['suburb'] . "\n"; 837 } 838 $email_order .= $order->customer['city'] . "\n"; 839 if ($order->delivery['state']) { 840 $email_order .= $order->delivery['state'] . "\n"; 841 } 842 $email_order .= $order->customer['postcode'] . "\n" . 843 $order->delivery['country'] . "\n"; 844 } 845 846 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . 847 EMAIL_SEPARATOR . "\n" . 848 $order->billing['name'] . "\n"; 849 if ($order->billing['company']) { 850 $email_order .= $order->billing['company'] . "\n"; 851 } 852 $email_order .= $order->billing['street_address'] . "\n"; 853 if ($order->billing['suburb']) { 854 $email_order .= $order->billing['suburb'] . "\n"; 855 } 856 $email_order .= $order->customer['city'] . "\n"; 857 if ($order->billing['state']) { 858 $email_order .= $order->billing['state'] . "\n"; 859 } 860 $email_order .= $order->customer['postcode'] . "\n" . 861 $order->billing['country'] . "\n\n"; 862 863 $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 864 EMAIL_SEPARATOR . "\n"; 865 $email_order .= $order->info['payment_method'] . "\n\n"; 866 867 868 // if ( ($order->info['payment_method'] == ORDER_EDITOR_SEND_INFO_PAYMENT_METHOD) && (EMAIL_TEXT_PAYMENT_INFO) ) { 869 // $email_order .= EMAIL_TEXT_PAYMENT_INFO . "\n\n"; 870 // } 871 //I'm not entirely sure what the purpose of this is so it is being shelved for now 872 873 if (EMAIL_TEXT_FOOTER) { 874 $email_order .= EMAIL_TEXT_FOOTER . "\n\n"; 875 } 876 877 //code for plain text emails which changes the € sign to EUR, otherwise the email will show ? instead of € 878 $email_order = str_replace("€","EUR",$email_order); 879 $email_order = str_replace(" "," ",$email_order); 880 881 //code which replaces the <br> tags within EMAIL_TEXT_PAYMENT_INFO and EMAIL_TEXT_FOOTER with the proper \n 882 $email_order = str_replace("<br>","\n",$email_order); 883 884 //send the email to the customer 885 tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); 886 887 // send emails to other people as necessary 888 if (SEND_EXTRA_ORDER_EMAILS_TO != '') { 889 tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); 890 } 891 892 ?> 893 894 <table> 895 <tr> 896 <td class="messageStackSuccess"> 897 <?php echo tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . sprintf(AJAX_SUCCESS_EMAIL_SENT, $order->customer['email_address']); ?> 898 </td> 899 </tr> 900 </table> 901 902 <?php } //end if ($action == 'new_order_email') { ?>
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 |