<%@ page import="java.sql.*" %> 
        <%!
        Connection con;
        Statement st;
        PreparedStatement pst;
        ResultSet rs;
        String uname,pwd,userid,str,utype;
        int i;
        %>
        <%
        uname=request.getParameter("unm");
        pwd=request.getParameter("pwd");
        utype=request.getParameter("utype");
        session.setAttribute("utype",utype);
        Class.forName("oracle.jdbc.driver.OracleDriver");
        con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","c2t","c2t");
        st=con.createStatement();
        if(utype.equals("admin"))
        {
            rs=st.executeQuery("select * from admin where uname='"+uname+"' and pwd='"+pwd+"'");
            if(rs.next())
            {
            %>
            <jsp:forward page="adminlogin.jsp"></jsp:forward>
            <%
            }
            else
                {
            %>
            <jsp:include page="login.jsp"></jsp:include><div style="position: absolute; width: 500px; height: 21px; z-index: 4; left: 321px; top: 487px" id="layer6">
				<b><font face="Arial Narrow" size="2" color="#17CA1C">Invalid 
				User Name or Password, Please enter the valid details and try 
				again....</font></b></div>            <%                    
                }
        }else  if(utype.equals("emp"))
        {
            rs=st.executeQuery("select * from employee where uname='"+uname+"' and pwd='"+pwd+"'");
            if(rs.next())
            { 
                String eid=rs.getString(1);
                session.setAttribute("uname",uname);
                session.setAttribute("eid",eid);
            %>
            <jsp:forward page="emplogin.jsp"></jsp:forward>
            <%
            }
            else
                {
            %>
            <jsp:include page="login.jsp"></jsp:include><div style="position: absolute; width: 500px; height: 21px; z-index: 4; left: 321px; top: 487px" id="layer6">
				<b><font face="Arial Narrow" size="2" color="#808080">Invalid 
				User Name or Password, Please enter the valid details and try 
				again....</font></b></div>
				            <%                    
                }
        }
        else  if(utype.equals("cust"))
        {
            rs=st.executeQuery("select * from customer where uname='"+uname+"' and pwd='"+pwd+"'");
            if(rs.next())
            {
                session.setAttribute("uname",uname);
            %>
            <jsp:forward page="custlogin.jsp"></jsp:forward>
            <%
            }
            else
                {
            %>
            <jsp:include page="login.jsp"></jsp:include>
           <div style="position: absolute; width: 500px; height: 21px; z-index: 4; left: 321px; top: 487px" id="layer6">
				<b><font face="Arial Narrow" size="2" color="#808080">Invalid 
				User Name or Password, Please enter the valid details and try 
				again....</font></b></div>            <%                    
                }
        }
        else
            {
            %>
            <jsp:include page="login.jsp"></jsp:include><div style="position: absolute; width: 500px; height: 21px; z-index: 4; left: 321px; top: 487px" id="layer6">
				<b><font face="Arial Narrow" size="2" color="#808080">Invalid 
				User Name or Password, Please enter the valid details and try 
				again....</font></b></div>            <%
            }
            
        %>