<?
/*
Author		: Yaw
Version		: 1.01
Date		: 9th January 2002
Function	: Login Screen & Welcome page
*/
ini_set('session.gc_maxlifetime', '86400');
session_start();
require("auth.php");
if ($_POST["submit"]=="Login") {
	newsession($_POST["login"],$_POST["password"]);
	if (($Transmarco["accesslevel"] < 1)) {
	//if ($_COOKIE['accesslvl'] < 0) {
		$msg= $msg . "<b>Failed Login</b><br>";
		$submit = "";
		$accesslevel = 0;
	}
}
?>

<? if ($Transmarco["accesslevel"] < 1) {
	//if ($_COOKIE['accesslvl'] < 1) { ?>
<html>
	<head>
		<title>Login Page </title>
		<META NAME="Generator" CONTENT="CX">
		<META NAME="Author" CONTENT="">
		<META NAME="Keywords" CONTENT="">
		<META NAME="Description" CONTENT="">
		<?include($style);?>
	</head>
	<body>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" align="center">
	  <tr>
		<td align="center" valign="middle">
		  <form align="center" method=POST action="">
			<img src="images/logotype.gif" width="400" height="115">
			<table align="center" width="380" cellpadding="5" cellspacing="0" border="0">
			  <tr>
				<td width="123"><b><font color="#660066">Login Name</font></b></td>
				<td width="134">
				  <input type="text" name="login" size="14" maxlength="20" value="">
				</td>
				<td width="93">&nbsp;</td>
			  </tr>
			  <tr>
				<td width="123"><b><font color="#660066">Password</font></b></td>
				<td width="134">
				  <input type="password" name="password" size="14" maxlength="20" value="">
				</td>
				<td width="93">
				  <input type="submit" name="submit" value="Login" class="input">
				</td>
			  </tr>
			</table>
			<p>If you are facing difficulties with this application, 
			please contact Ong at 016 328 9797. Thanks</p>
		  </form>
		</td>
	  </tr>
	  <tr>
		<td align="center"><? echo "<font size=+2>$msg</font>" ?></td>
	  </tr>
	</table>
	</body>
</html>
<? } else { ?>
<html>
	<head>
		<title><? echo $project ?> Project</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<?include($style);?>
	</head>
<frameset rows="80,80%,40" border="0" framespacing="0">
  <frame src=<?echo $header?> scrolling="NO" frameborder="NO" noresize marginwidth="0" marginheight="0" name="topFrame">
  <frame src=<?echo $welcome?> frameborder="NO" noresize name="mainFrame" marginwidth="0" marginheight="0">
  <frame src=<?echo $footer?> frameborder="NO" noresize name="footer" marginwidth="0" marginheight="0" scrolling="NO">
	</frameset><noframes></noframes>
</html>
<? } ?>
