1
0
mirror of https://e.coding.net/circlecloud/McAccount.git synced 2024-11-23 01:58:54 +00:00
McAccount/View/mail/mailstatus.php

213 lines
7.3 KiB
PHP
Raw Normal View History

2015-10-13 06:26:47 +00:00
<?php
if (empty ( $_SESSION ['username'] ))
header ( 'Location:' . Url ( 'index', 'login' ) );
?>
<!DOCTYPE html>
<html>
<head>
<title><?=$title?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- bootstrap -->
<link href="View/public/css/bootstrap/bootstrap.css" rel="stylesheet" />
<link href="View/public/css/bootstrap/bootstrap-responsive.css"
rel="stylesheet" />
<link href="View/public/css/bootstrap/bootstrap-overrides.css"
type="text/css" rel="stylesheet" />
<!-- libraries -->
<link href="View/public/css/lib/bootstrap-wysihtml5.css" type="text/css"
rel="stylesheet" />
<link href="View/public/css/lib/uniform.default.css" type="text/css"
rel="stylesheet" />
<link href="View/public/css/lib/select2.css" type="text/css"
rel="stylesheet" />
<link href="View/public/css/lib/bootstrap.datepicker.css"
type="text/css" rel="stylesheet" />
<link href="View/public/css/lib/font-awesome.css" type="text/css"
rel="stylesheet" />
<!-- global styles -->
<link rel="stylesheet" type="text/css" href="View/public/css/layout.css" />
<link rel="stylesheet" type="text/css"
href="View/public/css/elements.css" />
<link rel="stylesheet" type="text/css" href="View/public/css/icons.css" />
<!-- this page specific styles -->
<link rel="stylesheet" href="View/public/css/compiled/form-showcase.css"
type="text/css" media="screen" />
2015-10-13 06:26:47 +00:00
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
2015-10-13 06:26:47 +00:00
<!-- navbar -->
<?=load('header')?>
<!-- end navbar -->
2015-10-13 06:26:47 +00:00
<!-- sidebar -->
<?=load('left')?>
<!-- end sidebar -->
<!-- main container -->
<div class="content">
<div class="container-fluid">
<div id="pad-wrapper">
<div class="table-products section">
<div class="row-fluid form-wrapper">
<div class="container-fluid col-xs-12">
<div id="pad-wrapper" class="form-page">
<div class="row-fluid form-wrapper">
<!-- left column -->
<div class="span8 column">
<table class="table table-hover col-xs-12"
style="width: 570px;">
<tbody>
<!-- row -->
<tr class="first">
<td>邮箱地址</td>
<td class="description"><input style="width: 250px;"
class="span8 inline-input" id="mail" type="text"
disabled="disabled" /></td>
<td><button style="width: 90px;" id="submit" type="button"
class="btn-glow primary btn-next">发送验证码</button> <span
id="status"></span></td>
</tr>
<!-- row -->
<tr>
<td>邮箱验证码</td>
<td class="pass"><input style="width: 250px;"
class="span8 inline-input" id="verify" type="text" /></td>
<td>
<button style="width: 80px;" id="check" type="button"
class="btn-glow primary btn-next">验证邮箱</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end table sample -->
</div>
</div>
</div>
<!-- end main container -->
<!-- scripts for this page -->
<script src="View/public/js/wysihtml5-0.3.0.js"></script>
<script src="View/public/js/jquery-latest.js"></script>
<script src="View/public/js/bootstrap.min.js"></script>
<script src="View/public/js/bootstrap-wysihtml5-0.0.2.js"></script>
<script src="View/public/js/bootstrap.datepicker.js"></script>
<script src="View/public/js/jquery.uniform.min.js"></script>
<script src="View/public/js/select2.min.js"></script>
<script src="View/public/js/theme.js"></script>
2015-10-29 12:52:38 +00:00
<script type="text/javascript">
select()
2015-10-29 12:52:38 +00:00
var data = "user=<?=$_SESSION['username']?>";
function select(){
$("#submit").attr("disabled",true);
$("#check").attr("disabled",true);
2015-10-29 12:52:38 +00:00
$.ajax({
type:"GET",
dataType:"json",
data:data,
url:"<?=Url('mail_status', "select")?>",
success:function(rdata){
$.each(rdata.info,function(index,content)
{
if(rdata.status == "success")
{
$.ajax({
type:"GET",
dataType:"json",
data:data,
url:"<?=Url('mail_status', "stat")?>",
success:function(data){
if(data.status != "success")
{
$("#status").html("邮箱状态:尚未验证 ");
$("#status").css("color", "red");
$("#submit").attr("disabled",false);
}else{
$('#status').html("邮箱验证状态:已验证");
$("#status").css("color", "green");
}
},
error:function(){
alert("邮箱验证状态读取失败");
return false;
}
})
2015-10-29 12:52:38 +00:00
$("#mail").val(content.email);
}
}
)},
error:function(){
alert("数据读取失败");
return false;
}
});
}
2015-10-13 06:26:47 +00:00
$(document).ready(function(){
$("#submit").click(function(){
var mail = $("#mail").val();
if(mail==""){
alert("邮箱地址不能为空!");
}
$.ajax({
type:"POST",
data:{mail:mail,user:"<?=$_SESSION['username']?>",type:"status"},
dataType:"json",
url:'<?=Url('mail_status','sendmail')?>',
success:function(rdata){
switch(rdata.status){
case "success": alert(rdata.info); $("#submit").attr("disabled",true);$("#check").attr("disabled",false);break;
2015-10-13 06:26:47 +00:00
case "error": alert(rdata.info); break;
}
}
});
});
});
$(document).ready(function(){
$("#check").click(function(){
2015-10-13 06:26:47 +00:00
var mail = $("#mail").val();
var key = $("#verify").val();
var stat = "mail=" + mail + "&verify=" + key;
// document.write(key);
if(mail == ""){
alert("邮箱地址不能为空!");
return false;
}
if(key == ""){
alert("验证码不能为空");
return false;
}
$.ajax({
type:"POST",
dataType:"json",
data:stat,
url:"<?=Url('mail_status','mail')?>",
success:function(rdata){
switch(rdata.status){
case "success" : alert(rdata.info); location.href = "<?=Url('index','index')?>"; break;
case "error" : alert(rdata.info); return false; break;
2015-10-13 06:26:47 +00:00
}
}
})
})
})
</script>
</body>
2015-10-13 06:26:47 +00:00
</html>