index.php 23 KB

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