select.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  5. <meta charset="utf-8" />
  6. <title>学期切换</title>
  7. <meta name="description" content="" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
  9. <!-- bootstrap & fontawesome -->
  10. <link rel="stylesheet" href="/css/bootstrap.min.css" />
  11. <!-- ace styles -->
  12. <link rel="stylesheet" href="/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
  13. </head>
  14. <body class="no-skin">
  15. <div class="main-content-inner" style="heigth:500px;">
  16. <div class="page-content">
  17. <div class="row">
  18. <div class="col-xs-12" width="100%">
  19. <div class="col-sm-6">
  20. <ul class="list-unstyled spaced">
  21. <?php if(!empty($allSemester)):foreach($allSemester as $loop):if($semesterId != $loop->semester_id):?>
  22. <li><a onclick="chageSelect('<?php echo $loop->semester_id;?>')" href="javascript:void(0);"><?php echo $loop->semester_name;?></a></li>
  23. <?php endif;endforeach;else:?>
  24. <li>暂无学期可切换</li>
  25. <?php endif;?>
  26. </ul>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <!-- <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  33. <thead>
  34. <tr>
  35. <td>学生姓名</td>
  36. </tr>
  37. </thead>
  38. </table> -->
  39. <script src="/js/jquery.2.1.1.min.js"></script>
  40. <script src="/js/layer/layer.js"></script>
  41. <script type="text/javascript">
  42. function chageSelect(num){
  43. if(!num){
  44. layer.msg("选着学期有误!", {
  45. icon: 1,
  46. time: 2000 //2秒关闭(如果不配置,默认是3秒)
  47. },function(){
  48. var index = parent.layer.getFrameIndex(window.name);
  49. parent.layer.close(index);
  50. });
  51. }
  52. // 选着学期操作
  53. $.post("<?php echo $this->createUrl('index/select');?>",{smid:num},function(json){
  54. if(json.flag){
  55. //var index = parent.layer.getFrameIndex(window.name);
  56. //parent.layer.close(index);
  57. //parent.location.reload();
  58. parent.location.reload();
  59. }else{
  60. layer.msg('选择学期有误!', {
  61. icon: 1,
  62. time: 2000 //2秒关闭(如果不配置,默认是3秒)
  63. },function(){
  64. var index = parent.layer.getFrameIndex(window.name);
  65. parent.layer.close(index);
  66. });
  67. }
  68. },'json');
  69. }
  70. </script>
  71. </body>
  72. </html>