<?php
/**
 * The purchase view file of order module of ZDOO.
 *
 * @copyright   Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     order
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../sys/common/view/header.modal.html.php';?>
<div class='panel main-table' data-ride='table' data-fix-header='false'>
  <form method='post' id='ajaxForm' action='<?php echo inlink('purchase');?>'>
    <table class='table has-sort-head'>
      <thead>
        <tr>
          <?php $vars = 'orderBy=%s';?>
          <th>
            <div class='checkbox-primary check-all' title='<?php echo $this->lang->selectAll;?>'><label></label></div>
            <?php commonModel::printOrderLink('product', $orderBy, $vars, $lang->product->name);?>
          </th>
          <th><?php echo $lang->product->model;?></th>
          <th class='w-100px'><?php echo $lang->product->unit;?></th>
          <th class='w-80px'><?php commonModel::printOrderLink('amount', $orderBy, $vars, $lang->order->purchaseAmount);?></th>
        </tr>
      </thead>
      <tbody>
        <?php foreach($products as $product):?>
        <tr class='text-middle'>
          <td>
            <div class='checkbox-primary'><input type='checkbox' name='product[]' value="<?php echo $product->product;?>" id="product<?php echo $product->product;?>">
              <label for="product<?php echo $product->product;?>"></label>
            </div>
            <?php echo $product->name;?>
          </td>
          <td><?php echo $product->model;?></td>
          <td><?php echo $product->unit;?></td>
          <td class='text-right'><?php echo $product->amount;?></td>
        </tr>
        <?php endforeach;?>
      </tbody>
    </table>
    <div class='table-footer'>
      <?php if($products):?>
      <div class='checkbox-primary check-all'><label><?php echo $lang->selectAll?></label></div>
      <div class='table-actions btn-toolbar'>
        <?php echo html::submitButton($lang->order->createBuyOrder, 'btn btn-primary');?>
        <?php echo html::hidden('notSelected');?>
      </div>
      <div class='table-statistic'></div>
      <?php endif;?>
    </div>
  </form>
</div>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
