FORGETPWD.jsp 6.09 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.databean.*,com.csc.library.session.*,java.util.*,org.jdom.*"  %>
<%@page contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="form" class="com.csc.library.utilities.Forgetpassword" />
<%
        String submit=request.getParameter("submit");
		String username="";
		String email="";
		String employeeid="";
		String dbname="";
%>		  
<HTML>
	<HEAD>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<TITLE>Forget Password</TITLE>
		<link href="./CSS/TISCO.css" rel="stylesheet" type="text/css">
		<link rel="stylesheet" type="text/css" href="CSS/Bootstrap/css/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="CSS/EMPVIEW_LAYOUT.min.css" />
		
		<script type="text/javascript" src="JS/jquery-2.1.3.min.js"></script>
		
		<script>
			$(document).ready(function(){
				$(".msg_err").css({"color":"red","font-size":"18px"});
			});
		</script>
	</HEAD> 
	
	
	
<!--	<BODY onLoad="setTimer()"> -->
	<body>
		<div class="bg-com"></div>
		<div class="container csc-content">
			<form name="cscform" method="post" action="FORGETPWD.jsp">
				<%
					if(submit!=null)
					{
						username=request.getParameter("username");
						email=request.getParameter("email");
						employeeid=request.getParameter("employeeid");
						dbname=request.getParameter("dbname");
					}
				%>
				<jsp:setProperty name="form" property="username" value="<%=username%>" />
				<jsp:setProperty name="form" property="email" value="<%=email%>" />
				<jsp:setProperty name="form" property="employeeid" value="<%=employeeid%>" />		
				<jsp:setProperty name="form" property="dbname" value="<%=dbname%>" />		
				<%
					  InitialEnvironment en = new InitialEnvironment("GLOBAL");
					   Element root=en.getRootElement();
					   List list = root.getChildren("DATABASE");
					   List listchild=null;
					   Iterator it = list.iterator();
					   Iterator it2=null;
					   Element em=null,emchild=null;
					   String nodename="",companyid="",display="",db_name="",option="",selected="";
					   if(it.hasNext()){
						  em=(Element)it.next();
							 listchild=em.getChildren();
							 it2=listchild.iterator();
							 while(it2.hasNext()){
									emchild=(Element)it2.next();
									nodename=emchild.getName();
									if((String.valueOf(nodename.charAt(0))).equalsIgnoreCase("D")&&(String.valueOf(nodename.charAt(1))).equalsIgnoreCase("B")&&!nodename.equalsIgnoreCase("DBLIST")){
										companyid=emchild.getAttributeValue("companyid");
										display=emchild.getAttributeValue("display");
										db_name=emchild.getAttributeValue("name");
										selected=(emchild.getAttributeValue("default")!=null)?"selected":"";
										option+="<option value=\""+db_name+"\" >"+display+"</option>";
									}
							 }
					   }

					if(submit!=null&&form.validate()){
				%>
				
					<div class="csc-block">
						<div id="msgstatus">
							<div class="center">
								<h2 class="csc-block-head"> 
									Forget Password
								</h2>
							</div>
						</div>
						</br>
						<div align="center">
							<label class="control-label">ระบบได้ทำการส่ง password ตาม email ที่ท่านแจ้งเรียบร้อยแล้ว </label>
						</div>
						</br>
					</div>
				<%
					}else{
				%>
					
					<div class="csc-block">
						<div id="msgstatus">
							<div class="center">
								<h2 class="csc-block-head"> 
									Forgot your myHR Password ?
								</h2>
								<h4 class="csc-block-head">
									Enter your login username below and we will send you a password
								</h4>
							</div>
							<div class="form-horizontal">
								<div class="row">
									<div class="form-group">
										<div class="col-md-1 col-sm-1 col-xs-1"></div>
										<div class="col-md-2 col-sm-2 col-xs-2">
											<label class="control-label label-right">Database :</label>
										</div>
										
										<div class="col-md-3 col-sm-3 col-xs-3">
											<select class="form-control" name="dbname"><%=option%></select>
										</div>
									</div>
								</div>
								
			<!-- Employee id  display:none  -->
								<table>
									<tr style="display:none">
										<td>Employeeid </td>
										<td><input type="text" name="employeeid" size="15" value="<jsp:getProperty name="form" property="employeeid" />">
											<span class="msg_err"><jsp:getProperty name="form" property="msg_employeeid" /></span>
										</td>
									</tr>
								</table>
			<!-- Employee id  display:none  -->
								
								<div class="row">
									<div class="form-group">
										<div class="col-md-1 col-sm-1 col-xs-1"></div>
										<div class="col-md-2 col-sm-2 col-xs-2">
											<label class="control-label label-right">Username :</label>
										</div>
										<div class="col-md-3 col-sm-3 col-xs-3">
											<input class="form-control" type="text" name="username" value="<jsp:getProperty name="form" property="username" />">
										</div>
										<div class="col-md-1 col-sm-1 col-xs-1">
											<label class="control-label label-right">Email :</label>
										</div>
										<div class="col-md-3 col-sm-3 col-xs-3">
											<input class="form-control" type="text" name="email" value="<jsp:getProperty name="form" property="email" />">
										</div>
									</div>
								</div>
								<div class="row">
									<div class="form-group">
										<div class="col-md-3 col-sm-3 col-xs-3"></div>
										<div class="col-md-4 col-sm-4 col-xs-4">
											<span class="msg_err"><jsp:getProperty name="form" property="msg_username" /></span>
										</div>
										<div class="col-md-4 col-sm-4 col-xs-4">
											<span class="msg_err"><jsp:getProperty name="form" property="msg_email" /></span>
										</div>
									</div>
								</div>
								<div class="center">
									<input class="btn btn-primary" name="submit" type="submit" id="submit" value="Get password ">
								</div>
							</div>
						</div>
					</div>
				<%}%>
			</form>
		</div>
	</BODY>
</HTML>