[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

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

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2012 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 
  40          
  41              echo html_specialchars(date($BLM['shopprod_date_long'], $plugin['data']['order_date_unix'])); 
  42          
  43              if(SHOP_FELANG_SUPPORT) {
  44                  $plugin['data']['order_data']['lang'] = html_specialchars(strtolower($plugin['data']['order_data']['lang']));
  45                  echo '&nbsp;&nbsp;&nbsp;<span class="chatlist">'.$BL['be_profile_label_lang'].':</span> ';
  46                  echo '<img src="img/famfamfam/lang/';
  47                  echo $plugin['data']['order_data']['lang'] ? $plugin['data']['order_data']['lang'] : 'all';
  48                  echo '.png" alt="'.$plugin['data']['order_data']['lang'].'" style="position:relative;top:1px;" />';
  49              }    
  50              
  51          ?></td>
  52      </tr>
  53      
  54      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
  55      
  56      <tr> 
  57          <td class="chatlist"><?php echo $BLM['shopprod_ordernumber'] ?>:&nbsp;</td>
  58          <td class="v12b tdbottom5"><strong><?php echo html_specialchars($plugin['data']['order_number']) ?></strong></td>
  59      </tr>
  60      <tr> 
  61          <td class="chatlist"><?php echo $BLM['th_payment'] ?>:&nbsp;</td>
  62          <td class="v12b tdbottom5"><strong><?php echo html_specialchars($BLM[ 'shopprod_payby_'.$plugin['data']['order_payment'] ]) ?></strong></td>
  63      </tr>
  64      <tr> 
  65          <td class="chatlist" style="padding-top:3px;"><?php echo $BL['be_ftptakeover_status'] ?>:&nbsp;</td>
  66          <td class="v12b">
  67          <form action="<?php echo shop_url('controller=order').'&amp;show='.$plugin['data']['order_id'] ?>" method="post">
  68              <input type="hidden" name="order_status" value="<?php echo $plugin['data']['order_id'] ?>" />
  69              <table cellpadding="0" cellspacing="0" border="0" summary="">
  70          
  71              <tr class="row">
  72                  <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>
  73                  <td><label for="status_payment"><?php echo $BLM['shopprod_status_paid']?>&nbsp;</label></td>
  74                  <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>
  75                  <td><label for="status_send"><?php echo $BLM['shopprod_status_sent'] ?>&nbsp;</label></td>
  76                  <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>
  77                  <td><label for="status_back"><?php echo $BLM['shopprod_status_back'] ?>&nbsp;</label></td>
  78                  <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>
  79                  <td><label for="status_done"><?php echo $BLM['shopprod_status_done'] ?></label></td>
  80              </tr>
  81  
  82              </table>
  83          </form>
  84          </td>
  85      </tr>
  86      
  87      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15" /></td></tr>
  88      
  89      <tr> 
  90          <td class="chatlist"><?php echo $BL['be_profile_label_firstname'] ?>:&nbsp;</td>
  91          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_firstname']) ?></td>
  92      </tr>
  93      <tr> 
  94          <td class="chatlist"><?php echo $BL['be_profile_label_name'] ?>:&nbsp;</td>
  95          <td class="v12 tdbottom3"><strong><?php echo html_specialchars($plugin['data']['order_name']) ?></strong></td>
  96      </tr>
  97      <tr> 
  98          <td class="chatlist"><?php echo $BLM['shopprod_order_address'] ?>:&nbsp;</td>
  99          <td class="v12 tdbottom3"><?php echo nl2br( html_specialchars($plugin['data']['order_data']['address']['INV_ADDRESS'])) ?></td>
 100      </tr>
 101      <tr> 
 102          <td class="chatlist"><?php echo $BL['be_profile_label_zip'] ?>:&nbsp;</td>
 103          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_ZIP']) ?></td>
 104      </tr>
 105      <tr> 
 106          <td class="chatlist"><?php echo $BL['be_profile_label_city'] ?>:&nbsp;</td>
 107          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_CITY']) ?></td>
 108      </tr>
 109      <tr> 
 110          <td class="chatlist"><?php echo $BLM['shopprod_order_region'] ?>:&nbsp;</td>
 111          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_REGION']) ?>&nbsp;</td>
 112      </tr>
 113      <tr> 
 114          <td class="chatlist"><?php echo $BL['be_profile_label_country'] ?>:&nbsp;</td>
 115          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['INV_COUNTRY']) ?>&nbsp;</td>
 116      </tr>
 117      
 118      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
 119  
 120      <tr> 
 121          <td class="chatlist"><?php echo $BL['be_profile_label_email'] ?>:&nbsp;</td>
 122          <td class="v12 tdbottom3"><?php 
 123          
 124          if(is_valid_email($plugin['data']['order_data']['address']['EMAIL'])) {
 125              echo '<a href="mailto:'.html_specialchars($plugin['data']['order_data']['address']['EMAIL']);
 126              echo '?subject='.rawurlencode($BLM['th_ordnr'].': '.$plugin['data']['order_number']).'"><u>';
 127              echo html_specialchars($plugin['data']['order_data']['address']['EMAIL']).'</u></a>';
 128          } else {
 129              echo '&nbsp;';
 130          }
 131          ?></td>
 132      </tr>
 133      <tr> 
 134          <td class="chatlist"><?php echo $BL['be_profile_label_phone'] ?>:&nbsp;</td>
 135          <td class="v12 tdbottom3"><?php echo html_specialchars($plugin['data']['order_data']['address']['PHONE']) ?>&nbsp;</td>
 136      </tr>
 137      
 138  <?php
 139  
 140      $plugin['custom'] = array();
 141  
 142      foreach($plugin['data']['order_data']['address'] as $custom_key => $custom_field) {
 143      
 144          if(strpos($custom_key, 'shop_field') === FALSE) {
 145              continue;
 146          }
 147          
 148          $plugin['custom'][$custom_key] = $custom_field;
 149      
 150      }
 151      
 152      if(count($plugin['custom'])) {
 153  
 154  ?>    <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr><?php
 155  
 156          foreach($plugin['custom'] as $custom_key => $custom_field) {
 157  
 158  ?>
 159      <tr> 
 160          <td class="chatlist"><?php echo $BLM['shopprod_custom_field'].str_replace('shop_field_', ' ', $custom_key) ?>:&nbsp;</td>
 161          <td class="v12 tdbottom3"><?php echo nl2br( html_specialchars($custom_field) ) ?>&nbsp;</td>
 162      </tr>
 163  
 164  <?php        
 165          }    
 166      }
 167      
 168      $plugin['data']['currency'] = ' '.html_entities( _getConfig( 'shop_pref_currency' ) );
 169      $plugin['data']['weight_unit'] = ' '.html_entities( _getConfig( 'shop_pref_unit_weight' ) );
 170  
 171  ?>
 172  
 173      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
 174      
 175      <tr> 
 176          <td class="chatlist"><?php echo $BLM['shopprod_ordered'] ?>:&nbsp;</td>
 177          <td><table cellpadding="0" cellspacing="0" border="0" summary="" width="100%">
 178          
 179          <tr>
 180              <th><?php echo $BLM['shopprod_quantity'] ?></th>
 181              <th><?php echo $BLM['th_ordnr'] ?></th>
 182              <th><?php echo $BLM['shopprod_name1'] ?></th>
 183              <th class="right"><?php echo $BLM['shopprod_net'].' '.$plugin['data']['currency'] ?></th>
 184              <th class="right"><?php echo $BLM['shopprod_vat'].'%' ?></th>
 185              <th class="right"><?php echo $BLM['shopprod_total'].' '.$plugin['data']['currency'] ?></th>            
 186          </tr>
 187          
 188  <?php
 189  
 190      $_controller_link =  shop_url('controller=prod');
 191  
 192      foreach($plugin['data']['order_data']['cart'] as $plugin['product']) {
 193      
 194          $plugin['vat_factor'] = 1 + ( $plugin['product']['shopprod_vat'] / 100 );
 195          
 196          if($plugin['product']['shopprod_netgross'] == 1) {
 197              $plugin['price_net']    = $plugin['product']['shopprod_price'] / $plugin['vat_factor'];
 198              $plugin['price_gross']    = $plugin['product']['shopprod_price'];
 199          } else {
 200              $plugin['price_net']    = $plugin['product']['shopprod_price'];
 201              $plugin['price_gross']    = $plugin['product']['shopprod_price'] * $plugin['vat_factor'];
 202          }
 203          $plugin['price_vat']        = $plugin['price_gross'] - $plugin['price_net'];
 204  
 205          if(empty($plugin['product']['shopprod_quantity'])) {
 206              $plugin['product']['shopprod_quantity'] = 1;
 207          }
 208  ?>
 209          <tr class="product">
 210              <td><?php echo $plugin['product']['shopprod_quantity'] ?></td>
 211              <td><?php echo html_specialchars($plugin['product']['shopprod_ordernumber']) ?></td>
 212              <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>
 213              <td class="number"><?php echo number_format($plugin['price_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 214              <td class="number"><?php echo number_format($plugin['product']['shopprod_vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 215              <td class="number"><?php echo number_format($plugin['product']['shopprod_quantity'] * $plugin['price_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 216          </tr>
 217  
 218  
 219  <?php
 220  
 221      }
 222  
 223      if(isset($plugin['data']['order_data']['subtotal'])) {
 224      
 225          $plugin['data']['order_data']['subtotal']['vat'] = $plugin['data']['order_data']['subtotal']['subtotal_gross'] - $plugin['data']['order_data']['subtotal']['subtotal_net'];
 226          
 227  ?>
 228          <tr class="product linetop">
 229              <td colspan="3" class="chatlist"><?php echo $BLM['shopprod_subtotal'].' '.$plugin['data']['currency'] ?>:</td>
 230              <td class="number"><?php echo number_format($plugin['data']['order_data']['subtotal']['subtotal_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 231              <td class="number"><?php echo number_format($plugin['data']['order_data']['subtotal']['vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 232              <td class="number"><?php echo number_format($plugin['data']['order_data']['subtotal']['subtotal_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 233          </tr>
 234          
 235          <tr class="product linebottom">
 236              <td colspan="3" class="chatlist"><?php
 237              
 238              if(isset($plugin['data']['order_data']['weight'])) {
 239                  echo $BLM['shopprod_weight'].' ';
 240                  echo number_format($plugin['data']['order_data']['weight'], 0, $BLM['dec_point'], $BLM['thousands_sep']);
 241                  echo ' '.$plugin['data']['weight_unit'];
 242                  echo ' &#8211; ';
 243              }
 244                  
 245              echo $BLM['shopprod_shipping'].' '.$plugin['data']['currency'];
 246                  
 247              $plugin['data']['order_data']['shipping']['vat'] = $plugin['data']['order_data']['shipping']['shipping_gross'] - $plugin['data']['order_data']['shipping']['shipping_net'];
 248                  
 249              ?>:</td>
 250              <td class="number"><?php echo number_format($plugin['data']['order_data']['shipping']['shipping_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 251              <td class="number"><?php echo number_format($plugin['data']['order_data']['shipping']['vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 252              <td class="number"><?php echo number_format($plugin['data']['order_data']['shipping']['shipping_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 253          </tr>
 254  
 255  <?php    if(isset($plugin['data']['order_data']['discount'])):
 256              
 257              $plugin['data']['order_data']['discount']['vat'] = $plugin['data']['order_data']['discount']['discount_gross'] - $plugin['data']['order_data']['discount']['discount_net'];
 258              $plugin['data']['shop_pref_discount'] = _getConfig('shop_pref_discount');
 259  ?>
 260          <tr class="product linebottom">
 261              <td colspan="3" class="chatlist"><?php echo $BLM['shopprod_discount'].' '.number_format($plugin['data']['shop_pref_discount']['percent'], 2, $BLM['dec_point'], $BLM['thousands_sep'] ) ?>%:</td>
 262              <td class="number">-<?php echo number_format($plugin['data']['order_data']['discount']['discount_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 263              <td class="number">-<?php echo number_format($plugin['data']['order_data']['discount']['vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 264              <td class="number">-<?php echo number_format($plugin['data']['order_data']['discount']['discount_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 265          </tr>
 266          
 267  <?php    
 268          endif;
 269          if(isset($plugin['data']['order_data']['loworder'])):
 270          
 271              $plugin['data']['order_data']['loworder']['vat'] = $plugin['data']['order_data']['loworder']['loworder_gross'] - $plugin['data']['order_data']['loworder']['loworder_net'];
 272  ?>
 273          <tr class="product linebottom">
 274              <td colspan="3" class="chatlist"><?php echo $BLM['shopprod_loworder'].' '.$plugin['data']['currency'] ?>:</td>
 275              <td class="number"><?php echo number_format($plugin['data']['order_data']['loworder']['loworder_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 276              <td class="number"><?php echo number_format($plugin['data']['order_data']['loworder']['vat'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 277              <td class="number"><?php echo number_format($plugin['data']['order_data']['loworder']['loworder_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>            
 278          </tr>
 279  <?php
 280          endif;
 281  
 282      }
 283      
 284  ?>
 285          
 286          <tr class="product total"> 
 287              <td colspan="3" class="chatlist"><?php echo $BLM['shopprod_total_net'].' '.$plugin['data']['currency'] ?>:&nbsp;</td>
 288              <td colspan="3" class="v12 number"><?php echo number_format($plugin['data']['order_net'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></td>
 289          </tr>
 290          <tr class="product total"> 
 291              <td colspan="3" class="chatlist"><?php echo $BLM['shopprod_total_vat'].' '.$plugin['data']['currency'] ?>:&nbsp;</td>
 292              <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>
 293          </tr>
 294          <tr class="product total end"> 
 295              <td colspan="3" class="chatlist"><?php echo $BLM['shopprod_total_gross'].' '.$plugin['data']['currency'] ?>:&nbsp;</td>
 296              <td colspan="3" class="v12 number"><b><?php echo number_format($plugin['data']['order_gross'], 2, $BLM['dec_point'], $BLM['thousands_sep']); ?></b></td>
 297          </tr>
 298  
 299          </table></td>
 300      </tr>
 301      
 302      <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="20" /></td></tr>
 303      
 304      <tr> 
 305          <td class="chatlist" style="padding-top:7px;"><?php echo $BLM['shopprod_email_customer'] ?>:&nbsp;</td>
 306          <td class="tdbottom5 email"><pre><?php echo html_specialchars($plugin['data']['order_data']['mail_customer']) ?></pre></td>
 307      </tr>
 308  
 309  <?php if(!empty($plugin['data']['order_data']['mail_self'])) { ?>
 310  
 311      <tr> 
 312          <td class="chatlist" style="padding-top:7px;"><?php echo $BLM['shopprod_email_shop'] ?>:&nbsp;</td>
 313          <td class="email"><pre><?php echo html_specialchars($plugin['data']['order_data']['mail_self']) ?></pre></td>
 314      </tr>
 315  
 316  <?php } ?>
 317  
 318  </table>
 319  
 320  </div>
 321  
 322  <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') ?>'" />
 323  
 324  <?php
 325  /*
 326  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']);
 327  dumpVar($plugin['data']['order_data']);
 328  */
 329  
 330  ?>


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1