<%@ include file="newindex.htm"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Date" %> 
<%@ page import="java.text.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<html>
    <head>
    </head>
    <body>
        <%!
        Connection con;
        Statement st;
        PreparedStatement pst;
        ResultSet rs;
        String cid,comp,uname,emp,status;
        java.util.Date sdate,edate;
        int i;
        %>
        <%
        emp=(String)session.getAttribute("uname");
        Class.forName("oracle.jdbc.driver.OracleDriver");
        con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","c2t","c2t");
        st=con.createStatement();
        rs=st.executeQuery("select * from complaint where status='Not Solved' and emp='"+emp+"'");
        
        %>
        <div style="position: absolute; width: 31px; height: 18px; z-index: 7; left: 993px; top: 241px" id="layer10">
            <b><a href="emplogin.jsp">
        <font face="Tahoma" size="2" color="#2D2E32">Back</font></a></b></div>
        
        <div style="position: absolute; width: 592px; height: 236px; z-index: 3; left: 405px; top: 294px" id="layer1">
            <table border="2" width="100%" id="table1" bordercolorlight="#993366">
                <tr>
                    <td><b><font face="Tahoma" size="2">Complaint ID</font></b></td>
                    <td><b><font face="Tahoma" size="2">Complaint</font></b></td>
                    <td><b><font face="Tahoma" size="2">User Name</font></b></td>
                    <td><b><font face="Tahoma" size="2">Complaint Date</font></b></td>
                    <td><b><font face="Tahoma" size="2">Solved Date</font></b></td>
                    <td><b><font face="Tahoma" size="2">Action</font></b></td>
                </tr>
                <%
                while(rs.next())
                {
                    cid=rs.getString(1);
                    comp=rs.getString(2);
                    uname=rs.getString(3);
                   // emp=rs.getString(4);
                    status=rs.getString(5);
                    sdate=rs.getDate(6);
                    edate=rs.getDate(7);
                    if(status.equals("Not Solved"))
                    {
                        emp="--";
                    }

                %>
                <tr>
                    <td><font face="Verdana" color="#2D2E32" size="2"><%=cid%></font></td>
                    <td><font face="Verdana" color="#2D2E32" size="2"><%=comp%></font></td>
                    <td><font face="Verdana" color="#2D2E32" size="2"><%=uname%></font></td>
                    <td><font face="Verdana" color="#2D2E32" size="2"><%=sdate%></font></td>
                    <td><font face="Verdana" color="#2D2E32" size="2"><%=edate%></font></td>
                    <td><font face="Verdana"><a href="solvecomp.jsp?cid=<%=cid%>">
                    <font color="#2D2E32" size="2">Solve</font></a></font></td>
                </tr>
                <%
                }
                %>
            </table>
        </div>

            <div style="position: absolute; width: 73px; height: 27px; z-index: 5; left: 1003px; top: 541px" id="layer8">
				<b><a href="login.jsp">
				<font face="Tahoma" size="2" color="#2D2E32">Logout</font></a></b></div>
           
           <div style="position: absolute; width: 256px; height: 25px; z-index: 4; left: 293px; top: 249px" id="layer6">
				<b><font face="Arial" size="4" color="#F5A625">View Complaints</font></b></div>  
           
<p>&nbsp;</p>
 
</html>