<?php session_start() ?>

<?php

    function do_alert($msg) 

    {

        echo '<script type="text/javascript">alert("' . $msg . '") 

           parent.location="portal.html";



</script>';

       

    }

?>



<?



$dte= date("d/m/y", time());



#Include the connect.php file



include('connect.php');



#Connect to the database

//connection String

$connect = mysql_connect($hostname, $username, $password)

or die('Could not connect: ' . mysql_error());

//Select The database

$bool = mysql_select_db($database, $connect);

if ($bool === False){

print "can't find $database";

}





$dff=2154;



$sql = "SELECT * FROM subjects where serialno='$dff'";

          

         

$data = mysql_query($sql);

  while($row= mysql_fetch_array($data))

{



$class=  $row['class'];

$arm=  $row['type'];

$tyr=  $row['subjects'];

$qwa= $row['staffid'];

$myclass="$class$arm";

 

}

$_SESSION['sub']=$tyr;

$sub=$_SESSION['sub'];



$add="subjects";

$clay="year11amber";

$_SESSION['clay']=$myclass;



$sdc="$myclass$add";

$dd=sqlite_escape_string(@$_REQUEST['idty1']);

	$mm=sqlite_escape_string(@$_REQUEST['idty2']);

$yy=sqlite_escape_string(@$_REQUEST['idty3']);



         



	$toy2=sqlite_escape_string(@$_REQUEST['email']);

	$bdt="$mm/$dd/$yy";



	



	

?>

















<?php





//make the database connection

include('config.php');

$sql = "SELECT * FROM `$clay` where Subjects='$sub' ";

$data=(mysql_query($sql)); 



$rows = mysql_num_rows($data);











?>

<script>

	function showEdit(editableObj) {

		$(editableObj).css("background","#FF0");

	} 

	

	function saveToDatabase(editableObj,column,id) {

		$(editableObj).css("background","#009933 url(loaderIcon.gif) no-repeat right");

		$.ajax({

			url: "saveedit.php",

			type: "POST",

			data:'column='+column+'&editval='+editableObj.innerHTML+'&id='+id,

			success: function(data){

				$(editableObj).css("background","#DDD");

			}        

	   });

	}

	</script>





<!DOCTYPE html>

<!--[if IE]><![endif]-->

<!--[if IE 8 ]><html dir="ltr" lang="en" class="ie8"><![endif]-->

<!--[if IE 9 ]><html dir="ltr" lang="en" class="ie9"><![endif]-->

<!--[if (gt IE 9)|!(IE)]><!-->

<html dir="ltr" lang="en">

<!--<![endif]-->

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>online</title>



<meta name="description" content="Jasmine" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">



<link href="catalog/view/javascript/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />



<link href="catalog/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />



<link href="catalog/view/theme/default/stylesheet/stylesheet.css" rel="stylesheet">

<link href="catalog/view/javascript/jquery/owl-carousel/owl.carousel.css" type="text/css" rel="stylesheet" media="screen" />





	<!-- bootstrap css -->

	<link rel="stylesheet" type="text/css" href="assests/bootstrap/css/bootstrap.min.css">

	<!-- datatables css -->

	<link rel="stylesheet" type="text/css" href="assests/datatables/datatables.min.css">

<style>



h1 {

  line-height:0.7em;

}

img.alignleft {

	

	float: left;

margin: -40px 0px;



}



img.alignleft1 {

	

	float: right;

margin: -450px 20px;

border:4px solid black;

}



</style>

</head>

<body bgcolor="#eee" class="common-home">



<header>

</br></br></br>

  <div class="container">

    <div class="row">

      <div class="container1">



<div class="row">

 

    



    <div class="col-lg-2 col-md-2 col-sm-6 col-xs-12">

       </br>  </br>

 <img src="images/c11.jpg"  class="alignleft" />

      </div>

    

</BR></BR></BR></BR>

    <div class="col-lg-10 col-md-6 col-sm-6 col-xs-12">



  </BR></BR></BR></BR>

  <a href="score.php"> <b>CLICK HERE:BACK TO PREVIOUS PAGE</b></a>

  



</div></br></br>

<div class="panel panel-default"></div>

    









</br>

<b>

		<div class="col-sm-12">

		

		

					<?php

					$ass1="code";

					$ass2="weeklytest";

					$ass3="subject1";

					$ass4="cod";

					$ass5="week1";

					$ass6="d1";

					$ass7="d2";

					$ass8="d3";

						$ass9="d4";

					$ass10="ex";

				

		$subj="";

					

							

					

						require_once("dbcontroller.php");

						$db_handle = new DBController();

						$sql = "SELECT REGNO,name,Subjects,code,weeklytest,subject1,cod,week1,d1,d2,d3,d4,ex,tot as total from $clay WHERE Subjects='$sub' order by regno";

						$faq = $db_handle->runQuery($sql);

						

			

						

						echo "

						<div id='ajaxDiv'><H3>".$subj." ".$subj.'</H3></div>

						<table align="center" class="table table-striped table-bordered">

								  <thead>

									  <tr>

										<th class="table-header"  width="80%">NAME</th>

										<th class="table-header"  width="80%">SUBJECT</th>

										<th class="table-header" width="10%">HW1</th>

										<th class="table-header" width="10%">HW2</th>

										<th class="table-header" width="10%">ASS1</th>

										<th class="table-header" width="10%">ASS2</th>

										<th class="table-header" width="10%">CLW1</th>

										<th class="table-header" width="10%">CA1</th>

										<th class="table-header" width="10%">CA2</th>

										<th class="table-header" width="10%">NOTE</th>

										<th class="table-header" width="10%">OTHERS</th>

										<th class="table-header" width="10%">EXAM</th>

							

										<th class="table-header" width="10%">TOTAL</th>

									  </tr>

								  </thead>

								  <tbody>';

								 

								  foreach($faq as $k=>$v) {

								 echo '

									  <tr class="table-row">

										<td><b>'.$faq[$k]["name"].'</b></td>

										<td>'.$faq[$k]["Subjects"].'</td>

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass1."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass1].'</td> 

										

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass2."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass2].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass3."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass3].'</td> 

									 <td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass4."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass4].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass5."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass5].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass6."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass6].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass7."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass7].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass8."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass8].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass9."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass9].'</td> 

										<td align="center" contenteditable="true" onBlur=';

										echo '"saveToDatabase(this,'."'".$ass10."','".$faq[$k]["REGNO"]."'".');"  onClick="showEdit(this);">'.$faq[$k][$ass10].'</td> 

										

										<td>'.$faq[$k]["total"].'</td>

										</tr>';

								}

						 

								?>

								  </tbody>

								</table>   

				</div>

			</div>

		

		<div class="panel-footer"><center><font color="#fff"> &copy; LionGate Soft. </font></center>

</div>

		</div>

		

	</div>



	      

	

<!-- edit modal -->

	

 <script src="js/fusioncharts.js"></script>

<script src="js/jquery-3.1.1.js"></script>

<script src="js/jquery.js"></script>

<script src="js/jquery.easing.1.3.js"></script>

<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.fancybox.pack.js"></script>

<script src="js/jquery.fancybox-media.js"></script>  

<script src="js/jquery.flexslider.js"></script>

<script src="js/animate.js"></script>

<!-- Vendor Scripts -->

<script src="js/modernizr.custom.js"></script>

<script src="js/jquery.isotope.min.js"></script>

<script src="js/jquery.magnific-popup.min.js"></script>

<script src="js/animate.js"></script>

<script src="js/custom.js"></script> 



</body>

</html>