indextest.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <script src="/js/xsgl.js"></script>
  2. <script>
  3. $(function(){
  4. var semesterval = $("#semester_id").val();
  5. var val = $("#class_id").val();
  6. $(".diy_select_list").click(function(){
  7. if(val != $("#class_id").val()){
  8. $('.diy_select_input2').val(-1);
  9. $('.diy_select_txt2').html('--请选择学生--');
  10. var data={
  11. "class_id":$("#class_id").val()
  12. };
  13. $.post("<?php echo Yii::app()->createUrl('order/getstudents')?>",data,function(flag){
  14. var m =JSON.parse(flag);
  15. if(m.status)
  16. {
  17. var str='';
  18. $.each(m.result,function(i,e){
  19. str+='<li val="'+ e.student_id+'">'+ e.realname+'</li>'
  20. });
  21. $('.diy_select_list2').html(str);
  22. }
  23. });
  24. }else{
  25. return;
  26. }
  27. });
  28. $(".diy_select_list3").click(function(){
  29. if(semesterval != $("#semester_id").val()){
  30. semesterval=$("#semester_id").val()
  31. nianji=$("#nianji").val()
  32. $('.diy_select_input').val(-1);
  33. // $('.diy_select_txt').html('--请选择年级--');
  34. var data={
  35. "semester_id":$("#semester_id").val(),
  36. "nianji":$("#nianji").val()
  37. };
  38. $.post("<?php echo Yii::app()->createUrl('order/getclass')?>",data,function(flag){
  39. var m =JSON.parse(flag);
  40. if(m.status)
  41. {
  42. var str='';
  43. $.each(m.result,function(i,e){
  44. str+='<li val="'+ e.class_id+'">'+ e.class_name+'</li>'
  45. });
  46. $(".diy_select_txt").html("-全班-")
  47. $('.diy_select_list').html(str);
  48. $('.diy_select_list2').html("");
  49. }else{
  50. $(".diy_select_txt").html("-全班-")
  51. $('.diy_select_list').html("");
  52. $('.diy_select_list2').html("");
  53. }
  54. });
  55. }else{
  56. return;
  57. }
  58. });
  59. $(".diy_select_list4").click(function(){
  60. if(nianji != $("#nianji").val()){
  61. nianji=$("#nianji").val()
  62. semesterval=$("#semester_id").val()
  63. $('.diy_select_input').val(-1);
  64. var data={
  65. "nianji":$("#nianji").val(),
  66. "semester_id":$("#semester_id").val()
  67. };
  68. $.post("<?php echo Yii::app()->createUrl('order/getclass')?>",data,function(flag){
  69. var m =JSON.parse(flag);
  70. if(m.status)
  71. {
  72. var str='';
  73. $.each(m.result,function(i,e){
  74. str+='<li val="'+ e.class_id+'">'+ e.class_name+'</li>'
  75. });
  76. $(".diy_select_txt").html("-全班-")
  77. $('.diy_select_list').html(str);
  78. $('.diy_select_list2').html("");
  79. }else{
  80. $(".diy_select_txt").html("-全班-")
  81. $('.diy_select_list').html("");
  82. $('.diy_select_list2').html("");
  83. }
  84. });
  85. }else{
  86. return;
  87. }
  88. });
  89. });
  90. </script>
  91. <div class="main-content-inner">
  92. <ul class="clearfix main-content-inner-ul">
  93. <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
  94. <li class="pull-left">
  95. <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>
  96. <img src="/images/line.jpg" style="height:45px;" />
  97. </li>
  98. <li class="pull-left">
  99. <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>
  100. <img src="/images/line.jpg" style="height:45px;" />
  101. </li>
  102. <li class="pull-left">
  103. <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>
  104. <img src="/images/line.jpg" style="height:45px;" />
  105. </li>
  106. <li class="pull-left">
  107. <button onclick='location.href="<?php echo $this->createUrl("order/student");?>"' class="button button_normal button_group button_arrow " data-button="red">使用学生名单</button>
  108. <img src="/images/line.jpg" style="height:45px;" />
  109. </li>
  110. <?php }?>
  111. </ul>
  112. <div class="page-content">
  113. <div class="row" style="margin:0px;">
  114. <div class="col-xs-12">
  115. <!-- PAGE CONTENT BEGINS -->
  116. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  117. <div class="row">
  118. <div class="dataTables_length margin-zy">
  119. <div class="col-xs-12">
  120. <form action="<?php echo $this->createUrl("order/index");?>" method="get">
  121. <input type="hidden" value="test" name="type">
  122. <div class='diy_select3' style="width:175px;float: left;">
  123. <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;}?>"/>
  124. <div class='diy_select_txt3' style="width:142px;">
  125. <?php if(isset($search['semester_id'])&&isset($semester[$search['semester_id']])){echo $semester[$search['semester_id']]['semester_name'];}else{echo '--全学期--';}?>
  126. </div>
  127. <div class='diy_select_btn3'></div>
  128. <ul class='diy_select_list3'>
  129. <?php if(isset($semester)){?>
  130. <li val="<?php echo $nowsemesterId?>"><?php echo $semester[$nowsemesterId]['semester_name'];?></li>
  131. <?php foreach($semester as $k=>$v)
  132. {
  133. if($k!=$nowsemesterId){
  134. ?>
  135. <li val="<?php echo $v['semester_id']?>"><?php echo $v['semester_name']?></li>
  136. <?php
  137. }
  138. }
  139. }?>
  140. </ul>
  141. </div>
  142. <div class='diy_select4' style="width:150px;float: left;margin-left: 25px;">
  143. <input type='hidden' class='diy_select_input4' id="nianji" name="nianji" value="<?php if(isset($search['nianji'])){echo $search['nianji'];}else{echo -1;}?>"/>
  144. <div class='diy_select_txt4' style="width:118px;">
  145. <?php if(isset($search['nianji'])){
  146. if($search['nianji']==1){
  147. echo "高一";
  148. }elseif($search['nianji']==2){
  149. echo "高二";
  150. }elseif($search['nianji']==3){
  151. echo "高三";
  152. }else{
  153. echo '--全年级--';
  154. }
  155. }else{
  156. echo '--全年级--';
  157. }?>
  158. </div>
  159. <div class='diy_select_btn4'></div>
  160. <ul class='diy_select_list4'>
  161. <li val="-1" class="">全年级</li>
  162. <li val="1">高一</li>
  163. <li val="2">高二</li>
  164. <li val="3">高三</li>
  165. </ul>
  166. </div>
  167. <div class='diy_select' style="width:150px;float: left;border: 1px solid #73839F;margin-left: 25px">
  168. <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;}?>"/>
  169. <div class='diy_select_txt' style="width:118px;">
  170. <?php if(isset($search['class_id'])&&isset($class_name[$search['class_id']])){echo $class_name[$search['class_id']];}else{echo '--全班--';}?>
  171. </div>
  172. <div class='diy_select_btn'></div>
  173. <ul class='diy_select_list'>
  174. <li val="-1">--全班--</li>
  175. <?php if(isset($classes)){
  176. foreach($classes as $v)
  177. {
  178. ?>
  179. <li val="<?php echo $v->class_id?>"><?php echo $v->class_name?></li>
  180. <?php
  181. }
  182. }?>
  183. </ul>
  184. </div>
  185. <div class='diy_select2' style="width:150px;float: left;margin-left: 25px">
  186. <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;}?>"/>
  187. <div class='diy_select_txt2' style="width:118px;">
  188. <?php if(isset($student_name) && !empty($student_name)){echo $student_name;}else{echo '--请选择学生--';}?>
  189. </div>
  190. <div class='diy_select_btn2'></div>
  191. <ul class='diy_select_list2'>
  192. <li val="-1" class="">全学生</li>
  193. <?php if(isset($class_student)){
  194. foreach($class_student as $v)
  195. {
  196. ?>
  197. <li val="<?php echo $v->student_id?>"><?php echo $v->realname?></li>
  198. <?php
  199. }
  200. }?>
  201. </ul>
  202. </div>
  203. <div class='diy_select1' style="width:150px;float: left;margin-left: 25px;">
  204. <input type='hidden' class='diy_select_input1' id="status" name="status" value="<?php if(isset($search['status'])){echo $search['status'];}else{echo -1;}?>"/>
  205. <div class='diy_select_txt1' style="width:118px;">
  206. <?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 '订单状态';}?>
  207. </div>
  208. <div class='diy_select_btn1'></div>
  209. <ul class='diy_select_list1'>
  210. <li val="-1">全部</li>
  211. <li val="1">已支付</li>
  212. <li val="2">待审核</li>
  213. <li val="3">未通过</li>
  214. <li val="4">已取消</li>
  215. </ul>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. <div class="row "style="padding-top: 15px;">
  221. <div class="col-xs-12">
  222. <div class="fl" style="margin-left: 25px;"><button class="label-primary-s bth-s" id="search" style="padding:6px 22px;left:25px;">搜索</button></div>
  223. <div id="dynamic-table_filter" class="dataTables_filter position_g fl" style="margin-left: 25px;">
  224. <a class="btn btn-success btn-sm" style="padding: 6px 10px;" href="<?php echo $this->createUrl('order/add');?>?type=<?php echo $ordertype ?>">
  225. <i class="fa fa-plus" style="font-style: normal;"></i> 添加订单
  226. </a>
  227. </div>
  228. </div>
  229. </div>
  230. </form>
  231. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  232. <thead>
  233. <tr>
  234. <!--<th>ID</th>-->
  235. <th>订单号</th>
  236. <th>试用商品</th>
  237. <th>年级</th>
  238. <th>试用班级数/人数</th>
  239. <th>开始时间</th>
  240. <th>结束时间</th>
  241. <th>剩余时间</th>
  242. <th>状态</th>
  243. <th>操作</th>
  244. </tr>
  245. </thead>
  246. <tbody>
  247. <?php
  248. if(isset($return) && !empty($return['result'])){
  249. foreach($return['result'] as $v)
  250. {
  251. ?>
  252. <tr>
  253. <td><?php echo $v->order_no?></td>
  254. <td width="150"><?php if(isset($goods) && isset($goods[$v->id]['gname'])){ echo $goods[$v->id]['gname'];}?></td>
  255. <td><?php
  256. switch ($v->grade)
  257. {
  258. case -1 :
  259. echo '全年级';
  260. break;
  261. case 1 :
  262. echo '高一';
  263. break;
  264. case 2 :
  265. echo '高二';
  266. break;
  267. case 3 :
  268. echo '高三';
  269. break;
  270. default: echo '全年级';
  271. }
  272. ?></td>
  273. <td><?php echo @$classnum[$v->id]."/".@$stunum[$v->id] ?></td>
  274. <td><?php echo str_replace(" 00:00:00", "", $v->trial_begin_time);?></td>
  275. <td><?php $endtime= explode(" ", $v->trial_end_time);echo $endtime[0];?></td>
  276. <td><?php
  277. if(strtotime($v->trial_begin_time)<time()){
  278. if(strtotime($v->trial_end_time)>time()){
  279. echo floor((strtotime($v->trial_end_time)-time())/86400)."天".
  280. floor((strtotime($v->trial_end_time)-time())%86400/3600)."小时";
  281. }else{
  282. if($v->trial_end_time){
  283. echo "已到期";
  284. }
  285. }
  286. }else{
  287. if(strtotime($v->trial_end_time)>strtotime($v->trial_begin_time)){
  288. echo floor((strtotime($v->trial_end_time)-strtotime($v->trial_begin_time))/86400)."天".
  289. floor((strtotime($v->trial_end_time)-strtotime($v->trial_begin_time))%86400/3600)."小时";
  290. }
  291. }
  292. ?></td>
  293. <td>
  294. <?php
  295. $candel=1;
  296. if(!empty($isdel)){
  297. foreach($isdel as $i){
  298. if($i['id']==$v->id){ //如果在4步审核中找到
  299. $candel=0;
  300. }
  301. }
  302. }
  303. if($v->status==0){
  304. if($candel==0){ ?>
  305. <span class="label label-sm label-warning">审核中</span>
  306. <?php }else{
  307. ?>
  308. <span class="label label-sm label-warning">待审核</span>
  309. <?php }
  310. }
  311. if($v->chargeback!=2){
  312. if($v->status==1){
  313. if($v->type==1){
  314. ?>
  315. <span class="label label-sm label-warning" style="background-color:green;">审核通过</span>
  316. <?php }else{
  317. echo '<span class="label label-sm label-warning" style="background-color:green;">已支付</span>';
  318. }
  319. }?>
  320. <?php if($v->status==2){ ?>
  321. <span class="label label-sm label-warning" style="background-color:red;">审核驳回</span>
  322. <?php } ?>
  323. <?php if($v->status==3){ ?>
  324. <span class="label label-sm label-warning" style="background-color:black;">已取消</span>
  325. <?php }
  326. }else{ ?>
  327. <span class="label label-sm label-warning" style="background-color:red;">已退订</span>
  328. <?php } ?>
  329. </td>
  330. <td>
  331. <a href="<?php echo Yii::app()->createUrl('order/info',array('order_id'=>$v->id,"type"=>$ordertype))?>">查看</a>
  332. <!--<a href="<?php echo Yii::app()->createUrl('order/editorder',array('order_id'=>$v->id,"type"=>$ordertype))?>">修改</a>-->
  333. <?php if($v->status==2||$v->status==3){ ?>
  334. <a href="<?php echo Yii::app()->createUrl('order/delorder',array('order_id'=>$v->id,"type"=>$ordertype))?>" onclick="return confirm('确定删除?');">删除</a>
  335. <?php }
  336. if($candel==1&&$v->status==0&&$v->type==1){?>
  337. <a href="javascript:void(0);" onclick="checklink('<?php echo Yii::app()->createUrl('order/delete',array('order_id'=>$v->id))?>')">取消</a>
  338. <?php }
  339. ?>
  340. </td>
  341. </tr>
  342. <?php } }else{?>
  343. <tr><td colspan="10">暂无数据!</td></tr>
  344. <?php }
  345. ?>
  346. </tbody>
  347. </table>
  348. <?php if(isset($return)&&!empty($return)):?>
  349. <div class="row">
  350. <div class="col-xs-7">
  351. <!-- <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">Showing 1 to 10 of 23 entries</div> -->
  352. </div>
  353. <div class="col-xs-5">
  354. <div class="dataTables_paginate paging_simple_numbers">
  355. <?php
  356. $this->widget('CLinkPager', array(
  357. 'header' => '',
  358. //'selectedPageCssClass' => 'active2', //当前页的class
  359. //'hiddenPageCssClass' => 'disabled2', //禁用页的class
  360. 'firstPageLabel' => '首页',
  361. 'lastPageLabel' => '末页',
  362. 'prevPageLabel' => '上一页',
  363. 'nextPageLabel' => '下一页',
  364. 'pages' => $return['page'],
  365. 'maxButtonCount'=> 5,
  366. ));
  367. ?><?php echo '共:'.$return['page_total'].'条';?>
  368. </div>
  369. </div>
  370. </div>
  371. <?php endif;?>
  372. </div>
  373. <!-- PAGE CONTENT ENDS -->
  374. </div>
  375. </div>
  376. </div>
  377. </div>