<%@page import="project.ConnectionProvider"%>
<%@page import="java.sql.*"%>

<html>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <script src='https://kit.fontawesome.com/a076d05399.js'></script>
        <link rel="stylesheet" href="css/addNewProduct-style.css">
        <title>Edit Employee Details</title>
        <style>
            .back
            {
                color: navy;
                margin-left: 2.5%
            }
            h3{
                color: navy;
            }
            .Heading{
                background-color: lightsalmon;
                padding: 2px;
            }
        </style>
    </head>
    <body>
        <h2><a class="back" href="adminHome.jsp"><i class='fas fa-arrow-circle-left'> Back</i></a></h2>
        <%
            String id = request.getParameter("id");
          
            try {
                Class.forName("com.mysql.jdbc.Driver");
                Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/CLINIHR", "root", "Clinica123");
                Statement st = con.createStatement();
                ResultSet rs = st.executeQuery("select * from users where id='" + id + "'");
                while (rs.next()) {
        %>
        
           
                <form action="myTeam.jsp" method="post">
                    <input type="hidden" name="id" value="<%out.println(id);%>">

                    <div class="Heading">   
                        <h3>Personal Details</h3>
                        
                    </div>
                    <table>
                        <tr>
                        <td> 
                        <h3>First Name</h3>
                        <input class="input-style" type="text" name="first_name"  value="<%=rs.getString(2)%>" disabled>
                        </td>
                        <td> 
                        <h3>Middle Name</h3>
                        <input class="input-style" type="text" name="middle_name"  value="<%=rs.getString(3)%>" disabled>
                        </td>
                        <td> 
                        <h3>Last Name</h3>
                        <input class="input-style" type="text" name="last_name"  value="<%=rs.getString(4)%>" disabled>
                        </td>
                        </tr>
                    </table>
                        <table>
                        <tr>
                        <td> 
                        <h3>Date of Birth</h3>
                        <input class="input-style" type="date" name="DOB" value="<%=rs.getString(5)%>" disabled> 
                        </td>
                        <td> 
                        <h3>Gender</h3>
                        <input class="input-style" type="text" name="gender"  value="<%=rs.getString(6)%>" disabled>
                        </td>
                        </tr>
                        <tr>
                        <td> 
                        <h3>Address</h3>
                        <input class="input-style" type="text" name="address"  value="<%=rs.getString(7)%>" disabled >
                        </td>                      
                        <td> 
                        <h3>City</h3>
                        <input class="input-style" type="text" name="city"  value="<%=rs.getString(8)%>" disabled>
                        </td>
                        </tr>
                        <tr>
                        <td> 
                        <h3>State</h3>
                        <input class="input-style" type="text" name="country"  value="<%=rs.getString(9)%>" disabled>
                        </td>
                        <td> 
                        <h3>Email ID</h3>
                        <input class="input-style" type="text" name="email"  value="<%=rs.getString(11)%>" disabled>
                        </td>
                        </tr>
                        <tr>
                        <td> 
                        <h3>Personal Email</h3>
                        <input class="input-style" type="text" name="personal_email"  value="<%=rs.getString(12)%>" disabled >
                        </td>
                        <td> 
                        <h3>Mobile Number</h3>
                        <input class="input-style" type="text" name="phone_number"  value="<%=rs.getString(13)%>" disabled>
                        </td>
                        </tr>
                       </table>
                        <div class="Heading">   
                        <h3>Bank Details</h3>
                        
                    </div>
                        
                        <table>
                            <tr>
                                <td>
                        <h3>Bank Name</h3>
                        <input class="input-style" type="text" name="bank_name"  value="<%=rs.getString(14)%>"disabled>
                        </td>
                        <td>
                        <h3>Bank Account Number</h3>
                        <input class="input-style" type="text" name="bank_account_number"  value="<%=rs.getString(15)%>" disabled>
                        </td>
                        </tr>
                        <tr>
                            <td>
                        <h3>Bank Account Type</h3>
                        <input class="input-style" type="text" name="bank_account_type"  value="<%=rs.getString(16)%>" disabled>
                        </td>
                        <td>
                        <h3>IFSC Code</h3>
                        <input class="input-style" type="text" name="IFSC_code"  value="<%=rs.getString(17)%>" disabled>
                        </td>
                        
                        </tr>
                        </table>
                        <div class="Heading">   
                        <h3>Other Details</h3>
                        
                    </div>
                        <table>
                            <tr>
                            <td>
                        <h3>PAN Card Number</h3>
                        <input class="input-style" type="text" name="PAN_card"  value="<%=rs.getString(18)%>" disabled>
                        </td>
                        <td><h3>Joining Date</h3>
                            <input class="input-style" type="date" name="joining_date" value="<%=rs.getString(20)%>" disabled>
                        </td>
                       </tr>
                       <tr>
                           <td>
                        <h3>Employee Type</h3>
                        <input class="input-style" type="text" name="emp_type"  value="<%=rs.getString(21)%>" disabled>
                        </td>
                        <td>
                        <h3>Designation</h3>
                        <input class="input-style" type="text" name="designation"  value="<%=rs.getString(22)%>" disabled>
                        </td>
                        </tr>
                        <tr>
                        <td>
                        <h3>Department Name</h3>
                        <input class="input-style" type="text" name="department"  value="<%=rs.getString(23)%>" disabled>
                        </td>
                        <td>
                        <h3>Line Manager Name</h3>
                        <input class="input-style" type="text" name="line_manager"  value="<%=rs.getString(24)%>" disabled>
                        </td>
                          </tr>  
                            <tr>
                                <td>
                        <h3>Qualification</h3>
                        <input class="input-style" type="text" name="qualification"  value="<%=rs.getString(25)%>" disabled>
                        </td>
                        <td>
                        <h3>Experience</h3>
                        <input class="input-style" type="text" name="experience"  value="<%=rs.getString(26)%>" disabled>
                        </td>
                        </tr>
                        <tr>
                        <td>
                        <h3>Status</h3>
                        <select class="input-style" name="status" disabled>
                            <option value="Working"><%=rs.getString(26)%></option>
                        </select>
                        </td>
                        
                        <td>
                        <h3>Role</h3>
                        <select class="input-style" name="role" disabled>
                            <option value="Admin"><%=rs.getString(26)%></option>
                            
                        </select>
                        </tr>
                        </td>
                        
                        </table>
                       
                    <button class="button">Go Back <i class='far fa-arrow-alt-circle-right'></i></button>
                </form>
            </div></div>
            <%
                    }
                } catch (Exception e) {
                    out.println(e);
                }
            %>
    </body>
    <br><br><br>
</body>
</html>