change.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <style>
  2. .addborder{border:1px solid #ccc}
  3. .addheight{height:30px;border-radius:2px;}
  4. .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;}
  5. .ace{position:relative;top:0px !important;left:0px !important;}
  6. label{font-weight:100 !important;}
  7. </style>
  8. <div class="main-content-inner">
  9. <!-- 导航栏开始-->
  10. <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
  11. <!-- 导航栏结束-->
  12. <div class="page-content" style="margin-top:15px;">
  13. <div class="row" style="margin:0px;">
  14. <div class="col-xs-12">
  15. <!-- PAGE CONTENT BEGINS -->
  16. <form enctype="multipart/form-data" class="form-horizontal" action="" method="post" id="phoneChange">
  17. <div class="form-group">
  18. <label class="control-label col-xs-12 col-sm-3 no-padding-right">手机号:</label>
  19. <div class="col-sm-9">
  20. <input type="text" id="phone_number" name="phone_number" class="col-xs-10 col-sm-3" />
  21. <button class="btn btn-success btn-sm" id="checkPhone">
  22. <i class="ace-icon fa fa-check bigger-110"></i>
  23. 查询
  24. </button>
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="control-label col-xs-12 col-sm-3 no-padding-right"></label>
  29. <div class="col-sm-9">
  30. <span class="forPhoneNumber red"></span>
  31. </div>
  32. </div>
  33. <div class="clearfix form-actions">
  34. <div class="col-md-offset-3 col-md-9">
  35. <button class="btn btn-success btn-sm" type="submit" id="schoolSubmit" style="display: none">
  36. <i class="ace-icon fa fa-check bigger-110"></i>
  37. 确认
  38. </button>
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <div class="control-label col-xs-3 col-sm-3">
  43. </div>
  44. <!--<div class="control-label col-xs-9 col-sm-9 mt15" style="text-align: left;color: red">
  45. 1、只支持全班批量导入,导入之后会覆盖之前的学生信息<br>
  46. 2、单个或几个新加学生不要使用批量导入功能,请单个添加
  47. </div>-->
  48. </div>
  49. </form>
  50. <!-- PAGE CONTENT ENDS -->
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <script>
  56. $(function(){
  57. $('#schoolSubmit').click(function(){
  58. phoneNumber=$("input[name=phone_number]").val();
  59. if(phoneNumber==''){
  60. $('.forPhoneNumber').html('手机号不能为空!');
  61. $(this).focus();
  62. return false;
  63. }
  64. var regMobile = /^1([356789]\d|4[57])\d{8}$/;
  65. if(!regMobile.test(phoneNumber)){
  66. $('.forPhoneNumber').html('手机号格式有误!');
  67. $(this).focus();
  68. return false;
  69. }
  70. layer.confirm('确定要将该手机号做去重处理吗?', {
  71. btn: ['确定', '取消']
  72. }, function(index, layero){
  73. $('#phoneChange').submit();
  74. }, function(index){
  75. layer.closeAll()
  76. return false;
  77. });
  78. return false;
  79. });
  80. $('#phone_number').keyup(function(){
  81. console.log('1');
  82. $('#schoolSubmit').hide();
  83. });
  84. $('#checkPhone').click(function(){
  85. phoneNumber=$("input[name=phone_number]").val();
  86. obj=$(this);
  87. var regMobile = /^1([356789]\d|4[57])\d{8}$/;
  88. if(!regMobile.test(phoneNumber)){
  89. $('.forPhoneNumber').html('手机号格式有误!');
  90. $(this).focus();
  91. return false;
  92. }
  93. layer.msg('正在检测手机号,请稍候。。。。。。',{time:0});
  94. $.ajax({
  95. url: "<?php echo $this->createUrl('teacher/getTeacherForNumber');?>",
  96. type:'POST',
  97. dataType:'json',
  98. data:{phone_number:phoneNumber},
  99. success:function(res){
  100. layer.closeAll();
  101. if(res.status==-1){
  102. obj.focus();
  103. $('.forPhoneNumber').html('本校内该手机号已存在!');
  104. }else if(res.status==-2){
  105. obj.focus();
  106. $('.forPhoneNumber').html('该手机号不存在!');
  107. }else if(res.status==0){
  108. obj.focus();
  109. var showMessage='';
  110. teacherName='';
  111. schoolName='';
  112. if(res.data){
  113. schoolName=res.data['schoolName'];
  114. teacherName=res.data['teacherName'];
  115. }
  116. showMessage="该手机号所属老师为【"+teacherName+"】,注册学校为【"+schoolName+"】,\n" +
  117. "<br>" +
  118. "如需修改该手机号原注册号码,请点击确认"
  119. $('.forPhoneNumber').html(showMessage);
  120. $('#schoolSubmit').show();
  121. }else{
  122. $('.forPhoneNumber').html('手机号格式有误');
  123. }
  124. }
  125. })
  126. return false;
  127. });
  128. })
  129. </script>