123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <link rel="stylesheet" href="/css/bootstrap-duallistbox.min.css" />
- <style>
- .addborder{border:1px solid #ccc}
- .addheight{height:30px;border-radius:2px;}
- .addheight:focus{border-color: #66afe9;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);outline: 0 none;}
- .ace{position:relative;top:0px !important;left:0px !important;}
- label{font-weight:100 !important;}
- .moveall {
- background-color:#619aff;
- border: none;
- }
- .removeall{
- background-color:#ed1b24;border: none;
- }
- option{
- margin: 5px 0;
- padding-left: 10px;
- border-bottom: 1px solid #e4e4e4;
- }
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content" style="margin-top:15px;">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <form class="form-horizontal" action="<?php echo $this->createUrl('classes/copy',array('cid'=>$classId));?>" method="post" id="copyStudent">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2 no-padding-right">来自学期<span class="errorMessage">*</span>:</label>
- <div class="col-xs-12 col-sm-9">
- <div class='diy_select1' style="width: 240px; border: 1px solid #ccc">
- <input type='hidden' id="semester_id" name="semester_id" class='diy_select_input1' value="<?php echo $currSemester['semester_id']?>" />
- <div class='diy_select_txt1' style=" width: 207px;"><?php echo $currSemester['semester_name']?>(当前学期)</div>
- <div class='diy_select_btn1'></div>
- <ul class='diy_select_list1'>
- <li val="<?php echo $currSemester['semester_id']?>"><?php echo $currSemester['semester_name']?>(当前学期)</li>
- <?php if(!empty($semesters)){?><li val="<?php echo $semesters->semester_id?>"><?php echo $semesters->semester_name ?>(上学期)</li><?php }?>
- </ul>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-2 no-padding-right">来自班级<span class="errorMessage">*</span>:</label>
- <div class="col-xs-12 col-sm-9">
- <!--<select id="class_id" name="class_id" onchange="chageClass(this.value)">
- <option value="">请选择</option>
- <?php if(!empty($all_class)):foreach($all_class as $ac):?>
- <option value="<?php echo $ac->class_id;?>"><?php echo $ac->class_name;?></option>
- <?php endforeach;endif;?>
- </select>-->
- <div class='diy_select' style="width: 131px">
- <input type='hidden' id="class_id" name="class_id" class='diy_select_input' />
- <div class='diy_select_txt'>请选择班级</div>
- <div class='diy_select_btn'></div>
- <ul class='diy_select_list'>
- <?php if(!empty($all_class)):foreach($all_class as $ac):?>
- <li copyClass="cc" val="<?php echo $ac->class_id;?>"><?php echo $ac->class_name;?></li>
- <?php endforeach;endif;?>
- </ul>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label no-padding-top" for="duallist"></label>
- <div class="col-sm-8">
- <select multiple="multiple" size="15" name="class_array[]" id="duallist">
- </select>
- <div class="hr hr-16 hr-dotted"></div>
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-3 col-md-9">
- <button class="btn btn-success btn-sm" type="submit" id="schoolSubmit">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 提交
- </button>
-
- <button class="btn btn-success btn-sm" type="reset" onclick="javascript:history.go(-1)">
- <i class="ace-icon fa fa-undo bigger-110"></i>
- 返回
- </button>
- </div>
- </div>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <style type="text/css">
- .info-container{display:none;}
- </style>
- <script src="/js/jquery.validate.min.js"></script>
- <script src="/js/jquery.bootstrap-duallistbox.min.js"></script>
- <script src="/js/xsgl.js"></script>
- <script type="text/javascript">
- jQuery(function($) {
- demo1 = $('select[name="class_array[]"]').bootstrapDualListbox({
- nonSelectedListLabel: ' ',
- selectedListLabel: "转到班级:<?php echo $className;?>",
- infoTextEmpty:'',
- filterPlaceHolder:'',
- infoText:''
- //preserveSelectionOnMove: 'moved',
- //moveOnSelect: false,
- });
-
- $("#copyStudent").submit(function() {
- var res = $('[name="class_array[]"]').val();
- if ($.trim(res)=='' || $.trim(res)== null) {
- layer.msg('请选择要复制的学生');
- return false;
- } //else {
- //alert(res);return;
- //}
- jQuery("#schoolSubmit").attr("disabled", true);
- });
- $("#copyStudent").submit(function() {
- var res = $('[name="class_array[]"]').val();
- if ($.trim(res)=='' || $.trim(res)== null) {
- layer.msg('请选择要复制的学生');
- return false;
- } //else {
- //alert(res);return;
- //}
- jQuery("#schoolSubmit").attr("disabled", true);
- });
- $(".diy_select_list1").click(function(){
- var semester_id = $("#semester_id").val();
- var html = '<li val="0">请选择班级</li>';
- var data={
- semester_id:semester_id,
- class_id:"<?php echo $classId?>"
- };
- $('.diy_select_txt').html('请选择班级');
- $("select").find("option").remove();
- $.post("<?php echo Yii::app()->createUrl('classes/ajax_semester_class')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status>0)
- {
- $.each(m.data,function(index,val){
- html+='<li copyClass="cc" val="'+val.class_id+'">'+val.class_name+'</li>'
- });
- $('.diy_select_list').html(html);
- }else
- {
- $('.diy_select_list').html(html);
- }
- });
- });
- });
- // 获取当前班级学生
- function chageClass(num) {
- if (!num) return false;
- var selectVal = [];
- var html;
- var cityObj = $("#duallist");
- var count=$("#duallist option").length;
- for(var i=0;i<count;i++){
- if($("#duallist").get(0).options[i].selected==true){
- value=$("#duallist").get(0).options[i].value;
- text=$("#duallist").get(0).options[i].text;
- selectVal.push(value);
- html += "<option value='"+value+"' selected>" + text+ "</option>";
- }
- }
- $.post("<?php echo $this->createUrl('studentinfo/getstudent');?>",{cid:num},function(data){
- var p = eval("("+data+")");
- var cityObj = $("#duallist");
- cityObj.empty();
- if (p.flag) {
- if (p.resArray.length > 0){
- $.each(p.resArray,function(i,n){
- if($.inArray(n.student_id,selectVal)==-1){
- html += "<option value='"+n.student_id+"'>" + n.realname + " ( 准考证号:"+ n.student_card + " )</option>";
- }
- });
- }
- cityObj.html(html);
- demo1.bootstrapDualListbox('refresh',true);
- } else {
- demo1.bootstrapDualListbox('refresh',true);
- }
- });
- }
- </script>
|