<?php session_start() ?>

<html>

	<head>

		<title>SCHOOL PORTAL </title>



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

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

<script src="catalog/view/javascript/jquery/jquery-2.1.1.min.js" type="text/javascript"></script>



			<link rel="stylesheet" href="table2n.css" type="text/css" media="all" />

			<link rel="stylesheet" href="table1.css" type="text/css" media="all" />

<script src="catalog/view/javascript/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

<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" />

<script src="catalog/view/javascript/common.js" type="text/javascript"></script>

<script src="catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js" type="text/javascript"></script>



		<!--[if IE]>

			<link rel="stylesheet" href="vertical-text-ie2.css" type="text/css" media="all" />

<link rel="stylesheet" type="text/css" href="templatemo_style7e1.css" />

		<![endif]-->



<script language="JavaScript" type="text/javascript">

//--------------- LOCALIZEABLE GLOBALS ---------------

var d=new Date();

var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");

//Ensure correct for language. English is "January 1, 2004"

var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();

//---------------   END LOCALIZEABLE   ---------------

</script>

	</head>

	<body>

<style>

<style>



img.alignleft {

	

	float: right;

margin: 0px 30px;

border: 2px solid #111;

}

img.alignright {

	float: right;

margin: 65px -1px;

border: 2px solid #111;

}

img.alignright1 {

	

margin: 80px -100px;

border: 0px solid purple;

}

img.alignright2 {

	

margin: -20px 10px;

border: 0px solid purple;

}

/* ----------- My Form ----------- */

.myform{

margin:20px -40px;

width:890px;

height:1000px ;



border:solid 3px #904;







/* ----------- Form ----------- */

.form{

margin:140px -40px;

width:760px;

height:1000px ;

padding: 20px 0px 0px 0px;

border:solid 2px purple;



}



</style>



<script>

function cons()



{



window.print();





}



function funagree(){

        document.lodge.action="set1083.php";

}


</script>

<?php

    function do_alert($msg) 

    {

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

           parent.location="set1083.php";



</script>';

       

    }

?>

<?php





$at=  "11/12/2015";

 $bt= "04/01/2016";







$pee=$_POST['cust'];

$peea=$_POST['idty11'];



$clasx=$_SESSION['clax'];

$ddd=$_SESSION['clay'];



$cll=$_SESSION['clll'];

$aarm=$_SESSION['aaarm'];



$cvb="$pee$peea";



$asz="portalsms";



$dcv="$cvb$asz";

if ($pee=="current")

{

$bbl=$asz;

}else 

{

$bbl=$dcv;

}





?>

<?php

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



$tme= date(" h:i:s a", time());





?>





<?php







//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);



$sql =



"select 

* from `beva1` where `password` ='$ddd' order by regno ";

$data=(mysql_query($sql)); 





$rows4 = mysql_num_rows($data);

mysql_close($conn);



?>

<?php







$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);



$sql =" create table `#crd$ddd` 



as



select 

* from `beva1` where `password` ='$ddd' order by regno ";

$data=(mysql_query($sql)); 



mysql_close($conn);



?>

<?php







//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);



$sql =" delete from `#crd$ddd` where regno=0";

$data=(mysql_query($sql)); 



mysql_close($conn);

?>

<?php

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);

$sql ="ALTER TABLE `#crd$ddd` ADD ibv INT AUTO_INCREMENT NOT NULL PRIMARY KEY";







mysql_query($sql,$conn);



mysql_close($conn);



?>



<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);



$sql ="create table `#rd1$ddd` as select * from ddf  ";

$data=(mysql_query($sql)); 



mysql_close($conn);

?>



<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);





$sql = "select * from `tutors` where `name`='$cll' and `type` ='$aarm' ";



$data=(mysql_query($sql)); 

while($row= mysql_fetch_array($data))

{



$fff1=  $row['arm'];

$fff2=  $row['class'];





 

}



$fff3="$fff1 <b>&</b> $fff2";

?>







































<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);





$sql = "select * from `termset` where `name`='$pee'";



$data=(mysql_query($sql)); 

while($row= mysql_fetch_array($data))

{



$sss=  $row['type'];

$ttt=  $row['class'];





 

}



?>







<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);





