<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-->
<!--<html xmlns="http://www.w3.org/1999/xhtml">-->
    <!--<head>-->
        <!--<title>销售记录</title>-->
        <!--<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />-->
        <!--<meta name="viewport" content="width=device-width" />-->
        <!--<link href="<?php echo $data['rootUrl']; ?>global/v1/m/images/style.css" rel="stylesheet" type="text/css" />-->
        <!--<script type="text/javascript" src="<?php echo $data['rootUrl']; ?>global/v1/js/jquery-1.7.2.min.js"></script>-->
        <!--<link id="skin" rel="stylesheet" href="<?php echo $data['rootUrl']; ?>global/v1/a/jbox/Skins/Default/jbox.css">-->
        <!--<script type="text/javascript" src="<?php echo $data['rootUrl']; ?>global/v1/a/jbox/jquery.jBox-2.3.min.js"></script>-->
        <!--<script type="text/javascript" src="<?php echo $data['rootUrl']; ?>global/v1/a/jbox/jquery.jBox-zh-CN.js"></script>-->
        <!--<script type="text/javascript">-->
            <!--// 销售提成确认提取-->
            <!--function demo_1_5(id) {-->
                <!--jBox("iframe:<?php echo $data['rootUrl']; ?>m/sale/cash/"+id, {-->
                    <!--title: "确认提取",-->
                    <!--width: 550,-->
                    <!--height: 250,-->
                    <!--buttons: { '关闭': true }-->
                <!--});-->
            <!--}-->
        <!--</script>-->
    <!--</head>-->
    <!--<body>-->
        <!--<div class="main_content new_product">-->
            <!--<div class="globle_form">-->
            <!--<form action="/m/sale" method="post">-->
                <!--销售人名称：<input name="salename" type="text" >-->
                <!--销售优惠码：<input name="promocode" type="text" >-->
               <!--<input class="btn" type="submit" name="submit" value="添加销售人员"/>-->
            <!--</form>-->
            <!--总累计金额：<?php echo $data['total']; ?>   累计提取金额：<?php echo $data['usez']; ?>    累计未发金额：<?php echo $data['unpay']; ?>-->
            <!--</div>-->
            <!--&lt;!&ndash;table列表&ndash;&gt;-->
            <!--<div class="globle_list">-->
                    <!--<table cellspacing="0" cellpadding="0" class="tableList">-->
                        <!--<tbody>-->
                            <!--<tr>-->
                                <!--<th class="">姓名</th>-->
                                <!--<th class="">优惠码</th>-->
                                <!--<th class="">累计金额</th>-->
                                <!--<th class="">已提取金额</th>-->
                                <!--<th class="">未发金额</th>-->
                                <!--<th class="">操作</th>-->
                            <!--</tr>-->
                            <!--&lt;!&ndash; loop userArray &ndash;&gt;-->
                            <!--<tr  &lt;!&ndash; if <?php echo odd($k1); ?> &ndash;&gt; class="odd" &lt;!&ndash; endif &ndash;&gt; >-->
                                <!--<td> <?php echo $v1['salename']; ?> </td>-->
                                <!--<td> <?php echo $v1['promocode']; ?> </td>-->
                                <!--<td> <?php echo $v1['total']; ?> </td>-->
                                <!--<td> <?php echo $v1['usez']; ?> </td>-->
                                <!--&lt;!&ndash; <td> <?php echo $v1['unuse']; ?> </td> &ndash;&gt;-->
                                <!--<td> <input id="demoBtn3" type="submit" class="button btn-orange" onclick="demo_1_5(<?php echo $v1['id']; ?>);" value="确认提取" > </td>-->
                            <!--</tr>-->
                            <!--&lt;!&ndash; endloop &ndash;&gt;-->
                        <!--</tbody>-->
                    <!--</table>-->
                    <!--<table cellspacing="0" cellpadding="0" class="tableList">-->
                        <!--<tbody>-->
                            <!--<tr>-->
                                <!--<td></td>-->
                            <!--</tr>-->
                        <!--</tbody>-->
                    <!--</table>-->
                <!--<div class="pageNav"><?php echo $data['pager']; ?></div>-->
                <!---->
            <!--</div>-->
        <!--</div>-->
        <!--<div id="imgBox" style="display:none;"><img src="<?php echo $data['rootUrl']; ?>global/v1/img/XPButtonUploadText_61x22" alt="" /></div>-->
        <!--<script>-->

            <!--// 全选-->
            <!--function selectall(name) {-->
                <!--if ($("#check_box").attr("checked")==false) {-->
                    <!--$("input[name='"+name+"']").each(function() {-->
                        <!--this.checked=false;-->
                    <!--});-->
                <!--} else {-->
                    <!--$("input[name='"+name+"']").each(function() {-->
                        <!--this.checked=true;-->
                    <!--});-->
                <!--}-->
            <!--}-->

            <!--// 激活-->
            <!--function confirm_active() {-->
                <!--if(confirm('确认通过审核吗？')) $('#myform').submit();-->
            <!--}-->

            <!--// 删除-->
            <!--function confirm_delete(){-->
                <!--if(confirm('确认删除吗？')) $('#myform').submit();-->
            <!--}-->
            <!--function confirmurl(url,message) {-->
                <!--url = url;-->
                <!--if(confirm(message)) redirect(url);-->
            <!--}-->
            <!--function redirect(url) {-->
                <!--location.href = url;-->
            <!--}-->
        <!--</script>-->
    <!--</body>-->
