<?php
if($_SESSION['member_name']==''){
?>
<script>
function validlogin(){
	if(document.loginform.uname.value==''){
		alert('Please enter User name');
		document.loginform.uname.focus();
		return false;
	}
	if(document.loginform.pass.value==''){
		alert('Please enter Password');
		document.loginform.pass.focus();
		return false;
	}
}
</script>
<table width="98%" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><form name="loginform" id="loginform" method="post" action="login" onsubmit="return validlogin()">
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
        <tr>
          <td width="5%" align="right"><img src="images/member-icon.png" width="19" height="23"></td>
          <td width="15%" align="left" style="padding-left:5px;">Member Login</td>
          <td width="35%" align="left" style="padding-left:5px;"><input name="uname" type="text" class="form-control" id="uname" placeholder="User Name"></td>
          <td width="35%" align="left" style="padding-left:5px;"><input name="pass" type="password" class="form-control" id="pass" placeholder="Password"></td>
          <td width="10%" align="left" style="padding-left:5px;"><input type="submit" value="Submit" class="btn btn-blue" /></td>
        </tr>
      </table>
    </form></td>
  </tr>
</table>
<?php 
}else{
	?>
		<table align="right">
			<tr>
				<td><h4 ><a href="profile"><?php echo $_SESSION['member_name']?></a> | <a href="logout">Logout</a></h4></td>
			</tr>
		</table>
	<?php
}
?>