<?php 
session_start();
?>
<?php require_once('Connections/mycon.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['idno'])) {
  $loginUsername=$_POST['idno'];
  $password=$_POST['pinno'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "recheckcontPri.php";
  $MM_redirectLoginFailed = "failcard.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_mycon, $mycon);
  
  $LoginRS__query=sprintf("SELECT idno, pinno FROM checkers WHERE idno=%s AND pinno=%s",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $mycon) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
	if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
 
session_start();
?>
<!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>
<script language="JavaScript" type="text/javascript">
var t = setTimeout("document.form1.submit();",0); //2 seconds measured in miliseconds
</script>
<meta http-equiv="Refresh" content="3" />
</he><meta http-equiv="refresh" content="2" />
ad>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to student result portal</title>
<style type="text/css">
#header {
	background-color: #FC0000;
	height: 124px;
	width: 100%;
	margin-bottom: 15px;
}
#INSIDEE {
	height: 80px;
	width: 1000px;
	margin-right: auto;
	margin-left: auto;
}
#newlogo {
	float: left;
	height: 124px;
	width: 580px;
	text-align: left;
}
#name {
	width: 100px;
	float: left;
}
#menu {
	background-color: #EA9282;
	height: 30px;
	width: 900px;
	margin-right: auto;
	margin-left: auto;
	margin-bottom: 40px;
}
#marq {
	height: 40px;
	width: 900px;
	margin-right: auto;
	margin-left: auto;
	margin-bottom: 8px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
}
#INNNNN {
	height: 30px;
	width: 900px;
	margin-right: auto;
	margin-left: auto;
}
body {
	background-color: #F0F0F0;
}
#wrapper {
	width: 900px;
	margin-right: auto;
	margin-left: auto;
	height: 380px;
	margin-bottom: 10px;
}
#L {
	float: left;
	height: 150px;
	width: 300px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
}
#M {
	height: 150px;
	width: 290px;
	float: left;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
	text-align: center;
}
#R {
	float: right;
	height: 150px;
	width: 300px;
	text-align: center;
}
#logo {
}
#subfooter {
	width: 900px;
	margin-right: auto;
	margin-left: auto;
	height: 150px;
	clear: both;
	border-top-width: 10px;
	border-top-style: ridge;
	border-right-width: thin;
	border-bottom-width: thin;
	border-left-width: thin;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
}
#fotter {
	width: 900px;
	margin-right: auto;
	margin-left: auto;
	background-color: #6CF;
	text-align: center;
}
#logo {
	width: 90px;
	margin-left: 200px;
	float: left;
}
#wa {
	width: 900px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
	text-align: center;
	height: 380px;
	margin-right: auto;
	margin-left: auto;
}
#wb {
	float: right;
	width: 390px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
	height: 380px;
}
#wrapper #wb table {
	font-size: 12px;
}
#UP {
	height: 198px;
	width: 390px;
	border-bottom-width: 1px;
	border-bottom-style: dashed;
	border-top-width: 1px;
	border-right-width: 1px;
	border-left-width: 1px;
	border-top-style: dashed;
	border-right-style: dashed;
	border-left-style: dashed;
	text-decoration: none;
}
#dowm {
	height: 380px;
	width: 390px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: dotted;
	border-right-style: dotted;
	border-bottom-style: dotted;
	border-left-style: dotted;
}
#newname {
	float: left;
	height: 80px;
	width: 370px;
}
#CONTACTT {
	float: right;
	height: 128px;
	width: 400px;
	text-align: center;
}
</style>
<link href='menus/138/menu138id29_style.css' rel='stylesheet' type='text/css' />
<link href='menus/138/menu138id35_style.css' rel='stylesheet' type='text/css' />
</head>

<body>
<div id="header">
  <div id="INSIDEE">
    <div id="newlogo"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<img src="EP.png" width="498" height="124" /></div>
    <br />
    &nbsp;<br />
  </div>
</div>
<div id="wrapper">
  <div id="wa">
    <p><br />
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br />
    </p>
    <p style="font-family: Tahoma, Geneva, sans-serif; font-weight: bold; font-size: 14px;"> <br />
      &nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #F00; font-family: Tahoma, Geneva, sans-serif;">&nbsp;&nbsp;&nbsp;<br />
    &nbsp;&nbsp;&nbsp;Wait, result loading......</span></p>
    <form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
      <label for="idno"></label>
      <input name="idno" type="hidden" id="idno" value="<?php echo $_SESSION['idno']; ?>" />
      <label for="pinno"></label>
      <input name="pinno" type="hidden" id="pinno" value="<?php echo $_SESSION['pinno']; ?>" />
      <input name="button" type="hidden" id="button" value="Submit" />
    </form>
    <p>&nbsp; </p>
    <form id="form2" name="form2" method="post" action="">
      <label for="semester"></label>
      <input name="semester" type="hidden" id="semester" value="<?php echo $_SESSION['semester']; ?>" />
      <label for="session"></label>
      <input name="session" type="hidden" id="session" value="<?php echo $_SESSION['session']; ?>" />
    </form>
    <p>&nbsp;</p>
<p>
      <label for="IDNO"></label>
</p>
    
<p>&nbsp;</p>
    <p style="font-size: 14px"></p>
    <p><br />
      <br />
    </p>
<p style="font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif">&nbsp;</p>
  </div>
</div>
<div id="fotter">
  <p>Copyright © 2017 | <a href="http://dataswiftlimited.com" target="_blank">Powered by DataSwift</a> </p>
</div>
</body>
</html>