<script>
function rediectMeNow(typemenow){
	var no=$("#class").val();var section=$("#section").val();
	window.location='./?page_id=naz_add_result&typemenow='+typemenow+'&section='+section+'&class='+no+'&term=<?php echo $_GET["term"] ?>';
}
function exportMe(){
	var no=$("#class").val();var section=$("#section").val();
	window.location='./?page_id=naz_add_result&typemenow=view&section='+section+'&class='+no+'&term=<?php echo $_GET["term"] ?>&export=yes';
}
function exportRe(){
	var no=$("#class").val();var section=$("#section").val();
	window.location='./?page_id=naz_add_result&typemenow=view&section='+section+'&class='+no+'&term=<?php echo $_GET["term"] ?>&export=Remarks';
}
</script>
<style>
.rowme{width:50%; float:left; vertical-align:top;}
.stuList {
    border: 10px solid #ff0;
    margin: 10px;
    clear: both;
    display: inline-block;
    padding: 10px;
	width:100%;
}
.removeme{display:none}
table{width:99%}
</style>
<?php
if(isset($_GET["export"]) && $_GET["export"]=="Remarks" && $_GET["class"]!=""){
	error_reporting(9);
	define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
			/** Include PHPExcel */
	require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
	$objPHPExcel = new PHPExcel();
	$objPHPExcel->getProperties()->setCreator("Mragank shekhar Soni");
	$objPHPExcel->getProperties()->setLastModifiedBy("Mssinfotech");
	$objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Export Remark");
	$objPHPExcel->getProperties()->setSubject("Office 2007 XLSX Export Remark");
	$objPHPExcel->getProperties()->setDescription("Export Remark for Office 2007 XLSX, generated for ".$LinksDetails["site_name"]);
	$section="";
	if(isset($_GET["section"]) && $_GET["section"]!="")$section=" and section='".$_GET["section"]."'";
	$studentList=$db->getRows("select foccupation,idno,name,section,fname,class from student where class='".$_GET["class"]."' and status=1 and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'".$section."order by name");
	$i=1;
	$objPHPExcel->setActiveSheetIndex(0);
	foreach($studentList as $student){
		$i++;
		if($i==2){
			$objPHPExcel->getActiveSheet()->setCellValue('A1', 'idno');
			$objPHPExcel->getActiveSheet()->setCellValue('B1', 'name');
			$objPHPExcel->getActiveSheet()->setCellValue('C1', 'foccupation');
			$objPHPExcel->getActiveSheet()->setCellValue('D1', 'class');
			$objPHPExcel->getActiveSheet()->setCellValue('E1', 'section');
			$objPHPExcel->getActiveSheet()->setCellValue('F1', 'term');
			$objPHPExcel->getActiveSheet()->getStyle('G1')->getFont()->setSize(12);
			$objPHPExcel->getActiveSheet()->getStyle('G1')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('G1')->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
			$objPHPExcel->getActiveSheet()->getStyle('G1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_RED);
			$objPHPExcel->getActiveSheet()->setCellValue('G1', 'Remarks');
		}
		$objPHPExcel->getActiveSheet()->setCellValue('A'.$i, $student["idno"]);
		$objPHPExcel->getActiveSheet()->setCellValue('B'.$i.'', ''.$student["name"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('C'.$i.'', ''.$student["foccupation"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('D'.$i.'', ''.$student["class"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('E'.$i.'', ''.$student["section"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('F'.$i.'', ''.$_GET["term"].'');
		//echo "<pre>";
		$mymarkssa2=$db->getVal("select r.remarks from naz_remark as r where r.idno='".$student["idno"]."' and r.term='".$_GET["term"]."'");
		$objPHPExcel->getActiveSheet()->setCellValue('G'.$i, $mymarkssa2);									
			
	}
	//exit;
	$objPHPExcel->setActiveSheetIndex(0);
	$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
	$root="D:\Marks_Excel\Remarks_".$_GET['class']."_".$_GET['section']."_".$_GET['term']."_NAZ.xls";
	$objWriter->save($root);
	$_SESSION["msgs"]="expoted successfully at ".$root;
	redirect(URL_ROOT."?page_id=naz_add_result&typemenow=view&section=".$_GET["section"]."&class=".$_GET["class"]."&term=".$_GET["term"]);
	exit;
}elseif(isset($_GET["export"]) && $_GET["export"]=="yes" && $_GET["class"]!=""){
	$MyListNameWithDetails=array();
	$schoolList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subject' and class='".$_GET["class"]."'");
	$i=0;
	error_reporting(90);
	if(is_array($schoolList) &&  count($schoolList)>0){
		foreach($schoolList as $sList){ $i++;
			$MyListNameWithDetails[]=array("name"=>$sList["name"],"id"=>$sList["id"],"marks"=>$sList["marks"],"class"=>$sList["class"],"type"=>$sList["type"]);
			$criteriaList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='criteria' and underof=".$sList["id"]);
			if(is_array($criteriaList) &&  count($criteriaList)>0){
				foreach($criteriaList as $cList){
					$MyListNameWithDetails[]=array("name"=>$cList["name"],"id"=>$cList["id"],"marks"=>$cList["marks"],"class"=>$cList["class"],"type"=>$cList["type"]);
					$subcriteriaList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subcriteria'  and underof=".$cList["id"]);
					if(is_array($subcriteriaList) &&  count($subcriteriaList)>0){
						foreach($subcriteriaList as $scList){
							$MyListNameWithDetails[]=array("name"=>$scList["name"],"id"=>$scList["id"],"marks"=>$scList["marks"],"class"=>$scList["class"],"type"=>$scList["type"]);
						}
					} 
				}
			}
		}
	}
	//echo "<pre>";print_r($MyListNameWithDetails);$db->getErMsg();exit;
	define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
			/** Include PHPExcel */
	require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
	$objPHPExcel = new PHPExcel();
	$objPHPExcel->getProperties()->setCreator("Mragank shekhar Soni");
	$objPHPExcel->getProperties()->setLastModifiedBy("Mssinfotech");
	$objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Export mark");
	$objPHPExcel->getProperties()->setSubject("Office 2007 XLSX Export mark");
	$objPHPExcel->getProperties()->setDescription("Export mark for Office 2007 XLSX, generated for ".$LinksDetails["site_name"]);
	$section="";
	if(isset($_GET["section"]) && $_GET["section"]!="")$section=" and section='".$_GET["section"]."'";
	$studentList=$db->getRows("select foccupation,idno,name,section,fname,class from student where class='".$_GET["class"]."' and status=1 and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'".$section);
	$i=1;
	$objPHPExcel->setActiveSheetIndex(0);
	foreach($studentList as $student){
		$i++;
		if($i==2){
			$objPHPExcel->getActiveSheet()->setCellValue('A1', 'idno');
			$objPHPExcel->getActiveSheet()->setCellValue('B1', 'name');
			$objPHPExcel->getActiveSheet()->setCellValue('C1', 'foccupation');
			$objPHPExcel->getActiveSheet()->setCellValue('D1', 'class');
			$objPHPExcel->getActiveSheet()->setCellValue('E1', 'section');
			$objPHPExcel->getActiveSheet()->setCellValue('F1', 'term');
			if(is_array($MyListNameWithDetails) && count($MyListNameWithDetails)>0){$j=6;
				foreach($MyListNameWithDetails as $msList){
					$range=num2alpha($j)."1";
					$objPHPExcel->getActiveSheet()->setCellValue($range,$msList["id"].'-'.$msList["name"].'-'.$msList["marks"]);
					if($msList["type"]=="subject"){
							
						//$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setName('Candara');
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setSize(12);
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setBold(true);
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_RED);
					}elseif($msList["type"]=="criteria"){
						//$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setName('Candara');
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setSize(12);
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setBold(true);
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
						$objPHPExcel->getActiveSheet()->getStyle($range)->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_GREEN);
					}
					$j++;
				}
			}
		}
		$objPHPExcel->getActiveSheet()->setCellValue('A'.$i, $student["idno"]);
		$objPHPExcel->getActiveSheet()->setCellValue('B'.$i.'', ''.$student["name"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('C'.$i.'', ''.$student["foccupation"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('D'.$i.'', ''.$student["class"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('E'.$i.'', ''.$student["section"].'');
		$objPHPExcel->getActiveSheet()->setCellValue('F'.$i.'', ''.$_GET["term"].'');
		//echo "<pre>";
		if(is_array($MyListNameWithDetails) && count($MyListNameWithDetails)>0){$k=6;
			foreach($MyListNameWithDetails as $msList){
				$mymarkssa2=$db->getVal("select r.marks from naz_result as r where r.idno='".$student["idno"]."' and r.term='".$_GET["term"]."' and r.type_id='".$msList["id"]."'");				
				if($msList["type"]=="subject"){
					$typeList=$db->getRows("select id from naz_type where underof='".$msList["id"]."'");
					//echo $db->getErMsg().$db->getLastQuery()."<br />";
					$s=0;$data=array();
					if(is_array($typeList) && count($typeList)>0){
						foreach($typeList as $tList){
							$s++;
							$data[]=num2alpha($k+$s).$i;
							$typeList=$db->getRows("select id from naz_type where underof='".$tList["id"]."'");		if(is_array($typeList) && count($typeList)>0){
								foreach($typeList as $tList){
									$s++;
								}
							}
							
						}
					}
					if(is_array($data) && count($data)>0)
						$objPHPExcel->getActiveSheet()->setCellValue(num2alpha($k).$i, "=".implode("+",$data));
					else
						$objPHPExcel->getActiveSheet()->setCellValue(num2alpha($k).$i, $mymarkssa2);
					
				}elseif($msList["type"]=="criteria"){
					$typeList=$db->getRows("select id from naz_type where underof='".$msList["id"]."'");
					//echo $db->getErMsg().$db->getLastQuery()."<br />";
					$m=0;$data=array();
					if(is_array($typeList) && count($typeList)>0){
						foreach($typeList as $tList){
							$m++;
							$data[]=num2alpha($k+$m).$i;
						}
					}
					if(is_array($data) && count($data)>0)
						$objPHPExcel->getActiveSheet()->setCellValue(num2alpha($k).$i, "=".implode("+",$data));
					else
						$objPHPExcel->getActiveSheet()->setCellValue(num2alpha($k).$i, $mymarkssa2);
				}else{
					$objPHPExcel->getActiveSheet()->setCellValue(num2alpha($k).$i, $mymarkssa2);						}	
				//	$objPHPExcel->getActiveSheet()->setCellValue(num2alpha($k).$i, $mymarkssa2["marks"]);
				
				$k++;
			}
		} 
	}
	//exit;
	$objPHPExcel->setActiveSheetIndex(0);
	$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
	$root="D:\Marks_Excel\marks_".$_GET['class']."_".$_GET['section']."_".$_GET['term']."_NAZ1.xls";
	$objWriter->save($root);
	$_SESSION["msgs"]="expoted successfully at ".$root;
	redirect(URL_ROOT."?page_id=naz_add_result&typemenow=view&section=".$_GET["section"]."&class=".$_GET["class"]."&term=".$_GET["term"]);
	exit;
}
if($_POST){
	if(is_array($_POST["idno"]) && count($_POST["idno"])>0){
		for($j=0; $j<count($_POST["idno"]); $j++){
			$db->delete("naz_result","where idno='".$_POST["idno"][$j]."' and term='".$_GET["term"]."' and type_id=".$_POST["id"][$j]);
			$arrayData=array("idno"=>$_POST["idno"][$j],
							"type_id"=>$_POST["id"][$j],
							"total"=>$_POST["total"][$j],
							"marks"=>$_POST["marks"][$j],
							"term"=>$_GET["term"],
							"school_id"=>$_SESSION["admin"]["school_id"],
							"session"=>$_SESSION["admin"]["session"]);
			$db->insertAry("naz_result",$arrayData);
		}
		redirect(URL_ROOT."?page_id=naz_add_result&class=".$_GET["class"]."&term=".$_GET["term"]);
	}
	elseif(isset($_POST["import"])){
		//error_reporting(99);
		//echo "<pre>";print_r($_FILES);
		$file=$_FILES["file"]["tmp_name"];//"../uploads/excel/" . $_FILES["file"]["name"];
		define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
			/** Include PHPExcel */
		require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
		$objPHPExcel = new PHPExcel();
		if (($handle = fopen($file, "r")) !== FALSE) {		
			try { $objPHPExcel = PHPExcel_IOFactory::load($file); } 
					catch(Exception $e) { die('Error loading file "'.pathinfo($file,PATHINFO_BASENAME).'": '.$e->getMessage()); 
			}
			$allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
			$i=0;$c=1;
			//echo "<pre>";//print_r($allDataInSheet);
			for($i=2; $i<=count($allDataInSheet);$i++){$c++;
				for($j=0; $j<=count($allDataInSheet[1]); $j++){
					$k=num2alpha($j);
					$myAry=explode("-",$allDataInSheet[1][$k]);
					if($myAry[2]!="" && is_numeric($myAry[2])){
						if($myAry[2]>=$allDataInSheet[$c][$k]){
							$db->delete("naz_result","where idno='".$allDataInSheet[$c]['A']."' and term='".$_GET["term"]."' and type_id=".$myAry[0]);
							$dataSave=array("type_id"=>$myAry[0],
										"total"=>$myAry[2],
										"marks"=>$allDataInSheet[$c][$k],
										"idno"=>$allDataInSheet[$c]['A'],
										"school_id"=>$_SESSION["admin"]["school_id"],
										"session"=>$_SESSION["admin"]["session"],
										"term"=>$_GET["term"]);
										if($dataSave["marks"]==0 || $dataSave["marks"]=="0" || $dataSave["marks"]=="")
												$dataSave["marks"]==0;
							//print_r($dataSave);
							$db->insertAry("naz_result",$dataSave);
						}else{
							$_SESSION["errorMsg"][]="please correct the marks of idno ".$allDataInSheet[$c]['A']." for subject ".$myAry[2]." you Enter ".$allDataInSheet[$c][$k]." / ".$myAry[2];
						}
						//echo $k."-";
					}
				}
			}
		}
	}
	elseif(isset($_POST["importRe"])){
		//error_reporting(99);
		//echo "<pre>";print_r($_FILES);
		$file=$_FILES["fileRe"]["tmp_name"];//"../uploads/excel/" . $_FILES["file"]["name"];
		define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
			/** Include PHPExcel */
		require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
		$objPHPExcel = new PHPExcel();
		if (($handle = fopen($file, "r")) !== FALSE) {		
			try { $objPHPExcel = PHPExcel_IOFactory::load($file); } 
					catch(Exception $e) { die('Error loading file "'.pathinfo($file,PATHINFO_BASENAME).'": '.$e->getMessage()); 
			}
			$allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
			$i=0;
			//echo "<pre>";//print_r($allDataInSheet);
			for($i=2; $i<=count($allDataInSheet);$i++){
				for($j=0; $j<=count($allDataInSheet[1]); $j++){
					$db->delete("naz_remark","where idno='".$allDataInSheet[$i]['A']."' and term='".$_GET["term"]."'");
					$dataSave=array("remarks"=>$allDataInSheet[$i]['G'],
								"idno"=>$allDataInSheet[$i]['A'],
								"school_id"=>$_SESSION["admin"]["school_id"],
								"session"=>$_SESSION["admin"]["session"],
								"term"=>$_GET["term"]);
					//print_r($dataSave);
					$db->insertAry("naz_remark",$dataSave);
				}
			}
		}
	}
}
$alltype=$db->getRows("SELECT * FROM class where school_id='".$_SESSION["admin"]["school_id"]."'");
$allsection=$db->getRows("SELECT * FROM section where school_id='".$_SESSION["admin"]["school_id"]."'");
?><div class="control-group">
	<label class="control-label" for="class">Select Class</label>
	<div class="controls">
		<select name="class" id="class">
		<option value="">Select class</option><?php
		foreach($alltype as $atype){
			?><option <?php if($_REQUEST["class"]==$atype["class"])echo 'selected';?> value="<?php echo $atype["class"]; ?>"><?php echo $atype["class"] ?></option><?php
		}
		?></select>
        <select name="section" id="section">
		<option value="">Select section</option><?php
		foreach($allsection as $atype){
			?><option <?php if($_REQUEST["section"]==$atype["name"])echo 'selected';?> value="<?php echo $atype["name"]; ?>"><?php echo $atype["name"] ?></option><?php
		}
		?></select>
        <input type="button" value="Fetch Record" onclick="rediectMeNow('fetch')" />
        <input type="button" value="View Record" onclick="rediectMeNow('view')" />
        <input type="button" value="View Graph" onclick="rediectMeNow('graph')" />
	</div>
</div>

<?php 

if(is_array($_SESSION["errorMsg"]) && count($_SESSION["errorMsg"])>0){
	foreach($_SESSION["errorMsg"] as $errorm){
		echo '<p class="error">'.$errorm.'</p>';
	}
	unset($_SESSION["errorMsg"]);
}elseif($_SESSION["msgs"]!=""){
	echo '<p class="success">'.$_SESSION["msgs"].'</p>';
	unset($_SESSION["msgs"]);
}
//error_reporting(99);
if(isset($_GET["class"]) && $_GET["class"]!="" && $_GET["typemenow"]=="view"){
	?>
<form method="post" action="" enctype="multipart/form-data" style="display:none">
	<input type="file" name="file" id="file" onchange="$('#submitmenow').click()" />
	<input type="text" name="import" value="yes" />
    <input type="submit" id="submitmenow" />
</form>    
<form method="post" action="" enctype="multipart/form-data" style="display:none">
	<input type="file" name="fileRe" id="fileRe" onchange="$('#submitmenowRe').click()" />
	<input type="text" name="importRe" value="yes" />
    <input type="submit" id="submitmenowRe" />
</form>        
<form method="post" action="">
	<?php 
	
	$section="";
	if(isset($_GET["section"]) && $_GET["section"]!="")$section=" and section='".$_GET["section"]."'";
		$studentList=$db->getRows("select foccupation,idno,name,section from student where class='".$_GET["class"]."' and status=1 and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'".$section);
		//print_r($_SESSION);echo $db->getLastQuery();$db->getErMsg();
		if(is_array($studentList) && count($studentList)>0){
			?>
            <input type="button" value="print" onclick="printDivNoHeader('printdiv')" style="float:right; position:relative; right:0; margin-top:-40px;" class="btn btn-default" />
            <input type="button" value="Export Marks" onclick="exportMe()" style="float:right; position:relative; right:80px; margin-top:-40px;" class="btn btn-default" />
            <input type="button" value="Import Marks" onclick="$('#file').click()" style="float:right; position:relative; right:220px; margin-top:-40px;" class="btn btn-default" />
            
            <input type="button" value="Export Remarks" onclick="exportRe()" style="float:right; position:relative; right:80px; margin-top:-80px;" class="btn btn-default" />
            <input type="button" value="Import Remarks" onclick="$('#fileRe').click()" style="float:right; position:relative; right:220px; margin-top:-80px;" class="btn btn-default" />
            
			<div id="printdiv">
			<?php $he=0;
			foreach($studentList as $stuList){ $he++;?>
                <div class="stuList" style="border: 10px solid #ff0;<?php if($he==1) echo 'margin-bottom:10px;'?> clear: both; display: inline-block; padding: 10px; text-align:center; width:90%;height:995px;">
                
                <div class="headPrint hide" style="border: none;">
                     <div> <img src="<?php echo $LinksDetails["logo"] ?>" height="80px" style="margin:6px 0px 0px 10px;">
                     <div style="text-align:center;margin-bottom:18px;"> <h1 style="font-size:38px;margin:5px 0px 0px 0px;color: #000;"><?php echo ucfirst($LinksDetails["site_name"]) ?></h1>
                       <span style="font-size:13px;font-weight:800;  color: #000;"> <?php echo ucfirst(nl2br($LinksDetails["contact_content"])) ?></span>
                     </div> 
                  </div><br>
                  <div style="width:100%">
                	<div style="background:#ff0; margin: 10px 0; clear: both; display: block; padding: 3px;width:100%;">PERFORMANCE DETAILS : <?php echo $_SESSION["admin"]["session"] ?></div>  
                </div>
                </div>
               
                <table width="100%" cellpadding="0" style="font-size:12px" cellspacing="0">
                	<tr>
                    	<td><b>Name : </b></td><td><b><?php echo $stuList["name"] ?></b></td>
                        <td><b>Class :</b> </td><td><b><?php echo $_GET["class"]." - ".$stuList["section"] ?></b></td>
                    </tr>
                    <tr>
                    	<td><b>Roll Number : </b></td><td><b><?php echo $stuList["foccupation"] ?></b></td>
                        <td><b>Exam : </b></td><td><b>SA1+SA2</b></td>
                    </tr>
                </table>
				<?php
				$schoolList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subject' and class='".$_GET["class"]."'");
				$i=0;
				if(is_array($schoolList) &&  count($schoolList)>0){
					?>
					<div style="width:49%; float:left; vertical-align:top;">
					<table border="1" style="float:left; font-size:10px; border-color:#fff;" width="99%"  cellpadding="0" cellspacing="0">
					<?php
					foreach($schoolList as $sList){ $i++;
					  if($i==1){?>
						<tr>
							<th rowspan="2" style="background-color:#FF0">SUBJECTS</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th style="background-color:#FF0">SA1</th>
							<?php } ?>
							<th style="background-color:#FF0"><?php echo strtoupper($_GET["term"]) ?></th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th style="background-color:#FF0">SA (I+II)</th>
							<?php } ?>
						</tr>
						<tr>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th >Grade</th>
							<?php } ?>
							<th>Grade</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
						</tr>
					<?php } ?>
                    <?php if(strtoupper($sList["name"])=="ENVIRONMENTAL SCIENCE"){
						?></table></div><div style="width:49%; margin-left:1.5%; float:left; vertical-align:top;">
					<table border="1" style="float:left; font-size:10px;border-color:#fff;" width="99%"  cellpadding="0" cellspacing="0"><?php
						?>
						<tr style="background-color:#FF0">
							<th rowspan="2" >SUBJECTS</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th >SA1</th>
							<?php } ?>
							<th><?php echo strtoupper($_GET["term"]) ?></th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th >SA (I+II)</th>
							<?php } ?>
						</tr>
						<tr>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
							<th>Grade</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
						</tr>
					<?php }
					 ?>
					<tr>
						<td width="250px"><strong><b><?php echo $sList["name"] ?></b></strong></td>
						<?php if($_GET["term"]=="sa2"){ ?>
                        <td align="center">
                        <?php $exam2=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='sa1' and type_id='".$sList["id"]."'") ?>
                        <?php echo FindGrade_naz($sList["marks"],$exam2); ?></td>
                        <?php } ?>
                        <td align="center">
                        <?php $exam1=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$sList["id"]."'") ?>
                        <?php  echo FindGrade_naz($sList["marks"],$exam1); ?></td>
                        <?php if($_GET["term"]=="sa2"){ ?>
                        <td align="center">
                        <?php echo FindGrade_naz(($sList["marks"]+$sList["marks"]),($exam1+$exam2)); ?></td>
                        <?php } ?> 
					</tr>
					<?php 
						$criteriaList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='criteria' and underof=".$sList["id"]);
						if(is_array($criteriaList) &&  count($criteriaList)>0){
							foreach($criteriaList as $cList){
								?>
								<tr>
									<td align="center" width="250px"><strong><?php echo $cList["name"] ?></strong></td>
									<?php if($_GET["term"]=="sa2"){ ?>
                                    <td align="center">
                                    <?php $exam2=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='sa1' and type_id='".$cList["id"]."'") ?>
                                    <?php echo FindGrade_naz($cList["marks"],$exam2); ?></td>
                                    <?php } ?>
                                    <td align="center">
                                    <?php $exam1=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$cList["id"]."'") ?>
                                    <?php echo FindGrade_naz($cList["marks"],$exam1); ?></td>
                                    
                                   	<?php if($_GET["term"]=="sa2"){ ?>
                                    <td align="center">
                                    <?php echo FindGrade_naz(($cList["marks"]+$cList["marks"]),($exam1+$exam2)); ?></td>
                                    <?php } ?> 
								</tr>
								<?php
								$subcriteriaList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subcriteria'  and underof=".$cList["id"]);
								
								if(is_array($subcriteriaList) &&  count($subcriteriaList)>0){
									foreach($subcriteriaList as $scList){
										?>
										<tr>
											<td align="right" width="250px"><?php echo $scList["name"] ?></td>
											<?php if($_GET["term"]=="sa2"){ ?>
                                            <td align="center">
                                            <?php $exam2=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='sa1' and type_id='".$scList["id"]."'") ?>
                                            <?php echo FindGrade_naz($scList["marks"],$exam2); ?></td>
                                            <?php } ?>
                                            <td align="center">
                                            <?php $exam1=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$scList["id"]."'") ?>
                                            <?php echo FindGrade_naz($scList["marks"],$exam1); ?></td>
                                            <?php if($_GET["term"]=="sa2"){ ?>
                                            <td align="center">
                                            <?php echo FindGrade_naz(($scList["marks"]+$scList["marks"]),($exam1+$exam2)); ?></td>
                                            <?php } ?> 
										</tr>
										<?php 
									}
								} 
							}
						}
					
					}
					if($_GET["term"]=="sa2"){
					$att=$db->getRow("SELECT * FROM allattandence where idno='".$stuList["idno"]."' and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'"); ?>
                    <tr>
                    	<td style="font-weight:800;">Attendance</td>
                        <td><?php echo $att["term1_att"]."/".$LinksDetails["term1_all_day"]; ?></td>
                        <td><?php echo $att["term2_att"]."/".$LinksDetails["term2_all_day"]; ?></td>
                        <td><?php echo ($att["term2_att"]+$att["term1_att"])."/".$LinksDetails["overallday"]; ?></td>
                    </tr>
                    <?php }
                    elseif($_GET["term"]=="sa1"){
					$att=$db->getRow("SELECT * FROM allattandence where idno='".$stuList["idno"]."' and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'"); ?>
                    <tr>
                    	<td style="font-weight:800;">Attendance</td>
                        <td><?php echo $att["term1_att"]."/".$LinksDetails["term1_all_day"]; ?></td>
                       
                    </tr>
                    <?php } ?>
					</table>
                    
					</div>
					<?php
				}
				?><div class="removeme">
                <table width="100%">
					<!-- start remarks-->
                	<tr>
                    	<td colspan="3" style="border:0" align="center">
                           
                                <div style="background-color:#ff0; text-align:center; border:solid 2px; width:179px;">
                                    <b>Remarks</b>
                                </div>                       
                        </td>
                    </tr>
										
					<tr>
                    	<td colspan="1" style="border:0" align="center">
                            <div style="width:150px; margin:0 auto">
                                
                                <b>SA1</b>
                                <div style="border:1px solid #000; padding:10px;FONT-SIZE:12PX; width:163px;min-height:50px; text-align:left">
                                <b><?php echo $db->getVal("select r.remarks from naz_remark as r where r.idno='".$stuList["idno"]."' and r.term='sa1'"); ?></b>
                                </div>
                            </div>                            <br /><br />
                        </td>
						
						
						<td colspan="3" style="border:0" align="center">
                            <div style="width:150px; margin:0 auto">
                                
                                <b><?php echo strtoupper($_GET["term"]) ?></b>
                                <div style="border:1px solid #000; padding:10px;FONT-SIZE:12PX; width:163px;min-height:50px; text-align:left">
                                <b><?php echo $db->getVal("select r.remarks from naz_remark as r where r.idno='".$stuList["idno"]."' and r.term='".$_GET["term"]."'"); ?></b>
                                </div>
                            </div>                            <br /><br />
                        </td>
						
                    </tr>
					
				
					<!-- end remarks-->
					
					
					
                	<tr>
                    	<td style="border:1px solid #ccc" height="45px"></td>
                        <td style="border:1px solid #ccc"></td>
                        <td style="border:1px solid #ccc"></td>
                    </tr>
                    <tr>
                    	<td align="center" style="border:1px solid #ccc; background-color:#98ff95"><b>Class Teacher's Signature</b></td>
                        <td align="center" style="border:1px solid #ccc; background-color:#98ff95"><b>Principal's Signature</b></td>
                        <td align="center" style="border:1px solid #ccc; background-color:#98ff95"><b>Parent's  Signature</b></td>
                    </tr>
                </table></div>
                </div>
				<?php
			}
			?>
			</div>
			<?php
		}
	?>
	</form>
	<?php
}elseif(isset($_GET["class"]) && $_GET["class"]!="" && $_GET["typemenow"]=="graph"){
	?>
<form method="post" action="">
	<?php 
	function random_color_part() {
		return str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);
	}
	
	function random_color() {
		return "#".random_color_part() . random_color_part() . random_color_part();
	}
	$section="";
	if(isset($_GET["section"]) && $_GET["section"]!="")$section=" and section='".$_GET["section"]."'";
		$studentList=$db->getRows("select idno,fname,name,section from student where class='".$_GET["class"]."' and status=1 and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'".$section);
		//print_r($_SESSION);echo $db->getLastQuery();$db->getErMsg();
		if(is_array($studentList) && count($studentList)>0){
			?>
            <input type="button" value="print" onclick="printDivNoHeader('printdiv')" style="float:right; position:relative; right:0; margin-top:-40px;" class="btn btn-default" />
            <div id="printdiv">
			<?php $he=0;
			foreach($studentList as $stuList){$he++;?>
                <div class="stuList" style=" <?php if($he==1) echo 'margin-bottom:100px;'; ?>clear: both; display: inline-block; padding: 1px; text-align:center; width:90%;height:950px;">
                <div class="headPrint hide" style="border: none;">
        	  <div style="text-align:center;background: #F5FFD9;"> 
              <h1 style="font-size:33px;margin:0px 0px 0px 0px;color: #EC1E1E;"><?php echo ucfirst($LinksDetails["site_name"]) ?></h1>  </div> 
               <div style="height:42px;width:100%;background: #B5F5BE;color: #0743D2;font-weight: 800;BORDER-TOP: 2PX SOLID RED;font-size:12px;">
                  <ul style="padding-right: 10px;width:100%;margin-top:1px;list-style: none;text-align: left;">
                  <li style="float:left;width:66%"> Name : <?php echo $stuList["name"];?></li>
                  <li style="float:left;width:34%">Class : <?php echo $_GET['class'];if(isset($_GET["section"]) && $_GET["section"]!="") echo "-".$_GET['section']; ?></li>
                  <li style="float:left;width:65%">Father's Name : <?php echo $stuList["fname"];?></li>
                  <li style="float:left;width:33%;padding-left:10px;">Term : <?php echo $_GET["term"]; ?></li>
                  </ul>
            	</div>
                <p style="text-align:center;background:#FFFF36;color:blue;font-weight:800;margin:0;BORDER-TOP:2PX SOLID RED;BORDER-BOTTOM:2PX SOLID RED;font-size:14px;">ANALYTICAL PROGRESS REPORT(<?php echo $_SESSION["admin"]["session"] ?>)</p>           
                <p style="text-align:center;color:#FB007D;font-weight: 800;margin: 0;background: #F5FFD9;font-size:14px;"> GRAPH DESCRIPTION </p>
              <div style="height:58px;width:100%;background:#B5F5BE;color:#0743D2;font-weight: 800;BORDER-TOP: 2PX SOLID RED;BORDER-BOTTOM:2PX SOLID RED;">
              
                 <ul style="padding-right: 10px;width:100%;margin-top:5px;font-size:12px; list-style: none;text-align: left;">
                  <li style="float:left;width:8%"><div class="bar" style="width:100%;background:#FFD2F8;height:15px;"></div></li>
                  <li style="float:left;width:91%;padding-left:5px;">Lines drawn on this rectangular bar are related to this standard(<?php echo $_GET['class']; ?>)</li>
                  <?php if(isset($_GET["section"]) && $_GET["section"]!=""){?>
                  <li style="float:left;width:8%"><div class="bar" style="width: 100%;background:#D0D5FF;height:15px;margin-top:4px;"></div></li>
                  <li style="float:left;width:91%;padding-left:5px;margin-top:4px;">Lines drawn on this rectangular bar are related to this class(<?php echo $_GET['class']."-".$_GET['section']; ?>)</li>
                  <?php } ?>
                  <li style="float:left;width:10%;margin-left:60px;"><div class='midpoint' style="background:#000;">&nbsp;</div><b style="margin-left:3px;">Average</b></li>
                  <li style="float:left;width:10%"><div class='midpoint' style="background:#0DC314;">&nbsp;</div><b style="margin-left:3px;">Highest</b></li>
                  <li style="float:left;width:34%"><div class='rightpoint' style="background:#FFF">&nbsp;</div><b style="margin-left:3px;">Grade Obtained</b></li>
                 </ul>
          
     		 	</div>
      	   </div>
               
				<?php
				$schoolList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subject' and class='".$_GET["class"]."'");
				$i=0;
				if(is_array($schoolList) &&  count($schoolList)>0){
					?>
					<table width="99%"  cellpadding="0" cellspacing="0">
					<?php
					
					foreach($schoolList as $sList){ $i++;
						if($i==1)$color="blue";elseif($i==2)$color="green";elseif($i==3)$color="#FFC808";elseif($i==4)$color="red";elseif($i==5)$color="#6BE00E";elseif($i==6)$color="#0285FF";elseif($i==7)$color="#C90AFF";elseif($i==8)$color="#770606";elseif($i==9)$color="#FFC808";else $color="#0285FF";
						?>
						<tr>
                        	<td style="text-align:right; padding-right:10px; border-right:3px solid #000; color:<?php echo $color ?>" width="200px"><b><?php echo $sList["name"] ?></b></td>
                            <td>
                            <table width="99%"  cellpadding="0" cellspacing="0">
                            	<tr>
                                    <td><br /></td>
                                </tr>
                            	<tr>
                                	<td bgcolor="#FFEAEA">
                                    	<?php $maxMarksInSubject=$db->getRow("select max(marks),total from naz_result where type_id='".$sList["id"]."' AND term='".$_GET["term"]."'  and idno in (select idno from student where class='".$_GET["class"]."')");
										
										$noOfStudent=$db->getVal("select count(idno) from student where class='".$_GET["class"]."'");
										//echo "Total Student : ".$noOfStudent."<br />";
										$totalMaksByStident=$noOfStudent*$maxMarksInSubject[1];
										//echo "Total Marks By Student: ".$totalMaksByStident."<br />";
										$totalObtainMarksOfStudent=$db->getVal("select SUM(marks) from naz_result where type_id='".$sList["id"]."' AND term='".$_GET["term"]."' and  idno in (select idno from student where class='".$_GET["class"]."')");
										//echo "Total obtain Marks By Student: ".$totalObtainMarksOfStudent."<br />";
										$gradeOfAvg=Grade_naz($totalMaksByStident,$totalObtainMarksOfStudent); 
										//echo $db->getErMsg();
										?>
										
                                       <b> <div style="width:<?php echo $gradeOfAvg[1] ?>%; border-right:3px solid #000; text-align:right; padding-right:1px"><?php echo $gradeOfAvg[0] ?></div></b><?php			
										$gradeOfMaxMarks=Grade_naz($maxMarksInSubject[1],$maxMarksInSubject[0]); 
										?>
                        				<b><div style="width:<?php echo $gradeOfMaxMarks[1] ?>%; border-right:3px solid #0dc314; text-align:right; padding-right:1px; margin-top: -19px;"><?php echo $gradeOfMaxMarks[0] ?></div></b>
                                    </td>
                                </tr>
                                <tr>
                                	<td align="left"><?php $exam1=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$sList["id"]."'");
									$grade=Grade_naz($sList["marks"],$exam1); ?>
                       <b> <div style="width:<?php echo (float)$grade[1] ?>%; background-color:<?php echo $color ?>;"><span style="color:#000;background-color:#fff;border-radius:50%;width: 18px;height: 17px;display: inline-block;padding: 4px; text-align:center"><?php echo $grade[0] ?></span></div></b>
                        </td>                                
                                </tr>
                                <tr>
                                <?php if($_GET["section"]!=""){ ?>
                                	<td bgcolor="#EAEAFF">
                                    	<?php $maxMarksInSubject=$db->getRow("select max(marks),total from naz_result where type_id='".$sList["id"]."' AND term='".$_GET["term"]."' and idno in (select idno from student where class='".$_GET["class"]."' and section='".$_GET["section"]."')");
										
										$noOfStudent=$db->getVal("select count(idno) from student where class='".$_GET["class"]."'");
										//echo "Total Student : ".$noOfStudent."<br />";
										$totalMaksByStident=$noOfStudent*$maxMarksInSubject[1];
										//echo "Total Marks By Student: ".$totalMaksByStident."<br />";
										$totalObtainMarksOfStudent=$db->getVal("select SUM(marks) from naz_result where type_id='".$sList["id"]."' AND term='".$_GET["term"]."'  and  idno in (select idno from student where class='".$_GET["class"]."')");
										//echo "Total obtain Marks By Student: ".$totalObtainMarksOfStudent."<br />";
										$gradeOfAvg=Grade_naz($totalMaksByStident,$totalObtainMarksOfStudent); 
										//echo $db->getErMsg();
										?>
                                      <b>  <div style="width:<?php echo $gradeOfAvg[1] ?>%; border-right:3px solid #000; text-align:right; padding-right:1px"><?php echo $gradeOfAvg[0] ?></div></b><?php			
										$gradeOfMaxMarks=Grade_naz($maxMarksInSubject[1],$maxMarksInSubject[0]); 
										?>
                        				<b><div style="width:<?php echo $gradeOfMaxMarks[1] ?>%; border-right:3px solid #0dc314; text-align:right; padding-right:1px; margin-top: -19px;"><?php echo $gradeOfMaxMarks[0] ?></div></b>
                                    </td>
                                <?php } ?>
                                </tr>
                            </table>
                            </td>
						</tr>
						<?php  
					}
					?>
					</table>
					<?php
				}
				?>
                </div>
				<?php
			}
			?>
			</div>
			<?php
		}
	?>
	</form>
	<?php
}elseif(isset($_GET["class"]) && $_GET["class"]!=""){
	?>
<form method="post" action="">    	
    
	<?php 
	$section="";
	if(isset($_GET["section"]) && $_GET["section"]!="")$section=" and section='".$_GET["section"]."'";
		$studentList=$db->getRows("select foccupation,idno,name,section from student where class='".$_GET["class"]."' and status=1 and school_id='".$_SESSION["admin"]["school_id"]."' and session='".$_SESSION["admin"]["session"]."'".$section);
		//print_r($_SESSION);echo $db->getLastQuery();$db->getErMsg();
		if(is_array($studentList) && count($studentList)>0){
			?><input type="submit" style="float:right; position:relative; right:0; margin-top:-40px;" class="btn btn-default" /><?php
			foreach($studentList as $stuList){?>
                <div class="stuList">
                <table width="100%">
                	<tr>
                    	<td>Name : </td><td><?php echo $stuList["name"] ?></td>
                        <td>Class : </td><td><?php echo $_GET["class"]." - ".$stuList["section"] ?></td>
                    </tr>
                    <tr>
                    	<td>Roll Number : </td><td><?php echo $stuList["foccupation"] ?></td>
                        <td>Exam : </td><td>SA1+SA2</td>
                    </tr>
                </table>
				<?php
				$schoolList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subject' and class='".$_GET["class"]."'");
				$i=0;
				if(is_array($schoolList) &&  count($schoolList)>0){
					?>
					<div style="width:49%; float:left; vertical-align:top;">
					<table border="1" style="float:left; font-size:10px;" width="99%"  cellpadding="0" cellspacing="0">
					<?php
					foreach($schoolList as $sList){ $i++;
					   if($i==1){?>
						<tr>
							<th rowspan="2">SUBJECTS</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th style="background-color:#FF0">SA1</th>
							<?php } ?>
							<th><?php echo strtoupper($_GET["term"]) ?></th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th style="background-color:#FF0">SA (I+II)</th>
							<?php } ?>
						</tr>
						<tr>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
							<th>Grade</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
						</tr>
					<?php } ?>
                    <?php if(strtoupper($sList["name"])=="ENVIRONMENTAL SCIENCE"){
						?></table></div><div style="width:49%; margin-left:1.5%; float:left; vertical-align:top;">
					<table border="1" style="float:left; font-size:10px;" width="99%"  cellpadding="0" cellspacing="0"><?php
						?>
						<tr>
							<th rowspan="2">SUBJECTS</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th style="background-color:#FF0">SA1</th>
							<?php } ?>
							<th><?php echo strtoupper($_GET["term"]) ?></th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th style="background-color:#FF0">SA (I+II)</th>
							<?php } ?>
						</tr>
						<tr>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
							<th>Grade</th>
                            <?php if($_GET["term"]=="sa2"){ ?> 
								<th>Grade</th>
							<?php } ?>
						</tr>
					<?php }
					 ?>
					<tr>
						<td width="250px"><strong><?php echo $sList["name"] ?></strong></td>
						<td align="center">
                        <?php $mymarks=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$sList["id"]."'") ?>
                        <input type="hidden" name="idno[]" value="<?php echo $stuList["idno"] ?>" />
						<input type="hidden" name="id[]" value="<?php echo $sList["id"] ?>" />
						<input type="hidden" name="total[]" value="<?php echo $sList["marks"] ?>"/>
						<?php echo $sList["marks"] ?>/<input max="<?php echo $sList["marks"] ?>" type="number" name="marks[]" style="width:80px"  value="<?php echo $mymarks; ?>" /></td>
					</tr>
					<?php 
						$criteriaList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='criteria' and underof=".$sList["id"]);
						if(is_array($criteriaList) &&  count($criteriaList)>0){
							foreach($criteriaList as $cList){
								?>
								<tr>
									<td align="center" width="250px"><strong><?php echo $cList["name"] ?></strong></td>
									<td align="center">
                                    <?php $mymarks=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$cList["id"]."'") ?>
                                    <input type="hidden" name="idno[]" value="<?php echo $stuList["idno"] ?>" />
                                    <input type="hidden" name="id[]" value="<?php echo $cList["id"] ?>" />
									<input type="hidden" name="total[]" value="<?php echo $cList["marks"] ?>"/>
						<?php echo $cList["marks"] ?>/<input max="<?php echo $cList["marks"] ?>" type="number" name="marks[]" style="width:80px" value="<?php echo $mymarks ?>" /></td>
								</tr>
								<?php
								$subcriteriaList=$db->getRows("SELECT * FROM naz_type where school_id='".$_SESSION["admin"]["school_id"]."' and type='subcriteria'  and underof=".$cList["id"]);
								if(is_array($subcriteriaList) &&  count($subcriteriaList)>0){
									foreach($subcriteriaList as $scList){
										?>
										<tr>
											<td align="right" width="250px"><?php echo $scList["name"] ?></td>
											<td align="center">
                                            <?php $mymarks=$db->getVal("select marks from naz_result where idno='".$stuList["idno"]."' and term='".$_GET["term"]."' and type_id='".$scList["id"]."'") ?>
                                            <input type="hidden" name="idno[]" value="<?php echo $stuList["idno"] ?>" />
                                            <input type="hidden" name="id[]" value="<?php echo $scList["id"] ?>" />
						<input type="hidden" name="total[]" value="<?php echo $scList["marks"] ?>"/>
						<?php echo $scList["marks"] ?>/<input max="<?php echo $scList["marks"] ?>" type="number" name="marks[]" style="width:80px" value="<?php echo $mymarks?>" /></td>
										</tr>
										<?php 
									}
								} 
							}
						}
					}
					?>
					</table>
					</div>
					<?php
				}
				?>
                </div>
				<?php
			}
		}
	?>
	</form>
	<?php
} ?>