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

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="css/signup-style.css">
        <link rel="stylesheet" href="css/alerts.css"> 
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
        <title>Login</title>
    </head>
    <body>
        <h2><a class="back" href="HomeForAll.jsp"><i class='fas fa-arrow-circle-left'> Back</i></a></h2>
        <div class="modal-content animate">
            <%
                String msg = request.getParameter("msg");
                if ("notexist".equals(msg)) {
            %>
            <div class="alert"> 
                <button class="closebtn"><i class="fa fa-close"></i></button>
                <strong>Incorrect</strong> Username or Password
            </div>
            <% } %>
            <%
                if ("invalid".equals(msg)) {
            %> 
            <div class="alert">
                <button class="closebtn"><i class="fa fa-close"></i></button>
                <strong>Something Went Wrong! Try Again !</strong>
            </div>
            <% } %>
            <%
                if ("invalidEmail".equals(msg)) {
            %>
            <div class="alert">
                <button class="closebtn"><i class="fa fa-close"></i></button>
                <strong>Invalid Email ID! Please Try Again !</strong>
            </div>
            <% }%>
            <%
                if ("invalidPassword".equals(msg)) {
            %>
            <div class="alert">
                <button class="closebtn"><i class="fa fa-close"></i></button>
                <strong>Invalid Password! Please Try Again!</strong>
            </div>
            <% }%>
        </div>
        <script>
            var close = document.getElementsByClassName("closebtn");
            var i;

            for (i = 0; i < close.length; i++) {
                close[i].onclick = function () {
                    var div = this.parentElement;
                    div.style.opacity = "0";
                    setTimeout(function () {
                        div.style.display = "none";
                    }, 600);
                }
            }
        </script>
        <div class="container">
            <div class='signup'>
                <form action="loginAction.jsp" method="post">
                    <input type="email" placeholder="Enter Email" name="email"  required>
                    <input type="password" placeholder="Enter Password ex:Pass@123" name="password" required>
                    <input style="background-color: navy" type="submit" value="Login">
                </form> 
                <h3><a href="forgotPassword.jsp">Forgot Password?</a></h3>
            </div>
        </div>

    </body>
</html>