for ($i = 1; $i <= $rows4; $i++){







$sql = "select `regno` from `#crd$ddd` where `ibv` = '$i'";



$data=(mysql_query($sql)); 

while($row= mysql_fetch_array($data))

{



$svc=  $row['regno'];







 

}

$sql = "





INSERT INTO `#rd1$ddd` VALUES ('$svc',(SELECT sum(tot)  FROM `$ddd` WHERE `regno` = '$svc'))";

          

$data=(mysql_query($sql)); 







}

?>

<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);

$sql =" create table `#sod1$ddd` 



as



select 

 * from `#rd1$ddd`  order by name DESC ";

$data=(mysql_query($sql)); 



mysql_close($conn);

?>

<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);

$sql ="ALTER TABLE `#sod1$ddd` ADD ib VARCHAR(30)   NOT NULL DEFAULT ''";

$data=(mysql_query($sql)); 



mysql_close($conn);

?>



<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);

$sql =" create table `#sod2$ddd` 



as



select 

 * from `#sod1$ddd`   ";

$data=(mysql_query($sql)); 



mysql_close($conn);

?>

<?php









//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);

$sql ="ALTER TABLE `#sod2$ddd` ADD ibv INT AUTO_INCREMENT NOT NULL PRIMARY KEY";

$data=(mysql_query($sql)); 



mysql_close($conn);

?>

<?php





//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);





for ($i =1; $i <=$rows4; $i++){







$sql = "select regno from `#sod2$ddd` where `ibv` = '$i'";



$data=(mysql_query($sql)); 

while($row= mysql_fetch_array($data))

{



$svc=  $row['regno'];





}

 $b= "1st";

$c= $i-1;





$sql =" 

select 

name from `#sod2$ddd` where `ibv` =  '$c'  ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);

if ($c==0){



$a=0;



}

else{







while($row= mysql_fetch_array($data1))

{



$a=  $row['name'];







}

}

}



?>



<?php





//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db($bbl, $conn);





for ($i = 1; $i <= $rows4; $i++){







$sql = "select regno from `#crd$ddd` where ibv = '$i'";



$data=(mysql_query($sql)); 

while($row= mysql_fetch_array($data))

{



$svc=  $row['regno'];









 

}





$sql = "select * from `beva1` where regno= '$svc'";



$data=(mysql_query($sql)); 

while($row= mysql_fetch_array($data))

{



$rrg=  $row['ano'];









 

}





$sql =" 

select 

regno,name,sex,term,class from `$ddd` where `regno` =  '$svc'  ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$a=  $row['regno'];

 $b= $row['name'];

$c= $row['sex'];

$d=$row['term'];  

 $e=$row['class']; 





}









$sql =" 

select 

* from `#sod2$ddd` where `regno` =  '$svc'  ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$pp=  $row['ib'];

  







}



$sql =" 

select 

* from `beva1` where `regno` =  '$svc'  ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$ebb=  $row['2'];

  







}











$sql =" 

select 

* from `$ddd` where `regno` =  '$svc' ";

$data5=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data5);







$sql ="CREATE TABLE `#$svc` as 

select 

*



 from `$ddd` where `regno` =  '$svc'  and code !=0";



mysql_query($sql,$conn);





$sql ="alter table `#$svc` drop `regno`,drop `name`,drop `sex`,drop `active`,drop `term`,drop `class`,drop `weeklytest`,drop `subject1`,drop `cod`,drop `week1`,drop `d1`,drop `d2`,drop `d3`,drop `d4`,drop `ex`,drop `tot`,drop `rmk`



";

mysql_query($sql,$conn); 

















$sql = "update `#$svc` set okk= '5' WHERE code  between 9.0 and 10.0";

          

         

$result = mysql_query($sql);





$sql = "update `#$svc` set okk= '4' WHERE code  between 7.0 and 8.99";

          

         

$result = mysql_query($sql);





$sql = "update `#$svc` set okk= '3' WHERE code  between 6.0 and 6.99";

          

         

$result = mysql_query($sql);





$sql = "update `#$svc` set okk= ' 2' WHERE code  between 4.0 and 5.99";

          

         

$result = mysql_query($sql);





$sql = "update `#$svc` set okk= '1' WHERE code  between 0 and 4.9";

          

         

$result = mysql_query($sql);







