<div style="z-index:99999" class="modal" id="editpaymentModal" tabindex="-1" role="dialog" aria-labelledby="editpaymentModalLabel">
  <div class="modal-dialog" role="document" style="margin-top:80px;">
    <div class="modal-content">
      <div class="modal-body" style="padding:0;">
        <div class="row">
          <div class="col-sm-24">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
              <h4 class="modal-title" id="myModalLabel">修改付款记录</h4>
            </div>
            <div class="col-xs-24 nopadding">
                <div class="col-xs-24 btn-lg"></div>
                <form class="form-horizontal" id="form-edit-payment" method="post" action="<?php echo site_url('index/edit_payment_save'); ?>">
                  <div class="form-group">
                    <label class="col-sm-5 control-label">订单总报价</label>
                    <div class="col-sm-18">
                      <input type="text" class="form-control" value="$<?php echo $price; ?>" readonly>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">支付方式</label>
                    <div class="col-sm-18">
                      <select class="form-control" name="pm_money_type" id="pm_money_type">
                        <?php foreach ($payment_types as $key => $ptype) { ?>
                        <option value="<?php echo $key; ?>" <?php echo (isset($payments->pm_money_type) && $payments->pm_money_type==$ptype)?"selected":""; ?>><?php echo $ptype; ?></option>
                        <?php } ?>
                      </select>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">支付金额</label>
                    <div class="col-sm-9">
                      <select class="form-control" name="pm_money_currency" id="pm_money_currency">
                        <?php foreach ($currency_type as $key => $currency) { ?>
                        <option value="<?php echo $key ?>" <?php echo (isset($payments->pm_money_currency) && $payments->pm_money_currency==$key)?"selected":""; ?>><?php echo $key; ?></option>
                        <?php } ?>
                      </select>
                    </div>
                    <div class="col-sm-9 nopadding-L">
                      <input type="text" class="form-control" name="pm_money" id="pm_money" value="<?php echo isset($payments->pm_money)?$payments->pm_money:""; ?>" placeholder="">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">支付日期</label>
                    <div class="col-sm-9">
                      <input type="text" class="form-control lyydatepicker" name="pm_money_date" value="<?php echo isset($payments->pm_money_date)?$payments->pm_money_date:date('Y-m-d H:i:s'); ?>" placeholder="" readonly>
                    </div>
                    <div class="col-sm-9 nopadding-L">
                      <button type="button" class="btn btn-default" onclick="convert_to_rmb();">转换成实收金额</button>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">实收金额</label>
                    <div class="col-sm-9">
                      <input type="text" class="form-control" name="pm_rmb" id="pm_rmb" value="<?php echo isset($payments->pm_rmb)?$payments->pm_rmb:""; ?>" placeholder="">
                    </div>
                    <div class="col-sm-9 nopadding-L">
                      <input type="text" class="form-control lyydatepicker" name="pm_rmb_date" value="<?php echo isset($payments->pm_rmb_date)?$payments->pm_rmb_date:date('Y-m-d H:i:s'); ?>" placeholder="实收日期" readonly>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">付款客人</label>
                    <div class="col-sm-18">
                      <input type="text" class="form-control" name="pm_customer" value="<?php echo isset($payments->pm_customer)?$payments->pm_customer:""; ?>" placeholder="">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">Paypal邮箱</label>
                    <div class="col-sm-18">
                      <input type="text" class="form-control" name="pm_customer_email" value="<?php echo isset($payments->pm_customer_email)?$payments->pm_customer_email:""; ?>" placeholder="">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">收款公司</label>
                    <div class="col-sm-18">
                      <select class="form-control" name="pm_company" id="pm_company">
                        <?php foreach ($pm_company as $key => $value) { ?>
                        <option value="<?php echo $value; ?>" <?php echo (isset($payments->pm_company) && $payments->pm_company==$value)?"selected":""; ?>><?php echo $value; ?></option>
                        <?php } ?>
                      </select>
                      
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-5 control-label">备注信息</label>
                    <div class="col-sm-18">
                      <textarea class="form-control" name="pm_memo" rows="3"><?php echo isset($payments->pm_memo)?$payments->pm_memo:""; ?></textarea>
                    </div>
                  </div>
                  <input type="hidden" name="pm_o_sn" value="<?php echo $o_sn; ?>">
                  <?php if(isset($pm_sn)){ ?>
                  <input type="hidden" name="pm_sn" value="<?php echo $pm_sn; ?>">
                  <?php } ?>
                  
                </form>
            </div>
            <div class="clearfix"></div>
            <div class="modal-footer">
              <div class="col-xs-24 nopadding">
              <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
              <button type="button" class="btn btn-primary" onclick="$(this).button('loading');ajaxSubmit('form-edit-payment');">保存</button>
              <?php if(isset($pm_sn)){ ?>
              <button type="button" class="btn btn-default pull-left" onclick="do_submit('','<?php echo site_url('index/delete_payments/'.$pm_sn); ?>');">删除</button>
              <?php } ?>
              </div>
            </div>
          </div>
          
        </div>
      </div>
      <div class="clearfix"></div>
      
    </div>
  </div>
</div>
<script src="/min?f=/js/jquery.min.js,/js/bootstrap.min.js,/js/lyydate/jquery.lyydate.min.js"></script>
<script type="text/javascript">
$('.lyydatepicker').lyydatepicker({
      format:"yyyy-mm-dd",
      language:"zh",
      max_width:"350",
      festival:true
  });
</script>