[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_module/mod_shop/inc/ -> show.orders.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // ----------------------------------------------------------------
  24  // obligate check for phpwcms constants
  25  if (!defined('PHPWCMS_ROOT')) {
  26     die("You Cannot Access This Script Directly, Have a Nice Day.");
  27  }
  28  // ----------------------------------------------------------------
  29  
  30  ?>
  31  <h1 class="title" style="margin-bottom:10px"><?php echo $BLM['shopprod_order'] ?></h1>
  32  
  33  <div class="show">
  34  
  35  <table border="0" cellpadding="0" cellspacing="0" width="100%" summary="">
  36  
  37      <tr> 
  38          <td class="chatlist"><?php echo $BLM['shopprod_order_date'] ?>:&nbsp;</td>
  39          <td width="410" class="v12"><?php echo html_specialchars(date($BLM['shopprod_date_long'], $plugin['data']['order_date_unix'])) ?></td>
  40      </tr>
  41      
  42      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  43      
  44      <tr> 
  45          <td class="chatlist"><?php echo $BLM['shopprod_ordernumber'] ?>:&nbsp;</td>
  46          <td class="v12b tdbottom5"><strong><?php echo html_specialchars($plugin['data']['order_number']) ?></strong></td>
  47      </tr>
  48      <tr> 
  49          <td class="chatlist"><?php echo $BLM['th_payment'] ?>:&nbsp;</td>
  50          <td class="v12b tdbottom5"><strong><?php echo html_specialchars($BLM[ 'shopprod_payby_'.$plugin['data']['order_payment'] ]) ?></strong></td>
  51      </tr>
  52      <tr> 
  53          <td class="chatlist" style="padding-top:3px;"><?php echo $BL['be_ftptakeover_status'] ?>:&nbsp;</td>
  54          <td class="v12b">
  55          <form action="<?php echo shop_url('controller=order').'&amp;show='.$plugin['data']['order_id'] ?>" method="post">
  56              <input type="hidden" name="order_status" value="<?php echo $plugin['data']['order_id'] ?>" />
  57              <table cellpadding="0" cellspacing="0" border="0" summary="">
  58          
  59              <tr class="row">
  60                  <td><input type="checkbox" name="status_payment" value="PAYED" id="status_payment"<?php echo order_status('PAYED', $plugin['data']['order_status']) ?> onchange="this.form.submit();" /></td>
  61                  <td><label for="status_payment"><?php echo $BLM['shopprod_status_paid']?>&nbsp;</label></td>
  62                  <td><input type="checkbox" name="status_send" value="SENT" id="status_send"<?php echo order_status('SENT', $plugin['data']['order_status']) ?> onchange="this.form.submit();" /></td>
  63                  <td><label for="status_send"><?php echo $BLM['shopprod_status_sent'] ?>&nbsp;</label></td>
  64                  <td><input type="checkbox" name="status_back" value="RETURN" id="status_back"<?php echo order_status('RETURN', $plugin['data']['order_status']) ?> onchange="this.form.submit();" /></td>
  65                  <td><label for="status_back"><?php echo $BLM['shopprod_status_back'] ?>&nbsp;</label></td>
  66                  <td><input type="checkbox" name="status_done" value="COMPLETED" id="status_done"<?php echo order_status('COMPLETED', $plugin['data']['order_status']) ?> onchange="this.form.submit();" /></td>
  67                  <td><label for="status_done"><?php echo $BLM['shopprod_status_done'] ?></label></td>
  68              </tr>
  69  
  70              </table>
  71          </form>
  72          </td>
  73      </tr>
  74      
  75      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15" /></td></tr>
  76      
  77      <tr> 
  78          <td class="chatlist"><?php echo $BL['be_profile_label_firstname'] ?>:&nbsp;</td>
  79          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_firstname']) ?></td>
  80      </tr>
  81      <tr> 
  82          <td class="chatlist"><?php echo $BL['be_profile_label_name'] ?>:&nbsp;</td>
  83          <td class="v12 tdbottom3"><strong><?php echo html_specialchars($plugin['data']['order_name']) ?></strong></td>
  84      </tr>
  85      <tr> 
  86          <td class="chatlist"><?php echo $BLM['shopprod_order_address'] ?>:&nbsp;</td>
  87          <td class="v12 tdbottom3"><?php echo nl2br( html_specialchars($plugin['data']['order_data']['address']['INV_ADDRESS'])) ?></td>
  88      </tr>
  89      <tr> 
  90          <td class="chatlist"><?php echo $BL['be_profile_label_zip'] ?>:&nbsp;</td>
  91          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_ZIP']) ?></td>
  92      </tr>
  93      <tr> 
  94          <td class="chatlist"><?php echo $BL['be_profile_label_city'] ?>:&nbsp;</td>
  95          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_CITY']) ?></td>
  96      </tr>
  97      <tr> 
  98          <td class="chatlist"><?php echo $BLM['shopprod_order_region'] ?>:&nbsp;</td>
  99          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_REGION']) ?>&nbsp;</td>
 100      </tr>
 101      <tr> 
 102          <td class="chatlist"><?php echo $BL['be_profile_label_country'] ?>:&nbsp;</td>
 103          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_COUNTRY']) ?>&nbsp;</td>
 104      </tr>
 105      
 106      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
 107  
 108      <tr> 
 109          <td class="chatlist"><?php echo $BL['be_profile_label_email'] ?>:&nbsp;</td>
 110          <td class="v12 tdbottom3"><?php 
 111          
 112          if(is_valid_email($plugin['data']['order_data']['address']['EMAIL'])) {
 113              echo '<a href="mailto:'.html_specialchars($plugin['data']['order_data']['address']['EMAIL']);
 114              echo '?subject='.rawurlencode($BLM['th_ordnr'].': '.$plugin['data']['order_number']).'"><u>';
 115              echo html_specialchars($plugin['data']['order_data']['address']['EMAIL']).'</u></a>';
 116          } else {
 117              echo '&nbsp;';
 118          }
 119          ?></td>
 120      </tr>
 121      <tr> 
 122          <td class="chatlist"><?php echo $BL['be_profile_label_phone'] ?>:&nbsp;</td>
 123          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['PHONE']) ?>&nbsp;</td>
 124      </tr>
 125      
 126  <?php
 127  
 128      $plugin['custom'] = array();
 129  
 130      foreach($plugin['data']['order_data']['address'] as $custom_key => $custom_field) {
 131      
 132          if(strpos($custom_key, 'shop_field') === FALSE) {
 133              continue;
 134          }
 135          
 136          $plugin['custom'][$custom_key] = $custom_field;
 137      
 138      }
 139      
 140      if(count($plugin['custom'])) {
 141  
 142  ?>    <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr><?php
 143  
 144          foreach($plugin['custom'] as $custom_key => $custom_field) {
 145  
 146  ?>
 147      <tr> 
 148          <td class="chatlist"><?php echo $BLM['shopprod_custom_field'].str_replace('shop_field_', ' ', $custom_key) ?>:&nbsp;</td>
 149          <td class="v12 tdbottom3"><?php echo nl2br( html_specialchars($custom_field) ) ?>&nbsp;</td>
 150      </tr>
 151  
 152  <?php        
 153          }    
 154      }
 155      
 156      $plugin['data']['currency'] = ' '.html_entities( _getConfig( 'shop_pref_currency' ) );
 157      $plugin['data']['weight_unit'] = ' '.html_entities( _getConfig( 'shop_pref_unit_weight' ) );
 158  
 159  ?>
 160  
 161      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
 162      
 163      <tr> 
 164          <td class="chatlist"><?php echo $BLM['shopprod_ordered'] ?>:&nbsp;</td>
 165          <td><table cellpadding="0" cellspacing="0" border="0" summary="" width="100%">
 166          
 167          <tr>
 168              <th><?php echo $BLM['shopprod_quantity'] ?></th>
 169              <th><?php echo $BLM['shopprod_name1'] ?></th>
 170              <th class="right"><?php echo $BLM['shopprod_net'].' '.$plugin['data']['currency'] ?></th>
 171              <th class="right"><?php echo $BLM['shopprod_vat'].'%' ?></th>
 172              <th class="right"><?php echo $BLM['shopprod_total'].' '.$plugin['data']['currency'] ?></th>            
 173          </tr>
 174          
 175  <?php
 176  
 177      $_controller_link =  shop_url('controller=prod');
 178  
 179      foreach($plugin['data']['order_data']['cart'] as $plugin['product']) {
 180      
 181          $plugin['vat_factor'] = 1 + ( $plugin['product']['shopprod_vat'] / 100 );
 182          
 183          if($plugin['product']['shopprod_netgross'] == 1) {
 184              $plugin['price_net']    = $plugin['product']['shopprod_price'] / $plugin['vat_factor'];
 185              $plugin['price_gross']    = $plugin['product']['shopprod_price'];
 186          } else {
 187              $plugin['price_net']    = $plugin['product']['shopprod_price'];
 188              $plugin['price_gross']    = $plugin['product']['shopprod_price'] * $plugin['vat_factor'];
 189          }
 190          $plugin['price_vat']        = $plugin['price_gross'] - $plugin['price_net'];
 191  
 192          if(empty($plugin['product']['shopprod_quantity'])) {
 193              $plugin['product']['shopprod_quantity'] = 1;
 194          }
 195  ?>
 196          <tr class="product">
 197              <td><?php echo $plugin['product']['shopprod_quantity'] ?></td>
 198              <td><a href="<?php echo $_controller_link.'&amp;edit='.$plugin['product']["shopprod_id"] ?>" target="_blank"><?php echo html_specialchars($plugin['product']['shopprod_name1']) ?></a></td>
 199              <td class="number"><?php echo number_format($plugin['price_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 200              <td class="number"><?php echo number_format($plugin['product']['shopprod_vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 201              <td class="number"><?php echo number_format($plugin['product']['shopprod_quantity'] * $plugin['price_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 202          </tr>
 203  
 204  
 205  <?php
 206  
 207      }
 208  
 209      if(isset($plugin['data']['order_data']['subtotal'])) {
 210      
 211          $plugin['data']['order_data']['subtotal']['vat'] = $plugin['data']['order_data']['subtotal']['subtotal_gross'] - $plugin['data']['order_data']['subtotal']['subtotal_net'];
 212  ?>
 213          <tr class="product linetop">
 214              <td colspan="2" class="chatlist"><?php echo $BLM['shopprod_subtotal'].' '.$plugin['data']['currency'] ?>:</td>
 215              <td class="number"><?php echo number_format($plugin['data']['order_data']['subtotal']['subtotal_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 216              <td class="number"><?php echo number_format($plugin['data']['order_data']['subtotal']['vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 217              <td class="number"><?php echo number_format($plugin['data']['order_data']['subtotal']['subtotal_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 218          </tr>
 219          
 220          <tr class="product linebottom">
 221              <td colspan="2" class="chatlist"><?php
 222              
 223              if(isset($plugin['data']['order_data']['weight'])) {
 224                  echo $BLM['shopprod_weight'];
 225                  echo number_format($plugin['data']['order_data']['weight'], 0, $BLM['dec_point'], $BLM['thousands_sep']);
 226                  echo ' '.$plugin['data']['weight_unit'];
 227                  echo ' &#8211; ';
 228              }
 229                  
 230              echo $BLM['shopprod_shipping'].' '.$plugin['data']['currency'];
 231                  
 232              $plugin['data']['order_data']['shipping']['vat'] = $plugin['data']['order_data']['shipping']['shipping_gross'] - $plugin['data']['order_data']['shipping']['shipping_net'];
 233                  
 234              ?>:</td>
 235              <td class="number"><?php echo number_format($plugin['data']['order_data']['shipping']['shipping_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 236              <td class="number"><?php echo number_format($plugin['data']['order_data']['shipping']['vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 237              <td class="number"><?php echo number_format($plugin['data']['order_data']['shipping']['shipping_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 238          </tr>
 239  
 240  <?php
 241      }
 242  ?>
 243          
 244          <tr class="product total"> 
 245              <td colspan="2" class="chatlist"><?php echo $BLM['shopprod_total_net'].' '.$plugin['data']['currency'] ?>:&nbsp;</td>
 246              <td colspan="3" class="v12 number"><?php echo number_format($plugin['data']['order_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 247          </tr>
 248          <tr class="product total"> 
 249              <td colspan="2" class="chatlist"><?php echo $BLM['shopprod_total_vat'].' '.$plugin['data']['currency'] ?>:&nbsp;</td>
 250              <td colspan="3" class="v12 number"><?php echo number_format($plugin['data']['order_gross'] - $plugin['data']['order_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 251          </tr>
 252          <tr class="product total end"> 
 253              <td colspan="2" class="chatlist"><?php echo $BLM['shopprod_total_gross'].' '.$plugin['data']['currency'] ?>:&nbsp;</td>
 254              <td colspan="3" class="v12 number"><b><?php echo number_format($plugin['data']['order_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></b></td>
 255          </tr>
 256  
 257          </table></td>
 258      </tr>
 259      
 260      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="20" /></td></tr>
 261      
 262      <tr> 
 263          <td class="chatlist" style="padding-top:7px;"><?php echo $BLM['shopprod_email_customer'] ?>:&nbsp;</td>
 264          <td class="tdbottom5 email"><pre><?php echo html_specialchars($plugin['data']['order_data']['mail_customer']) ?></pre></td>
 265      </tr>
 266  
 267  <?php if(!empty($plugin['data']['order_data']['mail_self'])) { ?>
 268  
 269      <tr> 
 270          <td class="chatlist" style="padding-top:7px;"><?php echo $BLM['shopprod_email_shop'] ?>:&nbsp;</td>
 271          <td class="email"><pre><?php echo html_specialchars($plugin['data']['order_data']['mail_self']) ?></pre></td>
 272      </tr>
 273  
 274  <?php } ?>
 275  
 276  </table>
 277  
 278  </div>
 279  
 280  <input type="button" class="button10" style="margin-top:5px;" value="<?php echo $BL['be_func_struct_close'] ?>" onclick="document.location.href='<?php echo shop_url('controller=order') ?>'" />
 281  
 282  <?php
 283  /*
 284  unset($plugin['data']['order_data']['mail_customer'], $plugin['data']['order_data']['address'], $plugin['data']['order_data']['mail_self'], $plugin['data']['order_data']['cart'][0]['shopprod_var']);
 285  dumpVar($plugin['data']['order_data']);
 286  */
 287  
 288  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7