<?php 
/**
 * The view file for create function of order 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      Tingting Dai <daitingting@xirangit.com>
 * @package     order 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../common/view/header.html.php';?>
<?php $products = $this->loadModel('product')->getList();?>
<?php $products = $this->product->formatProductNameInList($products);?>
<div class='panel'>
  <div class='panel-heading'>
    <strong><?php echo $lang->order->create;?></strong>
  </div>
  <div class='panel-body'>
    <form method='post' id='orderForm'>
      <table class='table table-form' id='createTable'>
        <tr>
          <td class='w-60px'></td>
          <td></td>
          <td class='w-100px'></td>
          <td class='w-120px'></td>
          <td class='w-120px'></td>
          <td class='w-140px'></td>
          <td class='w-60px'></td>
        </tr>
        <tr>
          <th><?php echo $lang->order->customer;?></th>
          <td>
            <div class='input-group'>
              <?php echo html::select('customer', $customers, $customer, "class='form-control chosen' data-no_results_text='" . $lang->searchMore . "'");?>
              <?php if(commonModel::hasPriv('customer', 'create')):?>
              <?php echo html::input('customerName', '', "class='form-control rounded-left' style='display:none'");?>
              <span class='input-group-addon'>
                <label class='checkbox-inline'>
                  <input type='checkbox' name='createCustomer' id='createCustomer' value='1' /> <?php echo $lang->create;?>
                </label>
              </span>
              <?php endif;?>
            </div>
          </td>
          <td colspan='5'></td>
        </tr>
        <tr class='customerInfo hide'>
          <th><?php echo $lang->customer->contact;?></th>
          <td>
            <div class='required required-wrapper'></div>
            <?php echo html::input('contact', '', "class='form-control'");?>
          </td>
          <td colspan='5'></td>
        </tr>
        <tr class='customerInfo hide'>
          <th><?php echo $lang->customer->phone;?></th>
          <td><?php echo html::input('phone', '', "class='form-control'");?></td>
          <td colspan='5'></td>
        </tr>
        <tr class='customerInfo hide'>
          <th><?php echo $lang->customer->email;?></th>
          <td><?php echo html::input('email', '', "class='form-control'");?></td>
          <td colspan='5'></td>
        </tr>
        <tr class='customerInfo hide'>
          <th><?php echo $lang->customer->qq;?></th>
          <td><?php echo html::input('qq', '', "class='form-control'");?></td>
          <td colspan='5'></td>
        </tr>
        <tr class='customerInfo hide'>
          <th><?php echo $lang->customer->weixin;?></th>
          <td><?php echo html::input('weixin', '', "class='form-control'");?></td>
          <td colspan='5'></td>
        </tr>

        <?php include './orderproducts.html.php';?>

        <tr>
          <th><?php echo $lang->order->plan;?></th>
          <td>
            <div class='row'>
              <div class='col-sm-4'><?php echo html::select('currency', $currencyList, '', "class='form-control'");?></div>
              <div class='col-sm-8'><?php echo html::input('plan', '', "class='form-control'");?></div>
            </div>
          </td>
          <td colspan='5'></td>
        </tr>
        <tfoot>
        <tr>
          <th></th>
          <td colspan='6' class='form-actions'>
            <?php echo html::submitButton();?>
            <?php echo html::backButton();?>
            <div id='duplicateError' class='hide'></div>
          </td>
        </tr>
        </tfoot>
      </table>
    </form>
  </div>
</div>
<div class='errorMessage hide'>
  <div class='alert alert-danger alert-dismissable'>
    <button aria-hidden='true' data-dismiss='alert' class='close' type='button'>×</button>
    <button type='submit' class='btn btn-default' id='continueSubmit'><?php echo $lang->continueSave;?></button>
  </div>
</div>
<script>
<?php helper::import('../../js/searchcustomer.js');?>
</script>
<?php include '../../../common/view/footer.html.php';?>
