123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615 |
- <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;}
- </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('studentinfo/add');?>" method="post" id="userInfoSubmit">
- <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-xs-12 col-sm-9">
- <div class="clearfix">
- <select class="input-medium" id="class_id" name="class_id">
- <option value="">请选择</option>
- <?php if(!empty($classInfo)):foreach($classInfo as $loop):?>
- <option value="<?php echo $loop->class_id;?>" <?php if(isset($cid) && $cid==$loop->class_id){ echo 'selected';}?>><?php echo $loop->class_name;?></option>
- <?php endforeach;endif;?>
- </select>
- <label id="class-error" class="errorMessage" ></label>
- </div>
- </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 mtCentent">
- <input type="text" id="username" name="username" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" />
- </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 mtCentent">
- <input type="password" id="password" name="password" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" />
- </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 mtCentent">
- <input type="password" id="password2" name="password2" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" />
- </div>
- </div>-->
- <div class="hr hr-16 hr-dotted"></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-xs-12 col-sm-9 mtCentent">
- <input type="text" name="realname" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" placeholder="姓名唯一" />
- <label id="realname-error" class="errorMessage" for="realname"></label>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学号:</label>
- <div class="col-xs-12 col-sm-9 mtCentent">
- <input type="text" name="userno" id="userno" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" placeholder="学生学号" />
- </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-xs-12 col-sm-9 mtCentent">
- <input type="text" name="serial_number" id="serial_number" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" placeholder="学生所在这个班的序号" />
- </div>
- </div>-->
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学生手机号:</label>
- <div class="col-xs-12 col-sm-9 ">
- <input type="text" name="student_phone" class="col-xs-10 col-sm-3 addborder addheight" />
- <label id="student_phone-error" class="errorMessage" for="student_phone"></label>
- </div>
- </div>
- <?php if($use_zhixue){
- ?>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">绑定智学网准考证号:</label>
- <div class="col-xs-12 col-sm-9 ">
- <input type="text" name="zhixue_student_card" class="col-xs-10 col-sm-3 addborder addheight" />
- </div>
- </div>
- <?php }?>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">绑定学校准考证号:</label>
- <div class="col-xs-12 col-sm-9 ">
- <input type="text" name="school_student_card" class="col-xs-10 col-sm-3 addborder addheight" />
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">性别:</label>
- <div class="col-sm-9 mt6">
- <span class="inline blue">
- <input type="radio" class="ace" name="sex" value="1" checked="checked">
- <span class="lbl middle"> 男</span>
- </span>
-
- <span class="inline blue">
- <input type="radio" class="ace" name="sex" value="2">
- <span class="lbl middle"> 女</span>
- </span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">是否为在籍生:</label>
- <div class="col-sm-9 mt6">
- <span class="inline blue">
- <input type="radio" class="ace" name="is_outer" value="0" checked="checked">
- <span class="lbl middle"> 是</span>
- </span>
-
- <span class="inline blue">
- <input type="radio" class="ace" name="is_outer" value="1">
- <span class="lbl middle"> 否</span>
- </span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">身份证号:</label>
- <div class="col-xs-12 col-sm-9 ">
- <input type="text" name="id_number" class="col-xs-10 col-sm-3 addborder addheight" />
- <label id="idnumber-error" class="errorMessage" for="idnumber"></label>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right"><strong>其它第三方考号</strong></label>
- <div class="col-xs-12 col-sm-9 ">
- <button class="btn btn-success btn-sm" type="button" id="field_setting">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 设置
- </button>
- </div>
- </div>
- <div class="field_area">
- <?php
- if(isset($studentExtend) && $studentExtend){
- foreach ($studentExtend as $key=>$val){
- if($val['is_enable']==1) {
- ?>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right"><?php echo $val['field_mean']?>:</label>
- <div class="col-xs-12 col-sm-9 ">
- <input type="text" maxlength="20" name="<?php echo $key?>"
- class="col-xs-10 col-sm-3 addborder addheight"/>
- </div>
- </div>
- <?php
- }
- }
- }
- ?>
- </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>
- <!--
- <button class="btn" type="reset">
- <i class="ace-icon fa fa-undo bigger-110"></i>
- 重填
- </button>-->
- </div>
- </div>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <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: 500px;
- background: #fff;
- // border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- height:320px;
- }
- .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: 20px;
- overflow: auto;
- padding:15px;
- }
- .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;
- }
- .field{
- width:90%;
- border:1px solid #333;
- margin:5px auto;
- }
- </style>
- <!-- 弹窗 -->
- <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>
- <div class="class-modal-body">
- 最多可设置5个第三方考号,可自定义重命名,启用后生效
- <table class="student-counts addLine table-hide" width="100%">
- <tr>
- <td><input type="text" maxlength="10" class="field" name="field_1_s" value="<?php if(isset($studentExtend['field_1']) && $studentExtend['field_1']['field_mean']){echo $studentExtend['field_1']['field_mean']; }else{echo '自定义考号1';}?>"></td>
- <td><input type="checkbox" <?php if(isset($studentExtend['field_1']) &&$studentExtend['field_1']['is_enable']==1){echo 'checked';}?> name="field_1_status" value="1">启用</td>
- </tr>
- <tr>
- <td><input type="text" maxlength="10" class="field" name="field_2_s" value="<?php if(isset($studentExtend['field_2']) && $studentExtend['field_2']['field_mean']){echo $studentExtend['field_2']['field_mean']; }else{echo '自定义考号2';}?>"></td>
- <td><input type="checkbox" <?php if(isset($studentExtend['field_2']) &&$studentExtend['field_2']['is_enable']==1){echo 'checked';}?> name="field_2_status" value="1">启用</td>
- </tr>
- <tr>
- <td><input type="text" maxlength="10" class="field" name="field_3_s" value="<?php if(isset($studentExtend['field_3']) && $studentExtend['field_3']['field_mean']){echo $studentExtend['field_3']['field_mean']; }else{echo '自定义考号3';}?>"></td>
- <td><input type="checkbox" <?php if(isset($studentExtend['field_3']) &&$studentExtend['field_3']['is_enable']==1){echo 'checked';}?> name="field_3_status" value="1">启用</td>
- </tr>
- <tr>
- <td><input type="text" maxlength="10" class="field" name="field_4_s" value="<?php if(isset($studentExtend['field_4']) && $studentExtend['field_4']['field_mean']){echo $studentExtend['field_4']['field_mean']; }else{echo '自定义考号4';}?>"></td>
- <td><input type="checkbox" <?php if(isset($studentExtend['field_4']) &&$studentExtend['field_4']['is_enable']==1){echo 'checked';}?> name="field_4_status" value="1">启用</td>
- </tr>
- <tr>
- <td><input type="text" maxlength="10" class="field" name="field_5_s" value="<?php if(isset($studentExtend['field_5']) && $studentExtend['field_5']['field_mean']){echo $studentExtend['field_5']['field_mean']; }else{echo '自定义考号5';}?>"></td>
- <td><input type="checkbox" <?php if(isset($studentExtend['field_5']) &&$studentExtend['field_5']['is_enable']==1){echo 'checked';}?> name="field_5_status" value="1">启用</td>
- </tr>
- </table>
- </div>
- <p class="class_btn">
- <button type="button" class="setting_sumbit">确定</button>
- <button type="button" class="close_1">取消</button>
- </p>
- </div>
- </div>
- <script src="/js/xsgl.js"></script>
- <script type="text/javascript">
- $(function(){
- $('#field_setting').click(function(){
- $('#fieldModal').fadeIn();
- });
- $('.close_1').click(function(){
- $('#fieldModal').fadeOut();
- });
- $('.setting_sumbit').click(function(){
- var field_1=$('input[name=field_1_s]').val();
- var field_1_status=$('input[name=field_1_status]').is(':checked');
- var field_2=$('input[name=field_2_s]').val();
- var field_2_status=$('input[name=field_2_status]').is(':checked');
- var field_3=$('input[name=field_3_s]').val();
- var field_3_status=$('input[name=field_3_status]').is(':checked');
- var field_4=$('input[name=field_4_s]').val();
- var field_4_status=$('input[name=field_4_status]').is(':checked');
- var field_5=$('input[name=field_5_s]').val();
- var field_5_status=$('input[name=field_5_status]').is(':checked');
- if(field_1_status==true && field_1==''){
- layer.msg('请输入自定义考号1名称');
- return false;
- }
- if(field_2_status==true && field_2==''){
- layer.msg('请输入自定义考号2名称');
- return false;
- }
- if(field_3_status==true && field_3==''){
- layer.msg('请输入自定义考号3名称');
- return false;
- }
- if(field_4_status==true && field_4==''){
- layer.msg('请输入自定义考号4名称');
- return false;
- }
- if(field_5_status==true && field_5==''){
- layer.msg('请输入自定义考号5名称');
- return false;
- }
- $.ajax({
- url:'<?php echo $this->createUrl('studentinfo/ajaxstudentextendsetting')?>',
- type:'POST',
- dataType:'json',
- data:{
- 'field_1':field_1,
- 'field_1_status':field_1_status,
- 'field_2':field_2,
- 'field_2_status':field_2_status,
- 'field_3':field_3,
- 'field_3_status':field_3_status,
- 'field_4':field_4,
- 'field_4_status':field_4_status,
- 'field_5':field_5,
- 'field_5_status':field_5_status
- },
- success:function(res){
- if(res.status==1){
- html='';
- if(field_1_status==true){
- html+='<div class="form-group">';
- html+='<label class="control-label col-xs-12 col-sm-3 no-padding-right">'+field_1+'</label>';
- html+='<div class="col-xs-12 col-sm-9 ">';
- html+='<input type="text" name="field_1" class="col-xs-10 col-sm-3 addborder addheight"/>';
- html+='</div>';
- html+='</div>';
- }
- if(field_2_status==true){
- html+='<div class="form-group">';
- html+='<label class="control-label col-xs-12 col-sm-3 no-padding-right">'+field_2+'</label>';
- html+='<div class="col-xs-12 col-sm-9 ">';
- html+='<input type="text" name="field_2" class="col-xs-10 col-sm-3 addborder addheight"/>';
- html+='</div>';
- html+='</div>';
- }
- if(field_3_status==true){
- html+='<div class="form-group">';
- html+='<label class="control-label col-xs-12 col-sm-3 no-padding-right">'+field_3+'</label>';
- html+='<div class="col-xs-12 col-sm-9 ">';
- html+='<input type="text" name="field_3" class="col-xs-10 col-sm-3 addborder addheight"/>';
- html+='</div>';
- html+='</div>';
- }
- if(field_4_status==true){
- html+='<div class="form-group">';
- html+='<label class="control-label col-xs-12 col-sm-3 no-padding-right">'+field_4+'</label>';
- html+='<div class="col-xs-12 col-sm-9 ">';
- html+='<input type="text" name="field_4" class="col-xs-10 col-sm-3 addborder addheight"/>';
- html+='</div>';
- html+='</div>';
- }
- if(field_5_status==true){
- html+='<div class="form-group">';
- html+='<label class="control-label col-xs-12 col-sm-3 no-padding-right">'+field_5+'</label>';
- html+='<div class="col-xs-12 col-sm-9 ">';
- html+='<input type="text" name="field_5" class="col-xs-10 col-sm-3 addborder addheight"/>';
- html+='</div>';
- html+='</div>';
- }
- $('.field_area').html(html);
- layer.msg('设置成功');
- }else{
- layer.msg('设置失败');
- }
- $('#fieldModal').fadeOut();
- }
- });
- });
- $("#schoolSubmit").click(function () {
- $error=false;
- $("#schoolSubmit")[0].disabled = true;
- if($('#class_id').val()==''){
- $('#class-error').html('请选择班级');
- $error=true;
- }
- if($('input[name=realname]').val()==''){
- $('#realname-error').html('请输入姓名');
- $error=true;
- }else{
- //return checkRealName($(this).val());
- value=$('input[name=realname]').val();
- $('#realname-error').html('');
- //var pattern = /^[\u4E00-\u9FA5^·]{1,20}$/;
- var pattern = /^[\u2E80-\uFE4F^0-9·]{1,20}$/;
- if(!pattern.test(value)){
- $('#realname-error').html('姓名只能为20位汉字');
- $error=true;
- }
- $.post("<?php echo $this->createUrl('studentinfo/verifyrealname');?>",{
- realname:value,cid:$('#class_id').val()},function (data){
- var m = JSON.parse(data);
- if (m.status == 1){
- $("input[name=realname]").css("color","#000");
- }else
- {
- var id_number=$('input[name=id_number]').val();
- if($('input[name=id_number]').val()=='' || !isCardNo($('input[name=id_number]').val())){
- $("#realname-error").html('此学生姓名已存在,请输入身份证号');
- $error=true;
- }
- }
- });
- }
- var mobile=$('input[name=student_phone]').val();
- if(mobile!='' && !checkMobile(mobile)){
- $('#student_phone-error').html('手机号不正确,请重新输入');
- $error=true;
- }
- var id_number=$('input[name=id_number]').val();
- console.log(id_number);
- if(id_number!='' && !isCardNo(id_number)){
- $('#idnumber-error').html('身份证号不正确,主重新输入');
- $error=true;
- }
- if($error){
- $("#schoolSubmit")[0].disabled = false;
- return false;
- }else{
- $("#userInfoSubmit").submit();
- }
- });
- $('#class_id').change(function(){
- $('#class-error').html('');
- });
- $('input[name=realname]').change(function(){
- return checkRealName($(this).val());
- });
- /*
- $('input[name=id_number]').change(function () {
- $('#idnumber-error').html('');
- var id_number=$(this).val();
- if(id_number==''){
- return false;
- }
- if(!isCardNo(id_number)){
- $("#schoolSubmit")[0].disabled = false;
- $('#idnumber-error').html('身份证格式不正确');
- }
- });
- */
- //检测手机号
- function checkMobile(value){
- var regMobile = /^1([356789]\d|4[57])\d{8}$/;
- return regMobile.test( value );
- }
- //检测身份证号
- function isCardNo(card) {
- var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
- return pattern.test(card);
- }
- //检测用户姓名
- function checkRealName(value){
- if(value==''){
- return false;
- }
- $('#realname-error').html('');
- var pattern = /^[\u2E80-\uFE4F^0-9·]{1,20}$/;
- if(!pattern.test(value)){
- $('#realname-error').html('姓名只能为20位汉字');
- return false;
- }else{
- if($('#class_id').val()!=''){
- $.post("<?php echo $this->createUrl('studentinfo/verifyrealname');?>",{
- realname:value,cid:$('#class_id').val()},function (data){
- var m = JSON.parse(data);
- if (m.status == 1){
- $("input[name=realname]").css("color","#000");
- return true;
- }else
- {
- var id_number=$('input[name=id_number]').val();
- if($('input[name=id_number]').val()=='' || !isCardNo($('input[name=id_number]').val())){
- $("#realname-error").html('此学生姓名已存在,请输入身份证号');
- return false;
- }
- }
- });
- }
- return false;
- }
- }
- });
- // ajax获取班级
- function changeYears(num) {
- if (!num) return;
- $.post("<?php echo $this->createUrl('classes/ajaxclass');?>",{yid:num},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- $("#classDiv").show();
- var html;
- var cityObj = $("#class_id");
- cityObj.empty();
- if (p.classList.length > 0){
- html = "<option value=''>请选择班级</option>";
- $.each(p.classList,function(i,n){
- html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
- });
- } else {
- html = "<option value=''>暂无班级</option>";
- }
- cityObj.append(html);
- } else {
- alert("获取数据失败!");
- }
- });
- }
- </script>
|