<!--</html>-->

<?php include Doo::conf()->SITE_PATH .  Doo::conf()->PROTECTED_FOLDER . "viewc/admin/headAndLeftWrapper.php"; ?>
<div class="mainWrapper container-fluid">
    <div class="page-header pageTop">
        <h3>销售提成</h3>
    </div>
    <div class="shopContent clearfix">
        <div class="btnGroup">
            <a type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModalAdd">添加销售人员</a>
        </div>
        <!-- <div class="search">
          <div class="input-group">
            <input type="text" class="form-control" placeholder="Search for...">
            <span class="input-group-btn">
              <button class="btn btn-default" type="button">点击搜索</button>
            </span>
          </div>
        </div> -->
    </div>
    <div class="tableContent">
        <p>总累计金额：<?php echo $data['total']; ?> 累计提取金额：<?php echo $data['usez']; ?> 累计未发金额：<?php echo $data['unpay']; ?></p>
        <table class="table table-hover">
            <thead>
            <tr>
                <th>姓名</th>
                <th>优惠码</th>
                <th>累计金额</th>
                <th>已提取金额</th>
                <th>操作</th>
            </tr>
            </thead>
            <?php foreach($data['userArray'] as $k1=>$v1): ?>
            <tr>
                <td><?php echo $v1['salename']; ?></td>
                <td><?php echo $v1['promocode']; ?></td>
                <td><?php echo $v1['total']; ?></td>
                <td><?php echo $v1['usez']; ?></td>
                <td>
                    <a href="#" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModalLq" onclick="sumbitid(<?php echo $v1['id']; ?>)">确认提取</a>
                </td>
            </tr>
            <?php endforeach; ?>
        </table>
    </div>
    <nav style="margin:20px 0;">
        <?php echo $data['pager']; ?>
    </nav>
</div>
<!-- mainWrapper end -->
</div>

<!-- 添加 -->
<div class="modal fade" id="myModalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <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>
            <form class="form-horizontal" action="/m/sale" method="post">
            <div class="modal-body">
                    <div class="form-group">
                        <label for="" class="col-sm-3 control-label">销售人名称</label>
                        <div class="col-sm-7">
                            <input name="salename" type="text" class="form-control"  placeholder="请输入销售人名称">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="" class="col-sm-3 control-label">销售优惠码</label>
                        <div class="col-sm-7">
                            <input name="promocode" type="text" class="form-control" id="" placeholder="请输入销售优惠码">
                        </div>
                    </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" name="submit" class="btn btn-primary">确认</button>
            </div>
            </form>
        </div>
    </div>
</div>

<!-- 领取 -->
<div class="modal fade" id="myModalLq" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <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="myModalLabel2">确认领取金额</h4>
            </div>
            <form class="form-horizontal" action="/m/sale/cash" method="post" id="fromid">
            <div class="modal-body">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">提取金额</label>
                    <div class="col-sm-7">
                        <input name="money" type="number" class="form-control"  placeholder="">
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">确认人</label>
                    <div class="col-sm-7">
                        <input name="confirm" type="text" class="form-control" placeholder="">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button name="submit" type="submit" class="btn btn-primary">确认</button>
            </div>
            </form>
        </div>
    </div>
</div>

<script>
    function sumbitid(id){
        $('#fromid').attr('action', '/m/sale/cash/'+id);
    }
</script>
</body>
</html>

