123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <div class="main-content-inner">
- <div class="breadcrumbs" id="breadcrumbs">
- <ul class="breadcrumb">
- <li>
- <i class="ace-icon fa fa-home home-icon"></i>
- <a>首页</a>
- </li>
- <li>
- <a>班级管理</a>
- </li>
- <li class="active">编辑学生信息</li>
- </ul>
- </div>
- <div class="page-content">
- <div class="row">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <form class="form-horizontal" action="<?php echo $this->createUrl('userinfo/edit',array('uuid'=>$userInfo->uuid));?>" method="post" id="userInfoSubmit">
- <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">
- <div class="clearfix">
- <select class="input-medium" onchange="changeYears(this.value);" name="years_id" id="years_id">
- <option value="">请选择年级</option>
- <?php if(!empty($yearsInfo)):foreach($yearsInfo as $loop):?>
- <option <?php if($userInfo->years_id == $loop->years_id){echo 'selected';}?> value="<?php echo $loop->years_id;?>"><?php echo $loop->years_name;?></option>
- <?php endforeach;endif;?>
- </select>
- </div>
- </div>
- <div class="col-xs-12 col-sm-9" id="classDiv">
- <div class="clearfix">
- <select class="input-medium" id="class_id" name="class_id">
- <?php if(!empty($classInfo)):foreach($classInfo as $cf):?>
- <option <?php if($userInfo->class_id == $cf->class_id){echo 'selected';}?> value="<?php echo $cf->class_id;?>"><?php echo $cf->class_name;?></option>
- <?php endforeach;endif;?>
- </select>
- </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">
- <input type="text" id="school" name="username" class="col-xs-10 col-sm-3" value="<?php echo $studentInfo->username;?>" readonly="readonly" />
- </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" 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" 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">真实姓名:</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" />
- </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" class="col-xs-10 col-sm-3" value="<?php echo $userInfo->userno;?>" />
- </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">
- <div>
- <label class="line-height-1 blue">
- <input name="sex" value="1" type="radio" class="ace sex" <?php if($userInfo->sex == 1){echo 'checked="checked"';}?> />
- <span class="lbl"> 男</span>
- </label>
- </div>
- <div>
- <label class="line-height-1 blue">
- <input name="sex" <?php if($userInfo->sex == 2){echo 'checked="checked"';}?> value="2" type="radio" class="ace sex" />
- <span class="lbl"> 女</span>
- </label>
- </div>
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-3 col-md-9">
- <button class="btn btn-info" 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">
- jQuery(function($) {
- $('#userInfoSubmit').validate({
- //debug:true,// 表单不会提交
- //errorElement: 'font', // 错误信息div
- errorClass: 'errorMessage', //错误样式
- ignore: "", //忽略提交字段
- rules: {
- years_id: {
- required: true,
- },
- class_id: {
- required: true,
- },
- username: {
- required: true,
- },
- password: {
- //required: true,
- minlength: 6
- },
- password2: {
- //required: true,
- minlength: 6,
- equalTo: "#password"
- },
- sex: {
- required: true,
- },
- realname: {
- required: true,
- },
- userno: {
- required: true,
- }
- },
- messages: {
- years_id: {
- required: "请选择年级!",
- },
- class_id: {
- required: "请选择班级!",
- },
- username: {
- required: "请填写登录账号!",
- },
- password: {
- //required: "请填写登录密码!",
- minlength: "密码不能少于6位字符!"
- },
- password2: {
- //required: "请填写确认密码!",
- minlength: "密码不能少于6位字符!",
- equalTo: "两次密码输入不一致!"
- },
- realname: {
- required: "请填写真实姓名!",
- },
- sex: {
- required: "请选择性别!",
- },
- userno: {
- required: "请填写学号!",
- }
- },
- 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>
|