<?php session_start();
if(isset($_SESSION['user_name']) && isset($_SESSION['photo']))
{

}


 ?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en-US" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<link media="screen, projection" type="text/css" href="css/style.css" rel="stylesheet">
<link media="screen, projection" type="text/css" href="css/default.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">

$(document).ready(function(){
$("#shadow").fadeOut();

	$("#cancel_hide").click(function(){
        $("#").fadeOut("normal");
        $("#shadow").fadeOut();
   });
   $("#login").click(function(){
    
        username=$("#user_name").val();
        password=$("#password").val();
         $.ajax({
            type: "POST",
            url: "login.php",
            data: "name="+username+"&pwd="+password,
            success: function(html){
              if(html=='true')
              {
                $("#form").fadeOut("normal");
				$("#shadow").fadeOut();
				location.reload();
              }
              else
              {
                    $("#add_err").html("Wrong username or password");
              }
            },
            beforeSend:function()
			{
                 $("#add_err").html("<img src='images/loader.gif'/>")
            }
        });
         return false;
    });
});
</script>

<title>Welcome!</title>
</head>
<body class="login standard">

	<div id="profile">
			<?php if(isset($_SESSION['user_name'])){
			?>
	<div class="wrapper">

	<div class="header">
	<h1>Lifeguard Archangels Security Corporation</h1>
	</div>
	
	<div class="menu">
	<ul>
	<li><a href="index.php">Main Menu |</a></li>
	<li><a href="view_emp_list.php">Profiles |</a></li>
	<li><a href="calendar_view.php">Schedules |</a></li>
	<li><a href="view_exp_list.php">Records </a></li>
	<!-- hide actions for user access level-->
				<?php if($_SESSION['user_type'] != 'User'){ ?>
	<!-- hide actions for user access level--><li><a href="history.php">| History Log</a></li>
	<?php } ?>
	
	
	<li class="last"><img src="images/uploads/<?php echo $_SESSION['photo'];?>" width="25" height="25" style="padding:2px;" />
	<?php echo $_SESSION['user_name']; ?> <a href="logout.php">log out</a></li>
	<ul>
	</div>
	
	
	
	<div class="content1" width="940px">
	<img src="images/lifeguard.png" width="940px" height="470px">
	</div>
	<?php include("footer.php"); ?>
	</div>
	<?php }else {?>

	<div class="header_log">
	<h2>
	Lifeguard Archangels Security Corporation 
	</h2>
	</div>
	
	<div id="form">
	
	<form action="login.php" method="POST">
	
	<p>
		<label>Username:</label>
		<input type="text" id="user_name" name="user_name" placeholder="username"><br/>
	</p>
	
	<p>
		<label>Password:</label>
		<input type="password" id="password" name="password" placeholder="password"><br/>
	</p>
	
	<small>*Enter the details to log in your account</small><br/>
	<div class="err" style="float:left;" id="add_err"></div>
	<input type="submit" class="button" id="login" value="Login" />


	</form>
	</div>
	<div id="police"></div>
	
	<div class="footer">
		<h2>Powered by Cookie Crumbs</h2>
	</div>
	<?php } ?>
	</div>

	<div id="shadow" class="popup"></div>
	
</body>
</html>