<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<style>
  		#userResetPwdForm input,select{width:100px;}
  		#userResetPwdForm textarea{width: 365px;height: 50px;}
  		#userResetPwdForm td span,label{padding-left: 10px;height: 25px;}
  		#userResetPwdForm tr{line-height:30px;}
  		.userResetPwdMsg_img{width: 180px;margin: 0 auto;line-height: 40px;}
  		.userResetPwdMsg_txt{width: 180px;margin: 0 auto;line-height: 40px;text-align: center;}
  		
  	</style> 	
  </head>
  <body>	
			<div class="top"></div>
			<div class="center"  style="width: 350px;">
		  		<h3 id="draguserResetPwdPanel">
		        	<a href="javascript:;" title="关闭" class="message_close" id="closeuserResetPwdWin"></a>
		        	<span>重置密码 -> ${param.username}</span>
		        </h3>
		        <div class="popWinContainerPanel">
			        <table width="100%" border="0" style="line-height:35px; width: 300px; height: 100px;">
			        		<tr>
			        			<td colspan="2" >			        					
			        				<div id="userResetPwdMsg" class="userResetPwdMsg_img">			        				
			        					<img src="/mygpsonline/gpsonline/image/monitor/tishi.jpg" style="float: left;margin-right: 15px;"/>
			        					是否重置该账户密码
			        				</div>
			        			</td>		        					        			
			        		</tr>	
			        		<tr id="resetPwdBtns">
			        			<td style="text-align: center;">
			        				<input type="button" value="取消" id="cancle_user_reset_pwd" style="width:80px; height:30px;  margin-top:20px;"/>
			        			</td>	
			        			<td style="text-align: center;">
			        				<input type="button" value="确定" id="confirm_user_reset_pwd" style="width:80px; height:30px;  margin-top:20px;"/>
			        			</td>		        					        			
			        		</tr>						        		
			        </table>		        							
		        </div>
			 </div>
			<div class="bot"></div>
  </body>
  <script>
  	My$(function(){
  		
  		var resetReq = null;
  		
  		My$("#cancle_user_reset_pwd").unbind().click(function(){
  			My$("#closeuserResetPwdWin").click();
  			if(resetReq != null) resetReq.abort();
  		});
  		
  		My$("#confirm_user_reset_pwd").unbind().click(function(){
  		
  				setMsgOnResetSubmitting();
	  			resetReq = $.ajax({
						        type: "POST",
						        dataType: "json",
						        url: "manager/userAction_resetPwd.action",
						        data:{"form.id":${param.id}},
						        success: function(result) {
							        backfun(result);
						        },error: function() {}
						});
  		});
  		
  		function backfun(result){
  			 if (result.flag==true) {       
	         	setMsgOnResetSuccess();							         						         	
	         }else{
	         	setMsgOnResetError("*"+result.msg);						         	
	         }
  		}
  		
  		function setMsgOnResetSuccess(){
  			My$("#userResetPwdMsg").attr("className","userResetPwdMsg_img").html("<img src='/mygpsonline/gpsonline/image/monitor/success.jpg' style='float: left;margin-right: 15px;'/>" + manager.mimayichongzhiwei + ":000000");		
  		}
  		
  		function setMsgOnResetSubmitting(){
  			My$("#userResetPwdMsg").attr("className","userResetPwdMsg_txt").css("color","").html(manager.zztj);
			My$("#resetPwdBtns").hide();		
  		}
  		
  		function setMsgOnResetError(msg){
  			My$("#userResetPwdMsg").css("color","red").html(msg);
			My$("#resetPwdBtns").show();
  		}
  	});
  </script>
</html>
