123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574 |
- <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;}
- .diy_select{height:30px;width:260px;position:relative;font-size:12px;background:#fff;color:#000;float:left;border-radius:4px;}
- .diy_select:active{box-shadow:0 0 5px #66afe9;border:1px solid #66afe9}
- .diy_select_btn,.diy_select_txt{float:left;height:100%;line-height:30px}
- .diy_select,.diy_select_list{border:1px solid #ccc;}
- .diy_select_txt{width:200px;}
- .diy_select_txt,.diy_select_list li{text-indent:10px;overflow:hidden}
- .diy_select_btn{width:98px;background:url(/images/arrBottom.png) no-repeat center}
- .diy_select_list{position:absolute;top:27px;left:0px;z-index:88888;border-top:none;width:100%;display:none;_top:29px;background: #fff;max-height:300px;overflow-y:scroll;}
- .diy_select_list li{list-style:none;height:30px;line-height:30px;cursor:default;_background:#fff;/**padding-left: 10px;**/}
- .diy_select_list li.focus{background:#3399FF;color:#fff}
- .diy_select label{position:absolute;left:180px;width:160px;top:4px;font-size:15px;}
- </style>
- <style>
- /*弹出层*/
- .confirmbox {
- background: #fff;
- border: 1px solid #cccccc;
- border-radius: 3px;
- padding: 40px 40px 30px;
- text-align: center;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- }
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- .confirmbox-mask button {
- border: none;
- background: #2977ff;
- width: 80px;
- height: 26px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- .confirmbox-mask button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal {
- width: 700px;
- background: #fff;
- // border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- height:420px;
- }
- .class-modal-head {
- font-size: 14px;
- background:#2977ff;
- color:#fff;
- height:25px;
- line-height: 25px;
- padding: 0 0 0 15px;
- }
- .class-modal-body {
- margin-top: 5px;
- overflow: auto;
- padding:15px;
- min-height: 340px;
- }
- .class-modal-body .classes {
- margin-bottom: 20px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b;
- }
- .class-modal .icon-close{
- position: absolute;
- right: 20px;
- top: 2px;
- color:#fff;
- }
- .c-red {
- color: #CC3300
- }
- .avg{
- margin:0 10px;
- }
- .class_btn{
- text-align: center;
- }
- .confirmbox-mask p{
- word-wrap : break-word ;
- }
- .icon-close{
- cursor: pointer;
- }
- .model-input{
- border:1px solid #ccc;
- padding:5px;
- margin-top:10px;
- }
- .model-input label{
- margin:0 15px;
- }
- table{margin-top:5px;}
- .table_list{
- height:250px;
- overflow: auto;
- }
- .upload-box{
- position:relative;
- padding-left:106px;
- line-height: 28px;
- }
- .upload-div,.upload-ipt{
- position: absolute;
- left:0;
- top:0;
- width:100px!important;
- }
- .upload-div{
-
- height:28px;
- text-align: center;
- background: #eee;
- color: #333;
- border-radius: 3px;
- border:1px solid #ccc;
- }
- .upload-div:hover{
- background: #69d9a7;
- }
- .upload-ipt{
- z-index: 2;
- opacity: 0;
- }
- </style>
- <script src="/js/jquery.validate.min.js"></script>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery("#schoolSubmit").click(function(){
- var grade = $(".diy_select_txt").text();
- var _text = grade;
- var msg = '确定导入'+_text+'学生成绩吗?';
- obj=$(this);
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $('#classAdd').attr('action','<?php echo $this->createUrl('record/importstore');?>');
- obj.attr("disabled", true);
- jQuery("#classAdd").submit();
- }
- });
- });
- jQuery("#studentImgSubmit").click(function(){
- var grade = $(".diy_select_txt").text();
- var _text = grade;
- var msg = '确定导入'+_text+'学生答题图片吗?';
- obj=$(this);
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $('#classAdd').attr('action','<?php echo $this->createUrl('record/importStudentExcel');?>');
- obj.attr("disabled", true);
- jQuery("#classAdd").submit();
- }
- });
- });
- });
- </script>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_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 enctype="multipart/form-data" class="form-horizontal" action="<?php echo $this->createUrl('record/importstore');?>" method="post" id="classAdd">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">选择考试<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <input type="text" name="exam_name" class="exam_name" value="<?php if(isset($exam_name)) echo $exam_name;?>" readonly><span class="choose-exam">选择考试</span>
- <input type="hidden" name="exam_group_id" value="<?php if(isset($exam_group_id)) echo $exam_group_id;?>" >
- <input type="hidden" name="exam_renew" value="<?php if(isset($renew)) {echo $renew;}else{echo 0;}?>">
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">识别方式<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <select name="check_field" class="check_field">
- <option value="student_name" <?php if(isset($check_field) && $check_field=='student_name') echo 'selected';?>>学生姓名</option>
- <!--<option value="userno">学号</option>-->
- <option value="student_card" <?php if(isset($check_field) && $check_field=='student_card') echo 'selected';?>>系统准考证号</option>
- <option value="school_student_card" <?php if(isset($check_field) && $check_field=='school_student_card') echo 'selected';?>>学校准考证号</option>
- <!-- <option value="zhixue_student_card" <?php if(isset($check_field) && $check_field=='zhixue_student_card') echo 'selected';?>>智学网准考证号</option>-->
- <option value="id_number" <?php if(isset($check_field) && $check_field=='id_number') echo 'selected';?>>身份证号</option>
- <!--<option value="student_phone">手机号</option>-->
- <?php
- if(isset($studentExtend) && $studentExtend){
- foreach ($studentExtend as $key=>$val){
- if($val['is_enable']==1){
- if($key==$check_field){
- echo '<option value="'.$key.'" selected>'.$val['field_mean'].'</option>';
- }else{
- echo '<option value="'.$key.'">'.$val['field_mean'].'</option>';
- }
- }
- }
- }
- ?>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">模板示例<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <table id="template" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <tr>
- <th width="1"></th>
- <th>A</th>
- <th>B</th>
- <th>C</th>
- <th>D</th>
- <th>E</th>
- <th>F</th>
- <th>G</th>
- <th>H</th>
- <th class="hide custom_field_no">I</th>
- </tr>
- <tr>
- <th>1</th>
- <th>姓名</th>
- <th>班级</th>
- <th class="hide custom_field"></th>
- <th>科目总分</th>
- <th>第一题</th>
- <th>第二题</th>
- <th>第三题</th>
- <th>第四题</th>
- <th>第五题</th>
- </tr>
- <tr>
- <th>2</th>
- <th>苏苏</th>
- <th>高二1班</th>
- <th class="hide custom_field_value"></th>
- <th>90</th>
- <th>5</th>
- <th>0</th>
- <th>5</th>
- <th>0</th>
- <th>10</th>
- </tr>
- </table>
- <p class="c-red">注:下载模板表格后请根据选择的识别方式,按对应的模板示例匹配标题信息</p>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">上传Excel<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9 upload-box">
- <div class="col-xs-10 upload-div">选择文件</div>
- <span class="upload-exname">请选择文件</span>
- <input type="file" id="exname" name="exname" class="col-xs-10 upload-ipt" />
- </div>
- </div>
- <script>
- $(function(){
- $("#exname").change(function(e){
- $(".upload-exname").html(e.currentTarget.files[0].name)
- })
- })
- </script>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right"> </label>
- <div class="col-sm-9">
- <div style="margin-top:8px" class="col-sm-9"><a href="/assets/data/importScore/import_score_example_name.xls" class="download_template">下载Excel表格示例</a> <span class="c-red">请根据模板示例调整Excel格式</span></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="button" id="schoolSubmit">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 导入
- </button>
- </div>
- </div>
- <?php if(isset(Yii::app()->session['testFlag']) && Yii::app()->session['testFlag']==1):?>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">上传作答图片成绩<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9 upload-box">
- <div class="col-xs-10 upload-div">选择文件</div>
- <span class="upload-ywy-exname">请选择文件</span>
- <input type="file" id="exnameYwy" name="exnameYwy" class="col-xs-10 upload-ipt" />
- </div>
- </div>
- <script>
- $(function(){
- $("#exnameYwy").change(function(e){
- $(".upload-ywy-exname").html(e.currentTarget.files[0].name)
- })
- })
- </script>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right"> </label>
- <div class="col-sm-9">
- <div style="margin-top:8px" class="col-sm-9"><a href="/assets/data/import_ywy_score_example.xls" >下载Excel表格示例</a> </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="button" id="studentImgSubmit">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 导入
- </button>
- </div>
- </div>
- <?php endif;?>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <!-- 弹窗 -->
- <div class="confirmbox-mask" style="display: none" id="fieldModal">
- <div class="class-modal">
- <i class="icon close_1 icon-close">×</i>
- <div class="class-modal-head">选择考试</div>
- <form id="examSelect">
- <div class="class-modal-body">
- <select name="exam_type" class="exam_type">
- <option value="1">校本课程平台考试</option>
- <option value="2">第三方考试</option>
- </select>
- <select name="subject" class="subject">
- <?php
- if(isset(Yii::app()->params['subjectId']) && Yii::app()->params['subjectId']){
- foreach (Yii::app()->params['subjectId'] as $key=>$val){
- if($key==6 || $key==51) continue;
- echo '<option value="'.$key.'">'.$val.'</option>';
- }
- }
- ?>
- </select>
- <select name="grade" class="grade">
- <option value="0">年级</option>
- <?php
- if(Yii::app()->params['grade_list']){
- foreach (Yii::app()->params['grade_list'] as $id=> $val){
- echo '<option value="'.$id.'" >'.$val['grade_name'].'</option>';
- }
- }
- ?>
- </select>
- <select name="class" class="class" style="width: 100px">
- <option value="0">班级</option>
- </select>
- <input type="text" name="keyword" value="" placeholder="">
- <button class="search_exam">搜索</button>
- <div class="table_list">
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- </table>
- </div>
- <span class="notice c-red hide">部分学生已扫描/上传成绩。若需要重新上传,请勾选“覆盖并重新导入成绩”。否则只导入没有成绩的学生</span>
- </div>
- <p class="class_btn">
- <input type="checkbox" value="1" name="renew">覆盖并重新导入成绩
- <button type="button" class="setting_sumbit">确定</button>
- </p>
- </form>
- </div>
- </div>
- <script src="/js/xsgl.js"></script>
- <script>
- $(function(){
- changeField();
- $('#classAdd')[0].reset();
- $('#examSelect')[0].reset();
- $('.choose-exam,.exam_name').click(function(){
- $('#fieldModal').fadeIn();
- });
- $('.close_1').click(function(){
- closeModal();
- });
- $('.check_field').change(function(){
- var field_value=$(this).val();
- var field_text=$(this).find("option:selected").text();
- if(field_value=='student_name'){
- $('.custom_field').addClass('hide');
- $('.custom_field_value').addClass('hide');
- $('.custom_field_no').addClass('hide');
- $('.custom_field').html('');
- $('.download_template').attr('href','/assets/data/importScore/import_score_example_name.xls');
- }else{
- $('.custom_field').removeClass('hide');
- $('.custom_field_value').removeClass('hide');
- $('.custom_field_no').removeClass('hide');
- $('.custom_field').html(field_text);
- $('.download_template').attr('href','/assets/data/importScore/import_score_example_student_card.xls');
- }
- });
- function changeField(){
- var field_value=$('.check_field').val();
- var field_text=$('.check_field').find("option:selected").text();
- if(field_value=='student_name'){
- $('.custom_field').addClass('hide');
- $('.custom_field_value').addClass('hide');
- $('.custom_field_no').addClass('hide');
- $('.custom_field').html('');
- }else{
- $('.custom_field').removeClass('hide');
- $('.custom_field_value').removeClass('hide');
- $('.custom_field_no').removeClass('hide');
- $('.custom_field').html(field_text);
- }
- }
- $('.search_exam').click(function(){
- var exam_type=$('.exam_type').val();
- var subject=$('.subject').val();
- var grade=$('.grade').val();
- var class_id=$('.class').val();
- var keyword=$('input[name=keyword]').val();
- $.ajax({
- url:'<?php echo $this->createUrl('record/ajaxsearchexam')?>',
- type:'POST',
- dataType:'json',
- data:{'exam_type':exam_type,'subject':subject,'grade':grade,'class':class_id,'keyword':keyword},
- success:function(res){
- if(res.status==1){
- var html='';
- html+='<tr>';
- html+='<th>选择</th>';
- html+='<th>考试名称</th>';
- html+='<th>年级</th>';
- html+='<th>考试日期</th>';
- html+='<th>考试班级</th>';
- html+='<th>已导入成绩人数</th>';
- html+='</tr>';
- $.each(res.list,function(i,n){
- html+='<tr>';
- html+='<td><input type="radio" name="exam" value="'+n.exam_group_id+'"></td>';
- html+='<td>'+n.name+'</td>';
- html+='<td>'+n.grade+'</td>';
- html+='<td>'+n.exam_date+'</td>';
- html+='<td>'+n.class_count+'</td>';
- html+='<td>'+n.student_score_count+'</td>';
- html+='</tr>';
- });
- $('#dynamic-table').html(html);
- }
- }
- });
- return false;
- });
- $('.grade').change(function(){
- var subjectId=$('.subject').val();
- $.post("<?php echo $this->createUrl('print/getGradeClass'); ?>", {"grade": $('.grade').val(),"subjectId":subjectId}, function(data) {
- var m = JSON.parse(data);
- if(m.status==0)
- {
- var html = '<option value="0">请选择班级</option>';
- $(".class").html(html);
- }else{
- var html = '<option value="0">请选择班级</option>';
- $.each(m.message,function(i,n){
- html+='<option value="'+ n.class_id+'">'+ n.class_name+'</option>';
- });
- $(".class").html(html);
- }
- });
- });
- $('.setting_sumbit').click(function(){
- var exam_group_id=$('input[name=exam]:checked').val();
- var exam_name=$('input[name=exam]:checked').parent().next().html();
- if(exam_group_id==undefined){
- layer.msg('请选择一场考试');
- return false;
- }
- if($('input[name=renew]').is(':checked')){
- $('input[name=exam_renew]').val(1);
- console.log(111);
- }else{
- $('input[name=exam_renew]').val(0);
- }
- $('input[name=exam_name]').val(exam_name);
- $('input[name=exam_group_id]').val(exam_group_id);
- closeModal();
- return false;
- });
- $('#dynamic-table')
- .on('click','input[name=exam]',function(){
- var student_count=$(this).closest('tr').find('td:last').html();
- console.log(student_count);
- if(student_count>0){
- $('.notice').removeClass('hide');
- }else{
- $('.notice').addClass('hide');
- }
- })
- function closeModal(){
- $('#fieldModal').fadeOut();
- $('.notice').addClass('hide');
- }
- })
- </script>
|