<%@ 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>
        <script language="javascript">
            function confirmsubmit()
            {
            var agree=confirm("Are you sure to wish to continue?");
            if(agree)
                return true;
            else
                return false;
            }
        </script>
    </head>
    <body>
           
            <div style="position: absolute; width: 100px; height: 27px; z-index: 5; left: 891px; top: 533px" id="layer11">
				<b><a href="login.jsp">
				<font face="Tahoma" size="2" color="#2D2E32">Logout</font></a></b></div>
           
        <%!
        Connection con;
        Statement st;
        PreparedStatement pst;
        ResultSet rs;
        String custid,uname,pwd,fn,ln,email,mobile,addr,city,state,cntry;
        int i;
        %>
        <%
        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 customer");
        
        %>
        <div style="position: absolute; width: 31px; height: 18px; z-index: 7; left: 891px; top: 256px" id="layer10">
            <b><a href="adminlogin.jsp">
        <font face="Tahoma" size="2" color="#2D2E32">Back</font></a></b></div>
        
        <div style="position: absolute; width: 542px; height: 236px; z-index: 3; left: 390px; top: 293px" id="layer1">
            <table border="2" width="100%" id="table1" bordercolorlight="#993366">
                <tr>
                    <td><b><font face="Tahoma" size="2">Emp ID</font></b></td>
                    <td><b><font face="Tahoma" size="2">Name</font></b></td>
                    <td><b><font face="Tahoma" size="2">Contact Details</font></b></td>
                    <td><b><font face="Tahoma" size="2">Address</font></b></td>
                    <td><b><font face="Tahoma" size="2">Action</font></b></td>
                </tr>
                <%
                while(rs.next())
                {
                custid=rs.getString("custid");
                uname=rs.getString("uname");
                pwd=rs.getString("pwd");
                fn=rs.getString("fn");
                ln=rs.getString("ln");
                if(ln==null) ln="";
                email=rs.getString("email");
                mobile=rs.getString("mobile");
                addr=rs.getString("addr");
                city=rs.getString("city");
                state=rs.getString("state");
                cntry=rs.getString("cntry");
                %>
                <tr>
                    <td><font face="Tahoma" color="#2D2E32" size="2"><%=custid%></font></td>
                    <td><font face="Tahoma" color="#2D2E32" size="2"><%=fn+" "+ln%></font></td>
                    <td><font face="Tahoma" color="#2D2E32" size="2"><%="Mobile : "+mobile+"<br>Email : "+email%></font></td>
                    <td><font face="Tahoma" color="#2D2E32" size="2"><%=addr+","+city+"<br>"+state+","+cntry%></font></td>
                    <td><font face="Tahoma"><a href="delcust.jsp?custid=<%=custid%>" onclick="return confirmsubmit()">
                    <font color="#2D2E32" size="2">Delete</font></a></font></td>
                </tr>
                <%
                }
                %>
            </table>
        </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">Customer Details</font></b></div>  

<p>&nbsp;</p>
 
</html>