<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="changepwd.aspx.cs" Inherits="onlineTest.app.changepwd" %>


<!DOCTYPE html>
<html>
<head>
<title>修改密码——<%=xxsoft_check.check.getseting("systitle") %></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="viewport" content="width=device-width"/>
<meta name="viewport" content="initial-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../weui/css/weui.css"/>
    <link rel="stylesheet" href="../weui/css/weuix.css"/>
    <script src="../weui/js/zepto.min.js"></script>
    <script src="../weui/js/zepto.weui.js"></script>
    <script src="../weui/js/php.js"></script>

<body>
<div class="weui-header bg-blue"> 
  <div class="weui-header-left"> <a class="icon icon-109 f-white" href="javascript:history.go(-1);">返回</a>  </div>
   <h1 class="weui-header-title">修改密码</h1>
    <div class="weui-header-right"></div> 
    </div>

    
    <div class="weui-cells weui-cells_form">
	  <div class="weui-cell">
        <div class="weui-cell__hd">
          <label class="weui-label">原密码</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" name="oldpassword" id="oldpassword" type="password" placeholder="请输入密码">
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd">
          <label class="weui-label">新密码</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" name="password" id="password" type="password" placeholder="请输入新密码">
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd">
          <label class="weui-label">确认新密码</label>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input" name="password1" id="password1" type="password" placeholder="请再次输入新密码">
        </div>
      </div>     
       <div class="weui-btn-area">
	   <a href="javascript:;" class="weui-btn weui-btn_primary" id="showTooltips">确定修改</a>
	   </div>
    </div>
   
 <script>
     $("#showTooltips").click(function () {
         var oldpassword = $('#oldpassword').val();
         var password = $('#password').val();
         var password1 = $('#password1').val();

         if (oldpassword == "") {
             $.toptip('原密码必须输入', 'error');
             return
         }
         if (password == "") {
             $.toptip('新密码必须输入', 'error');
             return
         }
         if (password != password1) {
             $.toptip('两次输入的新密码不一致', 'error');
             return
         }
         $.post('changepwd.aspx?action=change', { oldpassword:md5(oldpassword), password:md5($('#password').val())}, function (data, status) {
             if (status == "success") {
                 var jsonData = data;
                 if (jsonData.isOk == 1) {
                     $.toptip('操作成功', 'success');
                 } else {
                     $.toptip(jsonData.message, 'error');
                     //window.location.href = 'login.asp';
                 }

             }
         }, 'json');
     });
    </script>
</body>
</html>