<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>simple e-document</title>
<style type="text/css">
<!--
.style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
-->
</style>
</head>
<body class="style7">
<p>
<?php
$security_filename_check1 = 'sql.php';
if (file_exists($security_filename_check1)) {
echo "<font color='#FF0000'><br><b>Warning:</b>The file <b>sql.php</b> has not been deleted from your server. If you have finish installation <b>delete it</b> from your server in order to avoid system hack!<br><br></font>";
}
if(!isset($_COOKIE['access']))$_COOKIE['access']='';
if(!isset($_POST['op'])) $_POST['op']='';
if(!isset($_POST['username'])) $_POST['username']='';
if(!isset($_POST['password'])) $_POST['password']='';
echo '<table width="100%" border="0">
<tr>
<td><img src="edoclogo.gif" alt="e-document for php" width="283" height="72" /></td>
</tr>
</table><hr>';
if (($_COOKIE['access'] == "1") || ($_COOKIE['access'] == "2") || ($_COOKIE['access'] == "3")) {
$username = $_COOKIE['username'];
echo '<br>Welcome <b>'.$username.'</b><br>';
if ($_COOKIE['access'] == "2"){
echo 'You are Administrator!<br><br>';
}
if ($_COOKIE['access'] == "3"){
echo 'You are Super Administrator!<br><br>';
}
echo 'Where would you like to go?<br><br>
<a href="main_in.php"><b>Incoming Documents Main Page</b></a><br><br>
<a href="main_out.php"><b>Outgoing Documents Main Page</b></a><br>';
if ($_COOKIE['access'] == "2"){
echo '<br><a href="admin.php"><b>Administration Page</b></a><br>';
}
if ($_COOKIE['access'] == "3"){
echo '<br><a href="admin.php"><b>Administration Page</b></a><br>';
}
echo '<form id="form1" name="form1" method="post" action="logout.php">
<input type="hidden" name="op" value="logout"/>
<input type="hidden" name="username" value="'.$username.'"/>
<p align="left"><input type="submit" name="Submit" value="Logout" /></p>
</form>';
} else {
include("settings.php");
$dbc = mysql_connect($databasehost, $databaseuname, $databasepass, $databasename);
$dbcs = mysql_select_db($databasename,$dbc);
$op = $_POST['op'];
$username= stripslashes($_POST['username']);
$password= stripslashes($_POST['password']);
$r_password = md5($password);
function show_loging(){
echo '<br><b>Login Page:</b><br><form id="form1" name="form1" method="post" action="login.php">
<p align="center">Username<br />
<input type="text" name="username" />
</p>
<p align="center">Password<br />
<input type="password" name="password" />
</p>
<input type="hidden" name="op" value="login"/>
<p align="center"><input type="submit" name="Submit" value="Login" /></p>
</form>';
}
switch($op) {
default:
show_loging();
break;
}
}
include "footer.php";
?>