123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <style>
- .btn-garder{
- text-decoration: none;background: cornflowerblue;padding: 5px;color: white;margin-left:5px;cursor: pointer;
- }
- </style>
- <script type="text/javascript">
- function in_array(search, array) {
- for (var i in array) {
- if (array[i] == search) {
- return true;
- }
- }
- return false;
- }
- testFlag = "<?php echo $this->testFlag;?>";
- customTplsIds = new Array();
- var i = 0;
- <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
- customTplsIds[i] = "<?php echo $tplId;?>";
- i++;
- <?php }?>
- jQuery(document).ready(function () {
- // 根据年级筛选班级
- jQuery("#grade").change(function () {
- var grade = $(this).val();
- if (!grade) return false;
- jQuery.post(
- '<?php echo $this->createUrl("print/getGradeClass");?>', {"grade": grade}, function (data) {
- data = JSON.parse(data);
- if (data.success == 1) {
- var classObj = $("#class");
- var html = "<option value=''>全部班级</option>";
- classObj.empty();
- $.each(data.message, function (i, n) {
- html += "<option value='" + n.class_id + "'>" + n.class_name + "</option>";
- });
- classObj.append(html);
- }
- }
- );
- });
- });
- </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("semester/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学期管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php }?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" 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("classes/index");?>"' class="button button_normal button_group button_arrow" 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("studentinfo/index");?>"' class="button button_normal button_group button_arrow 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("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- </ul>
- <div class="layout-gap">
- <section class="anc-top flex status_1>
- <div class="flex-one flex">
- <span><h1>学生英语阅读能力等级管理</h1></span>
- </div>
- </section>
- <section>
- <div class="x_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-9" style="margin-bottom: 10px;width: 70%">
- <form method="get" id="form1" action="<?php echo $this->createUrl("studentinfo/level"); ?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy clearfix">
- <select class="form-control" id="grade" name="grade">
- <option value="">年级</option>
- <option value="1" <?php if ($grade == 1) echo "selected"; ?>>高一</option>
- <option value="2" <?php if ($grade == 2) echo "selected"; ?>>高二</option>
- <option value="3" <?php if ($grade == 3) echo "selected"; ?>>高三</option>
- </select>
- <select class="form-control" id="class" name="classId">
- <option value="">全部班级</option>
- <?php foreach ($classes as $class) { ?>
- <option <?php if ((string)$classId === (string)$class["class_id"]) echo "selected=selected"; ?>
- value="<?php echo $class["class_id"]; ?>"><?php echo $class["class_name"]; ?></option>
- <?php } ?>
- </select>
- <input type="text" class="form-control input-sm" placeholder="学生姓名" name="name"
- value="<?php echo $studentName; ?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索
- </button>
- <span >
- <a class="btn-garder" onclick="UpdateLevel(1)">+1级</a>
- <a class="btn-garder" onclick="UpdateLevel(2)">+2级</a>
- <a class="btn-garder" onclick="UpdateLevel(3)">-1级</a>
- <a class="btn-garder" onclick="UpdateLevel(4)">-2级</a>
- </span>
- </div>
- </div>
- </form>
- </div>
- <table id="datatable" class="table table-striped table-bordered" style="width:60%;margin-left: 30px;">
- <thead>
- <tr>
- <th><input type="checkbox" class="ace selectAll"/>全选</th>
- <th>学生姓名</th>
- <th>年级</th>
- <th>班级</th>
- <th>系统能力等级</th>
- <th>人工能力等级</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($dataList as $loop): ?>
- <tr>
- <td><input class="myselect" type="checkbox" value="<?php echo $loop['student_id'];?>"></td>
- <td><?php echo $loop['realname'] ?></td>
- <td><?php if($loop['grade']==1){
- echo "高一";
- }elseif($loop['grade']==2){
- echo "高二";
- }else{
- echo "高三";
- }
- ?></td>
- <td><?php echo $loop['class_name'] ?></td>
- <td><?php echo $loop['english_level_one'] ?></td>
- <td> <input class="levelInput" type="text" uid="<?php echo $loop['student_id'];?>" value="<?php echo $loop['english_level_artificial']? $loop['english_level_artificial'] : '';?>"> </td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
- <div class="row" style="padding-top:10px;">
- <div class="col-xs-7">
-
- </div>
- <div class="col-xs-5" style="font-size: 16px">
- <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
- <ul id="yw0" class="yiiPager">
- <?php
- if($page>1){
- echo '<li class="previous"><a href="'.$this->createUrl('studentinfo/level').'?page='.($page-1).'&grade='.$grade.'&classId='.$classId.'&name='.$studentName.'">上一页</a></li>';
- }
- // for($i=1;$i<=$pages['totalPage'];$i++){
- // $url=$this->createUrl('studentinfo/level')."?page=".$i.'&grade_id='.$grade.'&class_id='.$classId.'&student_name='.$studentName;
- // if($page==$i){
- // echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
- // }else{
- // echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
- // }
- // }
- if($page<$pages['totalPage']){
- echo '<li class="next"><a href="'.$this->createUrl('studentinfo/level').'?page='.($page+1).'&grade='.$grade.'&classId='.$classId.'&name='.$studentName.'">下一页</a></li>';
- }
- echo '<li class="next"><a href="'.$this->createUrl('studentinfo/level').'?page='.($pages['totalPage']).'&grade='.$grade.'&classId='.$classId.'&name='.$studentName.'">尾页</a></li>';
- ?>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- </div>
- </div>
- <script src="/js/jquery-2.2.2.min.js" ></script>
- <script src="/js/layer/layer.js"></script>
- <script>
- // 全选\反选
- $(".selectAll").click(function(){
- if ($(this).prop("checked")) {
- var s_obj = $(".myselect");
- var s_len = s_obj.length;
- for (var i=0;i<s_len;i++) {
- if (!s_obj[i].disabled) {
- s_obj[i].checked=true;
- }
- }
- } else {
- $(".myselect").prop("checked",false);
- }
- });
- function UpdateLevel(type) {
- // 判断是否有选中
- if (!$("input[class='myselect']").is(':checked')) {
- layer.msg('至少选择一个目标!');
- return false;
- }
- var studentIds = [];
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() /*&& $(this).attr("stnm")*/) {
- studentIds.push($(this).val());
- }
- }
- });
- $.ajax({
- url: "<?php echo $this->createUrl('studentinfo/ajaxUpdateLevel');?>",
- type: "POST",
- dataType: "json",
- data: {
- type:type,
- studentIds:studentIds
- },
- success: function (data) {
- if(data.status == 1){
- layer.msg('更新成功!', {
- time: 2000,
- });
- window.location.reload();
- }else{
- layer.msg(data.msg);
- }
- }
- });
- }
- $('.levelInput').blur(function () {
- var level = $(this).val();
- var studentIds = [];
- studentIds.push($(this).attr('uid'));
- if(level == ''){
- return false;
- }
- if (!(/(^[1-9]\d*$)/.test(level)) || level>10) {
- layer.msg('请输入1-10内的正整数!');return false;
- }
- $.ajax({
- url: "<?php echo $this->createUrl('studentinfo/ajaxUpdateLevel');?>",
- type: "POST",
- dataType: "json",
- data: {
- level:level,
- studentIds:studentIds
- },
- success: function (data) {
- if(data.status == 1){
- layer.msg('更新成功!', {
- time: 1000,
- });
- window.location.reload();
- }else{
- layer.msg(data.msg);
- }
- }
- });
- })
- </script>
|