<?php require "_header.php";?>
<script language="javascript" type="text/javascript">
document.getElementById("main-content").style.display = 'none';
</script>
<style type="text/css">
	.table-report{
		font-family:Verdana, Geneva, sans-serif;
		font-size:12px;
		text-align:left;
		border-right:0px none;
		border-bottom:0px none;
	}
	.table-report-inner{
		font-family:Verdana, Geneva, sans-serif;
		font-size:12px;
	}
	.table-report tr{
		padding:2px 2px 2px 2px;
	}
	.table-report td{
		padding:2px 2px 2px 2px;
		border-top:0px none;
		border-left:0px none;
	}
	.table-report th{
		padding:2px 2px 2px 2px;
		font-weight:bold;
		text-align:center;
		border-top:0px none;
		border-left:0px none;
	}	
	.college_name{
		font-family:QTAbbie;
		font-size:22px;	
		font-weight:bold;
		padding:2px 2px 2px 2px;
		text-align:center;
	}
	.college_address{
		font-family:Tahoma, Geneva, sans-serif;
		font-size:11px;	
		text-align:center;
		padding:2px 2px 2px 2px;
	}
</style>
<?php
ob_start();
  $branch_id 		= Escape($_REQUEST['branch_hidden']);
	$semester_id	= Escape($_REQUEST['semester_hidden']);
	$div_id		    = Escape($_REQUEST['division_id']);
	$shift		    = Escape($_REQUEST['shift']);
	
	$branch_disp   = Escape($_REQUEST['branch_disp']);
	$semester_disp = Escape($_REQUEST['semester_disp']);
	//$date 		   = Escape($_REQUEST['date']);
	
	//$where .= " AND sm.student_gturegno=".$_POST['student_gturegno'];
	if($branch_id != "" &&  $branch_id != "All"){
	  $where.= " AND sd.cur_branchid = ".$branch_id;
	}
	if($semester_id != "" && $semester_id != "undefined"){
		$where.= " AND sd.cur_semesterid = ".$semester_id;
	}
	if($div_id != ""){
		$where.= " AND sd.cur_divison = '".$div_id."'";
	}
	if($shift != ""){
		$where.= " AND sm.shift = '".$shift."'";
	}
	//$where .= " AND sm.student_gturegno=".$_POST['student_gturegno'];
	$i=0;		

	$qry ="SELECT sm.*,sd.*,bm.branch_name from cms_studentmaster as sm
	        LEFT JOIN cms_studentdetail as sd on sd.student_id=sm.student_id
	        LEFT JOIN cms_branchmaster as bm on sm.branch_id=bm.branch_id 
	       WHERE 1=1 
	         AND sm.college_id= '".$_SESSION["VedantnrCollegeId"]."' 
			 AND sd.year_id = ".$_SESSION["VedantnrYearId"]."".$where."
	   ORDER BY sm.student_gturegno ASC";
  $rs = dbQuery($qry);
	$total= dbRows($rs);
	$HeadData = array("count" => $total, "data" => array());
	$sr=1;
	if(dbRows($rs) > 0)
	{
		while($row = dbArray($rs))
		{
			$name = $row["student_surname"]." ".$row["student_firstname"]." ".$row["student_lastname"]; 
			$qtip = $row["student_gturegno"];
			$branchname=$row["branch_name"];
			
			$HeadData["data"][$i] = $temparray;   
			$i++;
			$sr++;
?>
<div id="main-report">
<table width="100%" border="0" cellpadding="2" cellspacing="2" style="font-size:12px; color:#000;">
  <tr>
    <td colspan="2" align="center"><div class="college_name" style="height:30px;padding:0px">ઇમેજ એન્જીનીયરીંગ એન્ડ ટેકનીકલ ઇન્સ્ટીટ્યુટ</div></td>
 </tr>
  <tr>
    <td colspan="2" align="center">
      <div class="college_address" style="height:16px;padding:0px">વાલુકાંસ ચોકડી પાસે, માતર-તારાપુર રોડ, ગામ-અસલાલી, તા. માતર, જિ. ખેડા પીન-૩૮૭૫૩૦</div>
    </td>
	</tr>
	<tr>
    <td colspan="2" align="center">
		  <div class="college_address" style="height:16px;border-bottom: 4px double #fff; margin-bottom:10px;">
                  ફોન:- (૦૨૬૯૪) ૨૨૬૦૫૧,૨૨૬૦૫૨ મો.-૯૯૭૮૯૦૦૪૭૪/૮૬.  URL: www.image.ac.in
			</div>
			<hr style="color: #000000; height: 2px; margin-bottom: -5px;">
			<hr style="color: #000000; height: 2px; margin-top: -1px;">
    </td>
	</tr>
	
	</table>

 <table class="table-report" border="1" cellpadding="0" cellspacing="0" width="80%" align="center">
<tr>
	<th colspan='6' align="center">Marksheet Register</th>
</tr>
<tr>
	<th width='8%'>Name:</th>
	<td colspan='2' align='center' ><?php echo $name; ?> </td>
	<th>Enrollment No</th>
	<td colspan='2' align='center' ><?php echo $qtip; ?> </td>
</tr>
</table>
<table border='1' class='table-report'  cellpadding='0' cellspacing='0' width='80%' align='center'>
<tr height='25'>
	<th width='10%'>Sr No</th>
	<th width='10%' >Semester</th>
	<th width='25%' >Sr Nr Of Marksheet</th>	
	<th width='25%'>Receiver Sign</th>
	<th width='20%'>Given Sign</th>
	<th width='10%'>Date</th>
</tr>

</table>

<?php
echo "<table border='1' class='table-report'  cellpadding='0' cellspacing='0' width='80%' align='center'>";

for ($row = 1; $row <=15 ; $row ++) {
   echo "<tr>";

   for ($col = 1; $col <= 1; $col ++) {
        echo "<td height='22' width='10%' >", $row , "</td>";
   }for ($col = 1; $col <= 1; $col ++) {
        echo "<td height='22' width='10%' >", ' ' , "</td>";
   }
   for ($col = 1; $col <= 1; $col ++) {
        echo "<td height='22' width='25%' >", ' ' , "</td>";
   }
   for ($col = 1; $col <= 1; $col ++) {
        echo "<td height='22' width='25%' >", ' ' , "</td>";
   }
   for ($col = 1; $col <= 1; $col ++) {
        echo "<td height='22' width='20%' >", ' ' , "</td>";
   }
   for ($col = 1; $col <= 1; $col ++) {
        echo "<td height='22' width='10%' >", ' ' , "</td>";
   }	
 
   echo "</tr>";
}

echo "</table>";
echo "<br><br><br><br>";

?>
</div>
<?php
    }
	}
	$HtmlCode = ob_get_contents();
	ob_end_flush();
	
	$header_row_string="";
	$HtmlUrl = "student-marksheet-register.html";
	$HtmlPath =	"report/".$HtmlUrl;
	createHTMLReportPage($header_row_string,$HtmlUrl,$HtmlPath,$HtmlCode,false);
