<?php
/**
 * The browse view file of setting module of ZDOO.
 *
 * @copyright   Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     setting
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
<?php js::set('message', $lang->product->input . $this->lang->$module->property->$section);?>
<?php js::set('module',  $module);?>
<?php js::set('section', $section);?>
<div id='menuActions'>
  <form method='post' class='form-search w-200px'>
    <div class="input-group">
      <?php echo html::input('query', '', "class='form-control search-query' placeholder='{$lang->product->input}{$this->lang->$module->property->$section}'");?>
      <span class="input-group-btn">
        <?php echo html::submitButton($lang->product->search);?>
      </span>
    </div>
  </form>
  <?php echo html::a(inlink('batchCreateProperties', "module=$module&field=$section"), "<i class='icon-plus'></i> " . $lang->product->batchCreate, "class='btn btn-primary' data-toggle='modal'");?>
</div>
<?php if($section != 'expresses'):?>
<div class='main-row'>
  <div class='side-col'>
    <div class='panel'>
      <div class='panel-body'>
        <nav class='menu leftmenu'>
          <ul class='nav nav-primary'>
            <li <?php if($section == 'models') echo "class='active'";?>><?php echo html::a(inlink('browseProperties', "module=product&section=models"), $lang->product->model);?></li>
            <li <?php if($section == 'units') echo "class='active'";?>><?php echo html::a(inlink('browseProperties', "module=product&section=units"), $lang->product->unit);?></li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
  <div class='main-col'>
  <?php endif;?>
    <div class='main-table' data-ride='table'>
      <table class='table has-sort-head'>
        <thead>
          <tr class='text-center'>
            <?php $vars = "module=$module&section=$section&query=$query&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
            <th class='w-60px'><?php echo $lang->$module->id;?></th>
            <th><?php commonModel::printOrderLink('value', $orderBy, $vars, $lang->$module->property->$section);?></th>
            <th class='w-100px'><?php echo $lang->actions;?></th>
          </tr>
        </thead>
        <?php $i = 0;?>
        <?php foreach($properties as $key => $value):?>
        <tr class='text-center'>
          <td><?php echo ++$i;?></td>
          <td class='text-left'><?php echo $value;?></td>
          <td>
            <?php echo html::a(inlink('editProperty',   "module=$module&section=$section&id=$key"), $lang->edit, "data-toggle='modal' data-width='500'");?>
            <?php echo html::a(inlink('deleteProperty', "module=$module&section=$section&id=$key"), $lang->delete, "class='deleter'");?>
          </td>
        </tr>
        <?php endforeach;?>
      </table>
      <div class='table-footer'><?php $pager->show();?></div>
    </div>
  <?php if($section != 'expresses'):?>
  </div>
</div>
<?php endif;?>
<?php include '../../../common/view/footer.html.php';?>