$sql = "SELECT count(*) AS max FROM `#$svc`";

          

         

$result = mysql_query($sql);

    $result1 = mysql_fetch_assoc($result);



          





$dce=  $result1['max'];





$se= ($dce * 100);





$sql = "SELECT SUM(code) AS maxid FROM `#$svc`";

          

         

$result = mysql_query($sql);

    $result1 = mysql_fetch_assoc($result);



          





$pa=  $result1['maxid'];



$pe= round(($pa/$se * 100),2);



$fgt=round($pe,2);











$sql =" 

select 

code from `$ddd` where `Subjects` ='MATHEMATICS' and regno='$svc' ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$mat=  $row['code'];

$mgt=round($mat,2);

}



$sql =" 

select 

code from `$ddd` where `Subjects` ='ENGLISH LANGUAGE' and regno='$svc' ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$eng=  $row['code'];

  

$egt=round($eng,2);





}

$fgt=$pe;

$meng=$mat + $eng + $pe;



if ($mgt >=8.00 ){

$mm=1;

}else if($mgt >=7.00 ){

$mm=0.75;

}else if($mgt >=6.00 ){

$mm=0.3;

}else if($mgt <6.00){

$mm="0";

}





if ($egt >=8.00){

$ee="1";

}else if($egt >=7.00 ){

$ee="0.75";

}else if($egt >=6.00){

$ee="0.3";

}else if($egt <6.00 ){

$ee="0";

}





if ($fgt >=8.00){

$px="1";

}else if($fgt >=7.00 ){

$px="0.75";

}else if($fgt >=6.00){

$px="0.3";

}else if($fgt <6.00){

$px="0";

}



$dfry = $mm + $ee + $px;





$sql = "









create table `#ccc$ddd` as select * from `ccc`";

          

$data=(mysql_query($sql)); 



$sql = "









INSERT INTO  `#ccc$ddd` VALUES ('$svc','$dfry','$mgt','$egt',$fgt,0,0)";

          

$data=(mysql_query($sql)); 



















$sql = "update  `#ccc$ddd` set rr= 'BRONZE' WHERE (`hg` < 6.00) OR (`sf` < 6.00) OR (`gy` < 6.00 ) ";

          

         

$result = mysql_query($sql);





$sql = "update  `#ccc$ddd` set rr1= 'BRONZE' WHERE (`hg` < 6.00) OR (`sf` < 6.00) OR (`gy` < 6.00 ) ";

          

         

$result = mysql_query($sql);













$sql = "update  `#ccc$ddd` set rr= 'DIAMOND' where sno='$svc' and gg=3 ";

          

         

$result = mysql_query($sql);







$sql = "update  `#ccc$ddd` set rr= 'GOLD' where  rr1 !='BRONZE' and  sno='$svc' and gg between 2.25 and 2.99 ";

          

         

$result = mysql_query($sql);





$sql = "update  `#ccc$ddd` set rr= 'SILVER' where rr1 !='BRONZE' and sno='$svc' and gg between 0.60 and 2.24 ";

          

         

$result = mysql_query($sql);































$sql =" 

select 

* from  `#ccc$ddd` where `sno` =  '$svc'  ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$rfr=  $row['rr'];

  







}



$stav=$rfr;





$sql ="

select * from `#$svc` ";

$data2=(mysql_query($sql)); 

$rows = mysql_num_rows($data2);























$sql =" 

select 

* from  `#ccc$ddd` where `sno` =  '$svc'  ";

$data1=(mysql_query($sql)); 

$rows1 = mysql_num_rows($data1);









while($row= mysql_fetch_array($data1))

{



$pprr=  $row['rr'];

  







}











$cbb= 5;

$dbb=  4;

 $ebb= 5;

$dcc=  4;

 $aa= 5;

$bb= 5;

$cc=  3;

 $dd= 5;

$ee=  3;

 $ff= 5;

$gg= 4;

$hh=  4;

 $ii= 5;

$jj=  5;

 $kk= 5;











print "<center>\n";







print "<div id=templatemo_main_wrapper4445>";



print "<form name =lodge  method=post









class=myform div id=stylized >\n";



print "<center>\n";







	

print "<div id=templatemo_main_wrapper4446>";

