You are on page 1of 3

<?

Php
session_start();
$currentusername = $_SESSION['username'];
$currenttype = $_SESSION['globalusertype'];
$currentunit = $_SESSION['globaluserunit'];
?>
<head>
<title>Philamlife Sales Management System</title>
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="javascript/calendar_class.js"></script>
<script language="javascript" src="javascript/calendar_new.js"></script>
<script language="javascript" src="javascript/jquery-1.2.6.js"></script>
</head>

<body>
<div id="logo">
<?php include 'logo.php'; ?>
</div>
<?php if(isset($currentusername)){}else{$currentusername="mysyagency";};

include 'library/thesisfunctions.php';
?>

<script type="text/javascript" src="javascript/ajaxtooltip.js"></script>
<script type="text/javascript" src="javascript/jquery.confirm-1.1.js"></script>
<script type='text/javascript' src='javascript/impromptu.js'></script>

<div id="header">
<div id="nav" class="line">
<ul>
<?Php
if($currentpage=="mainpage"){
echo"<li class='currentpage'><a href='mainpage.php'>Main Page</a></li>";
}else{
echo"<li><a href='mainpage.php'>Main Page</a></li>";
}
if($currentpage=="prospects"){
echo"<li class='currentpage'><a href='viewprospects.php'>Prospects</a></li>";
}else{
echo"<li><a href='viewprospects.php'>Prospects</a></li>";
}
if($currentpage=="clients"){
echo"<li class='currentpage'><a href='viewclients.php'>Clients</a></li>";
}else{
echo"<li><a href='viewclients.php'>Clients</a></li>";
}
if($currentpage=="agents"){
echo"<li class='currentpage'><a href='viewagents.php'>Agents</a></li>";
}else{
echo"<li><a href='viewagents.php'>Agents</a></li>";
}
if($currenttype=='Agency Manager'){
if($currentpage=="addagent"){
echo"<li class='currentpage'><a href='addagent.php'>Add Agent</a></li>";
}else{
echo"<li><a href='addagent.php'>Add Agent</a></li>";
}
if($currentpage=="approvalcenter"){
echo"<li class='currentpage'><a href='viewsubmittedapps.php'>Approval Center</a></li>";
}else{
echo"<li><a href='viewsubmittedapps.php'>Approval Center</a></li>";
}
}
if($currentpage=="public"){
echo"<li class='currentpage'><a href='public.php?user=$currentusername'>Public Profile</a></li>";
}else{
echo"<li><a href='public.php?user=$currentusername'>Public Profile</a></li>";
}
if(!session_is_registered(login_username)){
if($currentpage=="login"){
echo"<li class='currentpage'><a href='login.php'>Log In</a></li>";
}else{
echo"<li><a href='login.php'>Log In</a></li>";
}
}else{
echo"<li><a href='logout.php'>Log Out</a></li>";
}
?>
</ul>
</div>
</div>
<div id="page">

<div id="maincontent">

<div id="mainnoborder">
<h2 class="globe">Welcome to Your Sy Agency</h2>
<div class="floatright"><img src="images/philamlife_logo.png"></div>
<p>Greetings and welcome to Your Sy Agency! We have worked hard for this and for you to be able to
maximize your earning potential. Go on and start closing those sales today! :)</p>
<p>My Sy Agency aims to empower people and optimize your earning potential by providing you the
tools and guidelines to achieve your dreams. You can do it and with our help, it will make achieving
your dreams so much easier. :)</p>

</div>
</div>
<div id="rightcontent">
<br />
<?php
//login code. Checks registered user.

if(!session_is_registered(login_username)){
echo "<div id='login'>
<h2 class='arrow'>Log In</h2>
<form action='checklogin.php' method='post'>
Username: <input type='text' name='login_username' /><br />
Password: <input type='password' name='login_password' /><br />
<div class='hr'></div>
<div class='forgotpass'><a href='resetpass.php'>Forgot Password?</a></div>
<input type='submit' value='Log In' />
</form>
</div>";
}else{ ?>
<div id="mainrightimg">
<h2 class="ideabox">Logged In</h2>
<?php
//AVATAR
include 'library/dbconfig.php';
include 'library/dbopen.php';

$query = "SELECT * FROM tblusers WHERE user_username = '$currentusername' ";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$avatarurl = $row['user_avatar'];
$firstname = $row['user_firstname'];
$lastname = $row['user_lastname'];
echo "<div class='floatright'><img src='".$avatarurl."'></div>";
echo "Hi $firstname :)";
echo "<ul>";
echo "<li><a href='mainpage.php');'>Your Account</a></li>";
echo "<li><a href='viewprospects.php'>Your Prospects</a></li>";
echo "<li><a href='viewclients.php'>Your Clients</a></li>";
echo "<li><a href='public.php?user=$currentusername'>Public Profile</a></li>";
echo "</ul>";
}
include 'library/dbclose.php';
?>
</div>
<?Php } ?>

</div>
<?php include 'footer.php'; ?>