214 lines
7.0 KiB
PHTML
Executable File
214 lines
7.0 KiB
PHTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
{include file="include/head" /}
|
|
<script type="text/javascript">
|
|
var navID = "1";
|
|
</script>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/m_weben/css/login.css">
|
|
</head>
|
|
<body style="background: #f4f5f5;">
|
|
<!--top-->
|
|
<div id="content">
|
|
{include file="include/top" /}
|
|
<div class="img-responsive personal-all margin-top-90">
|
|
<img src="__PUBLIC__/m_web/images/user/personal-bg.jpg" alt=""/>
|
|
<div class="personal_header">
|
|
<?php if (!empty($customer_info)): ?>
|
|
<?php
|
|
$head_img = $customer_info['picture'] != '' ? $customer_info['picture'] : '__PUBLIC__/web/images/customer/logo_small_03.png';
|
|
?>
|
|
<div class="m_Container">
|
|
<div class="left"><img class="headimg" style="border-radius: 50%;" src="<?php echo $head_img; ?>" alt=""/></div>
|
|
<div class="right text_28">
|
|
<p>User: <?php echo $customer_info['firstname']; ?></p>
|
|
<p class="margin-top-14">Status: Logged in</p>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<div class="personal-bg margin-top-14">
|
|
<div class="m_Container f_weight_100">
|
|
<div class="personal-m-a text_28 text_gray ">
|
|
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/collection.png" alt=""/></div>
|
|
<a href="__ORICOROOT__/customer/my_collection.html"><div class="personal-lable">Favorite</div></a>
|
|
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
|
|
</div>
|
|
<?php if (!empty($customer_info)): ?>
|
|
<div class="personal-m-a text_28 text_gray">
|
|
<div class="modify">
|
|
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/password.png" alt=""/></div>
|
|
<div class="personal-lable">Change Password</div>
|
|
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
|
|
</div>
|
|
<div class="Popup">
|
|
<div class="content password">
|
|
<?php if ($customer_info['have_pwd']): ?>
|
|
<div class="margin-bottom-20"><label>Original Password</label><input class="form-control input_class" id="old_password" type="password">
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="margin-bottom-20"><label>New Password</label><input id="new_password" class="form-control input_class" type="password"></div>
|
|
<div class="margin-bottom-20"><label>Confirm Password</label><input id="re_password" class="form-control input_class" type="password"></div>
|
|
<div class="text_right"><a href="__ORICOROOT__/customer/forgetpwd.html" class="text_blue">Forget Password?</a></div>
|
|
<div class="u_button text_22 text_center margin-top-50"><a class="u_button_blue" onclick="update_pwd()">Confirm</a><a class="u_button_gray">Cancel</a><!--<a href="http://www.orico.com.cn/forgetpwd"><span class="forget_button f_blue">忘记密码</span></a>--></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<!--<div class="personal-m-a text_24 text_gray">
|
|
<div class="modify">
|
|
<div class="personal-left-icon"><img src="__PUBLIC__/m_web/images/user/email.png" alt=""/></div>
|
|
<div class="personal-lable">Change Email</div>
|
|
<div class="personal-c margin-top-40"><?php echo $customer_info['email']; ?></div>
|
|
<div class="personal-icon"><img src="__PUBLIC__/m_web/images/user/personal-icon.png" alt=""/></div>
|
|
</div>
|
|
<div class="Popup">
|
|
<div class="content email">
|
|
<div class="margin-bottom-20"><label>New Email</label><input class="form-control input_class" id="email" type="text"></div>
|
|
<div class="u_button text_22 text_center margin-top-50"><a class="u_button_blue" onclick="bind_email()">Confim</a><a class="u_button_gray">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>-->
|
|
</div>
|
|
</div>
|
|
<div class=" login-btn" style="margin-bottom: 1.3rem;">
|
|
<button class="update margin-top-50" onclick="logout()">Logout</button>
|
|
</div>
|
|
|
|
<!-- bottom s -->
|
|
{include file="include/bottom" /}
|
|
<!-- bottom e -->
|
|
</body>
|
|
</html>
|
|
|
|
<script type="text/javascript">
|
|
function logout()
|
|
{
|
|
$.ajax({
|
|
'url': '/usmobile/customer/new_logout.html',
|
|
'type': 'post',
|
|
'success': function(res) {
|
|
location.href = '__ORICOROOT__';
|
|
}
|
|
})
|
|
}
|
|
/*修改密码*/
|
|
$(function(){
|
|
$(".modify").click(function(){
|
|
$(this).next(".Popup").show();
|
|
});
|
|
$(".u_button_gray").click(function(){
|
|
$(this).parents(".Popup").hide();
|
|
})
|
|
|
|
});
|
|
|
|
/*修改密码*/
|
|
function check_format(id)
|
|
{
|
|
if (id == 'new_password')
|
|
{
|
|
var re_password = $("#re_password").val();
|
|
if (re_password != '')
|
|
{
|
|
check_format('re_password');
|
|
}
|
|
|
|
var password = $("#new_password").val();
|
|
var arg = /^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&*-.]+$)[a-zA-Z\d!@#$%^&*-.]{8,20}$/;
|
|
if (!arg.test(password))
|
|
{
|
|
var html = 'Password must be 8 - 20 digits, letters or characters';
|
|
show_err('new_password', html);
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
hide_err('new_password');
|
|
return true;
|
|
}
|
|
|
|
}
|
|
else if (id == 're_password')
|
|
{
|
|
var password = $("#new_password").val();
|
|
var re_password = $("#re_password").val();
|
|
if (password != re_password)
|
|
{
|
|
var html = 'Two password inconsistencies';
|
|
show_err('re_password', html);
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
hide_err('re_password');
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function update_pwd()
|
|
{
|
|
var old_password = $("#old_password").val();
|
|
var password = $("#new_password").val();
|
|
|
|
var data = {
|
|
old_password: old_password,
|
|
password: password,
|
|
};
|
|
|
|
if (!check_format('new_password') || !check_format('re_password'))
|
|
{
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: '/us/customer/update_pwd',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: data,
|
|
success: function (res) {
|
|
if (res.code == 200)
|
|
{
|
|
alert(res.msg);
|
|
location.reload();
|
|
}
|
|
else if (res.code == -2)
|
|
{
|
|
var html = res.msg;
|
|
show_err('old_password', html);
|
|
}
|
|
else
|
|
{
|
|
alert(res.msg);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<script type="text/javascript">
|
|
function show_err(id, html)
|
|
{
|
|
var err_id = '#err_' + id;
|
|
var input_id = '#' + id;
|
|
|
|
$(err_id).html(html);
|
|
$(input_id).css('border', '1px solid red');
|
|
}
|
|
|
|
function hide_err(id)
|
|
{
|
|
var err_id = '#err_' + id;
|
|
var input_id = '#' + id;
|
|
|
|
$(err_id).html('');
|
|
$(input_id).css('border', '1px solid #dedfe0');
|
|
}
|
|
</script>
|