<?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 '../../common/view/header.html.php';?>
<?php include '../../common/view/confirmer.html.php';?>
<div class='main-row'>
  <?php include 'side.rule.html.php';?>
  <div>
    <div id='menuActions'>
      <?php commonModel::printLink('score', 'createRule', '', $lang->scorerule->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 = "type={$type}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
            <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->scorerule->id);?></th>
            <th class='w-200px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->scorerule->type);?></th>
            <th class='w-200px'><?php commonModel::printOrderLink('name', $orderBy, $vars, $lang->scorerule->rule);?></th>
            <th class='w-120px'><?php commonModel::printOrderLink('score', $orderBy, $vars, $lang->scorerule->score);?></th>
            <th class='text-left'><?php echo $lang->scorerule->desc;?></th>
            <th class='w-80px'><?php echo $lang->actions;?></th>
          </tr>
        </thead>
        <tbody>
          <?php foreach($rules as $rule):?>
          <tr class='text-center'>
            <td><?php echo $rule->id;?></td>
            <td><?php echo zget($lang->score->typeList, $rule->type);?></td>
            <td><?php echo $rule->name;?></td>
            <td><?php echo $rule->score;?></td>
            <td class='text-left' title='<?php echo $rule->desc;?>'><?php echo $rule->desc;?></td>
            <td>
              <?php
              commonModel::printLink('score', 'editRule', "ruleID={$rule->id}", $lang->edit, "data-toggle='modal'");
              $deleteBtnClass = 'confirmer';
              if($rule->buildin) $deleteBtnClass .= ' disabled';
              commonModel::printLink('score', 'deleteRule', "ruleID={$rule->id}", $lang->delete, "class='{$deleteBtnClass}'");
              ?>
            </td>
          </tr>
          <?php endforeach;?>
        </tbody>
      </table>
      <div class='table-footer'>
        <?php $pager->show();?>
      </div>
    </div>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
