<?php 
/**
 * The create 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.modal.html.php';?>
<form method='post' id='ajaxForm' action="<?php echo inlink('createfield', "productID={$product->id}");?>">
  <table class='table table-form'>
    <tr>
      <th class='w-60px'><?php echo $lang->product->field->name;?></th>
      <td class='w-400px'><?php echo html::input('name', '', "class='form-control'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->product->field->field;?></th>
      <td><?php echo html::input('field', '', "class='form-control'");?></td>
      <td></td>
    </tr>
    <tr>
      <th><?php echo $lang->product->field->control;?></th>
      <td><?php echo html::select("control", $lang->product->field->controlTypeList, '', "class='form-control'");?></td>
      <td></td>
    </tr>
    <tr id='optionTR'>
      <th><?php echo $lang->product->field->options;?></th>
      <td colspan='2'>
        <div class="input-group">
          <?php echo html::input('options[value][]', '', "class='form-control' placeholder={$lang->product->field->optionValue}");?>
          <span class='input-group-addon fix-border'>:</span>
          <?php echo html::input('options[text][]', '', "class='form-control' placeholder={$lang->product->field->optionText}");?>
          <div class='input-group-btn'>
            <a href='javascript:;' class='btn addItem'><i class='icon-plus'></i></a>
          </div>
          <div class='input-group-btn'>
            <a href='javascript:;' class='btn delItem'><i class='icon-remove'></i></a>
          </div>
        </div> 
      </td>
    </tr>
    <tr>
      <th><?php echo $lang->product->field->default;?></th>
      <td colspan='2'><?php echo html::textarea('default', '', "rows='2' placeholder='{$lang->product->field->optionsPlaceholder}' class='form-control'");?></td>
    </tr>
    <tr>
      <th><?php echo $lang->product->field->rules;?></th>
      <td colspan='2'><?php echo html::select('rules[]', $lang->product->field->rulesList, '', "multiple class='chosen form-control'");?></td>
    </tr>
    <tr>
      <th></th>
      <td colspan='2' class='form-actions'>
        <?php echo html::submitButton();?>
        <?php echo html::commonButton($lang->goback, 'btn btn-back', "data-dismiss='modal'");?>
      </td>
    </tr>
  </table>
</form>

<div id='optionGroup' class='hide'>
  <div class="input-group">
    <?php echo html::input('options[value][]', '', "class='form-control' placeholder={$lang->product->field->optionValue}");?>
    <span class='input-group-addon fix-border'>:</span>
    <?php echo html::input('options[text][]', '', "class='form-control' placeholder={$lang->product->field->optionText}");?>
    <div class='input-group-btn fix-border'>
      <a href='javascript:;' class='btn addItem'><i class='icon-plus'></i></a>
    </div>
    <div class='input-group-btn'>
      <a href='javascript:;' class='btn delItem'><i class='icon-remove'></i></a>
    </div>
  </div> 
</div>

<?php include '../../../common/view/footer.modal.html.php';?>
