| Current Path : /var/www/html/mmishra/mm/ada/ |
| Current File : /var/www/html/mmishra/mm/ada/index.php |
<?php
require("html.php");
require("functions.php");
dbConnect();
$user = "";
$sid = "";
$role = "";
$use_cookie = 0;
session_start();
if (isset($_SESSION['user'])) $user = $_SESSION['user'];
else if (isset($_SESSION['auto_login'])) {
$cred = explode(" ", $_SESSION['auto_login']);
$txtID = $cred[0];
$txtPWD = base64_decode($cred[1]);
$use_cookie = 1;
}
if (isset($_REQUEST['logout'])) {
mysql_query("delete from auth where sid='$sid'");
session_unset();
session_destroy();
$user = "";
$sid = "";
$role = "";
session_register("user", "sid", "role");
if ($mode == "forget") setcookie("auto_login", "", time()-3600);
header("Location: index.php");
} else if ($use_cookie == 1 || isset($_POST['login'])) {
$txtID = $_POST["txtID"];
$txtPWD = $_POST["txtPWD"];
$chkRem = $_POST["chkRem"];
$role = authenticate($txtID, $txtPWD);
$sid = uniq_sid($txtID, $txtPWD);
if ($role == "admin" || $role == "user"){
$user = $txtID;
session_register("user", "sid", "role");
if ($use_cookie == 0){
if ($chkRem) setcookie("auto_login", $txtID . " " . base64_encode($txtPWD), time()+31536000);
else setcookie("auto_login", "", time()-3600);
if (!$target) $target = 'cpanel';
header("Location: inner.php?conf=$target");
exit;
}
} else { // login failed
if ($use_cookie == 0) {
header("Location: inner.php?conf=login&target=$target&msg=failed");
exit;
} else {
// dont give an error to the user if we were trying login from a cookie
// just delete the cookie.
setcookie("auto_login", "", time()-3600);
}
}
}
mysql_query("update notices set status='expired' where expiry<now()");
mysql_query("update tenders set status='expired' where expiry<now()");
noticefeed();
tenderfeed();
logAccess($user, $HTTP_REFERER, $REQUEST_URI);
?>
<html>
<head>
<title><?php echo setup('title');?></title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<meta name="keywords" content="ADA,IIITA,Allahabad,MMishra,Recruitment,Information,Scheme,Property,Uttar Pradesh,INDIA">
<link rel="SHORTCUT ICON" href="images/logo.ico">
<script language="javascript" src="code.js"></script>
<script type="text/javascript" src="rss/ajax.js"></script>
<script type="text/javascript" src="rss/rss.js"></script>
<?php
require("stylesheet.php");
?>
</head>
<body>
<form name="frmStatic" action="inner.php?conf=<?=$conf?>" method="post" enctype="multipart/form-data">
<!--
onload="javascript: window.open('popup.php', 'Cheers Up...', 'left=220,top=50,width=797,height=490,scrollbars=no')">
-->
<div id="content">
<div id="greetings">
<?php echo "<marquee scrolldelay=200>" . setup('greeting') . "</marquee>"; ?>
</div>
<div id="showdate">
<?php showdate(); ?>
</div>
<div id="banner">
<?php include "banner.inc"; ?>
</div>
<div id="search_site">
<?php search_site(); ?>
</div>
<div id="gallery">
<?php photo_gallery(); ?>
</div>
<div id="notice">
<b>Notifications</b>
<marquee direction="up" scrollamount="1" scrolldelay="15" style="margin-top:10" onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 1, 0);">
<?php
if (!file_exists("notices.inc")) touch ("notices.inc");
include "notices.inc";
?>
</marquee>
</div>
<div id="intro">
<?
if (!file_exists("site_intro.inc")) touch ("site_into.inc");
include "site_intro.inc";
?>
</div>
<div id="newsfeed">
<b>News</b>
<div id="rssBox">
<!--RSS News Feed is placed here-->
</div>
<font color=orange>Visitors:
<?
hitcounter();
?>
</font>
</div>
<div id="left">
<a href='/'>Home</a> | <a href='inner.php?conf=contact'>Contact</a><br>
<div id="menu">
<? include "menus.inc"; ?>
</div>
<div id="fixed_links">
<? include "fixed_links.inc"; ?>
</div>
</div>
<div id="footer">
<? footer($user, $role, $conf); ?>
</div>
</div>
</form>
</body>
</html>