print "<table class=dre>\n";

print "<tr class=dre>\n";

print "<td class=dre>\n";



print "<img src=images/C112.jpg  width=611 height=226 class=alignleft /><img src=pics/$svc.jpg  width=100 height=120 class=alignright /></td>\n";

print "</tr>\n";









print "</table>\n";



print "</div>\n";









print "<B><u><H2>FIRST CAT (10%) RESULT SHEET</H2></u></B>";

	print "<CENTER>\n";



print "<table class=dredo1 width= 700>\n";

print "<tr class=dredo1>\n";

print "<td class=dredo123 bgcolor=><b>STUDENT NAME:</b></td><td colspan=3 align=left>

$b </td>\n";



print "</tr>\n";

print "<tr class=dredo1>\n";

print "<td class=dredo123 bgcolor=#904><b><font color=white>ADMISSION NO.:</font></b></td><td align=left>

$rrg</td><td class=dredo123 bgcolor=#904><b><font color=white>CLASS:</font></b></td><td  align=left>

$clasx </td>\n";

print "</tr>\n";

print "<tr class=dredoo>\n";

print "<td class=dredo123 bgcolor=><b>TERM :</b></td><td class=dredo1 align=left>

$ttt </td><td class=dredo123 bgcolor=><b>ACADEMIC YEAR:</b></td><td  align=left>

$sss </td>\n";





print "</tr>\n";

print "<tr class=dredo1>\n";

print "<td class=dredo123 bgcolor=#904 border=2px black><b><font color=white>FORM TUTOR(S):</font></b></td><td colspan=4 align=left>

$fff3</td>\n";

print "</tr>\n";



print "</table>\n";

print "</CENTER>\n";

print "<center>\n";



print "</br>\n";



            print "<div class=container>\n";



print "<div class=col-sm-8>\n";

              print "  <div class=panel panel-default>\n";

                   print " <div class=panel-heading>\n";

                   print " </div>\n";

                   print " <div class=panel-body>\n";

print "<center>\n";

		print "<table  >\n";

			print "<thead>\n";



print "<tr BGCOLOR=#904 class= dredo123 height=20>\n";



print "

		<th width=330><B><font color=white></br> SUBJECTS</font></B>

</th>

					<th width=30><B><font color=white></br> CAT(10%)</font></B>

</th>

			<th width=30><B><font color=white></br>REMARKS</font></B>

</th>\n";

		

				

					

				print "</tr>\n";



				

			print "</thead>\n";

			print "<tbody >\n";





				//get row data as an associative array

while ($row = mysql_fetch_assoc($data2)){

print "<tr>\n";

//look at each field

foreach ($row as $col=>$val){

print " <td>$val</td>\n";

} // end foreach

print "</tr>\n\n";

}// end while









print "</table>\n";

 print "</br>\n";

 print "</br>\n";

print "</br>\n";



print "<table width=320 >\n";

print "<tr BGCOLOR=#ccc class= dredo123>\n";

print "<TD COLSPAN=4><B> VICE PRINCIPAL(ACADEMICS)</TD>\n";





print "</tr>\n";

 

					

 

print "<tr class=dreo>\n";

print "<TD> <img src= images/pat.jpg  width=97 height=24 /> </TD>\n";





print "</tr>\n";



print "</center>\n";





print "<center>\n";



	print "</center>\n";

			print "</tbody>\n";









		print "</table>\n";



print "</center>\n";

print "</div>\n";



print "</div>\n";



print "</div>\n";



print "</div>\n";



print " <div class=col-sm-4>\n";

               print "  <div class=panel panel-default>\n";

                   print " <div class=panel-heading>\n";

                   print " </div>\n";

                   print " <div class=panel-body>\n";

                    print "<table class='table table-striped' width=250>\n";

print "<thead>\n";

				print "<tr BGCOLOR=#904>\n";

print "<td colspan=2><font COLOR=white size=3><b>SUMMARY</b></font></td>\n";

print "</tr>\n";



print "<tr class=dreg >\n";

print "<td >MAXIMUM POSIBLE</td><td   align=left>

10%





</td>\n";

print "</tr>\n";

print "<tr  class=dreg>\n";

print "<td >FINAL AVERAGE</td><td   align=left>

$pe





</td>\n";

