[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> edit_orders_add_product.php (source)

   1  <?php
   2  /*
   3    $Id: edit_orders_add_product.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    // include the appropriate functions & classes
  20    include ('order_editor/functions.php');
  21    include ('order_editor/cart.php');
  22    include ('order_editor/order.php');
  23    include(DIR_WS_LANGUAGES . $language. '/' . FILENAME_ORDERS_EDIT);
  24  
  25    // Include currencies class
  26    require (DIR_WS_CLASSES . 'currencies.php');
  27    $currencies = new currencies();
  28  
  29    $oID = tep_db_prepare_input((int)$_GET['oID']);
  30    $order = new manualOrder($oID);
  31  
  32    // Setup variables
  33    $step = ((isset($_POST['step'])) ? (int)$_POST['step'] : 1);
  34    $add_product_categories_id = ((isset($_POST['add_product_categories_id'])) ? (int)$_POST['add_product_categories_id'] : '');
  35    $add_product_products_id = ((isset($_POST['add_product_products_id'])) ? (int)$_POST['add_product_products_id'] : 0);
  36  
  37    // $_GET['action'] switch
  38    if (isset($_GET['action'])) {
  39      switch ($_GET['action']) {
  40  
  41      ////
  42      // Add a product to the virtual cart
  43        case 'add_product':
  44          if ($step != 5) break;
  45  
  46          $AddedOptionsPrice = 0;
  47  
  48          // Get Product Attribute Info
  49          if (isset($_POST['add_product_options'])) {
  50            foreach($_POST['add_product_options'] as $option_id => $option_value_id) {
  51              $result = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa INNER JOIN " . TABLE_PRODUCTS_OPTIONS . " po ON (po.products_options_id = pa.options_id and po.language_id = '" . $languages_id . "') INNER JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on (pov.products_options_values_id = pa.options_values_id and pov.language_id = '" . $languages_id . "') WHERE products_id = '" . $add_product_products_id . "' and options_id = '" . $option_id . "' and options_values_id = '" . $option_value_id . "'");
  52              $row = tep_db_fetch_array($result);
  53              if (is_array($row)) extract($row, EXTR_PREFIX_ALL, "opt");
  54                      if ($opt_price_prefix == '-')
  55                      {$AddedOptionsPrice -= $opt_options_values_price;}
  56                      else //default to positive
  57                      {$AddedOptionsPrice += $opt_options_values_price;}
  58              $option_value_details[$option_id][$option_value_id] = array (
  59                      "options_values_price" => $opt_options_values_price,
  60                      "price_prefix" => $opt_price_prefix);
  61              $option_names[$option_id] = $opt_products_options_name;
  62              $option_values_names[$option_value_id] = $opt_products_options_values_name;
  63              
  64          //add on for downloads
  65          if (DOWNLOAD_ENABLED == 'true') {
  66          $download_query_raw ="SELECT products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount 
  67          FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " 
  68          WHERE products_attributes_id='" . $opt_products_attributes_id . "'";
  69  
  70          $download_query = tep_db_query($download_query_raw);
  71          if (tep_db_num_rows($download_query) > 0) {
  72            $download = tep_db_fetch_array($download_query);
  73            $filename[$option_id] = $download['products_attributes_filename'];
  74            $maxdays[$option_id]  = $download['products_attributes_maxdays'];
  75            $maxcount[$option_id] = $download['products_attributes_maxcount'];
  76          } //end if (tep_db_num_rows($download_query) > 0) {
  77          } //end if (DOWNLOAD_ENABLED == 'true') {
  78          //end downloads 
  79          
  80            } //end foreach($_POST['add_product_options'] as $option_id => $option_value_id) {
  81          } //end if (isset($_POST['add_product_options'])) {
  82          
  83  
  84          // Get Product Info
  85          //BOF Added languageid (otherwise products_name is empty)
  86          //$product_query = tep_db_query("select p.products_model, p.products_price, pd.products_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_id = '" . (int)$add_product_products_id . "'");
  87          $product_query = tep_db_query("select p.products_model, p.products_price, pd.products_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_id = '" . (int)$add_product_products_id . "' and pd.language_id = '" . $languages_id . "'");
  88          //EOF Added languageid
  89          $product = tep_db_fetch_array($product_query);
  90          $country_id = oe_get_country_id($order->delivery["country"]);
  91          $zone_id = oe_get_zone_id($country_id, $order->delivery['state']);
  92          $products_tax = tep_get_tax_rate($product['products_tax_class_id'], $country_id, $zone_id);
  93          
  94          
  95              // 2.1.3  Pull specials price from db if there is an active offer
  96              $special_price = tep_db_query("
  97              SELECT specials_new_products_price 
  98              FROM " . TABLE_SPECIALS . " 
  99              WHERE products_id =". $add_product_products_id . " 
 100              AND status");
 101              $new_price = tep_db_fetch_array($special_price);
 102              
 103              if ($new_price) 
 104              { $product['products_price'] = $new_price['specials_new_products_price']; }
 105              
 106              //sppc patch
 107              //Set to false by default, configurable in the Order Editor section of the admin panel
 108              //thanks to whistlerxj for the original version of this patch
 109  
 110              if (ORDER_EDITOR_USE_SPPC == 'true') {
 111      
 112              // first find out the customer associated with this order ID..
 113              $c_id_result = tep_db_query('SELECT customers_id 
 114              FROM orders 
 115              WHERE orders_id="' . (int)$oID . '"');
 116      
 117              $cid = tep_db_fetch_array($c_id_result);
 118              if ($cid){
 119              $cust_id = $cid['customers_id'];
 120              // now find the customer's group.
 121              $c_g_id_result = tep_db_query('SELECT customers_group_id 
 122              FROM customers 
 123              WHERE customers_id="' . $cust_id . '"');
 124      
 125              $c_g_id = tep_db_fetch_array($c_g_id_result);
 126              if ($c_g_id){
 127              $cust_group_id = $c_g_id['customers_group_id'];
 128              // get the price of the product from the products_groups table.
 129              $price_result = tep_db_query('SELECT customers_group_price 
 130              FROM products_groups 
 131               WHERE products_id="' . $add_product_products_id . '" 
 132              AND customers_group_id="' . $cust_group_id . '"');
 133      
 134              $price_array = tep_db_fetch_array($price_result);
 135              if ($price_array){
 136              // set the price of the new product to the group specific price.
 137              $product['products_price'] = $price_array['customers_group_price'];
 138                 }
 139                }
 140               }
 141               }
 142              //end sppc patch 
 143  
 144          $sql_data_array = array('orders_id' => tep_db_prepare_input($oID),
 145                                  'products_id' => tep_db_prepare_input($add_product_products_id),
 146                                  'products_model' => tep_db_prepare_input($product['products_model']),
 147                                  'products_name' => tep_db_prepare_input($product['products_name']),
 148                                  'products_price' => tep_db_prepare_input($product['products_price']),
 149                                  'final_price' => tep_db_prepare_input(($product['products_price'] + $AddedOptionsPrice)),
 150                                  'products_tax' => tep_db_prepare_input($products_tax),
 151                                  'products_quantity' => tep_db_prepare_input($_POST['add_product_quantity']));
 152          tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
 153          $new_product_id = tep_db_insert_id();
 154  
 155          if (isset($_POST['add_product_options'])) {
 156            foreach($_POST['add_product_options'] as $option_id => $option_value_id) {
 157              $sql_data_array = array('orders_id' => tep_db_prepare_input($oID),
 158                                      'orders_products_id' => tep_db_prepare_input($new_product_id),
 159                                      'products_options' => tep_db_prepare_input($option_names[$option_id]),
 160                                      'products_options_values' => tep_db_prepare_input($option_values_names[$option_value_id]),
 161               'options_values_price' => tep_db_prepare_input($option_value_details[$option_id][$option_value_id]['options_values_price']),
 162               'price_prefix' => tep_db_prepare_input($option_value_details[$option_id][$option_value_id]['price_prefix']));
 163              tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
 164  
 165              
 166          //add on for downloads
 167          if (DOWNLOAD_ENABLED == 'true' && isset($filename[$option_id])) {
 168          
 169          $Query = "INSERT INTO " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " SET
 170                  orders_id = '" . tep_db_prepare_input($oID) . "',
 171                  orders_products_id = '" . tep_db_prepare_input($new_product_id) . "',
 172                  orders_products_filename = '" . tep_db_prepare_input($filename[$option_id]) . "',
 173                  download_maxdays = '" . tep_db_prepare_input($maxdays[$option_id]) . "',
 174                  download_count = '" . tep_db_prepare_input($maxcount[$option_id]) . "'";
 175                          
 176                      tep_db_query($Query);
 177                      
 178             } //end if (DOWNLOAD_ENABLED == 'true') {
 179          //end downloads 
 180            }
 181          }
 182          
 183          // Update inventory Quantity
 184              // This is only done if store is set up to use stock
 185              if (STOCK_LIMITED == 'true'){
 186              tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET
 187              products_quantity = products_quantity - " . $_POST['add_product_quantity'] . " 
 188              WHERE products_id = '" . $_POST['add_product_products_id'] . "'");
 189              }
 190              // Update products_ordered info
 191              tep_db_query ("UPDATE " . TABLE_PRODUCTS . " SET
 192              products_ordered = products_ordered + " . $_POST['add_product_quantity'] . "
 193              WHERE products_id = '" . $_POST['add_product_products_id'] . "'");
 194  
 195          // Unset selected product & category
 196          $add_product_categories_id = 0;
 197          $add_product_products_id = 0;
 198  
 199               
 200          tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $oID . '&step=1&submitForm=yes'));
 201  
 202          break;
 203      }
 204    }
 205  
 206   
 207  ////
 208  // Generate product list based on chosen category or search keywords
 209    $not_found = true;
 210    if (isset($_POST['search'])) {
 211      $search_array = explode(" ", $_POST['product_search']);
 212      $search_array = oe_clean_SQL_keywords($search_array);
 213      if (sizeof($search_array) <= 1) {
 214        $search_fields = array('p.products_id', 'p.products_price', 'p.products_model', 'pd.products_name');
 215        $product_search = oe_generate_search_SQL($search_array, $search_fields);
 216      } else {
 217        $search_fields = array('pd.products_name');
 218        $product_search = oe_generate_search_SQL($search_array, $search_fields, 'AND');
 219      }
 220  
 221      $products_query = tep_db_query("select p.products_id, p.products_price, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on (p.products_id = pd.products_id) where pd.language_id = '" . $languages_id . "' and (" . $product_search . ") order by pd.products_name");
 222      $not_found = ((tep_db_num_rows($products_query)) ? false : true);
 223    } 
 224  
 225    if (!isset($_POST['search'])) {
 226      $product_search = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
 227  
 228      $_GET['inc_subcat'] = '1';
 229      if ($_GET['inc_subcat'] == '1') {
 230        $subcategories_array = array();
 231        oe_get_subcategories($subcategories_array, $add_product_categories_id);
 232        $product_search .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$add_product_categories_id . "'";
 233        for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
 234          $product_search .= " or p2c.categories_id = '" . $subcategories_array[$i] . "'";
 235        }
 236        $product_search .= ")";
 237      } else {
 238        $product_search .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p2c.categories_id = '" . (int)$add_product_categories_id . "'";
 239      }
 240  
 241      $products_query = tep_db_query("select distinct p.products_id, p.products_price, p.products_model, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c " . $product_search . " order by pd.products_name");
 242      $not_found = ((tep_db_num_rows($products_query)) ? false : true);
 243    }
 244  
 245    $category_array = array(array('id' => '', 'text' => TEXT_SELECT_CATEGORY),
 246                            array('id' => '0', 'text' => TEXT_ALL_CATEGORIES));
 247  
 248    if (($step > 1) && (!$not_found)) {
 249      $product_array = array(array('id' => 0, 'text' => TEXT_SELECT_PRODUCT));
 250      while($products = tep_db_fetch_array($products_query)) {
 251        $product_array[] = array('id' => $products['products_id'],
 252                                 'text' => $products['products_name'] . ' (' . $products['products_model'] . ')' . ':&nbsp;' . $currencies->format($products['products_price'], true, $order->info['currency'], $order->info['currency_value']));
 253      }
 254    }
 255  
 256    $has_attributes = false;
 257    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$add_product_products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
 258    $products_attributes = tep_db_fetch_array($products_attributes_query);
 259    if ($products_attributes['total'] > 0) $has_attributes = true; 
 260  ?>
 261  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 262  "http://www.w3.org/TR/html4/loose.dtd">
 263  <html <?php echo HTML_PARAMS; ?>>
 264  <head>
 265  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 266  <title><?php echo TITLE; ?></title>
 267  <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
 268  <?php if ( (isset($_GET['submitForm'])) && ($_GET['submitForm'] == 'yes') ) {
 269          echo '<script language="javascript" type="text/javascript"><!--' . "\n" .
 270               '  window.opener.document.edit_order.subaction.value = "add_product";' . "\n" . 
 271               '  window.opener.document.edit_order.submit();' . "\n" .
 272               '//--></script>';
 273               }
 274      ?>
 275  </head>
 276  
 277  <body>
 278  <!-- body //-->
 279       <table border="0" width="100%" cellspacing="0" cellpadding="2">
 280        <tr>
 281          <td><table border="0" cellspacing="0" cellpadding="2" style="border: 1px solid #C9C9C9;" align="center">
 282            <tr class="dataTableHeadingRow">
 283              <td class="dataTableHeadingContent" colspan="3" align="center"><?php echo sprintf(ADDING_TITLE, $oID); ?></td>
 284            </tr>
 285            <tr class="dataTableRow">
 286             <form action="<?php echo tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_GET['oID']); ?>" method="POST">
 287              <td class="dataTableContent" align="right"><?php echo TEXT_STEP_1; ?></td>
 288              <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('add_product_categories_id', tep_get_category_tree('0', '', '0', $category_array), $add_product_categories_id,'style="width:300px;" onchange="this.form.submit();"'); ?></td>
 289              <td class="dataTableContent" align="center">
 290                <noscript>
 291                  <input type="submit" value="<?php echo TEXT_BUTTON_SELECT_CATEGORY; ?>">
 292                </noscript>
 293                  <input type="hidden" name="step" value="2">
 294               </td>
 295             </form>
 296            </tr>
 297            <tr class="dataTableRow">
 298              <td class="dataTableContent" colspan="3" align="center"><?php echo TEXT_PRODUCT_SEARCH; ?></td>
 299            </tr>
 300            <tr class="dataTableRow">
 301            <form action="<?php echo tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_GET['oID']); ?>" method="POST">
 302              <td>&nbsp;</td>
 303              <td class="dataTableContent" valign="top">&nbsp;<input type="text" name="product_search" value="<?php if(isset($_POST['product_search'])) echo $_POST['product_search']; ?>" onchange="this.form.submit();">
 304              </td>
 305              <td class="dataTableContent" align="center"><noscript><input type="submit" value="Search for This Product"></noscript><input type="hidden" name="step" value="2"><input type="hidden" name="search" value="1"></td>
 306            </form>
 307            </tr>
 308          <?php if ($not_found) { ?>
 309            <tr class="dataTableRow">
 310              <td class="dataTableContent" colspan="3" align="center"><?php echo TEXT_PRODUCT_NOT_FOUND; ?></td>
 311            </tr>
 312          <?php } ?>
 313  <?php
 314    if (($step > 1) && (!$not_found)) {
 315      echo '          <tr class="dataTableRow">' . "\n" .
 316           '            <td colspan="3" style="border-bottom: 1px solid #C9C9C9;">' . tep_draw_separator('pixel_trans.gif', '1', '1') . '</td>' . "\n" .
 317           '          </tr>' . "\n" .
 318           '          <tr class="dataTableRow">' . "\n" .
 319           '            <td colspan="3" style="background: #FFFFFF;">' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
 320           '          </tr>' . "\n";
 321  ?>
 322            <tr class="dataTableRow"> 
 323              <td colspan="3" style="border-top: 1px solid #C9C9C9;"><?php echo tep_draw_separator('pixel_trans.gif', '1', '1'); ?></td>
 324            </tr>
 325            <tr class="dataTableRow">
 326            <form action="<?php echo tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_GET['oID']); ?>" method="POST">
 327              <td class="dataTableContent" align="right"><?php echo TEXT_STEP_2; ?></td>
 328              <td class="dataTableContent" valign="top"><?php echo tep_draw_pull_down_menu('add_product_products_id', $product_array, $add_product_products_id, 'style="width:300px;" onchange="this.form.submit();"'); ?></td>
 329              <td class="dataTableContent" align="center"><noscript><input type="submit" value="<?php echo TEXT_BUTTON_SELECT_PRODUCT; ?>"></noscript><input type="hidden" name="step" value="3">
 330              <input type="hidden" name="add_product_categories_id" value="<?php echo $add_product_categories_id; ?>">
 331            <?php if (isset($_POST['search'])) { ?>
 332              <input type="hidden" name="search" value="1">
 333              <input type="hidden" name="product_search" value="<?php echo $_POST['product_search']; ?>">
 334            <?php } ?>
 335              </td>
 336            </form>
 337            </tr>
 338  <?php
 339    }
 340  
 341    if (($step > 2) && ($add_product_products_id > 0)) {
 342      echo '          <tr class="dataTableRow">' . "\n" .
 343           '            <td colspan="3" style="border-top: 1px solid #C9C9C9;">' . tep_draw_separator('pixel_trans.gif', '1', '1') . '</td>' . "\n" .
 344           '          </tr>' . "\n" .
 345           '          <tr class="dataTableRow">' . "\n";
 346  
 347      if ($has_attributes) echo '          <form action="' . tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_GET['oID']) . '" method="post">' . "\n";
 348  
 349      echo '            <td class="dataTableContent" align="right">' . TEXT_STEP_3 . '</td>' . "\n";
 350  
 351      if ($has_attributes) {
 352        $i=1;
 353        $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$add_product_products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");
 354        while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
 355          $selected = 0;
 356          $products_options_array = array();
 357          if ($i > 1) echo '            <td class="dataTableContent">&nbsp;</td>' . "\n";
 358          $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$add_product_products_id . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
 359          while ($products_options = tep_db_fetch_array($products_options_query)) {
 360            $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options_name['products_options_name'] . ' - ' . $products_options['products_options_values_name']);
 361            if ($products_options['options_values_price'] != '0') {
 362              $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->format($products_options['options_values_price'], true, $order->info['currency'], $order->info['currency_value']) .')';
 363            }
 364          }
 365          
 366          if(isset($_POST['add_product_options'])) {
 367            $selected_attribute = $_POST['add_product_options'][$products_options_name['products_options_id']];
 368          } else {
 369            $selected_attribute = false;
 370          }
 371          
 372          echo   '            <td class="dataTableContent" valign="top">' . tep_draw_pull_down_menu('add_product_options[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td>' . "\n" .
 373                 '            <td class="dataTableContent">&nbsp;</td>' . "\n" .
 374                 '          </tr>' . "\n" .
 375                 '          <tr class="dataTableRow">' . "\n";
 376          $i++;
 377        }
 378        echo '            <td class="dataTableContent">&nbsp;</td>' . "\n" .
 379             '            <td class="dataTableContent" colspan="2" align="left"><input type="submit" value="' . TEXT_BUTTON_SELECT_OPTIONS . '"><input type="hidden" name="step" value="4"><input type="hidden" name="add_product_categories_id" value="' . $add_product_categories_id . '"><input type="hidden" name="add_product_products_id" value="' . $add_product_products_id . '">' . ((isset($_POST['search'])) ? '<input type="hidden" name="search" value="1"><input type="hidden" name="product_search" value="' . $_POST['product_search'] . '">' : '') . '</td>' . "\n" .
 380             '          </tr>' . "\n" .
 381             '          </form>' . "\n";
 382      } else {
 383        $step = 4;
 384        echo '            <td class="dataTableContent" valign="top" colspan="2">' . TEXT_SKIP_NO_OPTIONS . '</td>' . "\n" .
 385             '          </tr>' . "\n";
 386      }
 387    }
 388  
 389    if ($step > 3) {
 390      echo '          <tr class="dataTableRow">' . "\n" .
 391           '            <td colspan="3" style="border-bottom: 1px solid #C9C9C9;">' . tep_draw_separator('pixel_trans.gif', '1', '1') . '</td>' . "\n" .
 392           '          </tr>' . "\n" .
 393           '          <tr class="dataTableRow">' . "\n" .
 394           '            <td colspan="3" style="background: #FFFFFF;">' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' . "\n" .
 395           '          </tr>' . "\n" .
 396           '          <tr class="dataTableRow">' . "\n" .
 397           '            <td colspan="3" style="border-top: 1px solid #C9C9C9;">' . tep_draw_separator('pixel_trans.gif', '1', '1') . '</td>' . "\n" .
 398           '          </tr>' . "\n" .
 399           '          <form action="' . tep_href_link(FILENAME_ORDERS_EDIT_ADD_PRODUCT, 'oID=' . $_GET['oID'] . '&action=add_product') . '" method="post">' . "\n" .
 400           '          <tr class="dataTableRow">' . "\n" .
 401           '            <td class="dataTableContent" align="right" valign="middle">' . TEXT_STEP_4 . '</td>' . "\n" .
 402           '            <td class="dataTableContent" align="left" valign="middle">' . TEXT_QUANTITY . '&nbsp;<input name="add_product_quantity" size="3" value="1"></td>' . "\n" .
 403           '            <td class="dataTableContent" align="center" valign="middle"></td>' . "\n" .
 404           '          </tr>' . "\n" . 
 405           '          <tr class="dataTableRow">' . "\n" .
 406           '             <td></td>' . "\n" . 
 407           '             <td colspan="2"><input type="submit" value="' . TEXT_BUTTON_ADD_PRODUCT .'">' . "\n" .
 408           '           ';
 409      if (isset($_POST['add_product_options'])) {
 410        foreach($_POST['add_product_options'] as $option_id => $option_value_id) {
 411          echo '<input type="hidden" name="add_product_options['.$option_id.']" value="' . $option_value_id . '">';
 412        }
 413      }
 414      echo '<input type="hidden" name="add_product_categories_id" value="' . $add_product_categories_id . '"><input type="hidden" name="add_product_products_id" value="' . $add_product_products_id . '"><input type="hidden" name="step" value="5"></td>' . "\n" .
 415           '          </tr>' . "\n" .
 416           '          </form>' . "\n";
 417    }
 418  ?>
 419          </table></td>
 420        </tr>
 421      </table>
 422      <!-- body_text_eof //-->
 423   
 424             <div align="center" class="dataTableContent">
 425   
 426                     <script language="JavaScript" type="text/javascript">
 427                     <!--
 428                      document.write("<a href=\"javascript:self.close();\"><?php echo TEXT_CLOSE_POPUP; ?></a>");
 429                     //-->
 430                    </script>
 431                  
 432                    <noscript>
 433                     <strong>
 434                      <?php echo TEXT_ADD_PRODUCT_INSTRUCTIONS; ?>
 435                     </strong>
 436                    </noscript>
 437                  
 438             </div>
 439  
 440      
 441  <!-- body_eof //-->
 442  
 443  </body>
 444  </html>
 445  <?php  //eof   ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7