<%@ page import="java.sql.*,databaseconnection.*"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
function validation()
{
var a = document.form.ltype.value;
if(a=="Marriage Leave")
{
location.href="marriage.jsp";
}
else if(b=="Special Leave")
{
location.href="special.jsp"
}
}
</script>
</head>
<body>
<table>
<form name="form" action="empleaveinsert.jsp" method="post">
<p align="right" height="37" class="paragraping">Type of Leave:
<select name="leavtype" class="texta1" onblur="return validation()">
<option name="select1"><- - - SELECT - - - ></option>
<option name="Casual Leave">Casual Leave</option>
<option name="Privilege Leave">Privilege Leave</option>
<option name="Marriage Leave">Marriage Leave</option>
<option name="Maternity Leave">Maternity Leave</option>
<option name="Special Leave">Special Leave</option>
</select>
</p>
<%
try
{
Connection con=databasecon.getconnection();
Statement st=con.createStatement();
String s=(String)session.getAttribute("staffcode");
String sql="select * from staff where staffcode ='"+s+"'";
ResultSet rs=st.executeQuery(sql);
while(rs.next())
{
%>
<table width="549">
<tr>
<td width="549" height="24" background="images/img02.jpg"><font color="#FFFFFF" size="4">Applicant</font></td>
</tr>
</table>
<table>
<tr>
<td height="37" class="paragraping">StaffCode</td>
<td> <input name="name" TYPE="text" class="texta1" value="<%out.println(rs.getString("staffcode"));%> "></td>
</tr>
<tr>
<td height="37" class="paragraping">Name</td>
<td> <input name="name" TYPE="text" class="texta1" value="<%out.println(rs.getString("name"));%>"></td>
</tr>
<tr>
<td height="37" class="paragraping">Designation</td>
<td> <input name="designation" TYPE="text" class="texta1" value="<%out.println(rs.getString("designation")); %>"></td>
</tr>
<tr>
<td height="37" class="paragraping">Department</td>
<td> <input name="department" TYPE="text" class="texta1" value="<%out.println(rs.getString("department"));% >"></td>
</tr>
<tr>
<td height="37" class="paragraping">DOJ</td>
<td> <input name="doj" TYPE="text" class="texta1" value="<%out.println(rs.getString("doj"));%>"></td>
</tr>
</table>