<?php require "_header.php"; ?>
<script language="javascript" type="text/javascript">
document.getElementById("main-content").style.display = 'none';
</script>
<div id="main-report" align="center">
<style>
	.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:left;
		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;
	}
	.report_name{
		font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
		font-size:13px;	
		background-color:#CCC;
		text-align:center;
		font-weight:bold;
		padding:2px 2px 2px 2px;
	}
</style>
<?php 
$adm_year = '';
	$header_row_string="Student Debit Fees Report";
	
	$branch_id 	= Escape($_REQUEST['branch_hidden']);
	$semester_id  = $_REQUEST['semester_hidden']=='undefined'?"":Escape($_REQUEST['semester_hidden']);
	$div_id	   = Escape($_REQUEST['division_id']);
	$student_id   = Escape($_REQUEST['student_hidden']); 
	$head_id 	  = Escape($_REQUEST['head_hidden']); 
	$head_name    = Escape($_REQUEST['head_disp']);
		$allsem    = Escape($_REQUEST['allsem']);
			$regular    = Escape($_REQUEST['regular']);
	
	
	$pos= strpos($_REQUEST['head_hidden'],'All');
	if ($pos !== false) {
		$head_id = "All";
		$head_name = "All";
	}
	$branch_disp 	= Escape($_REQUEST['branch_disp']);
	$semester_disp  = Escape($_REQUEST['semester_disp']);
	$show_mobile_no = Escape($_REQUEST['show_mobile_no']);
	$allsem = Escape($_REQUEST['allsem']);
	if($branch_id == "" && $semester_id == "")
	{?>
		<script language="javascript" type="text/javascript">
			location.href='report-fees-dueamt.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,
						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,
						frm.student_id,
						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,
						cms_feesreceivemaster frm
					WHERE
						frm.student_id = sm.student_id and
						sm.student_id = sd.student_id AND
						sm.student_active = 1 AND 
						sm.transport_facility='on' and
						
						sd.cur_semesterid = sem.semester_id AND
						sd.cur_branchid = branch.branch_id 	 AND
						sd.year_id = ".$_SESSION["VedantnrYearId"];
		
		$where = "";
		if($head_name == 'Ahmedabad to Collage')
		{
			$where .= " AND frm.head_name= 'Ahmedabad to Collage'";
		}
		if($head_name == 'Anand To Collage')
		{
			$where .= " AND frm.head_name= 'Anand To Collage'";
		}
		if($head_name == 'Nadiad To Collage')
		{
			$where .= " AND frm.head_name= 'Nadiad To Collage'";
		}
		if($head_name == 'Alindra To Collage')
		{
			$where .= " AND frm.head_name= 'Alindra To Collage'";
		}
		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)
		{?>
                    <div class="college_name">
                        <?php echo $_SESSION["VedantnrCollegeName"]; ?>
                    </div>
                    <div class="college_address">
                            <?php echo $_SESSION["VedantnrCollegeAddress"]; ?>
                    </div>
                    <div class="report_name">
                            Student Debit Fees Report
                    </div>
                    <br/><br/>
									 <table width="100%"  cellpadding="0" cellspacing="0" >
                        <tr>
                        <td align="left" style="border:solid 0px red;"><b>Branch:</b>
                        <?php 
                            echo $branch_disp;
                            if($semester_disp != "")
                            {
                                echo " - ".$semester_disp;	
                            }
                            if($div_id != "")
                            {
                                echo " - ".$div_id;	
                            }
                            
                        ?>
                        </td>
                        
                      
                      <?php if($head_name != "")
                            { ?>
                        <td align="right" style="border:solid 0px red;" ><b>Head:</b><?php echo $head_name; ?></td>
                    		<?php } ?>
                    	</tr>
                    </table>                    
                    <table width="100%" class="table-report" border="1" cellpadding="0" cellspacing="0">
                        <tr>
                            <th style="text-align:left;">Sr No</th>
                            <th style="text-align:left;">Enrollment Reg No</th>
                            <th style="text-align:left;">Student Name</th>
                            <?php if($show_mobile_no=='true'){ ?>
                            <th style="text-align:center;">Parents Mo</th>
                            <th style="text-align:center;">Student Mo.</th>
							<?php } ?>
                            <th style="text-align:center;">Adm. Type</th>
                            <th style="text-align:right;">Receiveble</th>
                            <th style="text-align:right;">Received</th>
                            <th style="text-align:right;">Debit Amt</th>
                        </tr>
					<?php					
			
					$TEMPCOUNT=1;
					$i = 1;
				while($rec_student = dbArray($res_student))
				{
						//echo "tempcount-".$TEMPCOUNT;
						//echo "</br>";
						$nir = 1;
						if( ($rec_student['branch_name'] != $temp && $branch_disp == ':: All ::') || ($rec_student['semester_name'] != $temp1 && $semester_disp=='' ) )
						{
							
							$temp1 = $rec_student['semester_name'];
							$temp = $rec_student['branch_name'];
							if($i!=1)
							{?>
                                      <tr><th colspan="<?php echo $show_mobile_no=='true'?'6':'4'?>" style="text-align:center;">Total</th>
                                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $gtotal_amount; ?></th>
                                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $greceived_amount; ?></th>
                                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $gdebit_amount; ?></th>
                                    </tr>
					  <?php }  ?>
                        
                   					<tr><th colspan="<?php echo $show_mobile_no=='true'?'9':'8'?>"><?php echo strtoupper($temp)."  ".$rec_student['semester_name']; ?></th></tr>
                   		<?php
							$i = 1;
							$ntotal_amount+=$gtotal_amount;
							$nreceived_amount+=$greceived_amount;
							$ndebit_amount+=$gdebit_amount;
					
							 $gtotal_amount=0;
							 $greceived_amount=0;
							 $gdebit_amount=0;
					   }
			
            
						$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"] == 12 && $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"] )
						{
							$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 !="" && $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" && $rec_student['student_admby'] != "M.Q" && $rec_student['student_admby'] != "V.Q")
						{
								$sql_setupamt = "SELECT SUM(fees_amount) AS fees_amount 
												 FROM cms_feessetup 
												 WHERE  year_id =year_id = $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.") Group by 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"] == '14')
						{
								$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.") Group by head_id ";	
								}
								
								$res_setupamt = dbQuery($sql_setupamt);
								$rec_setupamt = dbArray($res_setupamt);
								$total_amount = $rec_setupamt['fees_amount'];
								
						}
						elseif($rec_student['student_admby'] == "V.Q" && $_SESSION["VedantnrYearId"] == '14')
						{
							 $sql_setupamt = "SELECT SUM(fees_amount) AS fees_amount 
												 FROM cms_feessetup 
												 WHERE  year_id = '14' 
												 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.") Group by head_id ";	
								}
							//	echo $sql_setupamt; exit;
								$res_setupamt = dbQuery($sql_setupamt);
								$rec_setupamt = dbArray($res_setupamt);
								$total_amount = $rec_setupamt['fees_amount'];
								
						}
						elseif($rec_student['student_admby'] == "M.Q" && $_SESSION["VedantnrYearId"] == '14')
						{
								$sql_setupamt = "SELECT SUM(fees_amount) AS fees_amount 
												 FROM cms_feessetup 
												 WHERE  year_id = '14' 
												 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.") Group by 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.") Group by 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+amount_discount) 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.") Group by head_id";	
								}
						//		echo  $sql_receivedamt; 
								//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)
								//{
								?>
										<tr>
											<td>&nbsp;<?php echo $i++; ?></td>
											<td>&nbsp;<?php echo $student_gturegno; ?></td>
											<td>&nbsp;<?php echo $student_name; ?></td>
                                            <?php if($show_mobile_no=='true'){ ?>
                                            <td style="text-align:center;">&nbsp;<?php echo $rec_student['student_mobileparents']; ?></td>
											<td style="text-align:center;">&nbsp;<?php echo $rec_student['student_mobilestudents']; ?></td>
                                            <?php } ?>
                                            <td style="text-align:center;">&nbsp;<?php echo $rec_student['student_admby']; ?></td>
                                            <td style="text-align:right; padding-right:2px;">&nbsp;<?php echo $total_amount; ?></td>
											<td style="text-align:right; padding-right:2px;">&nbsp;<?php echo $received_amount; ?></td>
											<td style="text-align:right; padding-right:2px;">&nbsp;<?php echo $debit_amount; ?></td>
										</tr>
										<?php
										$gtotal_amount+=$total_amount;
										$greceived_amount+=$received_amount;
										$gdebit_amount+=$debit_amount;
								//}
								/*else
								{
									echo "No data found for selected criteria.";
									//exit;
								}*/
				
				}
			
				$ntotal_amount+=$gtotal_amount;
				$nreceived_amount+=$greceived_amount;
				$ndebit_amount+=$gdebit_amount;
			?>	
             <tr>
                 	   		<th colspan="<?php echo $show_mobile_no=='on'?'6':'4'?>" style="text-align:center;">Total</th>
                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $gtotal_amount; ?></th>
                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $greceived_amount; ?></th>
                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $gdebit_amount; ?></th>
                    </tr>
                     <tr>
                    <td colspan="10" >
                    <table class="table-report-footer" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td align="left" style="border:solid 0px red;" width="70%">Created by <b><?php echo $_SESSION["VedantnrUserName"]; ?></b> </td>
                            <td align="right" style="border:solid 0px red;" width="30%">Developed By <b>Aum Imagineering Pvt.Ltd.</b></td>
                        </tr>
                    </table>
                    </td>        
					</tr>
                    
                    
              <?php if($branch_id == "All" || $semester_id == ""  )
			  		{ ?>
                     <tr>
                    	<th colspan="<?php echo $show_mobile_no=='on'?'6':'4'?>" style="text-align:center;">Grand Total</th>
                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $ntotal_amount; ?></th>
                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $nreceived_amount; ?></th>
                        <th style="text-align:right; padding-right:2px;">&nbsp;<?php echo $ndebit_amount; ?></th>
                    </tr>
                     <tr>
                    <td colspan="10" >
                    <table class="table-report-footer" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td align="left" style="border:solid 0px red;" width="70%">Created by <b><?php echo $_SESSION["VedantnrUserName"]; ?></b> </td>
                            <td align="right" style="border:solid 0px red;" width="30%">Developed By <b>Aum Imagineering Pvt.Ltd.</b></td>
                        </tr>
                    </table>
                    </td>        
					</tr>
                    
                   
                    <?php }?>
            </table><?php				
			$HtmlCode= ob_get_contents();
			ob_end_flush();
			$header_row_string="";
			$HtmlUrl  =	"feesdueamt-report.html";
			$HtmlPath =	"report/".$HtmlUrl;
			createHTMLReportPage($header_row_string,$HtmlUrl,$HtmlPath,$HtmlCode);
		?>
		<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
		}
		else
		{
			echo "No data found for selected criteria.";	
		}		
	}  
   	else{
      	echo "Session Expired";      
   	} 
?>
</div>
<?php require "_footer.php";?>