meorder.html 4.5 KB
<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>我的订单列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('zj_order/meorder')}">
        服务分类:
        <select class="form-control" name="ser_type"  id="classo" onchange="teacherChange(this.options[this.selectedIndex].value)">
            <option value>选择服务类别</option>
            <foreach name="ser" item="vo">
                <option value="{$vo.id}">{$vo.name}</option>
            </foreach>
        </select>&nbsp;&nbsp;

        服务名称:
        <select class="form-control"  id="classobj" name="name">
            <option value>选择服务名称</option>
            <foreach name="allservice" item="val">
                <option value="{$val.id}">{$val.name}</option>
            </foreach>
        </select>&nbsp;&nbsp;
        订单状态:
        <select class="form-control" name="order_type">
            <option value>选择订单状态</option>
            <option value="3">未完成</option>
            <option value="4">待评论</option>
            <option value="5">订单完成</option>
        </select>&nbsp;&nbsp;
        预约时间:
        <input type="date" class="form-control time" name="date_min" style="width: 150px;">
        -
        <input type="date" class="form-control time" name="date_max" style="width: 150px;">
        <select class="form-control" name="contact_time">
            <option value>选择时间</option>
            <foreach name="allcon" item="val">
                <option value="{$val.id}">{$val['contact']}</option>
            </foreach>
        </select>&nbsp;&nbsp;<br/>
        订单编号:
        <input type="text" name="order_num" placeholder="请输入12位订单编号" class="form-control">&nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('zj_order/meorder')}">清空</a>
    </form>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>订单编号</th>
            <th>所购服务</th>
            <th>服务分类</th>
            <th>客户姓名</th>
            <th>客户手机</th>
            <th>客户留言</th>
            <th>预约时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="allorder" item="vo">
            <tr>
                <td>{$vo['order_num']}</td>
                <td>{$vo['sname']}</td>
                <td>{$vo['tname']}</td>
                <td>{$vo['uname']}</td>
                <td>{$vo['name']}</td>
                <td>
                    <if condition="mb_strlen($vo.remarks) gt '10'">
                        {:mb_substr($vo.remarks,0,8)}...
                        <else>
                        {$vo.remarks}
                    </if>
                </td>
                <td>{$vo.contact_date} , {$vo.contact}
                </td>
                <td>
                    <a href="{:url('zj_order/one',array('id'=>$vo['id']))}">查看详情</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$allorder->render()}</div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">

    var ar1={:json_encode($allservice)};//后台传入服务名称
    //当选择指向类时改变目标的下拉菜单
    function teacherChange(area){
        var tobj=document.getElementById('classobj');
        removeAllOptions(tobj);
        var option = document.createElement("option");
        option.text = "选择服务名称";
        option.value = "";
        tobj.add(option);

        for(m=0;m<ar1.length;m++){
            if (ar1[m]['ser_type']==area&&area!=''){
                var option = document.createElement("option");
                option.text = ar1[m]['name'];
                option.value = ar1[m]['id'];
                tobj.add(option);
            }else if(area==''){
                var option = document.createElement("option");
                option.text = ar1[m]['name'];
                option.value = ar1[m]['id'];
                tobj.add(option);
            }
        }
    }
    //移除option 当中所有元素
    function removeAllOptions(selectbox)
    {
        var i;
        for(i=selectbox.options.length-1;i>=0;i--)
        {
            selectbox.remove(i);
        }
    }

</script>
</body>
</html>