<!DOCTYPE html>

<?php
$flag=$_REQUEST['flag'];
//$id=$_REQUEST['id'];
if($flag=='')
{
	/*require_once('convert_marathi.php');
	$no=$_GET['no'];
	$ltrid=$_REQUEST['ltr_id'];*/
	$no=$_REQUEST['no'];

	if($no=='2') 
	{
		require_once('convert_marathi.php');
		//$no=$_GET['no'];
		$ltrid=$_REQUEST['ltr_id'];
		$no=$_REQUEST['no'];
		include('rec_sort_desk_dashboard.php');
		$username = $_SESSION['User_Name'];
		?>
		<html>
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<script type="text/javascript">     
		function PrintDiv() 
		{    
			var divToPrint = document.getElementById('divToPrint');
			var popupWin = window.open('', '_blank', 'width=600,height=600');
			popupWin.document.open();
			popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
			popupWin.document.close();
		}
		</script>
		<script>
		function dt_check(str)
		{
			var dt  = document.getElementById(str);
			var dt1 = dt.value;
			if(dt1!="")
			{
			//alert("date chk"+dt1);
			
			var arr = dt1.split("-");
			var cnt = arr.length;
			//alert("cnt:"+cnt);
			
			if(cnt==3)
			{
				if(isNaN(arr[0]))
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(arr[0].length!=2)
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(parseInt(arr[0]) < 1 || parseInt(arr[0]) > 31)
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(isNaN(arr[1]))
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(arr[1].length!=2)
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(parseInt(arr[1]) < 1 || parseInt(arr[1]) > 12)
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(isNaN(arr[2]))
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(arr[2].length!=4)
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
				else if(parseInt(arr[2]) < 1970 || parseInt(arr[2]) > 2100)
				{
					alert("Please Enter Date in Proper Format!!!");
					//dt.focus();
					dt.value="";
					return false;
				}
			}
			else
			{
				alert("Please Enter Date in Proper Format!!!");
				dt.focus();
				dt.value="";
				return false;
			}
			
			}
		}
		</script>
		<script src="tableToExcel.js"></script>
		</head>
		<body>
		<div class="mainwrapper">   
			<div class="rightpanel">
					<ul class="breadcrumbs">
						<li><a href=""><i class="iconfa-home"></i></a> <span class="separator"></span></li>
						<li><a href="">Tables</a> <span class="separator"></span></li>
						<li>रिपोर्ट्स </li>
					</ul>
					<div class="pageheader">
						<div class="pageicon"><span class="iconfa-table"></span></div>
						<div class="pagetitle">
							<h5>Tables</h5>
							<h1>रिपोर्ट्स </h1>
						</div>
					</div><!--pageheader-->
					<div class="maincontent">
						<div class="maincontentinner">
							<?php
							$qx= mysql_query("SELECT * FROM desk_master dm,department_master d WHERE dm.desk_id = (select desk_id from login where login_id='$username')
							AND d.dept_id=dm.dept_id") or die("".mysql_error());
							$rwx=mysql_fetch_array($qx) or die("".mysql_error());
							
							$id=$_REQUEST['id'];
							
							echo "<h4 class=widgettitle>".$rwx['dept_nm']." -> ".$rwx['desk_nm']." रिपोर्ट्स   </h4>";
							?>
							
							<form method="post" action="rec_sort_report.php?no=2&id=<?php echo $id; ?>&uname=<?php echo $username; ?>">
								<?php 		
									$id=$_REQUEST['id'];
								###################################### Display Counter ########################
								if($id=="")
								{
									echo "<form name='dept_sandarbh' action='' method='post'>
									<div align='center'><br><table align='center' cellpadding='2' cellspacing='0' class='myClass'>
									<table>
										<tr>											  
											<td align='center'><label style='width:110px;'>Enter Year :</label></td>
											<td align='center'><input type='text' name='year' class='input-small'/></td>
										</tr>
										<tr>
											<td colspan='6'>
											<div align='center'>
												<input type='submit' name='ok' value='GO'/>
												<input type='reset' value='CLEAR' name='clear'/>
											</div>
											</td>
										</tr>
									</table>
								</div>				
								</form><br><br> ";
								
								$yr=$_POST['year'];	
								$cur_yr=date("Y");
								
								echo "<table id='dyntable' class='table table-bordered'>	
										<thead>
											<tr>
												<th rowspan=3 class='head0 center' style=width:160px;>अ.क्र </th>
												<th colspan=7 class='head0 center' style=width:160px;>फाईलची संख्‍या </th>
											</tr>
											<tr>
												<th rowspan=2 class='head0 center' style=width:160px;>फाईल नष्‍ट करावयाचे वर्ष (वर्ष टाकावे) </th>
												<th colspan=6 class='head0 center' style=width:160px;>वर्गीकरण </th>
											</tr>
											<tr>
												<th class='head0 center' style=width:160px;>अ </th>
												<th class='head0 center' style=width:160px;>ब </th>
												<th class='head0 center' style=width:160px;>क </th>
												<th class='head0 center' style=width:160px;>क१ </th>
												<th class='head0 center' style=width:160px;>ड </th>
												<th class='head0 center' style=width:160px;>एकूण </th>
											</tr>
										</thead>";
									echo "<tbody>";	
								
									if($yr=='')
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$cur_yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											
											$qre=mysql_query("SELECT COUNT(*) AS total from desk_transaction d
											where d.nasti_nashta_dt!='0000-00-00'
											AND d.vargawari='$vargawari'
											AND d.desk_id_from=(select desk_id from login where login_id='$username')
											AND d.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'><a href='rec_sort_jatanprakar.php?no=2&id=".$vargawari." '>".$rws['total']." </a></td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
									else
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											
											$qre=mysql_query("SELECT COUNT(*) AS total from desk_transaction d
											where d.nasti_nashta_dt!='0000-00-00'
											AND d.vargawari='$vargawari'
											AND d.desk_id_from=(select desk_id from login where login_id='$username')
											AND d.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'><a href='rec_sort_jatanprakar.php?no=2&id=".$vargawari." '>".$rws['total']." </a></td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
									echo "</tbody>
										</table>";
						
								
							echo "<div id='divToPrint' style='display:none;'>
							<center><h2>पोलीस अधिक्षक कार्यालय, <br> जि.रायगड <h2>
								<table id='export' border='1px' style='margin-left:50px;'>";
								
							echo "<tr><td colspan='9'><center><b>".$rsz['dept_nm']."  रेकॉर्ड सॉर्टिंग </b></center></td></tr>";
							echo "<tr>
									<th rowspan=3 class='head0 center' style=width:160px;>अ.क्र </th>
									<th colspan=7 class='head0 center' style=width:160px;>फाईलची संख्‍या </th>
								</tr>
								<tr>
									<th rowspan=2 class='head0 center' style=width:160px;>फाईल नष्‍ट करावयाचे वर्ष (वर्ष टाकावे) </th>
									<th colspan=6 class='head0 center' style=width:160px;>वर्गीकरण </th>
								</tr>
								<tr>
									<th class='head0 center' style=width:160px;>अ </th>
									<th class='head0 center' style=width:160px;>ब </th>
									<th class='head0 center' style=width:160px;>क </th>
									<th class='head0 center' style=width:160px;>क१ </th>
									<th class='head0 center' style=width:160px;>ड </th>
									<th class='head0 center' style=width:160px;>एकूण </th>
								</tr>";
									
									if($yr=='')
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$cur_yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											
											$qre=mysql_query("SELECT COUNT(*) AS total from desk_transaction d
											where d.nasti_nashta_dt!='0000-00-00'
											AND d.vargawari='$vargawari'
											AND d.desk_id_from=(select desk_id from login where login_id='$username')
											AND d.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'>".$rws['total']."</td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
									else
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											
											$qre=mysql_query("SELECT COUNT(*) AS total from desk_transaction d
											where d.nasti_nashta_dt!='0000-00-00'
											AND d.vargawari='$vargawari'
											AND d.desk_id_from=(select desk_id from login where login_id='$username')
											AND d.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'>".$rws['total']." </td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
							echo "</table></div>";
							
							echo "<br>
							<p>	
								<center>
								<input type='button' value='Print Page' onclick='PrintDiv();' class='btn btn-primary'/>
								<input type='button' class='btn' onclick='tableToExcel('sample_1', 'Sandarbha-Nusar Report')' value='Export to Excel'></center>
							</p>";
					
					} 
							################################## End Of Display Counter #####################
					?>		
					</form>
					<?php include_once('footer.php'); ?>
					</div><!--maincontentinner-->
				</div><!--maincontent-->
			</div><!--rightpanel-->
		</div><!--mainwrapper-->
		</body>
		</html>
<?php
	}

} // if($flag=='')

/////////////////////////////////////////////////////////////////////////////////////////////

else if($flag=='n')
{
	require_once('convert_marathi.php');
	$no=$_GET['no'];
	$ltrid=$_REQUEST['ltr_id'];

############################################### Jatan Prakar Wise Report For Department ########################################

include('rec_sort_dpt_dashboard.php');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="text/javascript">     
       function PrintDiv() {    
           var divToPrint = document.getElementById('divToPrint');
           var popupWin = window.open('', '_blank', 'width=600,height=600');
           popupWin.document.open();
           popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
            popupWin.document.close();
       }
</script> 
<script src="tableToExcel.js"></script>
<script>
function dt_check(str)
{
	var dt  = document.getElementById(str);
	var dt1 = dt.value;
	if(dt1!="")
	{
	//alert("date chk"+dt1);
	
	var arr = dt1.split("-");
	var cnt = arr.length;
	//alert("cnt:"+cnt);
	
	if(cnt==3)
	{
		if(isNaN(arr[0]))
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(arr[0].length!=2)
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(parseInt(arr[0]) < 1 || parseInt(arr[0]) > 31)
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(isNaN(arr[1]))
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(arr[1].length!=2)
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(parseInt(arr[1]) < 1 || parseInt(arr[1]) > 12)
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(isNaN(arr[2]))
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(arr[2].length!=4)
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
		else if(parseInt(arr[2]) < 1970 || parseInt(arr[2]) > 2100)
		{
			alert("Please Enter Date in Proper Format!!!");
			//dt.focus();
			dt.value="";
			return false;
		}
	}
	else
	{
		alert("Please Enter Date in Proper Format!!!");
		dt.focus();
		dt.value="";
		return false;
	}
	
	}
}
</script>
</head>

<body>
<div class="mainwrapper">   
    <div class="rightpanel">
        <ul class="breadcrumbs">
            <li><a href=""><i class="iconfa-home"></i></a> <span class="separator"></span></li>
            <li><a href="">Tables</a> <span class="separator"></span></li>
            <li>रिपोर्ट्स </li>
        </ul>
        <div class="pageheader">
            <div class="pageicon"><span class="iconfa-table"></span></div>
            <div class="pagetitle">
                <h5>Tables</h5>
                <?php 
				$qryz=mysql_query("Select dept_nm from department_master where dept_id=(select dept_id from login where login_id='$username')");
				$rsz=mysql_fetch_array($qryz);
				$id=$_REQUEST['id'];
				
				?>
               <!-- <h1><?php echo 	$rsz['dept_nm'];?> रेकॉर्ड सॉर्टिंग </h1>-->
				<h1>रिपोर्ट्स </h1>
            </div>
        </div><!--pageheader-->
        <div class="maincontent">
            <div class="maincontentinner">
				<h4 class="widgettitle"><?php echo 	$rsz['dept_nm'];?> रिपोर्ट </h4>
					<form method="post" action="rec_sort_report.php?flag=n&uname=<?php echo $username; ?>">
						<?php 		
							
							############################ Display Counter ##############################
							if($id=="" )
							{
								echo "<form name='dept_sandarbh' action='' method='post'>
								<div align='center'><br><table align='center' cellpadding='2' cellspacing='0' class='myClass'>
								<table>
									<tr>											  
										<td align='center'><label style='width:110px;'>Enter Year :</label></td>
										<td align='center'><input type='text' name='year' class='input-small'/></td>
									</tr>
									<tr>
										<td colspan='6'>
										<div align='center'>
											<input type='submit' name='ok' value='GO'/>
											<input type='reset' value='CLEAR' name='clear'/>
										</div>
										</td>
									</tr>
								</table>
							</div>				
							</form><br><br> ";
							
							$yr=$_POST['year'];	
							$cur_yr=date("Y");
								echo "<table id='dyntable' class='table table-bordered'>	
										<thead>
											<tr>
												<th rowspan=3 class='head0 center' style=width:160px;>अ.क्र </th>
												<th rowspan=3 class='head0 center' style=width:160px;> विभागाचे नाव </th>
												<th colspan=7 class='head0 center' style=width:160px;>फाईलची संख्‍या </th>
											</tr>
											<tr>
												<th rowspan=2 class='head0 center' style=width:160px;>फाईल नष्‍ट करावयाचे वर्ष (वर्ष टाकावे) </th>
												<th colspan=6 class='head0 center' style=width:160px;>वर्गीकरण </th>
											</tr>
											<tr>
												<th class='head0 center' style=width:160px;>अ </th>
												<th class='head0 center' style=width:160px;>ब </th>
												<th class='head0 center' style=width:160px;>क </th>
												<th class='head0 center' style=width:160px;>क१ </th>
												<th class='head0 center' style=width:160px;>ड </th>
												<th class='head0 center' style=width:160px;>एकूण </th>
											</tr>
										</thead>";
									echo "<tbody>";	
								
									if($yr=='')
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$rsz['dept_nm']." </td>
											<td class='center'>".$cur_yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											$qre=mysql_query("SELECT COUNT(*) AS total from incoming_letters_transaction i, tapal_to_dpt_transaction t, department_master dm
											where i.ltr_id=t.ltr_id
											AND dm.dept_id=t.dept_id_from
											AND t.nasti_nashta_dt!='0000-00-00'
											AND dm.desk_flag='N'
											AND t.vargawari='$vargawari'
											AND t.dept_id_from=(select dept_id from login where login_id='$username')
											AND t.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'><a href='rec_sort_jatanprakar.php?flag=n&id=".$vargawari." '>".$rws['total']." </a></td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
									else
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$rsz['dept_nm']." </td>
											<td class='center'>".$yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											$qre=mysql_query("SELECT COUNT(*) AS total from incoming_letters_transaction i, tapal_to_dpt_transaction t, department_master dm
											where i.ltr_id=t.ltr_id
											AND dm.dept_id=t.dept_id_from
											AND t.nasti_nashta_dt!='0000-00-00'
											AND dm.desk_flag='N'
											AND t.vargawari='$vargawari'
											AND t.dept_id_from=(select dept_id from login where login_id='$username')
											AND t.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'><a href='rec_sort_jatanprakar.php?flag=n&id=".$vargawari." '>".$rws['total']." </a></td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
									echo "</tbody>
										</table>";
						
								
							echo "<div id='divToPrint' style='display:none;'>
							<center><h2>पोलीस अधिक्षक कार्यालय, <br> जि.रायगड <h2>
								<table id='export' border='1px' style='margin-left:50px;'>";
								
							echo "<tr><td colspan='9'><center><b>".$rsz['dept_nm']."  रेकॉर्ड सॉर्टिंग </b></center></td></tr>";
							echo "<tr>
									<th rowspan=3 class='head0 center' style=width:160px;>अ.क्र </th>
									<th rowspan=3 class='head0 center' style=width:160px;> विभागाचे नाव </th>
									<th colspan=7 class='head0 center' style=width:160px;>फाईलची संख्‍या </th>
								</tr>
								<tr>
									<th rowspan=2 class='head0 center' style=width:160px;>फाईल नष्‍ट करावयाचे वर्ष (वर्ष टाकावे) </th>
									<th colspan=6 class='head0 center' style=width:160px;>वर्गीकरण </th>
								</tr>
								<tr>
									<th class='head0 center' style=width:160px;>अ </th>
									<th class='head0 center' style=width:160px;>ब </th>
									<th class='head0 center' style=width:160px;>क </th>
									<th class='head0 center' style=width:160px;>क१ </th>
									<th class='head0 center' style=width:160px;>ड </th>
									<th class='head0 center' style=width:160px;>एकूण </th>
								</tr>";
									
									if($yr=='')
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$rsz['dept_nm']." </td>
											<td class='center'>".$cur_yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											$qre=mysql_query("SELECT COUNT(*) AS total from incoming_letters_transaction i, tapal_to_dpt_transaction t, department_master dm
											where i.ltr_id=t.ltr_id
											AND dm.dept_id=t.dept_id_from
											AND t.nasti_nashta_dt!='0000-00-00'
											AND dm.desk_flag='N'
											AND t.vargawari='$vargawari'
											AND t.dept_id_from=(select dept_id from login where login_id='$username')
											AND t.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'><a href='rec_sort_jatanprakar.php?flag=n&id=".$vargawari." '>".$rws['total']." </a></td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
									else
									{
										echo "<tr class='gradeX'>
											<td class='center'>1. </td>
											<td class='center'>".$rsz['dept_nm']." </td>
											<td class='center'>".$yr."</td>
											<td class='center'>कायम </td>";
										convert_marathi();
										$q=mysql_query("SELECT * from  jatanprakar_master where jatanprakar_nm!='अ ' ");
										$total=0;
										while($r=mysql_fetch_array($q))
										{
											$vargawari=$r['jatanprakar_nm'];
											$qre=mysql_query("SELECT COUNT(*) AS total from incoming_letters_transaction i, tapal_to_dpt_transaction t, department_master dm
											where i.ltr_id=t.ltr_id
											AND dm.dept_id=t.dept_id_from
											AND t.nasti_nashta_dt!='0000-00-00'
											AND dm.desk_flag='N'
											AND t.vargawari='$vargawari'
											AND t.dept_id_from=(select dept_id from login where login_id='$username')
											AND t.final_nashta_dt IS NULL ") or die("".mysql_error());
											
											$rws=mysql_fetch_array($qre);
											echo "<td class='center'><a href='rec_sort_jatanprakar.php?flag=n&id=".$vargawari." '>".$rws['total']." </a></td>";
											$total=$total+$rws['total'];
										}
										echo "<td class='center'>".$total." </td>";
									}
							echo "</table></div>";
							
							echo "<br>
							<p>	
								<center>
								<input type='button' value='Print Page' onclick='PrintDiv();' class='btn btn-primary'/>
								<input type='button' class='btn' onclick='tableToExcel('sample_1', 'Sandarbha-Nusar Report')' value='Export to Excel'></center>
							</p>";
						
						
							}
						############################ End Of Display Counter ##############################	

						?>
							
							
					</form>
					<br /><br />
                    <?php include_once('footer.php'); ?>
				</div><!--maincontentinner-->
			</div><!--maincontent-->
		</div><!--rightpanel-->
</div><!--mainwrapper-->
</body>
</html>
<?php 

######################################### End OF Jatan Prakar Wise Report For Department ########################

} //else if($flag=='n')
?>
