<?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';?>
<?php $canBatchPass = commonModel::hasPriv('score', 'batchPass') && $scores;?>
<div class='main-row'>
  <div class='main-col'>
    <div class='panel main-table' data-ride='table'>
      <?php if($canBatchPass):?>
      <form id='ajaxForm' method='post' action="<?php echo $this->createLink('score', 'batchPass');?>">
      <?php endif;?>
        <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='text-left w-100px'>
                <?php if($canBatchPass):?>
                <div class='checkbox-primary check-all' title='<?php echo $this->lang->selectAll;?>'><label></label></div>
                <?php endif;?>
                <?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-80px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->score->applicant);?></th>
              <th class='w-100px'><?php commonModel::printOrderLink('dept', $orderBy, $vars, $lang->score->dept);?></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->status;?></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 class='text-left'>
                <?php if($canBatchPass):?>
                <div class='checkbox-primary'><input type='checkbox' name='scoreIDList[]' value="<?php echo $score->id;?>" id="scoreIDList<?php echo $score->id;?>">
                  <label for="scoreIDList<?php echo $task->id;?>"></label>
                </div>
                <?php endif;?>
                <?php echo $score->id;?>
              </td>
              <td><?php echo $score->createdDate;?></td>
              <td><?php echo zget($users, $score->createdBy);?></td>
              <td><?php echo zget($depts, $score->dept);?></td>
              <td><?php echo zget($rule, 'name');?></td>
              <td><?php echo $score->score;?></td>
              <td><?php echo $score->actionDate;?></td>
              <td class='text-left ellipsis' title="<?php echo $score->desc;?>"><?php echo $score->desc;?></td>
              <td><?php echo zget($lang->score->statusList, $score->status);?></td>
              <td>
                <?php commonModel::printLink('score', 'pass', "scoreID=$score->id", $lang->score->pass, "class='confirmer' data-confirmTitle='{$lang->score->tip->confirmPassTitle}' data-confirmDetail='{$lang->score->tip->confirmPassDetail}' data-confirmButton='{$lang->confirm}' data-confirming='{$lang->score->confirming}'");?>
                <?php commonModel::printLink('score', 'reject', "scoreID=$score->id", $lang->score->reject, "data-toggle='modal'");?>
              </td>
            </tr>
            <?php endforeach;?>
          </tbody>
        </table>
        <div class='table-footer'>
          <?php if($canBatchPass):?>
          <div class='checkbox-primary check-all'><label><?php echo $lang->selectAll?></label></div>
          <div class='table-actions btn-toolbar'><?php echo html::submitButton($lang->score->pass, 'btn btn-default');?></div>
          <div class='table-statistic'></div>
          <?php endif;?>
          <?php $pager->show();?>
        </div>
      <?php if($canBatchPass):?>
      </form>
      <?php endif;?>
    </div>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
