<?php
	require_once('source/session.php');
	require_once('source/error.php');
	require_once('source/dbconfig.php');
	require_once('source/function.php');
	require_once('source/restrict_admin.php');
    require_once('ScriptLibrary/incPureUpload.php');

// Pure PHP Upload 2.1.12
$ppu = new pureFileUpload();
$ppu->path = "profile_pic";
$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG";
$ppu->formName = "form1";
$ppu->storeType = "path";
$ppu->sizeLimit = "";
$ppu->nameConflict = "Uniq";
$ppu->nameToLower = false;
$ppu->requireUpload = false;
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "600";
$ppu->progressBar = "showProgress.htm";
$ppu->progressWidth = "300";
$ppu->progressHeight = "100";
$ppu->redirectURL = "";
$ppu->checkVersion("2.1.12");
$ppu->doUpload();

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;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE `tbl_user` SET profile_pic=%s, WHERE registration_no=%s",
					   GetSQLValueString($_POST['profile_pic'], "text"),
                       GetSQLValueString($_POST['resistration_no'], "int"));

  mysql_select_db($database_mycon, $mycon);
  $Result1 = mysql_query($updateSQL, $mycon) or die(mysql_error());

  $updateGoTo = "uppok.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}

$colname_Recordset1 = "-1";
if (isset($_GET['recxX'])) {
  $colname_Recordset1 = $_GET['recxX'];
}
mysql_select_db($database_mycon, $mycon);
$query_Recordset1 = sprintf("SELECT * FROM `DataResult` WHERE sno = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $mycon) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);mysql_select_db($database_mycon, $mycon);
$query_Recordset1 = "SELECT * FROM `DataResult`";
$Recordset1 = mysql_query($query_Recordset1, $mycon) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$colname_Recordset1 = "-1";
if (isset($_GET['recxX'])) {
  $colname_Recordset1 = $_GET['recxX'];
}
mysql_select_db($database_mycon, $mycon);
$query_Recordset1 = sprintf("SELECT * FROM `DataResult` WHERE sno = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $mycon) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
?>
<!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=utf-8" />
<title>Student Result Upload Point</title>
<style type="text/css">
#header {
	background-color: #990099;
	height: 124px;
	width: 100%;
	margin-bottom: 15px;
	color: #990099;
}
#INSIDEE {
	height: 80px;
	width: 100%;
	background-color: #3399FF;
	color: #990099;
	margin: auto;
}
#newlogo {
	float: left;
	height: 124px;
	width: 100%;
	text-align: left;
	background-color: #3399FF;
}
#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;
	color: #03C;
}
#wrapper {
	width: 95%;
	margin-right: auto;
	margin-left: auto;
	height: auto;
	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: 90%;
	text-align: center;
	height: auto;
	font-weight: bold;
	color: #000000;
	margin: auto;
	border: 2px dotted #3399FF;
}
#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;
}
.TopName {
	font-size: 36px;
	color: #FFC;
}
</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' />
<style type="text/css">
<!--
.style13 {font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.style2 {color: #FF0000}
.style3 {	color: #000000;
	font-weight: bold;
}
.style21 {
	font-size: 36px;
	color: #FFFF99;
	font-family: Georgia, "Times New Roman", Times, serif;
	background-color: #F00;
}
.style10 {
	font-size: 36px;
	font-weight: bold;
	color: #FC0;
}
.style11 {
	color: #000000
}
.style23 {
	font-size: 45px;
	color: #FF0000;
}
.style27 {
	color: #003366;
	font-weight: bold;
	font-size: 20px;
	font-family: Georgia, "Times New Roman", Times, serif;
}
.SubjectCSS {	font-size: 12px;
	border: thin none #00F;
}
.style16 {
	font-size: 14px;
	color: #F00;
}
.style161 {
	font-size: 14px;
	color: #FF6633;
}
.style17 {
	font-size: 12;
	color: #003366;
}
.style25 {
	color: #FF0033;
	font-weight: bold;
	border-top-color: #39F;
	border-right-color: #39F;
	border-bottom-color: #39F;
	border-left-color: #39F;
}
#RESULTCHAT {
	color: #333;
	text-align: left;
	font-size: 14px;
	white-space: normal;
	margin: auto;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: none;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #39F;
	border-right-color: #39F;
	border-bottom-color: #39F;
	border-left-color: #39F;
}
.style111 {
	color: #FFFFFF
}
.style112 {	color: #000000
}
.style1611 {	font-size: 14px;
	color: #000000;
}
.style113 {	color: #000066
}
-->
</style>
<script type="text/javascript">
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function KW_getVal(o){ //v1.2
	var retVal="0";if (o.type=="select-one")
	{retVal=(o.selectedIndex==-1)?0:o.options[o.selectedIndex].value;}
	else if (o.length>1){for (var i=0;i<o.length;i++) if (o[i].checked) retVal=o[i].value;
	} else if (o.type=="checkbox") {retVal=(o.checked)?o.value:0;} else {
	retVal=Number(o.value)}return parseFloat(retVal);
}

function KW_calcForm() { //v1.2
	var str="",a=KW_calcForm.arguments; for (var i=3;i<a.length;i++)
	str+=(a[i].indexOf("#")==-1)?a[i]:KW_getVal(MM_findObj(a[i].substring(1)));
	t=Math.round(a[1]*eval(str))/a[1];tS=t.toString();if(a[2]>0){tSp=tS.indexOf(".");
	if(tSp==-1)	tS+=".";tSp=tS.indexOf(".");while(tSp!=(tS.length-1-a[2])){tS+="0";
	tSp=tS.indexOf(".");}} MM_findObj(a[0]).value=tS;
}
</script>
</head>

<body>
<div id="INSIDEE">
  <div id="newlogo">
    <div id="newlogo2">
      <div align="center" class="style10">
        <div align="center" class="TopName"><img src="https://gilfordmemorialschools.com/sch/Rportal/GilfordBadgeLogo.png" alt="Victory School Logo" width="118" height="138" align="middle" /> <span class="TopName"> GILFORD MEMORIAL SCHOOLS, ABA</span><br />
        </div>
        <br />
      </div>
    </div>
  </div>
</div>
<div id="wrapper">
  <div id="wa">
  <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="post">
    <table width="75%" align="center" cellpadding="5">
      <tr valign="baseline">
        <td height="418" colspan="14" align="center" nowrap="nowrap" bgcolor="#F0F0F0"><table width="95%" align="center" cellpadding="3">
          <tr valign="baseline">
            <td width="168" align="center" nowrap="nowrap" bgcolor="#99CCCC" class="style161"><div align="right" class="style17">
              <input name="sno" type="hidden" id="sno" value="<?php echo $row_Recordset1['sno']; ?>" />
              <font size="2" face="Tahoma">ADMISSION NUMBER</font> :</div></td>
            <td width="214" align="left" bgcolor="#99CCCC"><span class="style27"><?php echo $row_Recordset1['idno']; ?></span></td>
            <td colspan="2" rowspan="7" align="center" valign="middle" bgcolor="#99CCCC"><span class="style11"><font face="Tahoma">
            <!--webbot bot="Validation" s-data-type="Number" s-number-separators=",." --></font></span><span class="style2"><img src="<?php echo $row_Recordset1['Photos']; ?>" alt="Pupil's Photo" width="175" height="200" /><br />
            </span></td>
          </tr>
          <tr valign="baseline">
            <td align="center" nowrap="nowrap" bordercolor="#FFFFFF" bgcolor="#99CCCC" class="style161"><div align="right" class="style17"><font size="2" face="Tahoma">NAME OF STUDENT</font></div></td>
            <td align="center" bgcolor="#99CCCC"><div align="left"><span class="style17"><strong><?php echo $row_Recordset1['status']; ?></strong></span></div></td>
          </tr>
          <tr valign="baseline">
            <td align="center" nowrap="nowrap" bordercolor="#FFFFFF" bgcolor="#99CCCC" class="style161">&nbsp;</td>
            <td align="left" bgcolor="#99CCCC">&nbsp;</td>
          </tr>
          <tr valign="baseline">
            <td align="center" nowrap="nowrap" bordercolor="#FFFFFF" bgcolor="#99CCCC" class="style17"><div align="right" class="style17"><font size="2" face="Tahoma">ACADEMIC SESSION:</font></div></td>
            <td align="left" bgcolor="#99CCCC"><div align="left"><span class="style17"><?php echo $row_Recordset1['session']; ?></span></div></td>
          </tr>
          <tr valign="baseline">
            <td height="28" align="center" nowrap="nowrap" bordercolor="#FFFFFF" bgcolor="#99CCCC" class="style17"><div align="right" class="style17"><font size="2" face="Tahoma">CLASS:</font></div></td>
            <td align="left" bgcolor="#99CCCC"><span class="style17"><?php echo $row_Recordset1['level']; ?></span></td>
          </tr>
          <tr valign="baseline">
            <td height="28" align="center" nowrap="nowrap" bordercolor="#FFFFFF" bgcolor="#99CCCC" class="style17"><div align="right" class="style17"><font size="2" face="Tahoma">SEX:</font></div></td>
            <td align="left" bgcolor="#99CCCC"><span class="style17"><?php echo $row_Recordset1['Sex']; ?></span></td>
          </tr>
          <tr valign="baseline">
            <td height="25" colspan="2" align="center" nowrap="nowrap" bordercolor="#FFFFFF" bgcolor="#003366" class="style161"><br />              ENGLISH STUDIES<br />
            <span class="style111"><strong>Exam for:</strong>  <?php echo $row_Recordset1['ExamReg']; ?></span></td>
          </tr>
          <tr valign="baseline">
            <td align="right" valign="middle" nowrap="nowrap" bgcolor="#99CCCC" class="style161"><p class="style111"><span class="style17"><font size="2" face="Tahoma">PLACE OF STUDY :</font></span><br />
            </p></td>
            <td colspan="3" align="left" valign="middle" nowrap="nowrap" bgcolor="#99CCCC"><span class="style111"><span class="style17"><strong><?php echo $row_Recordset1['Campus']; ?></strong></span></span></td>
          </tr>
          <tr valign="baseline">
            <td colspan="2" rowspan="5" align="center" valign="baseline" nowrap="nowrap" bgcolor="#A4A4A4"><input name="EnglishStudiesClassTotal2" type="text" id="EnglishStudiesClassTotal2" value="<?php echo $row_Recordset1['Photo']; ?>" size="15" />
            <span class="style113">
            <input name="Photos" type="file" id="Photos" onchange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','','','','','')" />
            </span></td>
            <td width="195" align="right" bgcolor="#A4A4A4"><span class="style11"><font face="Tahoma" size="2">Class Total Score in this subject: </font></span></td>
            <td width="102" align="left" bgcolor="#A4A4A4"><span class="style11"></span>
              <input name="EnglishStudiesClassTotal" type="text" id="EnglishStudiesClassTotal" value="<?php echo $row_Recordset1['EnglishStudiesClassTotal']; ?>" size="15" /></td>
          </tr>
          <tr valign="baseline">
            <td width="195" align="right" bgcolor="#A4A4A4"><span class="style11"><font face="Tahoma" size="2">Total Number of Students for the subject in this class:</font></span></td>
            <td width="102" align="left" bgcolor="#A4A4A4"><span class="style11"></span>
              <input name="EnglishStudiesNumberTookExam" type="text" id="EnglishStudiesNumberTookExam" value="<?php echo $row_Recordset1['EnglishStudiesNumberTookExam']; ?>" size="15" /></td>
          </tr>
          <tr valign="baseline">
            <td height="28" align="center" nowrap="nowrap" bgcolor="#A4A4A4"><div align="right" class="style11"><font face="Tahoma" size="2">Class Average:</font></div></td>
            <td align="left" bgcolor="#A4A4A4"><input name="EnglishStudiesClassAv" type="text" id="EnglishStudiesClassAv" onmouseover="KW_calcForm('EnglishStudiesClassAv',100,-1,'#EnglishStudiesClassTotal','/','#EnglishStudiesNumberTookExam')" value="<?php echo $row_Recordset1['EnglishStudiesClassAv']; ?>" size="6" /></td>
          </tr>
          <tr valign="baseline">
            <td align="center" nowrap="nowrap" bgcolor="#A4A4A4"><div align="right" class="style11"><font face="Tahoma" size="2">Position in Subject</font>:</div></td>
            <td align="left" bgcolor="#A4A4A4"><input name="EnglishStudiesClassPos" type="text" id="level7" value="<?php echo $row_Recordset1['EnglishStudiesClassPos']; ?>" size="6" /></td>
          </tr>
          <tr valign="baseline">
            <td height="28" colspan="2" align="center" valign="middle" nowrap="nowrap" bgcolor="#A4A4A4"><input name="submit" type="submit" value="UPDATE Your RESULT" /></td>
          </tr>
        </table></td>
      </tr>
    </table>
    </div>
</div>
    <input type="hidden" name="MM_update" value="form1" />
  </form>
  <div align="center" class="style13">
    <div align="center">
      <p>Copyright ©2017-2018 GILFORD MEMORIAL SCHOOLS, ABA ::: All Rights Reserved </p>
      <p><a href="https://dataswiftlimited.com" target="_blank"><img src="https://dataswiftlimited.com/datalogo.jpg" alt="DataSwift Designs" width="123" height="63" border="0" longdesc="https://dataswiftlimited.com" /></a></p>
    </div>
  </div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