?>

<br/>
<form name="frm" id="frm" action="" method="post">		
    
    <input type="hidden"   name="txtFile" id="txtFile" value="<?php echo $HtmlUrl ;?>" />
    <!--input type="button"  name="btnPrint" id="btnPrint" value="Print" onClick="SetPageAction('PRINT');"/-->
    <input type="button"  name="btnPdf" id="btnPdf" value="Create PDF" onClick="SetPageAction('PDF');"/>
    <!--input type="button" name="btnHtml" id="btnHtml" value="Create HTML" onClick="SetPageAction('HTML');"/>
    <input type="button" name="btnWord" id="btnWord" value="Create WORD" onClick="SetPageAction('WORD');"/>
    <input type="button" name="btnExcel" id="btnExcel" value="Create EXCEL" onClick="SetPageAction('Excel');"/-->

</form>
<script language="javascript" type="text/javascript">
function SetPageAction(varAction) {
	if(varAction=="PRINT"){			
		document.frm.action="print/create-print.php";
		document.frm.target = "_blank";
		document.frm.submit();
	}
	else if(varAction=="PDF"){			
		document.frm.action="convertpdf/create-pdf.php";
		document.frm.target = "_blank";
		document.frm.submit();
	}
	else if(varAction=="HTML"){
		document.frm.action="<?php echo $HtmlPath ;?>";
		document.frm.target = "_blank";
		document.frm.submit();
	}
	else if(varAction=="WORD"){
		document.frm.action="convertword/create-word.php";
		document.frm.target="_blank";
		document.frm.submit();
	}
	else if(varAction=="Excel"){
		document.frm.action="convertword/create-excel.php";
		document.frm.target="_blank";
		document.frm.submit();
	}
}
</script>
<?php 
		require "_footer.php";
?>