<?php require "_header.php";?>

<script language="javascript" type="text/javascript">
document.getElementById("main-content").style.display = 'none';
</script>
<style type="text/css">

	.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:20px;	
		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']);
	
		$semester_id  = $_REQUEST['semester_hidden']=='undefined'?"":Escape($_REQUEST['semester_hidden']);
	$div_id	   = Escape($_REQUEST['division_id']);
	$student_id   = Escape($_REQUEST['student_hidden']); 
	$branch_disp 	= Escape($_REQUEST['branch_disp']);
		if($branch_id == "" && $semester_id == "")
		{?>
			<script language="javascript" type="text/javascript">
				location.href='student-letter.php';
			</script><?php
		}
	
		elseif($_SESSION['VedantnrCollegeId']!="" && isset($_SESSION['VedantnrCollegeId']))
		{
		if($student_id != 0  || $student_id  != '')
		{
			$adm_year =  getAdmYear($student_id);
		}
		ob_start();
		$i=1;
		$sql_student = "
					SELECT
						sm.student_id,
						sm.student_gturegno,
						sm.student_address,
						sm.	student_mobilestudents,
						sm.	student_mobileparents,
						sm.student_phoneo,
						sm.student_pincode,
						CONCAT(sm.student_surname,' ',sm.student_firstname,' ',sm.student_lastname) AS student_name,
						YEAR(sm.student_admdate) as adm_year,
						sm.student_admby,
						sm.student_techcerti,
						sm.tfw_scheme,
						sd.cur_semesterid,
						semester_name,
						branch.branch_name,
						sd.cur_divison,
						student_mobilestudents,
						student_mobileparents
					FROM
						cms_studentmaster sm,
						cms_studentdetail sd,
						cms_semestermaster sem,
						cms_branchmaster branch
					WHERE
						sm.student_id = sd.student_id AND
						sm.student_active = 1 AND 
						sd.cur_semesterid = sem.semester_id AND
						sd.cur_branchid = branch.branch_id 	 AND
						sd.year_id = ".$_SESSION["VedantnrYearId"];
		$where = "";
		if($student_id != 0)
			$where .= " AND sm.student_id = $student_id "; 
		if($branch_id != "" && $branch_id != "All")
			$where .= " AND sd.cur_branchid = $branch_id ";
		if($semester_id != "" )
			$where .= " AND sd.cur_semesterid = $semester_id ";
		if($div_id != "")
			$where  .= " AND sd.cur_divison = '".$div_id."'";
		if($where != "")
			$sql_student .= $where;	
			
		 $sql_student .= " ORDER BY sd.cur_branchid , sd.cur_semesterid,sm.student_gturegno ";	
		
		//echo $sql_student;
		$res_student = dbQuery($sql_student);
		if(dbRows($res_student)>0)
		{?>
  
					<?php					
			
					$TEMPCOUNT=1;
					$i = 1;
				while($rec_student = dbArray($res_student))
				{
						//echo "tempcount-".$TEMPCOUNT;
						//echo "</br>";
						$nir = 1;
						$student_id 		= $rec_student['student_id'];
						$student_gturegno 	= $rec_student['student_gturegno'];
						$student_name 		= $rec_student['student_name'];
						$tfw_scheme 		= $rec_student['tfw_scheme'];
						$total_amount 		= 0;
						$received_amount 	= 0;
						$debit_amount 		= 0;
						$cur_semesterid     = $rec_student['cur_semesterid'];
						$semester_id= $rec_student['cur_semesterid'];
						$adm_year=$rec_student['adm_year'];
						$student_techcerti=$rec_student['student_techcerti'];
						//fees year start
						$SQL_year = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$adm_year."%' LIMIT 0 , 1";
						$SQL_c2d_year = dbQuery($SQL_year);
						$year_arr = dbArray($SQL_c2d_year);
						$c2d_year = $year_arr[0] ;
						$fees_year = "";
						$test="";
						if($student_gturegno !="" && $student_gturegno !=0 && $student_techcerti!="" && $semester_id == 3 && $c2d_year == $_SESSION["VedantnrYearId"])
						{
							$test = "Freess";
							$student_feesyear = trim(substr($student_gturegno,0,-10));
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$student_feesyear."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0] - 2;
							$semester_id = $semester_id - 2;
						}
						elseif($student_gturegno !="" && $student_gturegno !=0 && $semester_id == 3 && $_SESSION["VedantnrYearId"] == 11 && $student_techcerti =="")
						{
							$test = "Freess";
							$student_feesyear = trim(substr($student_gturegno,0,-10));
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$student_feesyear."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0] + 2;
						}
						elseif($student_gturegno !="" && $student_gturegno !=0 && $student_techcerti =="")
						{
							$test = "Freess1";
							$student_feesyear = trim(substr($student_gturegno,0,-10));
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$student_feesyear."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0];
						}
						elseif($student_techcerti !="" && $semester_id == 3 && $c2d_year == $_SESSION["VedantnrYearId"] && $student_techcerti !="")
						{
							$test = "Freess2";
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$adm_year."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0];
							$semester_id = $semester_id;
						}
						elseif($student_techcerti !="" && $semester_id == 3 && $c2d_year == $_SESSION["VedantnrYearId"] )
						{
							$test = "Freess2";
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$adm_year."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0] - 2;
							$semester_id = $semester_id - 2;
						}
						elseif($student_techcerti !="" && $c2d_year != $_SESSION["VedantnrYearId"] )
						{
							$test = "Freess3";
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$adm_year."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0] ;
						}
						else
						{
							$test = "Freess4";
							$SQL_fees = "SELECT year_id FROM `cms_yearmaster` WHERE `year_name` LIKE '%".$adm_year."%' LIMIT 0 , 1";
							$SQL_fees_res = dbQuery($SQL_fees);
							$fees_year_arr = dbArray($SQL_fees_res);
							$fees_year = $fees_year_arr[0] ;
							if($semester_id == 1){
								$fees_year=$_SESSION["VedantnrYearId"];
							}
						}
						/*echo $test.$rec_student['student_gturegno']." - ";
						echo $fees_year."<br/>";*/
						//exit;*/
						if($rec_student['student_admby'] != "ACPDC")
						{
								$sql_setupamt = "SELECT SUM(fees_amount) AS fees_amount 
												 FROM cms_feessetup 
												 WHERE  year_id = ".trim($fees_year)." 
												 AND semester_id = $semester_id AND head_id != 1";
								if($rec_student['student_techcerti'] == "" && $semester_id == 3)
								{
									$sql_setupamt .= " AND head_id != 23";	
									$sql_setupamt .= " AND head_id != 24";	
								}
								if($head_id != "" && $head_id != "undefined" && $head_id != "All")
								{
									$sql_setupamt .= " AND head_id IN(1,".$head_id.") ";	
								}
								
								$res_setupamt = dbQuery($sql_setupamt);
								$rec_setupamt = dbArray($res_setupamt);
								$total_amount = $rec_setupamt['fees_amount'];
								
						}
						elseif($rec_student['student_admby'] == "ACPDC" && $_SESSION["VedantnrYearId"] == '11')
						{
								$sql_setupamt = "SELECT SUM(fees_amount) AS fees_amount 
												 FROM cms_feessetup 
												 WHERE  year_id = ".trim($fees_year)." 
												 AND semester_id = $semester_id AND head_id != 1";
								if($rec_student['student_techcerti'] == "" && $semester_id == 3)
								{
									$sql_setupamt .= " AND head_id != 23";	
									$sql_setupamt .= " AND head_id != 24";	
								}
								if($head_id != "" && $head_id != "undefined" && $head_id != "All")
								{
									$sql_setupamt .= " AND head_id IN(1,".$head_id.") ";	
								}
								
								$res_setupamt = dbQuery($sql_setupamt);
								$rec_setupamt = dbArray($res_setupamt);
								$total_amount = $rec_setupamt['fees_amount'];
								
						}
						else
						{
						//echo 'nirav-7';
						//echo "</br>";
						$flag_amt = 0;
						$sql_setupamt="";
						$sql_setupamt = "
									SELECT fh.head_id,fh.head_name,fs.fees_amount 
									FROM cms_feessetup as fs,cms_feeshead as fh 
									WHERE  fs.head_id = fh.head_id 
									AND fs.semester_id = $semester_id";
									
								if($head_id != "" && $head_id != "undefined" && $head_id != "All")
								{
									$sql_setupamt .= " AND fs.head_id IN(1,".$head_id.") ";	
								}
								if($fees_year!="")
								{
									$sql_setupamt.=" AND year_id = ".$fees_year;
								}else{
									$sql_setupamt.=" AND year_id = ".$c2d_year;
								}	
								$sql_setupamt.= " order by fh.head_id,fh.fees_type ASC ";
								
									
								$res_setupamt = dbQuery($sql_setupamt);
								$$flag_amt=0;
								while($rec_setupamt = dbArray($res_setupamt))
								{	
									if($rec_setupamt['head_name'] == "ACPDC Adm Fee")
									{
										$flag_amt = $rec_setupamt["fees_amount"];
										if($tfw_scheme == 0)
										{
											$total_amount= ($total_amount - $rec_setupamt["fees_amount"]);
											
										}
										
									}else if($tfw_scheme == 1 && $rec_setupamt["head_name"] == "Tution Fee")
									{
											continue;
									}
									else{
											$total_amount += $rec_setupamt["fees_amount"];
									}
									
							
								}
						  }
						
						
						$sql_receivedamt = "
								SELECT
									SUM(recdetail_amt) AS receive_amt
								FROM
									cms_feesreceivemaster frm,
									cms_feesreceivedetail frd
								WHERE
									frm.feesreceive_id = frd.feesreceive_id ";
									 //AND frm.year_id = ".$_SESSION["VedantnrYearId"];
						
								$where = "";
								if($student_id != 0)
									$where .= " AND frm.student_id = $student_id "; 
								if($branch_id != "" && $branch_id != "All")
									$where .= " AND frm.branch_id = $branch_id ";
								if($semester_id != "")
									$where .= " AND frm.semester_id = $semester_id ";
								if($div_id != "")	
										$where  .= " AND frm.division_id = '".$div_id."'";
								if($where != "")
									$sql_receivedamt .= $where;		
										
								if($head_id != "" && $head_id != "undefined" && $head_id != "All")
								{
									$sql_receivedamt .= " AND frd.head_id IN(".$head_id.") ";	
								}
								
								//echo "</br>";
								/*echo $rec_student['student_gturegno']." - ".$sql_receivedamt."<br/>";
								echo "</br>";*/
								
																
								$res_receivedamt = dbQuery($sql_receivedamt);
								$rec_receivedamt = dbArray($res_receivedamt);
								$received_amount = (empty($rec_receivedamt['receive_amt'])) ? '0' : $rec_receivedamt['receive_amt'];
				
								//echo "Total amount-".$total_amount;
								$debit_amount = $total_amount-$received_amount;
				
								//if($debit_amount > 0)
								//{
								?>
<div id="main-report">
<table width="100%" border="0" cellpadding="2" cellspacing="2" style="font-size:12px;  color:#000;">
	  
	   <tr>
	    <td  align="center" colspan="2"><div class="college_name" style="height:30px;padding:0px">ઇમેજ એન્જીનીયરીંગ એન્ડ ટેકનીકલ ઇન્સ્ટીટ્યુટ</div></td>
	  </tr>
  	<tr>
    	<td  align="center" colspan="2">
    	  <div class="college_address" style="height:16px;padding:0px">વાલુકાંસ ચોકડી પાસે, માતર-તારાપુર રોડ, ગામ-અસલાલી, તા. માતર, જિ. ખેડા પીન-૩૮૭૫૩૦</div>
    	</td>
	  </tr>
		<tr>
    	<td  align="center" colspan="2">
		  	<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> 
  <tr>
		<td width="78%" align="left">
      <textarea rows="7" cols="45" style="padding:2px;border:1px solid #000; font-weight:bold; font-size:12px;"><?php echo "To,\n". $student_name."\n".str_replace("'","",$rec_student['student_address'])." Pin: ".$rec_student['student_pincode']."\n"."Phone: ";
      	if($rec_student['student_mobileparents']!="")
      	{
      	  echo $rec_student['student_mobileparents'];
      	}
      	if($rec_student['student_mobilestudents']!="")
      	{
      	  echo ','.$rec_student['student_mobilestudents'];
      	}
      	if($rec_student['student_phoneo']!="")
      	{
      	  echo ','.$rec_student['student_phoneo'];
      	}
      	if($rec_student['student_phoner']!="")
      	{
      	  echo ','.$rec_student['student_phoner'];
      	}
      	?>
      </textarea>
		</td>
    <td width="22%" style="text-align:right;padding-right:5px;vertical-align:top;"><?php echo 'Date :&nbsp;'.$date; ?></td>
	</tr>
	<tr>
			<td width="100%" colspan='2' align="left" style="font-size:15px;">
				<br>
				<p>સુજ્ઞ વાલીગણ,</p>
				<br>
				<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; કુશળ હશો !!!</p>
				<br>
				<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; નવા વર્ષ ની હાર્દીક શુભકામનાઓ.............. </p>
				<br>
				<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;ધોરણ-૧૦ બાદ આપના બાળકની શૈક્ષણિક કારકીર્દી આગળ ધપાવવાના આપના શુભગ નિર્ણયમાં અમારી સંસ્થામાં પ્રવેશ લઇ અમોને તેમાં ભાગીદાર બનાવવા બદલ અમો આભારી છીએ.</p>
				
				<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;આપનો પાલ્ય <b><?php echo $student_name; ?></b> એ અમારી સંસ્થામાં ડીપ્લોમાં એન્જીનીયરીંગની <b><?php echo $branch_disp;?></b>&nbsp;.શાખામાં પ્રવેશ લીધેલ છે.તમે જાણો છો કે હાલમાં ચાલી રહેલ સેમેસ્ટરની નિયમિત શરૂઆત તા-૦૮/૦૮/૨૦૧૫ થી શરુ થયી ગયેલ હતી. આ પત્ર દ્વારા તમને તમારા પાલ્યની જરૂરી માહિતી અને સેમેસ્ટરના બાકી રહેલા હવે પછીના અભ્યાસ દરમ્યાન અમારા તમામ થીયરી અથવા પ્રેક્ટીકલ ક્લાસમાં નિયમિત હાજરી આપવા તમને સુચના આપવામાં આવે છે </p>
				<br>
				<ul style="list-style-type:disc" > 
							
				<li>	આપના પાલ્યની હાજરી આ મહિનામાં _________ % છે.</li>
				
				<li>	આપના પાલ્યની ફી <b><?php echo $debit_amount; ?> </b>રૂપિયા બાકી છે. તે તાત્કાલિક ભરી દેવી.</li>
				
				<li>	કોલેજ માં નિયમ અનુસાર ટર્મવર્ક સબમીશન કરાવેલ______________.</li>
				
				<li>	સંસ્થાનો સમય ૯:૦૦ થી ૩:૪૫ નો છે.સંસ્થામાં જાહેર રજા તેમજ બીજો અને ચોથો શનિવાર દરમ્યાન જ કોલેજમાં રજા આપવામાં આવે છે. આ સિવાય કોઈ રજા આપવામાં આવતી નથી.જેની ખાસ નોંધ લેવા વિનંતી.</li>

				<li>	મીડ સેમેસ્ટરની પરીક્ષા તથા રીમીડ પરીક્ષા સફળતાપૂર્વક આપેલ છે કે નહિ .</li>
				
				<li> 	કોલેજ બસ તથા રહેવા અને જમવાની આધુનિક સગવડ અનુભવીને તથા નિયમિત હાજરી ને અનુલક્ષી ને ઘણા બધા વિદ્યાર્થીઓ એ રૂપિયા ૫૦૦/- નું માસિક સ્ટાઇપેંડ સંસ્થા દ્વારા આપવામાં આવેલ છે.</li>
				
				<li>	આ ઉપરાંત આપના પાલ્યનો આગળ નો અભ્યાસ ચાલુ થવા અર્થે આગામી સેમેસ્ટર ની સંસ્થા ની ફી ભરવાની તારીખ અને રજીસ્ટ્રેશન કરવાની તારીખ નીચે મુજબ છે.</li>
				</ul>
				
					<table border = "6" height="125" width="700"  align="center" style="border-color:black">
						<tr>
								<th style="text-align:center;font-size:200%">-: બીજા સેમેસ્ટર માટે:-
									તા: ૦૮/૦૧/૨૦૧૬ થી ૨૦/૦૧/૨૦૧૬</th>
						</tr>	
					</table>
						
				
				<ul style="list-style-type:disc" style="font-size:15px;"> 
				<li>		આથી વિશેષ રાજ્યસરકાર  તથા કોઈ પણ શિષ્યવૃત્તિ ની વધુ જાણકારી માટે કોલેજ માં<b> હિમાંશુભાઈ મકવાણા</b> તથા<b> ધર્મેન્દ્રભાઈ સોલંકી</b> નો રૂબરૂ સંપર્ક કરવો .</li>
				
				<li>		ઉપરકોત દર્શાવેલ સરનામું તથા ફોન નંબર માં કોઈ બદલાવ હોય તો  આપ  તાત્કાલિક સંસ્થા નો  રૂબરૂ સંપર્ક કરવો. અથવા<b> ૯૯૭૮૯૦૦૪૭૪</b> પર સંપર્ક કરવો </li>
			
				<li>	વધુ માહિતી માટે કોલેજનું નોટીશ બોર્ડ દરરોજ અચૂક વાંચવું.</li>				
				</ul>
				
				<table border = "0"   align="center" style="border-color:black">
						<tr>
								<th style="text-align:center;font-size:150%"> G.T.U ની પરીક્ષાનું ટાઇમ ટેબલ નીચે મુજબ છે.</th>
						</tr>	
			</table>
				
				<?php if($semester_id == 1)
				{
				?>
			
			<br>
		<table border='1' class='table-report'  cellpadding='0' cellspacing='0' width='100%'  align='center'>
				<tr>
				<th>SR</th>
				<th>SUBJECT CODE</th>
				<th>SUBJECT NAME</th>	
				<th>DATE</th>
				<th>TIME</th>
				</tr>
			
				<?php
				if($branch_id == 1 && $semester_id == 1)
				{
				?>
				<tr>
					<td>1</td>
					<td>3300002</td>
					<td>ENGLISH</td>
					<td>22-Dec-15</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>2</td>
					<td>3300004</td>
					<td>ENGINEERING PHYSICS   ( GROUP-1 )</td>
					<td>01-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>3</td>
					<td>3300003</td>
					<td>ENVIRONMENT CONSERVATION AND HAZARD MANAGEMENT</td>
					<td>04-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>4</td>
					<td>3300007</td>
					<td>BASIC ENGINEERING DRAWING</td>
					<td>06-Jan-16</td>
					<td>10:30 AM TO 01:30 PM</td>
				</tr>
				<tr>	
					<td>5</td>
					<td>3300001</td>
					<td>BASIC MATHEMATICS</td>
					<td>08-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				<?php
			}
			else if ($branch_id == 2 && $semester_id == 1)
			{
			?>
				<tr>
					<td>1</td>
					<td>3300002</td>
					<td>ENGLISH</td>
					<td>22-Dec-15</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>2</td>
					<td>3300006</td>
					<td>ENGINEERING CHEMISTRY ( GROUP-2 )</td>
					<td>01-Jan-16</td>
					<td>02:30 PM TO 05:00 PM </td>
				</tr>
				<tr>	
					<td>3</td>
					<td>3300003</td>
					<td>ENVIRONMENT CONSERVATION AND HAZARD MANAGEMENT</td>
					<td>04-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>4</td>
					<td>3300015</td>
					<td>FUNDAMENTAL OF MECHANICAL ENGINEERING</td>
					<td>07-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>5</td>
					<td>3300001</td>
					<td>BASIC MATHEMATICS</td>
					<td>08-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>	
			<?php
			}
			else if ($branch_id == 3 && $semester_id == 1)
			{	
			?>
				<tr>
					<td>1</td>
					<td>3300004</td>
					<td>ENGINEERING PHYSICS   ( GROUP-1 )</td>
					<td>01-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>2</td>
					<td>3300003</td>
					<td>ENVIRONMENT CONSERVATION AND HAZARD MANAGEMENT</td>
					<td>04-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
				<td>3</td>
					<td>3300007</td>
					<td>BASIC ENGINEERING DRAWING</td>
					<td>06-Jan-16</td>
					<td>10:30 AM TO 01:30 PM</td>
				</tr>
				<tr>	
				<td>4</td>
					<td>3300001</td>
					<td>BASIC MATHEMATICS</td>
					<td>08-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>	
				
			<?php
			}
			else if($branch_id == 5 && $semester_id == 1)
			{
			?>
			
			<tr>
					<td>1</td>
					<td>3300002</td>
					<td>ENGLISH</td>
					<td>22-Dec-15</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>2</td>
					<td>3310701</td>
					<td>COMPUTER PROGRAMMING</td>
					<td>28-Dec-15</td>
					<td>10:30 AM TO 01:00 PM</td>
				</tr>
				<tr>	
				<td>3</td>
					<td>3310702</td>
					<td>FUNDAMENTAL OF DIGITAL ELECTRONICS</td>
					<td>01-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
				<td>4</td>
					<td>3300003</td>
					<td>ENVIRONMENT CONSERVATION AND HAZARD MANAGEMENT</td>
					<td>04-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
				<td>5</td>
					<td>3300001</td>
					<td>BASIC MATHEMATICS</td>
					<td>08-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
			
			<?php
			}
			else if($branch_id == 7 && $semester_id == 1)
			{
			?>
			
			<tr>
					<td>1</td>
					<td>3300002</td>
					<td>ENGLISH</td>
					<td>22-Dec-15</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
					<td>2</td>
					<td>3300008</td>
					<td>APPLIED MECHANICS</td>
					<td>30-Dec-15</td>
					<td>10:30 AM TO 01:00 PM</td>
				</tr>
				<tr>	
				<td>3</td>
					<td>3300004</td>
					<td>ENGINEERING PHYSICS ( GROUP-1 )</td>
					<td>01-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
				<td>4</td>
					<td>3300007</td>
					<td>BASIC ENGINEERING DRAWING</td>
					<td>06-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
				<tr>	
				<td>5</td>
					<td>3300001</td>
					<td>BASIC MATHEMATICS</td>
					<td>08-Jan-16</td>
					<td>10:30 AM TO 01:00 PM </td>
				</tr>
			<?php
			}
			?>	
			</table>
			<br>
			<?php
			}
			?>
			
				આપના બાળકની ઉચ્ચ કારકિદીના સહકાર ની  અપેક્ષા સહ...... 
	
	</td>
  </tr>
 
</table>
					<p align="right">આપનો વિશ્વાસુ </p>
	
					<b><p align="right">મહેન્દ્રભાઈ ઠક્કર </p></b>
</div>        								

	<?php
			}
			?>	
		

		<?php
		}
		else
		{
			echo "No data found for selected criteria.";	
		}		
	}  
 else{
      	echo "Session Expired";      
   	 } 
	?>
		
		
	<?php	
	//$where .= " AND sm.student_gturegno=".$_POST['student_gturegno'];

?>



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


<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";
?>