123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <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/edit',array('stid'=>$userInfo->student_id));?>" 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">
- <input type="hidden" name="class_id" value="<?php echo $userInfo->class_id;?>" />
- <div class="clearfix" style="line-height:32px">
- <!--<select class="input-medium" id="class_id" name="class_id_1">
- <option value="">请选择</option>
- </select>-->
- <?php echo $userInfo->class_name;?>
- </div>
- </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" style="line-height:32px">
- <?php echo $studentInfo->student_card;?>
- </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" style="line-height:32px">
- <input type="text" id="username" name="username" readonly class="col-xs-10 col-sm-3" value="<?php echo $studentInfo->username;?>" />
- <?php /*echo $studentInfo->username;*/?>
- </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">
- <input type="password" id="password" name="password" class="col-xs-10 col-sm-3 addborder addheight" placeholder="无需修改密码请留空!" />
- </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">
- <input type="password" id="password2" name="password2" class="col-xs-10 col-sm-3 addborder addheight" placeholder="无需修改密码请留空!" />
- </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">
- <input value="<?php echo $userInfo->realname;?>" type="text" name="realname" 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-xs-12 col-sm-9">
- <input type="text" name="userno" id="userno" class="col-xs-10 col-sm-3 addborder addheight" value="<?php echo $userInfo->userno;?>" />
- </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">
- <input type="text" name="serial_number" id="serial_number" class="col-xs-10 col-sm-3 addborder addheight" value="<?php echo $userInfo->serial_number;?>" />
- </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" value="<?php if($userInfo->student_phone){echo $userInfo->student_phone;}?>" />
- <input type="hidden" name="student_id" value="<?php echo $studentId;?>" />
- </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" <?php if($userInfo->sex == 1){echo 'checked="checked"';}?>>
- <span class="lbl middle"> 男</span>
- </span>
-
- <span class="inline blue">
- <input type="radio" class="ace" name="sex" value="2" <?php if($userInfo->sex == 2){echo 'checked="checked"';}?>>
- <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" <?php if($userInfo->is_outer == 0){echo 'checked="checked"';}?>>
- <span class="lbl middle"> 是</span>
- </span>
-
- <span class="inline blue">
- <input type="radio" class="ace" name="is_outer" value="1" <?php if($userInfo->is_outer == 1){echo 'checked="checked"';}?>>
- <span class="lbl middle"> 否</span>
- </span>
- </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" value="<?php if($studentInfo->zhixue_student_card){echo $studentInfo->zhixue_student_card;}?>" />
- </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" value="<?php if($studentInfo->school_student_card){echo $studentInfo->school_student_card;}?>" />
- </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" value="<?php if($userInfo->id_number){echo $userInfo->id_number;}?>" />
- </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="status" value="0" <?php if(!$studentInfo->status){echo 'checked="checked"';}?>>
- <span class="lbl middle"> 是</span>
- </span>
-
- <span class="inline blue">
- <input type="radio" class="ace" name="status" value="1" <?php if($studentInfo->status == 1){echo 'checked="checked"';}?>>
- <span class="lbl middle"> 否</span>
- </span>
- </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" type="reset">
- <i class="ace-icon fa fa-undo bigger-110"></i>
- 重填
- </button>-->
- </div>
- </div>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script src="/js/jquery.validate.min.js"></script>
- <script type="text/javascript">
- //检测手机号
- $.validator.addMethod("isPhone", function(value, element) {
- var regMobile = /^1([356789]\d|4[57])\d{8}$/;
- return this.optional(element) || (regMobile.test( value ));
- }, "请正确填写手机号!");
- jQuery(function($) {
- $('#userInfoSubmit').validate({
- errorClass: 'errorMessage', //错误样式
- ignore: "", //忽略提交字段
- rules: {
- /*years_id: {
- required: true,
- },
- class_id: {
- required: true,
- },*/
- password: {
- //required: true,
- minlength: 6
- },
- password2: {
- //required: true,
- minlength: 6,
- equalTo: "#password"
- },
- sex: {
- required: true,
- },
- student_phone:{
- isPhone:true
- },
- realname: {
- required: true,
- maxlength: 20,
- remote:{ //自带远程验证存在的方法
- url:"<?php echo $this->createUrl('studentinfo/verifyrealname');?>",
- type:"post",
- dataType:"html",
- data:{
- realname:function(){return $("input[name=realname]").val();},
- student_id:function(){return $("input[name=student_id]").val();},
- cid:function(){return $("input[name=class_id]").val();},
- p_type:2
- },
- dataFilter: function(data) {
- var m = JSON.parse(data);
- if (m.status == 1){
- return true;
- }
- return false;
- }
- }
- },
- serial_number:{
- required: true,
- remote:{ //自带远程验证存在的方法
- url:"<?php echo $this->createUrl('studentinfo/verifynum');?>",
- type:"post",
- dataType:"html",
- data:{
- pnumber:function(){return $("input[name=serial_number]").val();},
- cid:function(){return $("input[name=class_id]").val();},
- sid:function(){return $("input[name=student_id]").val();},
- type:2
- },
- dataFilter: function(data) {
- var m = JSON.parse(data);
- if (m.status == 2){
- return true;
- }
- return false;
- }
- }
- }
- },
- messages: {
- years_id: {
- required: "请选择年级!",
- },
- class_id: {
- required: "请选择班级!",
- },
- password: {
- //required: "请填写登录密码!",
- minlength: "密码不能少于6位字符!"
- },
- password2: {
- //required: "请填写确认密码!",
- minlength: "密码不能少于6位字符!",
- equalTo: "两次密码输入不一致!"
- },
- realname: {
- required: "请填写真实姓名!",
- maxlength: "姓名不能大于20个字符!",
- remote: "此学生已存在!"
- },
- sex: {
- required: "请选择性别!",
- },
- serial_number:{
- required: "序号不能为空!",
- remote:"序号已经存在!"
- }
- },
- errorPlacement: function (error, element) { // 指定错误信息显示位置
- if(element.is('input[type=radio]')) {
- var controls = element.closest('div[class*="col-"]');
- if(controls.find(':checkbox,:radio').length > 1) controls.append(error);
- else error.insertAfter(element.nextAll('.lbl:eq(0)').eq(0));
- }else{
- error.insertAfter(element.after());
- }
- },
- })
- });
- // 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>
|