123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <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 enctype="multipart/form-data" class="form-horizontal" action="" method="post" id="phoneChange">
- <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="phone_number" name="phone_number" class="col-xs-10 col-sm-3" />
- <button class="btn btn-success btn-sm" id="checkPhone">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 查询
- </button>
- </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">
- <span class="forPhoneNumber red"></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" style="display: none">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 确认
- </button>
- </div>
- </div>
- <div class="form-group">
- <div class="control-label col-xs-3 col-sm-3">
- </div>
- <!--<div class="control-label col-xs-9 col-sm-9 mt15" style="text-align: left;color: red">
- 1、只支持全班批量导入,导入之后会覆盖之前的学生信息<br>
- 2、单个或几个新加学生不要使用批量导入功能,请单个添加
- </div>-->
- </div>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function(){
- $('#schoolSubmit').click(function(){
- phoneNumber=$("input[name=phone_number]").val();
- if(phoneNumber==''){
- $('.forPhoneNumber').html('手机号不能为空!');
- $(this).focus();
- return false;
- }
- var regMobile = /^1([356789]\d|4[57])\d{8}$/;
- if(!regMobile.test(phoneNumber)){
- $('.forPhoneNumber').html('手机号格式有误!');
- $(this).focus();
- return false;
- }
- layer.confirm('确定要将该手机号做去重处理吗?', {
- btn: ['确定', '取消']
- }, function(index, layero){
- $('#phoneChange').submit();
- }, function(index){
- layer.closeAll()
- return false;
- });
- return false;
- });
- $('#phone_number').keyup(function(){
- console.log('1');
- $('#schoolSubmit').hide();
- });
- $('#checkPhone').click(function(){
- phoneNumber=$("input[name=phone_number]").val();
- obj=$(this);
- var regMobile = /^1([356789]\d|4[57])\d{8}$/;
- if(!regMobile.test(phoneNumber)){
- $('.forPhoneNumber').html('手机号格式有误!');
- $(this).focus();
- return false;
- }
- layer.msg('正在检测手机号,请稍候。。。。。。',{time:0});
- $.ajax({
- url: "<?php echo $this->createUrl('teacher/getTeacherForNumber');?>",
- type:'POST',
- dataType:'json',
- data:{phone_number:phoneNumber},
- success:function(res){
- layer.closeAll();
- if(res.status==-1){
- obj.focus();
- $('.forPhoneNumber').html('本校内该手机号已存在!');
- }else if(res.status==-2){
- obj.focus();
- $('.forPhoneNumber').html('该手机号不存在!');
- }else if(res.status==0){
- obj.focus();
- var showMessage='';
- teacherName='';
- schoolName='';
- if(res.data){
- schoolName=res.data['schoolName'];
- teacherName=res.data['teacherName'];
- }
- showMessage="该手机号所属老师为【"+teacherName+"】,注册学校为【"+schoolName+"】,\n" +
- "<br>" +
- "如需修改该手机号原注册号码,请点击确认"
- $('.forPhoneNumber').html(showMessage);
- $('#schoolSubmit').show();
- }else{
- $('.forPhoneNumber').html('手机号格式有误');
- }
- }
- })
- return false;
- });
- })
- </script>
|