<?php 
/**
 * The admin field view file of product module of ZDOO.
 *
 * @copyright   Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      Xiying Guan <guanxiying@xirangit.com>
 * @package     product 
 * @version     $Id $
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../common/view/header.html.php';?>
<div id='mainTitle' class='clearfix'>
  <div class='btn-toolbar pull-left'>
    <?php if(!isonlybody()):?>
    <?php $productLink = $this->createLink('product', 'browse');?>
    <?php echo html::a($productLink, '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, "class='btn btn-back'");?>
    <div class="divider"></div>
    <?php endif;?>
    <div class="page-title">
      <span class="text"><?php echo $product->name . $lang->product->adminfield;?></span>
    </div>
  </div>
  <div class='btn-toolbar pull-right'>
    <?php commonModel::printLink('product', 'createField', "productID={$productID}", '<i class="icon-plus"></i> ' . $lang->product->field->create, "class='btn btn-primary' data-toggle='modal'");?>
  </div>
</div>
<div class='main-table' data-ride='table'>
  <table class='table'>
    <thead>
      <tr>
        <th><?php echo $lang->product->field->field;?></th>
        <th><?php echo $lang->product->field->name;?></th>
        <th class='w-160px'><?php echo $lang->product->field->control;?></th>
        <th ><?php echo $lang->product->field->options;?></th>
        <th ><?php echo $lang->product->field->default;?></th>
        <th class='w-100px'><?php echo $lang->actions;?></th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($fields as $field):?>
      <tr>
        <td><?php echo $field->field;?></td>
        <td><?php echo $field->name;?></td>
        <td><?php echo $lang->product->field->controlTypeList[$field->control];?></td>
        <td>
          <?php
          $delimiter = '';
          foreach($field->options as $value => $text)
          {
              echo $delimiter . $value . '=>' . $text;
              $delimiter = ', ';
          }
          ?>
        </td>
        <td><?php echo $field->default;?></td>
        <td>
          <?php
          commonModel::printLink('product', 'editField',   "fieldID={$field->id}", $lang->edit, "data-toggle='modal'");
          commonModel::printLink('product', 'deleteField', "fieldID={$field->id}", $lang->delete, "class='deleter'");
          ?>
        </td>
      </tr>
      <?php endforeach;?>
    </tbody>
  </table>
</div>
<?php include '../../../common/view/footer.html.php';?>
