<?php 
/**
 * The browse finished bateches view of batch module of ZDOO.
 *
 * @copyright   Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      yaozeyuan<yaozeyuan@yidou.biz>
 * @package     batch 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('mode', $mode);?>
<li id='bysearchTab'><?php echo html::a('javascript:;', "<i class='icon-search icon'></i>" . $lang->search->common)?></li>
<div class='panel main-table' data-ride='table'>
  <table class='table has-sort-head'>
    <thead>
      <tr>
        <th class='w-60px'><?php echo $lang->batch->id;?></th>
        <th class='w-140px'><?php echo $lang->batch->batchNo;?></th>
        <th class='w-140px'><?php echo $lang->order->orderNo->common;?></th>
        <th><?php echo $lang->batch->trader;?></th>
        <th class='w-120px'><?php echo $lang->order->finishedDate;?></th>
        <th class='w-80px'><?php echo $lang->batch->status;?></th>
        <th class='w-100px text-center'><?php echo $lang->actions;?></th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($batches as $id => $batch):?>
      <tr>
        <td><?php echo $id;?></td>
        <td><?php echo $batch->batchNo;?></td>
        <td>
          <?php $order = zget($orders, $batch->order);?>
          <?php if(!commonModel::printLink(str_replace('Refund', '', $order->type), 'detail', "id={$order->id}", $order->orderNo)) echo $order->orderNo;?>
        </td>
        <td><?php if(!commonModel::printLink(strpos($order->type, 'sale') === 0 ? 'customer' : 'provider', 'view', "id=$batch->trader", zget($customers, $batch->trader))) echo zget($customers, $batch->trader);?></td>
        <td><?php echo formatTime($order->finishedDate, DT_DATE1);?></td>
        <td><?php echo zget($lang->batch->statusList, $batch->status, ' ');?></td>
        <td class='text-center'><?php commonModel::printLink('batch', 'detail', "id={$id}", $lang->detail, "data-toggle='modal'");?></td>
      </tr>
      <?php endforeach;?>
    </tbody>
  </table>
  <div class='table-footer'>
    <?php $pager->show();?>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
