<?php
/**
 * The admin view file of user 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      Yangyang Shi <shiyangyangwork@yahoo.cn>
 * @package     User
 * @version     $Id: admin.html.php 4029 2016-08-26 06:50:41Z liugang $
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../my/view/header.html.php';?>
<?php include '../../common/view/confirmer.html.php';?>
<div id='menuActions'>
  <?php commonModel::printLink('score', 'apply', '', $lang->score->apply, "class='btn btn-primary' data-toggle='modal'");?>
</div>
<div class='main-row'>
  <div class='main-col'>
    <div class='panel main-table' data-ride='table'>
      <table class='table has-sort-head'>
        <thead>
          <tr class='text-center'>
            <?php $vars = "type=common&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
            <th class='w-60px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->score->id);?></th>
            <th class='w-140px'><?php commonModel::printOrderLink('createdDate', $orderBy, $vars, $lang->score->applyTime);?></th>
            <th class='w-120px'><?php commonModel::printOrderLink('rule', $orderBy, $vars, $lang->score->rule);?></th>
            <th class='w-60px'><?php commonModel::printOrderLink('score', $orderBy, $vars, $lang->score->score);?></th>
            <th class='w-100px'><?php echo $lang->score->actionDate;?></th>
            <th class='text-left'><?php echo $lang->score->desc;?></th>
            <th class='w-80px'><?php echo $lang->score->reviewer;?></th>
            <th class='w-80px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->score->status);?></th>
            <th class='text-left w-160px'><?php echo $lang->score->rejectReason;?></th>
            <th class='w-120px'><?php echo $lang->score->action;?></th>
          </tr>
        </thead>
        <tbody>
          <?php foreach($scores as $score):?>
          <?php $rule = zget($rules, $score->rule);?>
          <tr class='text-center'>
            <td><?php echo $score->id;?></td>
            <td><?php echo $score->createdDate;?></td>
            <td><?php echo zget($rule, 'name');?></td>
            <td><?php echo $score->score;?></td>
            <td><?php echo $score->actionDate;?></td>
            <td class='text-left text-ellipsis' title="<?php echo $score->desc;?>"><?php echo $score->desc;?></td>
            <td><?php echo zget($users, $score->reviewer);?></td>
            <td><?php echo zget($lang->score->statusList, $score->status);?></td>
            <td class='text-left text-ellipsis' title="<?php echo $score->rejectReason;?>"><?php echo $score->rejectReason;?></td>
            <td>
              <?php
              if($score->status != 'normal')
              {
                  echo html::a($this->createLink('score', 'edit', "scoreID=$score->id"), $lang->edit, "data-toggle='modal'");
                  echo html::a($this->createLink('score', 'delete', "scoreID=$score->id"), $lang->delete, "class='confirmer'");
              }
              else
              {
                  echo html::a('javascript:;', $lang->edit, "class='disabled'");
                  echo html::a('javascript:;', $lang->delete, "class='disabled'");
              }
              ?>
            </td>
          </tr>
          <?php endforeach;?>
        </tbody>
      </table>
      <div class='table-footer'>
        <?php $pager->show();?>
      </div>
    </div>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