print "</tr>\n";

print "<tr class=dreg >\n";

print "<td >GRADE</td><td   align=left>

<b>$stav</b>





</td>\n";

print "</tr>\n";











print "</thead>\n";

print "</table>\n";



print "</br>\n";

print "<table class='table table-striped' width=250>\n";

print "<thead>\n";

				print "<tr BGCOLOR=#904 >\n";

print "<td colspan=2><font COLOR=white size=3><b>REMARK KEY</b></font></td>\n";

print "</tr>\n";



print "<tr class=dreg >\n";

print "<td >EXCEPTIONAL PERFORMANCE</td><td   align=left>

5 





</td>\n";

print "</tr>\n";

print "<tr  class=dreg>\n";

print "<td >EXCEEDS EXPECTATION</td><td   align=left>

4





</td>\n";

print "</tr>\n";

print "<tr class=dreg >\n";

print "<td >MEETS EXPECTATION</td><td   align=left>

3





</td>\n";

print "</tr>\n";



print "<tr  class=dreg>\n";

print "<td >NEEDS DEVELOPMENT</td><td   align=left>

2





</td>\n";

print "</tr>\n";



print "<tr  class=dreg>\n";

print "<td >UNSATISFACTORY</td><td   align=left>

1





</td>\n";

print "</tr>\n";



print "</thead>\n";

print "</table>\n";





print "</br>\n";

print "<table class='table table-striped' width=250>\n";

print "<thead>\n";

				print "<tr BGCOLOR=#904 >\n";

print "<td colspan=3><font COLOR=white size=3><b> GRADING SYSTEM</b></font></td>\n";

print "</tr>\n";



print "<tr class=dreg >\n";

print "<td >MATHS,ENG. & FA >= 8</td><td>A</td><td   align=left>

DIAMOND(D)





</td>\n";

print "</tr>\n";

print "<tr class=dreg >\n";

print "<td >MATHS,ENG. & FA >= 7</td><td>C</td><td   align=left>

GOLD(G)





</td>\n";

print "</tr>\n";

print "<tr class=dreg >\n";

print "<td >MATHS,ENG. & FA >= 6</td><td>P</td><td   align=left>

SILVER(S)





</td>\n";

print "</tr>\n";



print "<tr class=dreg >\n";

print "<td >MATHS,ENG. & FA < 6</td><td>F</td><td   align=left>

BRONZE(B)





</td>\n";

print "</tr>\n";





print "</thead>\n";

print "</table>\n";

              



print "</br>\n";



               print " </div>\n";

                print " </div>\n";

         print " </div>\n";







print "</div>";



print "</form>";

print "</div>";





  print "</br>\n";

print "</br>\n"; 

      

print "<div id=templatemo_main_wrapper4447>";



print "</div>";

$sql ="

drop table  `#$svc` ";

$data2=(mysql_query($sql)); 



}

?>




<?php





//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db("portalsms", $conn);

$sql ="

drop `#crd$ddd` ";

$data2=(mysql_query($sql)); 



mysql_close($conn);



?>

<?php





//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db("portalsms", $conn);

$sql ="

drop table `#rd1$ddd` ";

$data2=(mysql_query($sql)); 



mysql_close($conn);



?>





<?php





//make the database connection

$conn = mysql_connect("localhost", "root", "plugg") or die (mysql_error());

mysql_select_db("portalsms", $conn);

$sql ="

drop table  `#sod1$ddd` ";

$data2=(mysql_query($sql)); 







$sql ="

drop table  `#ccc$ddd` ";

$data2=(mysql_query($sql)); 





$sql ="

drop table  `#sod2$ddd` ";

$data22=(mysql_query($sql)); 



$sql ="

drop table `#crd$ddd` ";

$data21=(mysql_query($sql)); 



mysql_close($conn);



?>











</form>

<center>

 <tr>



<td align="left" ><a href="ca.php">Go to Previous Page </a>

</TD>
</tr>







</center>

</body>

</html>







<!-- end of main_container -->      

        

        <div class="clear"></div> 

        

</diV>

    

      <div id="footer">   



   

       

    

    </div>

   

    

    

</div>

<!-- end of main_container -->								</p>
			</div>
		</div>
	</div>


</div></body>
</html>