<?php
/**
 * The configure psi view file of trade module of ZDOO.
 *
 * @copyright   Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     trade 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../common/view/header.html.php';?>
<div class='panel'>
  <form id='ajaxForm' method='post'>
    <table class='table table-form'>
      <thead>
      <tr class='text-center'>
        <th class='w-200px required'><?php echo $lang->setting->pid;?></th>
        <th class='w-300px required'><?php echo $lang->setting->alipayKey;?></th>
        <th class='w-200px required'><?php echo $lang->setting->email;?></th>
        <th class='w-200px required'><?php echo $lang->setting->depositor;?></th>
        <th><?php echo $lang->setting->tradeType;?></th>
        <th class='w-100px'><?php echo $lang->actions;?></th>
      </tr>
      </thead>
      <?php $key = 1;?>
      <?php if($settings):?>
      <?php foreach($settings as $setting):?>
      <tr>
        <td><?php echo html::input("pid[$key]", $setting->pid, "id='pid{$key}' class='form-control'");?></td>
        <td><?php echo html::input("key[$key]", $setting->key, "id='key{$key}' class='form-control'");?></td>
        <td><?php echo html::input("email[$key]", $setting->email, "id='email{$key}' class='form-control'");?></td>
        <td><?php echo html::select("depositor[$key]", $depositors, $setting->depositor, "id='depositor{$key}' class='form-control chosen'");?></td>
        <td><?php echo html::select("tradeType[$key][]", $lang->setting->tradeTypeList, $setting->tradeType, "id='tradeType{$key}' class='form-control chosen' multiple");?></td>
        <td>
          <a href='javascript:;' class='btn addItem'><i class='icon icon-plus'></i></a>
          <a href='javascript:;' class='btn delItem'><i class='icon icon-remove'></i></a>
        </td>
      </tr>
      <?php $key++;?>
      <?php endforeach;?>
      <?php else:?>
      <tr>
        <td><?php echo html::input("pid[$key]", '', "id='pid{$key}' class='form-control'");?></td>
        <td><?php echo html::input("key[$key]", '', "id='key{$key}' class='form-control'");?></td>
        <td><?php echo html::input("email[$key]", '', "id='email{$key}' class='form-control'");?></td>
        <td><?php echo html::select("depositor[$key]", $depositors, '', "id='depositor{$key}' class='form-control chosen'");?></td>
        <td><?php echo html::select("tradeType[$key][]", $lang->setting->tradeTypeList, '', "id='tradeType{$key}' class='form-control chosen' multiple");?></td>
        <td>
          <a href='javascript:;' class='btn addItem'><i class='icon icon-plus'></i></a>
          <a href='javascript:;' class='btn delItem'><i class='icon icon-remove'></i></a>
        </td>
      </tr>
      <?php $key++;?>
      <?php endif;?>
      <tr>
        <td class='text-center form-actions' colspan='6'>
          <?php echo html::submitButton();?>
          <?php commonModel::printLink('cash.trade', 'syncAlipay', '', $lang->setting->syncAlipay, "class='btn btn-primary'");?>
        </td>
      </tr>
    </table>
  </form>
</div>
<?php
$depositor = html::select('depositor[KEY]', $depositors, '', "id='depositorKEY' class='form-control chosen'");
$tradeType = html::select('tradeType[KEY][]', $lang->setting->tradeTypeList, '', "id='tradeTypeKEY' class='form-control chosen' multiple");
$itemRow   = <<<EOT
      <tr>
        <td><input type='text' name='pid[KEY]'   id='pidKEY'   class='form-control'></td>
        <td><input type='text' name='key[KEY]'   id='keyKEY'   class='form-control'></td>
        <td><input type='text' name='email[KEY]' id='emailKEY' class='form-control'></td>
        <td>{$depositor}</td>
        <td>{$tradeType}</td>
        <td>
          <a href='javascript:;' class='btn addItem'><i class='icon icon-plus'></i></a>
          <a href='javascript:;' class='btn delItem'><i class='icon icon-remove'></i></a>
        </td>
      </tr>
EOT;
js::set('itemRow', $itemRow);
js::set('key', $key);
?>
<?php include '../../../common/view/footer.html.php';?>
