<?php 
/**
 * The browse view file of gift module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Yuting Wang <wangyuting@cnezsoft.com>
 * @package     gift
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/confirmer.html.php';?>
<div id='menuActions'>
  <?php commonModel::printLink('gift', 'create', '', $lang->gift->create, "class='btn btn-primary' data-toggle='modal'");?>
</div>
<div class='panel main-table' data-ride='table'>
  <table class='table has-sort-head'>
    <thead>
      <tr class='text-center'>
        <?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
        <th class='w-70px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->product->id);?></th>
        <th class='text-left'><?php echo $lang->product->name;?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('score', $orderBy, $vars, $lang->product->score);?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('amount', $orderBy, $vars, $lang->product->amount);?></th>
        <th class='w-120px'><?php echo $lang->product->limit;?></th>
        <th class='w-140px'><?php commonModel::printOrderLink('createdDate', $orderBy, $vars, $lang->product->createdDate);?></th>
        <th class='w-100px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->product->status);?></th>
        <th class='w-100px'><?php echo $lang->actions?></th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($gifts as $gift):?>
      <tr class='text-center' data-url="<?php echo $this->createLink('gift', 'view', "giftID={$gift->id}");?>">
        <td><?php echo $gift->id;?></td>
        <td class='text-left'><?php echo $gift->name;?></td>
        <td><?php echo $gift->score;?></td>
        <td><?php echo $gift->amount;?></td>
        <td><?php echo $gift->limit;?></td>
        <td><?php echo $gift->createdDate;?></td>
        <td><?php echo zget($lang->gift->statusList, $gift->status);?></td>
        <td>
          <?php
          commonModel::printLink('gift', 'edit', "giftID={$gift->id}", $lang->edit, "data-toggle='modal'");
          commonModel::printLink('gift', 'delete', "giftID={$gift->id}", $lang->delete, "class='confirmer'");
          ?>
        </td>
      </tr>
      <?php endforeach;?>
    </tbody>
  </table>
  <div class='table-footer'>
    <?php $pager->show();?>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
