123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- <script src="/js/xsgl.js"></script>
- <script>
- $(function(){
- var semesterval = $("#semester_id").val();
- var val = $("#class_id").val();
- $(".diy_select_list").click(function(){
- if(val != $("#class_id").val()){
- $('.diy_select_input2').val(-1);
- $('.diy_select_txt2').html('--请选择学生--');
- var data={
- "class_id":$("#class_id").val()
- };
- $.post("<?php echo Yii::app()->createUrl('order/getstudents')?>",data,function(flag){
- var m =JSON.parse(flag);
- if(m.status)
- {
- var str='';
- $.each(m.result,function(i,e){
- str+='<li val="'+ e.student_id+'">'+ e.realname+'</li>'
- });
- $('.diy_select_list2').html(str);
- }
- });
- }else{
- return;
- }
- });
- $(".diy_select_list3").click(function(){
- if(semesterval != $("#semester_id").val()){
- semesterval=$("#semester_id").val()
- nianji=$("#nianji").val()
- $('.diy_select_input').val(-1);
- // $('.diy_select_txt').html('--请选择年级--');
- var data={
- "semester_id":$("#semester_id").val(),
- "nianji":$("#nianji").val()
- };
- $.post("<?php echo Yii::app()->createUrl('order/getclass')?>",data,function(flag){
- var m =JSON.parse(flag);
- if(m.status)
- {
- var str='';
- $.each(m.result,function(i,e){
- str+='<li val="'+ e.class_id+'">'+ e.class_name+'</li>'
- });
- $(".diy_select_txt").html("-全班-")
- $('.diy_select_list').html(str);
- $('.diy_select_list2').html("");
- }else{
- $(".diy_select_txt").html("-全班-")
- $('.diy_select_list').html("");
- $('.diy_select_list2').html("");
- }
- });
- }else{
- return;
- }
- });
- $(".diy_select_list4").click(function(){
- if(nianji != $("#nianji").val()){
- nianji=$("#nianji").val()
- semesterval=$("#semester_id").val()
- $('.diy_select_input').val(-1);
- var data={
- "nianji":$("#nianji").val(),
- "semester_id":$("#semester_id").val()
- };
- $.post("<?php echo Yii::app()->createUrl('order/getclass')?>",data,function(flag){
- var m =JSON.parse(flag);
- if(m.status)
- {
- var str='';
- $.each(m.result,function(i,e){
- str+='<li val="'+ e.class_id+'">'+ e.class_name+'</li>'
- });
- $(".diy_select_txt").html("-全班-")
- $('.diy_select_list').html(str);
- $('.diy_select_list2').html("");
- }else{
- $(".diy_select_txt").html("-全班-")
- $('.diy_select_list').html("");
- $('.diy_select_list2').html("");
- }
- });
- }else{
- return;
- }
- });
- });
- </script>
- <div class="main-content-inner">
- <ul class="clearfix main-content-inner-ul">
- <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("order/index");?>?type=ordinary"' class="button button_normal button_group button_arrow <?php if($ordertype=="ordinary"){echo 'button_active';} ?>" data-button="red">普通订单</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("order/index");?>?type=test"' class="button button_normal button_group button_arrow <?php if($ordertype=="test"){echo 'button_active';} ?>" data-button="red">试用订单</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("order/index");?>?type=all"' class="button button_normal button_group button_arrow <?php if($ordertype=="all"){echo 'button_active';} ?>" data-button="red">统订订单</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("order/student");?>"' class="button button_normal button_group button_arrow " data-button="red">使用学生名单</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php }?>
-
- </ul>
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row">
- <div class="dataTables_length margin-zy">
- <div class="col-xs-12">
- <form action="<?php echo $this->createUrl("order/index");?>" method="get">
- <input type="hidden" value="test" name="type">
- <div class='diy_select3' style="width:175px;float: left;">
-
- <input type='hidden' class='diy_select_input3' id="semester_id" name="semester_id" value="<?php if(isset($search['semester_id'])){echo $search['semester_id'];}else{echo -1;}?>"/>
- <div class='diy_select_txt3' style="width:142px;">
- <?php if(isset($search['semester_id'])&&isset($semester[$search['semester_id']])){echo $semester[$search['semester_id']]['semester_name'];}else{echo '--全学期--';}?>
- </div>
- <div class='diy_select_btn3'></div>
- <ul class='diy_select_list3'>
- <?php if(isset($semester)){?>
- <li val="<?php echo $nowsemesterId?>"><?php echo $semester[$nowsemesterId]['semester_name'];?></li>
- <?php foreach($semester as $k=>$v)
- {
- if($k!=$nowsemesterId){
- ?>
- <li val="<?php echo $v['semester_id']?>"><?php echo $v['semester_name']?></li>
- <?php
- }
- }
- }?>
- </ul>
- </div>
- <div class='diy_select4' style="width:150px;float: left;margin-left: 25px;">
- <input type='hidden' class='diy_select_input4' id="nianji" name="nianji" value="<?php if(isset($search['nianji'])){echo $search['nianji'];}else{echo -1;}?>"/>
- <div class='diy_select_txt4' style="width:118px;">
- <?php if(isset($search['nianji'])){
- if($search['nianji']==1){
- echo "高一";
- }elseif($search['nianji']==2){
- echo "高二";
- }elseif($search['nianji']==3){
- echo "高三";
- }else{
- echo '--全年级--';
- }
- }else{
- echo '--全年级--';
- }?>
- </div>
- <div class='diy_select_btn4'></div>
- <ul class='diy_select_list4'>
- <li val="-1" class="">全年级</li>
- <li val="1">高一</li>
- <li val="2">高二</li>
- <li val="3">高三</li>
- </ul>
- </div>
- <div class='diy_select' style="width:150px;float: left;border: 1px solid #73839F;margin-left: 25px">
- <input type='hidden' class='diy_select_input' id="class_id" name="class_id" value="<?php if(isset($search['class_id'])){echo $search['class_id'];}else{echo -1;}?>"/>
- <div class='diy_select_txt' style="width:118px;">
- <?php if(isset($search['class_id'])&&isset($class_name[$search['class_id']])){echo $class_name[$search['class_id']];}else{echo '--全班--';}?>
- </div>
- <div class='diy_select_btn'></div>
- <ul class='diy_select_list'>
- <li val="-1">--全班--</li>
- <?php if(isset($classes)){
- foreach($classes as $v)
- {
- ?>
- <li val="<?php echo $v->class_id?>"><?php echo $v->class_name?></li>
- <?php
- }
- }?>
- </ul>
- </div>
- <div class='diy_select2' style="width:150px;float: left;margin-left: 25px">
- <input type='hidden' class='diy_select_input2' id="student_id" name="student_id" value="<?php if(isset($search['student_id'])){echo $search['student_id'];}else{echo -1;}?>"/>
- <div class='diy_select_txt2' style="width:118px;">
- <?php if(isset($student_name) && !empty($student_name)){echo $student_name;}else{echo '--请选择学生--';}?>
- </div>
- <div class='diy_select_btn2'></div>
- <ul class='diy_select_list2'>
- <li val="-1" class="">全学生</li>
- <?php if(isset($class_student)){
- foreach($class_student as $v)
- {
- ?>
- <li val="<?php echo $v->student_id?>"><?php echo $v->realname?></li>
- <?php
- }
- }?>
- </ul>
- </div>
- <div class='diy_select1' style="width:150px;float: left;margin-left: 25px;">
- <input type='hidden' class='diy_select_input1' id="status" name="status" value="<?php if(isset($search['status'])){echo $search['status'];}else{echo -1;}?>"/>
- <div class='diy_select_txt1' style="width:118px;">
- <?php if(isset($search['status']) && $search['status']==2){echo '待审核';}elseif(isset($search['status']) && $search['status']==1){echo '已支付';}elseif(isset($search['status']) && $search['status']==3){echo '未通过';}elseif(isset($search['status']) && $search['status']==4){echo '已取消';}else{echo '订单状态';}?>
- </div>
- <div class='diy_select_btn1'></div>
- <ul class='diy_select_list1'>
- <li val="-1">全部</li>
- <li val="1">已支付</li>
- <li val="2">待审核</li>
- <li val="3">未通过</li>
- <li val="4">已取消</li>
- </ul>
- </div>
-
-
- </div>
-
- </div>
- </div>
- <div class="row "style="padding-top: 15px;">
- <div class="col-xs-12">
-
- <div class="fl" style="margin-left: 25px;"><button class="label-primary-s bth-s" id="search" style="padding:6px 22px;left:25px;">搜索</button></div>
- <div id="dynamic-table_filter" class="dataTables_filter position_g fl" style="margin-left: 25px;">
- <a class="btn btn-success btn-sm" style="padding: 6px 10px;" href="<?php echo $this->createUrl('order/add');?>?type=<?php echo $ordertype ?>">
- <i class="fa fa-plus" style="font-style: normal;"></i> 添加订单
- </a>
- </div>
- </div>
- </div>
- </form>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <!--<th>ID</th>-->
- <th>订单号</th>
- <th>试用商品</th>
- <th>年级</th>
- <th>试用班级数/人数</th>
- <th>开始时间</th>
- <th>结束时间</th>
- <th>剩余时间</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($return) && !empty($return['result'])){
- foreach($return['result'] as $v)
- {
-
- ?>
- <tr>
-
- <td><?php echo $v->order_no?></td>
- <td width="150"><?php if(isset($goods) && isset($goods[$v->id]['gname'])){ echo $goods[$v->id]['gname'];}?></td>
- <td><?php
- switch ($v->grade)
- {
- case -1 :
- echo '全年级';
- break;
- case 1 :
- echo '高一';
- break;
- case 2 :
- echo '高二';
- break;
- case 3 :
- echo '高三';
- break;
- default: echo '全年级';
- }
- ?></td>
- <td><?php echo @$classnum[$v->id]."/".@$stunum[$v->id] ?></td>
- <td><?php echo str_replace(" 00:00:00", "", $v->trial_begin_time);?></td>
- <td><?php $endtime= explode(" ", $v->trial_end_time);echo $endtime[0];?></td>
- <td><?php
- if(strtotime($v->trial_begin_time)<time()){
- if(strtotime($v->trial_end_time)>time()){
- echo floor((strtotime($v->trial_end_time)-time())/86400)."天".
- floor((strtotime($v->trial_end_time)-time())%86400/3600)."小时";
- }else{
- if($v->trial_end_time){
- echo "已到期";
- }
- }
- }else{
- if(strtotime($v->trial_end_time)>strtotime($v->trial_begin_time)){
- echo floor((strtotime($v->trial_end_time)-strtotime($v->trial_begin_time))/86400)."天".
- floor((strtotime($v->trial_end_time)-strtotime($v->trial_begin_time))%86400/3600)."小时";
- }
- }
- ?></td>
- <td>
- <?php
- $candel=1;
- if(!empty($isdel)){
- foreach($isdel as $i){
- if($i['id']==$v->id){ //如果在4步审核中找到
- $candel=0;
- }
- }
- }
- if($v->status==0){
- if($candel==0){ ?>
- <span class="label label-sm label-warning">审核中</span>
- <?php }else{
- ?>
- <span class="label label-sm label-warning">待审核</span>
- <?php }
- }
- if($v->chargeback!=2){
- if($v->status==1){
- if($v->type==1){
- ?>
- <span class="label label-sm label-warning" style="background-color:green;">审核通过</span>
- <?php }else{
- echo '<span class="label label-sm label-warning" style="background-color:green;">已支付</span>';
- }
- }?>
- <?php if($v->status==2){ ?>
- <span class="label label-sm label-warning" style="background-color:red;">审核驳回</span>
- <?php } ?>
- <?php if($v->status==3){ ?>
- <span class="label label-sm label-warning" style="background-color:black;">已取消</span>
- <?php }
- }else{ ?>
- <span class="label label-sm label-warning" style="background-color:red;">已退订</span>
- <?php } ?>
- </td>
- <td>
- <a href="<?php echo Yii::app()->createUrl('order/info',array('order_id'=>$v->id,"type"=>$ordertype))?>">查看</a>
- <!--<a href="<?php echo Yii::app()->createUrl('order/editorder',array('order_id'=>$v->id,"type"=>$ordertype))?>">修改</a>-->
- <?php if($v->status==2||$v->status==3){ ?>
- <a href="<?php echo Yii::app()->createUrl('order/delorder',array('order_id'=>$v->id,"type"=>$ordertype))?>" onclick="return confirm('确定删除?');">删除</a>
- <?php }
- if($candel==1&&$v->status==0&&$v->type==1){?>
- <a href="javascript:void(0);" onclick="checklink('<?php echo Yii::app()->createUrl('order/delete',array('order_id'=>$v->id))?>')">取消</a>
- <?php }
- ?>
- </td>
- </tr>
- <?php } }else{?>
- <tr><td colspan="10">暂无数据!</td></tr>
- <?php }
- ?>
- </tbody>
- </table>
- <?php if(isset($return)&&!empty($return)):?>
- <div class="row">
- <div class="col-xs-7">
- <!-- <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">Showing 1 to 10 of 23 entries</div> -->
- </div>
- <div class="col-xs-5">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- //'selectedPageCssClass' => 'active2', //当前页的class
- //'hiddenPageCssClass' => 'disabled2', //禁用页的class
- 'firstPageLabel' => '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $return['page'],
- 'maxButtonCount'=> 5,
- ));
- ?><?php echo '共:'.$return['page_total'].'条';?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
|