Advertisement
NFL

Untitled

NFL
Jul 1st, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.73 KB | None | 0 0
  1. <?php
  2. $totalAmount = 0;
  3. $totalCount = 0;
  4. ?>
  5. <div style="font-weight: bold;margin-bottom: 25px; margin-left: 25%;">Управление заказом # <?= $this->order['id'] ?></div>
  6. <?=
  7. $this->tabs([
  8.     ['title' => 'Информация о заказе', 'hash' => 'main'],
  9.     ['title' => 'Информация о заказанных товарах', 'hash' => 'products'],
  10.     ['title' => 'История покупателя', 'hash' => 'history'],
  11.     ['title' => 'Корзина покупателя', 'hash' => 'cart'],
  12.     ['title' => 'Лог действий', 'hash' => 'log'],
  13. ])
  14. ?>
  15. <div class="turnover" style=" border: 1px solid green;font-size: 20px;margin-top: 15px;padding: 11px 19px;text-align: center;width: 58%;">
  16.     Оборот покупателя за последние <?= $this->months ?> месяца: <?= $this->turnover ?> грн
  17.     <a href="javascript://" id="closeTurnoverBtn" title="Закрыть">[x]</a>
  18. </div>
  19. <?= $this->tabs()->open() ?>
  20. <?= $this->tabs()->start('main') ?>
  21. <form action="<?= $this->adminLink(['action' => 'orders', 'params' => ['act' => 'update-info'], 'checkAcl' => false])->url() ?>" method="post">
  22.  
  23.     <p><b>Информация о заказчике: </b></p>
  24.     <p>Имя: <input type="text" name="order_info[name]" value="<?= $this->order['order_info']['name'] ?>"></p>
  25.     <p>E-Mail: <input type="text" name="order_info[email]" value="<?= $this->order['order_info']['email'] ?>"></p>
  26.     <p>Телефон: <input type="text" name="order_info[phone]" value="<?= $this->order['order_info']['phone'] ?>"></p>
  27.  
  28.     <?php foreach (array_reverse($this->fields) as $field => $info): ?>
  29.         <p><?= $info['title'] ?>: <input type="text" name="order_info[<?= $field ?>]" value="<?= $this->order['order_info'][$field] ?>"></p>
  30.     <?php endforeach ?><br>
  31.  
  32.     <div><b>Информация о заказе</b></div>
  33.     <p> Статус заказа:
  34.         <select name="status_id">
  35.             <?php foreach ($this->statuses as $v): ?>
  36.                 <option <?php if ($v['id'] == $this->order['status_id']): ?>selected<?php endif ?> value="<?= $v['id'] ?>"><?= $v['title'] ?></option>
  37.             <?php endforeach ?>
  38.         </select></p>
  39.  
  40.     <br>
  41.  
  42.     <div><b>Адрес доставки</b></div>
  43.     <p>
  44.     <div>Регион: <select name="region_id">
  45.             <?php foreach ($this->regions as $v): ?>
  46.                 <option <?php if ($v['id'] == $this->order['region_id']): ?>selected<?php endif ?> value="<?= $v['id'] ?>"><?= $v['title'] ?></option>
  47.             <?php endforeach ?>
  48.         </select>
  49.     </div>
  50.     <div>Улица: <input type="text" name="delivery_info[address][street]" value="<?= $this->order['delivery_info']['address']['street'] ?>"> </div>
  51.     <div>Дом: <input type="text" name="delivery_info[address][house]" value="<?= $this->order['delivery_info']['address']['house'] ?>"></div>      
  52.     <div>Подъезд: <input type="text" name="delivery_info[address][housing]" value="<?= $this->order['delivery_info']['address']['housing'] ?>"></div>
  53.     <div>Этаж: <input type="text" name="delivery_info[address][floor]" value="<?= $this->order['delivery_info']['address']['floor'] ?>"></div>
  54.     <div>Квартира: <input type="text" name="delivery_info[address][flat]" value="<?= $this->order['delivery_info']['address']['flat'] ?>"></div>
  55.     <div>Код: <input type="text" name="delivery_info[address][code]" value="<?= $this->order['delivery_info']['address']['code'] ?>"></div>
  56.     <br>
  57.     <div><b>Способ и стоимость доставки</b></div>
  58.     <p>Способ доставки:
  59.         <select name="delivery_type">
  60.             <option value="courier" <?php if ($this->order['delivery_type'] == DELIVERY_COURIER): ?>selected<?php endif ?>>Курьер</option>
  61.             <option value=plan <?php if ($this->order['delivery_type'] == DELIVERY_PLAN): ?>selected<?php endif ?>>Плановая доставка</option>
  62.             <option value="transport" <?php if ($this->order['delivery_type'] == DELIVERY_TRANSPORT): ?>selected<?php endif ?>>Транспортная компания</option>
  63.         </select></p>
  64.     <?php if ($this->order['delivery_type'] == DELIVERY_TRANSPORT): ?>
  65.         <p>Транспортная компания: <select name="delivery_id">
  66.                 <option value="">Выберите</option>
  67.                 <?php foreach ($this->deliveries as $v): ?>
  68.                     <option <?php if ($v['id'] == $this->order['delivery_id']): ?>selected<?php endif ?> value="<?= $v['id'] ?>"><?= $v['title'] ?></option>
  69.                 <?php endforeach ?>
  70.             </select>
  71.         </p>
  72.     <?php endif ?>
  73.     <p>Время доставки: <input type="text" name="delivery_time" value="<?= $this->order['delivery_time'] ?>"></p>
  74.     <p>Стоимость доставки: <input type="text" name="delivery_price" value="<?= $this->order['delivery_price'] ?>"></p>
  75.     <br><br>
  76. <!--    <div>Способ оплаты: <b><?= $this->methods[$this->order['order_info']['ps_id']]['title'] ?></b></div>-->
  77.     <div><b>Комментарий менеджера</b></div>
  78.     <div><textarea cols="40" rows="7" name="manager_comment"><?= $this->order['manager_comment'] ?></textarea></div><br>
  79.     <input type="hidden" name="order_id" value="<?= $this->order['id'] ?>">
  80.     <input type="submit" value="Изменить информацию">
  81. </form>
  82. <hr>
  83. <p><b>Тип цены:</b> </p>
  84. <form action="<?= $this->adminUrl('shop', 'orders', ['act' => 'change-price-type']) ?>" method="post">
  85.     <select name="price_type">
  86.         <?php foreach ($this->types as $v): ?>
  87.             <option <?php if ($v['id'] == $this->order['price_type']): ?>selected<?php endif ?> value="<?= $v['id'] ?>"><?= $v['title'] ?></option>
  88.         <?php endforeach ?>
  89.     </select>
  90.     <input type="hidden" name="order_id" value="<?= $this->order['id'] ?>">
  91.     <input type="submit" value="Изменить тип цены">
  92.     <p style="color: red;">* - Внимание! Это приведет к пересчету цен в текущем заказе!</p>
  93. </form>
  94. <?= $this->tabs()->end('main') ?>
  95. <?= $this->tabs()->start('products') ?>
  96. <p><b>Информация о заказанных товарах</b></p>
  97. <div style="margin-bottom: 50px;">Добавить позицию в заказ:
  98.     <input type="text" id="addPosition" placeholder="Начните вводить название">
  99.     <input type="hidden" name="order_id" value="<?= $this->order['id'] ?>">
  100.     <ul id="autocomplete-order">
  101.  
  102.     </ul>
  103. </div>
  104. <form action="" method="post">
  105.     <table id="sample-table-2" class="table table-striped table-bordered">
  106.         <thead>
  107.             <tr>
  108.  
  109.                 <th>Название</th>
  110.                 <th>Комментарий</th>
  111.                 <th>Единица измерения</th>
  112.                 <th>Количество</th>
  113.                 <th>Цена за единицу</th>
  114.                 <th>Всего</th>
  115.                 <th>Удалить</th>
  116.             </tr>        
  117.         </thead>
  118.         <tbody>
  119.             <?php foreach ($this->order['products'] as $v): ?>
  120.                 <?php
  121.                 $count = 0;
  122.                 $amount = 0;
  123.                 ?>
  124.                 <tr>
  125.                     <td><?= $v['properties']['title']['value'] ?></td>
  126.                     <td><?= $v['product_options']['comment'] ?></td>
  127.                     <td><?= $v['product_options']['step'] ?><?= $v['properties']['unit_of_measure']['value'] ?></td>
  128.                     <td><input type="text" name="qty[<?= $v['id'] ?>]" value="<?= $v['qty'] ?>"> <?= $v['properties']['unit_of_measure']['value'] ?></td>
  129.                     <td><input type="text" name="single_price[<?= $v['id'] ?>]" value="<?= $v['single_price'] ?>"></td>
  130.                     <td><?= round($v['single_price'] * $v['qty'] / $v['product_options']['step'], 2) ?>&nbsp;грн</td>
  131.                     <td><?= $this->adminLink(['action' => 'orders', 'params' => ['id' => $v['id'], 'act' => 'del-pos', 'order' => $this->order['id']], 'checkAcl' => false], ['class' => 'icon-trash']) ?></td></td>
  132.                     <?php $totalAmount+=($v['single_price'] * $v['qty']) ?>
  133.                     <?php $totalCount+=$v['qty'] ?>
  134.                 </tr>
  135.             <?php endforeach ?>
  136.             <tr><td colspan="3"></td>
  137.                 <td><input type="submit" value="Внести изменения в заказ и пересчитать"></td>
  138.                 <td>Итого: <?= round(($totalAmount * (1 + $this->order['fee'] / 100)), 2) ?> грн&nbsp;</td>                
  139.             </tr>
  140.         </tbody>
  141.  
  142.     </table>
  143.  
  144. </form>
  145. <?= $this->tabs()->end('products') ?>
  146. <?= $this->tabs()->start('log') ?>
  147. <table id="sample-table-2" class="table table-striped table-bordered">
  148.     <thead>
  149.         <tr>
  150.             <th>Дата/время</th>
  151.             <th>IP адрес</th>
  152.             <th>Пользователь</th>
  153.             <th>Уровень доступа</th>
  154.             <th>Описание</th>
  155.         </tr>
  156.     </thead>
  157.     <tbody>
  158.         <?php foreach ($this->log as $v): ?>
  159.             <tr>
  160.                 <td><?= date('d.m.Y H:i:s', $v['created']) ?></td>
  161.                 <td><?= $v['ip_addr'] ?></td>
  162.                 <td><?= $v['name'] ?></td>
  163.                 <td><?= $v['role_title'] ?></td>
  164.                 <td><?= $v['description'] ?></td>
  165.             </tr>
  166.         <?php endforeach ?>
  167.     </tbody>
  168. </table>
  169.  
  170. <?= $this->tabs()->end('log') ?>
  171. <?= $this->tabs()->start('history') ?>
  172.  
  173. <table id="sample-table-3" class="table table-striped table-bordered">
  174.     <thead>
  175.         <tr>
  176.             <th>#</th>
  177.             <th>Дата/время</th>
  178.             <th>Тип цены</th>
  179.             <th>Статус</th>            
  180.         </tr>
  181.     </thead>
  182.     <tbody id="userOrdersList">
  183.  
  184.     </tbody>
  185. </table>
  186. <?= $this->tabs()->end('history') ?>
  187. <?= $this->tabs()->start('cart') ?>
  188.  
  189. <table id="sample-table-3" class="table table-striped table-bordered">
  190.     <thead>
  191.         <tr>
  192.             <th>Название товара</th>
  193.             <th>Количество</th>
  194.             <th>Дата/время добавления</th>                      
  195.         </tr>
  196.     </thead>
  197.     <tbody>
  198.         <?php foreach ($this->cart as $v): ?>
  199.             <tr>
  200.                 <td><a href="<?= $this->uri(['id' => $v['id']], 'catalog_product') ?>" target="_blank"><?= $v['properties']['title']['value'] ?></a></td>
  201.                 <td><?= $v['count'] ?> <?= $v['properties']['unit_of_measure']['value'] ?></td>
  202.                 <td><?= date('d.m.Y H:i:s', $v['created']) ?></td>
  203.             </tr>
  204.         <?php endforeach ?>
  205.     </tbody>
  206. </table>
  207.  
  208. <?= $this->tabs()->end('cart') ?>
  209. <?=
  210. $this->tabs()->close()?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement