<%@page import="com.billpalmatary.provider.util.Login,
                com.billpalmatary.provider.user.User" %>

<%
boolean invalidLogin = false;

if (request.getParameter("user_name") != null) {
    User userInfo = Login.isValid(request.getParameter("user_name"), request.getParameter("user_password"));
    if (userInfo != null) {
        session.setAttribute("user", userInfo);
        if (userInfo.getSecurityLevel().equals("admin")) {
            response.sendRedirect("admin_home.jsp");
            return;
        } else if (userInfo.getSecurityLevel().equals("user")) {
            response.sendRedirect("doctor_home.jsp");
            return;
        }
    } else {
        invalidLogin = true;
    }
}
%>
<html>
<head>
<title>Cosmetic Dentistry Information - Cosmetic Dentist </title>
<meta name="keywords" content="cosmetic dentistry, tooth bleaching, tooth bleeching, cost of cosmetic dentistry, laser dentistry, family dentistry, dental tooth contouring, tooth reshaping, dental implant, dental implant procedure, dental bonding procedure, dental bridges, cost of dental bridges, restorative dentistry, tooth crown, cost of tooth crown procedure, porcelain veneers, dental veneers, laser teeth whitening, tooth whitening, teeth bleaching, tooth bleaching, dentures, dental filings, tooth crowns, tooth root canal, gum surgery">
<meta name="description" content="Offers cosmetic dentistry information"><!-- cosmetic dentistry information, cosmetic dentistry doctor, cosmetic dentistry dentist, cosmetic dentist -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="robots" content="index,follow">
<link rel="stylesheet" href="cosmetic_dentistry.css" type="text/css">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="2">
<div align="center"> <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <form name="login" action="doctor_login.jsp" method=POST>
  <table width="400" border="0" cellspacing="0" cellpadding="2" bgcolor="#9999CC">
    <tr>
      <td>
        <table width="400" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
          <tr> 
            <td align="center">&nbsp;</td>
          </tr>
          <tr> 
              <td align="center"><img src="images/cosmetic_dentistry_logo.jpg" width="266" height="38"></td>
          </tr>
<%
if (invalidLogin) {
%>
          <tr>
            Invalid Login
          </tr>
<%
}
%>
          <tr> 
            <td align="center"> 
              <table border="0" cellspacing="0" cellpadding="5">
                <tr> 
                  <td>Login Name: </td>
                  <td> 
                    <input type="text" name="user_name">
                  </td>
                  <td>&nbsp;</td>
                </tr>
                <tr> 
                  <td>Password:</td>
                  <td> 
                    <input type="password" name="user_password">
                  </td>
                  <td> 
                    <input type="submit" name="Submit" value="Submit">
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr> 
            <td align="center">&nbsp;</td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  </form>
</div>
</body>
</html>

