[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/includes/modules/ -> create_order_details.php (source)

   1  <?php
   2  /*

   3  $Id: create_order_details.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  function sbs_get_zone_name($country_id, $zone_id) {
  14      $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . $country_id . "' and zone_id = '" . $zone_id . "'");
  15      if (tep_db_num_rows($zone_query)) {
  16        $zone = tep_db_fetch_array($zone_query);
  17        return $zone['zone_name'];
  18      } else {
  19        return $default_zone;
  20      }
  21    }
  22   
  23   // Returns an array with countries

  24  // TABLES: countries

  25    function sbs_get_countries($countries_id = '', $with_iso_codes = false) {
  26      $countries_array = array();
  27      if ($countries_id) {
  28        if ($with_iso_codes) {
  29          $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "' order by countries_name");
  30          $countries_values = tep_db_fetch_array($countries);
  31          $countries_array = array('countries_name' => $countries_values['countries_name'],
  32                                   'countries_iso_code_2' => $countries_values['countries_iso_code_2'],
  33                                   'countries_iso_code_3' => $countries_values['countries_iso_code_3']);
  34        } else {
  35          $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $countries_id . "'");
  36          $countries_values = tep_db_fetch_array($countries);
  37          $countries_array = array('countries_name' => $countries_values['countries_name']);
  38        }
  39      } else {
  40        $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name");
  41        while ($countries_values = tep_db_fetch_array($countries)) {
  42          $countries_array[] = array('countries_id' => $countries_values['countries_id'],
  43                                     'countries_name' => $countries_values['countries_name']);
  44        }
  45      }
  46  
  47      return $countries_array;
  48    } 
  49    ////

  50  function sbs_get_country_list($name, $selected = '', $parameters = '') { 
  51     $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); 
  52     $countries = sbs_get_countries(); 
  53     $size = sizeof($countries); 
  54     for ($i=0; $i<$size; $i++) { 
  55       $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); 
  56     } 
  57  
  58     return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); 
  59  }
  60  
  61  ?>
  62  
  63  <?php
  64      tep_draw_hidden_field($account['customers_id']);    
  65  ?>
  66  <table border="0" width="100%" cellspacing="0" cellpadding="2">
  67    <tr>
  68      <td class="formAreaTitle"><?php echo CATEGORY_CORRECT; ?></td>
  69    </tr>
  70    <tr>
  71      <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
  72        <tr>
  73          <td class="main"><table border="0" cellspacing="0" cellpadding="2">
  74                      <tr>
  75              <td class="main">&nbsp;<?php echo ENTRY_CUSTOMERS_ID; ?></td>
  76              <td class="main">&nbsp;
  77  <?php
  78    if ($is_read_only) {
  79      echo $account['customers_id'];
  80  
  81    } else {
  82      echo tep_draw_input_field('customers_id', $account['customers_id']) . '&nbsp;' . ENTRY_CUSTOMERS_ID_TEXT;
  83    }
  84  ?></td>
  85            </tr>
  86            <tr>
  87              <td class="main">&nbsp;<?php echo ENTRY_FIRST_NAME; ?></td>
  88              <td class="main">&nbsp;
  89  <?php
  90    if ($is_read_only) {
  91      echo $account['customers_firstname'];
  92  
  93    } else {
  94      echo tep_draw_input_field('firstname', $account['customers_firstname']) . '&nbsp;' . ENTRY_FIRST_NAME_TEXT;
  95    }
  96  ?></td>
  97            </tr>
  98            <tr>
  99              <td class="main">&nbsp;<?php echo ENTRY_LAST_NAME; ?></td>
 100              <td class="main">&nbsp;
 101  <?php
 102    if ($is_read_only) {
 103      echo $account['customers_lastname'];
 104    } else {
 105      echo tep_draw_input_field('lastname', $account['customers_lastname']) . '&nbsp;' . ENTRY_LAST_NAME_TEXT;
 106    }
 107  ?></td>
 108            </tr>
 109  <?php
 110    //}

 111  ?>
 112            <tr>
 113              <td class="main">&nbsp;<?php echo ENTRY_EMAIL_ADDRESS; ?></td>
 114              <td class="main">&nbsp;
 115  <?php
 116    if ($is_read_only) {
 117      echo $account['customers_email_address'];
 118    } else {
 119      echo tep_draw_input_field('email_address', $account['customers_email_address']) . '&nbsp;' . ENTRY_EMAIL_ADDRESS_TEXT;
 120    }
 121  ?></td>
 122            </tr>
 123          </table></td>
 124        </tr>
 125      </table></td>
 126    </tr>
 127  <?php
 128    if (ACCOUNT_COMPANY == 'true') {
 129  ?>  
 130    <tr>
 131      <td class="formAreaTitle"><br><?php echo CATEGORY_COMPANY; ?></td>
 132    </tr>
 133    <tr>
 134      <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
 135        <tr>
 136          <td class="main"><table border="0" cellspacing="0" cellpadding="2">
 137            <tr>
 138              <td class="main">&nbsp;<?php echo ENTRY_COMPANY; ?></td>
 139              <td class="main">&nbsp;
 140  <?php
 141      if ($is_read_only) {
 142        echo $address['entry_company'];
 143      } else {
 144        echo tep_draw_input_field('company', $address['entry_company']) . '&nbsp;' . ENTRY_COMPANY_TEXT;
 145      }
 146  ?></td>
 147            </tr>
 148          </table></td>
 149        </tr>
 150      </table></td>
 151    </tr>
 152  <?php
 153    }
 154  ?>
 155    <tr>
 156      <td class="formAreaTitle"><br><?php echo CATEGORY_ADDRESS; ?></td>
 157    </tr>
 158    <tr>
 159      <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
 160        <tr>
 161          <td class="main"><table border="0" cellspacing="0" cellpadding="2">
 162            <tr>
 163              <td class="main">&nbsp;<?php echo ENTRY_STREET_ADDRESS; ?></td>
 164              <td class="main">&nbsp;
 165  <?php
 166    if ($is_read_only) {
 167      echo $address['entry_street_address'];
 168    } else {
 169      echo tep_draw_input_field('street_address', $address['entry_street_address']) . '&nbsp;' . ENTRY_STREET_ADDRESS_TEXT;
 170    }
 171  ?></td>
 172            </tr>
 173  <?php
 174    if (ACCOUNT_SUBURB == 'true') {
 175  ?>
 176            <tr>
 177              <td class="main">&nbsp;<?php echo ENTRY_SUBURB; ?></td>
 178              <td class="main">&nbsp;
 179  <?php
 180      if ($is_read_only) {
 181        echo $address['entry_suburb'];
 182      } else {
 183        echo tep_draw_input_field('suburb', $address['entry_suburb']) . '&nbsp;' . ENTRY_SUBURB_TEXT;
 184      }
 185  ?></td>
 186            </tr>
 187  <?php
 188    }
 189  ?>
 190            <tr>
 191              <td class="main">&nbsp;<?php echo ENTRY_POST_CODE; ?></td>
 192              <td class="main">&nbsp;
 193  <?php
 194    if ($is_read_only) {
 195      echo $address['entry_postcode'];
 196    } else {
 197      echo tep_draw_input_field('postcode', $address['entry_postcode']) . '&nbsp;' . ENTRY_POST_CODE_TEXT;
 198    }
 199  ?></td>
 200            </tr>
 201            <tr>
 202              <td class="main">&nbsp;<?php echo ENTRY_CITY; ?></td>
 203              <td class="main">&nbsp;
 204  <?php
 205    if ($is_read_only) {
 206      echo $address['entry_city'];
 207    } else {
 208      echo tep_draw_input_field('city', $address['entry_city']) . '&nbsp;' . ENTRY_CITY_TEXT;
 209    }
 210  ?></td>
 211            </tr>
 212  <?php
 213    if (ACCOUNT_STATE == 'true') {
 214  ?>
 215            <tr>
 216              <td class="main">&nbsp;<?php echo ENTRY_STATE; ?></td>
 217              <td class="main">&nbsp;
 218  <?php
 219      $state = sbs_get_zone_name($country, $zone_id, $state);
 220      if ($is_read_only) {
 221        echo sbs_get_zone_name($address['entry_country_id'], $account['entry_zone_id'], $account['entry_state']);
 222      } else {
 223        echo tep_draw_input_field('state', sbs_get_zone_name($address['entry_country_id'], $address['entry_zone_id'], $address['entry_state'])) . '&nbsp;' . ENTRY_STATE_TEXT;
 224      }
 225  ?></td>
 226               </tr>
 227  <?php
 228       }
 229  ?>
 230               <tr>
 231                 <td class="main">&nbsp;<?php echo ENTRY_COUNTRY; ?></td>
 232                 <td class="main">&nbsp;
 233  <?php
 234      if ($is_read_only) {
 235             echo tep_get_country_name($address['entry_country_id']);
 236      } else { 
 237      echo tep_draw_input_field('country', tep_get_country_name($address['entry_country_id'])) . '&nbsp;' . ENTRY_COUNTRY_TEXT;
 238  
 239       }
 240  ?>
 241  
 242  <?php
 243  
 244       tep_draw_hidden_field('step', '3')
 245  ?>
 246  
 247  </td>
 248            </tr>
 249          </table></td>
 250        </tr>
 251      </table></td>
 252    </tr>
 253    <tr>
 254      <td class="formAreaTitle"><br><?php echo CATEGORY_CONTACT; ?></td>
 255    </tr>
 256    <tr>
 257      <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
 258        <tr>
 259          <td class="main"><table border="0" cellspacing="0" cellpadding="2">
 260            <tr>
 261              <td class="main">&nbsp;<?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
 262              <td class="main">&nbsp;
 263  <?php
 264    if ($is_read_only) {
 265      echo $account['customers_telephone'];
 266    } else {
 267      echo tep_draw_input_field('telephone', $account['customers_telephone']) . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT;
 268    } ?>
 269                </td>
 270              </tr>
 271              <tr>
 272                <td class="main">&nbsp;<?php echo ENTRY_FAX_NUMBER; ?></td>
 273                <td class="main">&nbsp;
 274                  <?php
 275    if ($is_read_only) {
 276      echo $account['customers_fax'];
 277    } else {
 278      echo tep_draw_input_field('fax', $account['customers_fax']) . '&nbsp;' . ENTRY_FAX_NUMBER_TEXT;
 279    }
 280  ?></td>
 281              </tr>
 282            </table></td>
 283        </tr>
 284        </table>
 285        <tr>
 286          <td class="formAreaTitle"><br>
 287            <?php echo CATEGORY_ORDER_DETAILS; ?></td>
 288        </tr>
 289        <tr>
 290          <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
 291              <tr>
 292                <td class="main"><table border="0" cellspacing="0" cellpadding="2">
 293                    <tr>
 294                      <td class="main">&nbsp;<?php echo ENTRY_CURRENCY; ?></td>
 295                      <td class="main"><?php echo $SelectCurrencyBox ?></td>
 296                    </tr>
 297                  </table></td>
 298              </tr>
 299            </table></td>
 300        </tr>
 301      </table>


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