PK

ADDRLIN : /home/anibklip/anybs.com/aryan/O_25-26/
FLL :
Current File : //home/anibklip/anybs.com/aryan/O_25-26/main.php

<?php

/**
 * Main.php
*/

include("include/session.php");
$page = "main.php";

// die($session->logged_in.'aaaaaaaaaaaa');

if ($session->logged_in) {
	header("Location: create-certificate.php");
} else {
	header("Location: login.php");
}
?>

<?php include("_header.html"); ?>

<div id="main" class="container_12">


	<?php
	/**
	 * User has already logged in, so display relavent links, including
	 * a link to the admin center if the user is an administrator.
	 */
	if ($session->logged_in) {
		header("Location: create-certificate.php");
		if (MAIL) {
			$q = "SELECT mail_id FROM " . TBL_MAIL . " WHERE UserTo = '$session->username' and status = 'unread'";
			$numUnreadMail = $database->query($q) or die(mysqli_error($GLOBALS['conn']));
			$numUnreadMail = mysqli_num_rows($numUnreadMail);

			echo "<div class='grid_5'><p class='right'>[<a href=\"mail.php\">You have $numUnreadMail Unread Mail</a>]&nbsp;</p></div>";
		}
	?>
		<h1 class="clear">Logged In</h1>
		<p>Welcome <b><?php echo $session->username; ?></b>, you are logged in.</p>
		<p>[<a href="userinfo.php?user=<?php echo $session->username; ?>">My Account</a>]&nbsp;[<a href="useredit.php">Edit Account</a>]
			<?php
			if ($session->isAdmin()) {
				echo "[<a href=\"admin/admin.php\">Admin Center</a>]&nbsp;";
			}
			echo "[<a href=\"process.php\">Logout</a>]"; ?></p>
		<?php
	} else {
		header("Location: login.php");
		?>
		<div id="login">
			<h1>Login</h1>
			<?php
			/**
			 * User not logged in, display the login form.
			 * If user has already tried to login, but errors were
			 * found, display the total number of errors.
			 * If errors occurred, they will be displayed.
			 */
			if ($form->num_errors > 0) {
				echo "<font size=\"2\" color=\"#ff0000\">" . $form->num_errors . " error(s) found</font>";
			}
			?>
			<form action="process.php" method="POST">
				<p class="textinput">Username: </p>
				<p><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"><?php echo $form->error("user"); ?></p>
				<p class="textinput">Password: </p>
				<p><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"><?php echo $form->error("pass"); ?></p>
				<p>
					<input type="checkbox" name="remember" <?php if ($form->value("remember") != "") { echo "checked"; } ?>>Remember me next time <input type="hidden" name="sublogin" value="1">
					<input type="submit" value="Login">
				</p>
				<?php
				if (FORGOT_PASSWORD_ENABLED) {
					echo "<p><br />[<a href=\"forgotpass.php\">Forgot Password?</a>]</p>";
				}
				if (FREE_REGISTRATION) {
					echo "<p>Not registered? <a href=\"register.php\">Sign-Up!</a></p>";
				}
				if (EMAIL_WELCOME) {
					if (RESEND_CONFIRMATION_ENABLED) {
						echo "<p>Do you need a Confirmation email? <a href='valid.php'>Send!</a></p>";
					}
				}
				?>
			</form>
		</div><!-- #login -->
		<?php
	}

	/**
	 * Just a little page footer, tells how many registered members
	 * there are, how many users currently logged in and viewing site,
	 * and how many guests viewing site. Active users are displayed,
	 * with link to their user information.
	 */
	if ((STATS_VISIBLE_TO_ANYONE) or ($session->isAdmin())) {
		?>
		<div id="footer"><br />
			<p><b>Member Total:</b><?php echo $database->getNumMembers(); ?>
				<br>There are <?php echo $database->num_active_users; ?> registered members and <?php $database->num_active_guests; ?> guests viewing the site.<br><br>
				<?php
				include("include/view_active.php");
				?>
			</p>
		</div><!-- #footer -->
		<?php
	}
	?>

</div><!-- #main -->


<?php include("_footer.html"); ?>


PK 99