Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/iws8/html/ilight/
Upload File :
Current File : /var/www/html/mmishra/iws8/html/ilight/printit.php

<?php
include "functions.inc";
dbConnect();
$systemip = $_SERVER["REMOTE_ADDR"];

$pg = $_REQUEST["pg"];
if (!$pg) $pg = 'home';


//initialize session variables and session
session_start();

//check session and session variables
if (isset($_SESSION['user'])) {        
        $sessionid = $_SESSION['sessionid'];
        $user = $_SESSION['user'];
        $mybp = $_SESSION['mybp'];

	//check for singout signal
} else if (isset($_POST["login"])) { //authenticate sign in
        $uid = $_POST["txtID"];
        $pwd = $_POST["txtPWD"];

	if (ldapAuth($uid, $pwd)) {
                $sessionid = base64_encode($uid.'-'.$pwd);
                $_SESSION["user"] = "$uid";
                $_SESSION["sessionid"] = "$sessionid";
		if ($uid == 'grsingh' || $uid == 'mmishra') 
			$_SESSION["mybp"] = TRUE;
		else 
			$_SESSION["mybp"] = FALSE;
                //session information
		mysql_query("insert into el_session(user,sessionid,datelogin,remoteip)
		values('$uid','$sessionid',now(),'$remoteip')");
                
		header("Location: index.php?pg=home");
        }
}

//check for singout signal
if ($_GET["logout"] == 1) {
        //clear session information
        mysql_query("update el_session set datelogout=now() where sessionid='$sessionid'");

        //abondon session
        session_unset();
        session_destroy();

        //reset session variables
        $HTTP_SESSION_VARS['user'] = "";
        $HTTP_SESSION_VARS['sessionid'] = "";
        $HTTP_SESSION_VARS['mybp'] = "";

        $user = "";
	$sessionid = "";
	$mybp = "";

        //redirect to home page
        header("Location: index.php?pg=home");
}

if (!$mybp == TRUE) $pg = 'home';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>iLight@IIITA</title>
<style type="text/css">
body {
	font-size: 10pt;
	font-weight: normal;
	font-family: verdana;
}
h1 {
	font-size: 16pt;
	font-weight: bold;
}
h2 {
	font-size: 14pt;
	font-weight: bold;
}
h3 {
	font-size: 13pt;
	font-weight: bold;
}
th {
	text-align: center;
	font-size: 10pt;
	font-weight: bold;
	font-family: verdana;
}

/*@import "layout.css";*/
</style>
</head>
<body><center>
<table>
<tr><td><img src='images/logo4.jpg' width='80' height='80'></td>
<th>			
<h1>Indian Institute of Information Technology Allahabad</h1>
<b>Devghat, Jhalwa, Allahabad-211012 (UP), India</b><br>
</th></tr>
<tr><th colspan='2'><hr><a href='/?pg=<?php echo $pg; ?>'><h3>Electricity Billing System</h3></a></th></tr>
<tr><td colspan='2'>
<form method="post" action="?pg=<?php echo $pg; ?>">
<?php
	include "{$pg}.inc";
?>
</form>
<div align='right'>-- generated by iLight@IIITA (https://ilight.iiita.ac.in)</div>
</td></tr>
</table>
</center></body>
</html>