indexall.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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");?>"' 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="all" 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. <th>缴费状态</th>
  245. <th>操作</th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <?php
  250. if(isset($return) && !empty($return['result'])){
  251. foreach($return['result'] as $v)
  252. {
  253. ?>
  254. <tr>
  255. <!--<td><?php echo $v->id?></td>-->
  256. <td><?php echo $v->order_no?></td>
  257. <td><?php if($v->type==0){echo '微信';}else{echo '学管';}?></td>
  258. <td width="150"><?php if(isset($goods) && isset($goods[$v->id]['gname'])){ echo $goods[$v->id]['gname'];}?></td>
  259. <td><?php
  260. switch ($v->grade)
  261. {
  262. case -1 :
  263. echo '全年级';
  264. break;
  265. case 1 :
  266. echo '高一';
  267. break;
  268. case 2 :
  269. echo '高二';
  270. break;
  271. case 3 :
  272. echo '高三';
  273. break;
  274. default: echo '全年级';
  275. }
  276. ?></td>
  277. <td><?php echo $v->quantity?></td>
  278. <td><?php if(isset($v->total_price)){echo $v->total_price;}?></td>
  279. <td><?php $paymoney=0;if(isset($pay[$v['id']])){foreach($pay[$v['id']] as $val){$paymoney+=$val['pay_money'];}echo $paymoney;}else{echo 0;}?></td>
  280. <td><?php if(isset($v->total_price)){echo $v->total_price-$paymoney>0?$v->total_price-$paymoney:0;}?></td>
  281. <td>
  282. <?php
  283. $candel=1;
  284. if(!empty($isdel)){
  285. foreach($isdel as $i){
  286. if($i['id']==$v->id){ //如果在4步审核中找到
  287. $candel=0;
  288. }
  289. }
  290. }
  291. if($v->chargeback!=2){
  292. if($v->status==0){
  293. if($candel==0){ ?>
  294. <span class="label label-sm label-warning">审核中</span>
  295. <?php }else{
  296. ?>
  297. <span class="label label-sm label-warning">待审核</span>
  298. <?php }
  299. }?>
  300. <?php if($v->status==1){
  301. if($v->type==1){
  302. ?>
  303. <span class="label label-sm label-warning" style="background-color:green;">审核通过</span>
  304. <?php }else{
  305. echo '<span class="label label-sm label-warning" style="background-color:green;">已支付</span>';
  306. }
  307. }?>
  308. <?php if($v->status==2){ ?>
  309. <span class="label label-sm label-warning" style="background-color:red;">审核驳回</span>
  310. <?php } ?>
  311. <?php if($v->status==3){ ?>
  312. <span class="label label-sm label-warning" style="background-color:black;">已取消</span>
  313. <?php }
  314. }else{ ?>
  315. <span class="label label-sm label-warning" style="background-color:red;">已退订</span>
  316. <?php } ?>
  317. </td>
  318. <td><?php
  319. $ispay=0;
  320. if(isset($paystatus[$v['id']])){
  321. if($paystatus[$v['id']][count($paystatus[$v['id']])-1]['status']==0){
  322. $payresult= "等待审核";
  323. $color="orange";
  324. }if($paystatus[$v['id']][count($paystatus[$v['id']])-1]['status']==1){
  325. $color="green";
  326. $payresult= "成功";
  327. }if($paystatus[$v['id']][count($paystatus[$v['id']])-1]['status']==2){
  328. $payresult= "不成功";
  329. $color="red";
  330. }if($paystatus[$v['id']][count($paystatus[$v['id']])-1]['status']==3){
  331. $payresult= "取消";
  332. $color="black";
  333. }
  334. if(@$v->payment_status==0){
  335. echo "<font color='$color'>全部缴清</font>";
  336. }else{
  337. if(isset($payresult)){
  338. if($payresult!="不成功"){
  339. echo "<font color='$color'>第".count($paystatus[$v['id']])."期缴费".$payresult."</font>";
  340. // var_dump($pay[$v['id']]);
  341. }else{
  342. $ispay=1;
  343. // echo "<a href='".Yii::app()->createUrl('order/payedit',array('id'=>$pay[$v['id']][count($pay[$v['id']])-1]['id']))."'><font color='$color'>第".count($pay[$v['id']])."期缴费".$payresult."</font></a>";
  344. echo "<font color='$color'>第".count($paystatus[$v['id']])."期缴费".$payresult."</font>";
  345. }
  346. }
  347. }
  348. }else{
  349. echo "<font color='orange'>第1期缴费等待审核</font>";
  350. }
  351. ?></td>
  352. <td>
  353. <a href="<?php echo Yii::app()->createUrl('order/info',array('order_id'=>$v->id,"type"=>"all"))?>">查看</a>
  354. <!--<a href="<?php echo Yii::app()->createUrl('order/editorder',array('order_id'=>$v->id,"type"=>"all"))?>">修改</a>-->
  355. <?php if(@$v->payment_status!=0&&@$paystatus[$v['id']][count($paystatus[$v['id']])-1]['status']==1&&@$v->total_price-@$paymoney>0){ ?>
  356. <a href="<?php echo Yii::app()->createUrl('order/pay',array('order_id'=>$v->id))?>">缴费</a>
  357. <?php } ?>
  358. <?php if($v->status==2||$v->status==3){ ?>
  359. <a href="<?php echo Yii::app()->createUrl('order/delorder',array('order_id'=>$v->id,"type"=>"all"))?>" onclick="return confirm('确定删除?');">删除</a>
  360. <?php } ?>
  361. <?php if($ispay==1&&$v->status!=2){
  362. echo "<a href='".Yii::app()->createUrl('order/payedit',array('id'=>$paystatus[$v['id']][count($paystatus[$v['id']])-1]['id']))."'>修改缴费</a>";
  363. }
  364. if($candel==1&&$v->status==0&&$v->type==1){?>
  365. <a href="javascript:void(0);" onclick="checklink('<?php echo Yii::app()->createUrl('order/delete',array('order_id'=>$v->id))?>')">取消</a>
  366. <?php }
  367. ?>
  368. </td>
  369. </tr>
  370. <?php } }else{ ?>
  371. <tr><td colspan="10">暂无数据!</td></tr>
  372. <?php }?>
  373. </tbody>
  374. </table>
  375. <?php if(isset($return)&&!empty($return)):?>
  376. <div class="row">
  377. <div class="col-xs-7">
  378. <!-- <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">Showing 1 to 10 of 23 entries</div> -->
  379. </div>
  380. <div class="col-xs-5">
  381. <div class="dataTables_paginate paging_simple_numbers">
  382. <?php
  383. $this->widget('CLinkPager', array(
  384. 'header' => '',
  385. //'selectedPageCssClass' => 'active2', //当前页的class
  386. //'hiddenPageCssClass' => 'disabled2', //禁用页的class
  387. 'firstPageLabel' => '首页',
  388. 'lastPageLabel' => '末页',
  389. 'prevPageLabel' => '上一页',
  390. 'nextPageLabel' => '下一页',
  391. 'pages' => $return['page'],
  392. 'maxButtonCount'=> 5,
  393. ));
  394. ?><?php echo '共:'.$return['page_total'].'条';?>
  395. </div>
  396. </div>
  397. </div>
  398. <?php endif;?>
  399. </div>
  400. <!-- PAGE CONTENT ENDS -->
  401. </div>
  402. </div>
  403. </div>
  404. </div>