<!DOCTYPE html>
<?php 

 require_once('convert_marathi.php');
 $no=$_GET['no'];
 
if($no==1)
{ #################################### Stamp Report For tapal ########################################################### 
include('dashboard_tapal.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 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">
				<h4 class="widgettitle"> Form-B Service Stamp Account </h4>
				<form method="post" action="" >
				<?php 
				$curdt=date("d-m-Y");
				echo "<br><center><h5>".$curdt." पर्यंतचे स्टॉक रिपोर्ट्स</h5></center><br><br> "; 
					convert_marathi();
					$qx= mysql_query("SELECT * FROM stamp_master") or die("fgh".mysql_error());
					echo "<table id='dyntable' class='table table-bordered'>		
					<thead style=align:center>
					<tr>
						<th class='head1 center'>तिकिटाचे नाव </th>
						<th class='head0 center'> स्टॉक </th>
						<th class='head0 center'> एकूण रक्कम  </th>
					</tr>
					</thead><tbody>";
					$stock=0;
					$amount=0;
					while($rwx=mysql_fetch_array($qx)) 
					{
							
						echo "<tr class='gradeX'>";
						$amt=$rwx['value']*$rwx['stock'];
						echo "<td class='center'>".$rwx['stamp_nm']."</a></td>	<td class='center'>". $rwx['stock']."</td> <td class='center'>". $amt."</td></tr>";     
						$stock=$stock+$rwx['stock'];
						$amount=$amount+$amt;
					}
					//echo "<tr class='gradeX'><td class='center'>Total </td><td class='center'>". $stock."</td><td class='center'>". $amount."</td> </tr>";    
						
						?>
                    </tbody>
                </table>
				<?php
				echo "<div id='divToPrint' style='display:none;'>
							<center><table id='export' border='1px' style='border-collapse:collapse;width:700px;text-align :center;'>
							<tr><td colspan='9'><center>  तिकिटाचे स्टॉक रिपोर्ट्स </center></td></tr>";
				//echo ' <center><h2>पोलीस अधिक्षक कार्यालय, <br> जि.रायगड <h2></center>';			
				echo ' <center><h2> Form-B Service Stamp Account <h2></center>';			
					$curdt=date("d-m-Y");
					echo "<center><strong>".$curdt." पर्यंतचे स्टॉक रिपोर्ट्स</strong></center><br><br> "; 
					convert_marathi();
					$qx= mysql_query("SELECT * FROM stamp_master") or die("".mysql_error());
					echo "<tr>
							<th>तिकिटाचे नाव </th>
							<th> स्टॉक </th>
							<th> एकूण रक्कम </th>
						</tr>";
						$stock=0;
						$amount=0;
					while($rwx=mysql_fetch_array($qx)) 
						{
							echo "<tr class='gradeX'>";
							$amt=$rwx['value']*$rwx['stock'];
							echo "<td class='center'>".$rwx['stamp_nm']."</a></td>	<td class='center'>". $rwx['stock']."</td> <td class='center'>". $amt."</td></tr>";     
							$stock=$stock+$rwx['stock'];
							$amount=$amount+$amt;    
						}
                    echo "</table></center></div>";
             
				?>
				<br>
				<p>	
					<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"/>
					<input type="button" class="btn" onclick="tableToExcel('export', 'W3C Example Table')" value="Export to Excel"></center>
				</p>
<?php }
 #################################### End OF Stamp Report For tapal ########################################################### 
else if($no==2)
{
 #################################### Stamp Report For BDO ########################################################### 
include('dashboard_bdo.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 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
					echo "<h4 class=widgettitle>तिकिटाचे स्टॉक रिपोर्ट्स  </h4>";?>
					<form method="post" action="" >
						<?php 		
						convert_marathi();
						$qx= mysql_query("SELECT * FROM stamp_master") or die("fgh".mysql_error());
					echo "<table id='dyntable' class='table table-bordered'>		
					<thead style=align:center>
					<tr>
						<th class='head1 center'>तिकिटाचे नाव </th>
						<th class='head0 center'> स्टॉक </th>
						<th class='head0 center'> एकूण रक्कम  </th>
					</tr>
					</thead><tbody>";
					$stock=0;
					$amount=0;
					while($rwx=mysql_fetch_array($qx)) 
					{
							
						echo "<tr class='gradeX'>";
						$amt=$rwx['value']*$rwx['stock'];
						echo "<td class='center'>".$rwx['stamp_nm']."</a></td>	<td class='center'>". $rwx['stock']."</td> <td class='center'>". $amt."</td></tr>";     
						$stock=$stock+$rwx['stock'];
						$amount=$amount+$amt;
					}
					//	echo "<tr class='gradeX'><td class='center'>Total </td><td class='center'>". $stock."</td><td class='center'>". $amount."</td> </tr>";   
					
					?>
						</tbody>
						</table>
					<?php
				echo "<div id='divToPrint' style='display:none;'>
							<center><table id='export' border='1px' style='border-collapse:collapse;'>
							<tr><td colspan='9'><center><h4>  तिकिटाचे स्टॉक रिपोर्ट्स </h4></center></td></tr>";
							echo ' <center><h2>पोलीस अधिक्षक कार्यालय, <br> जि.रायगड <h2></center>';
					convert_marathi();
					$qx= mysql_query("SELECT * FROM stamp_master") or die("".mysql_error());
					echo "<tr>
							<th>तिकिटाचे नाव </th>
							<th> स्टॉक </th>
							<th> एकूण रक्कम </th>
						</tr>";
					while($rwx=mysql_fetch_array($qx)) 
						{
							echo "<tr class='gradeX'>";
							$amt=$rwx['value']*$rwx['stock'];
							echo "<td class='center'>".$rwx['stamp_nm']."</a></td>	<td class='center'>". $rwx['stock']."</td> <td class='center'>". $amt."</td></tr>";     
							$stock=$stock+$rwx['stock'];
							$amount=$amount+$amt;     
						}
                    echo "</table></center></div>";
             
				?>
					<br>
					<p>	
						<center><input type="submit" value=" Print Page " onclick="PrintDiv();" class="btn btn-primary"/>
						<input type="button" class="btn" onclick="tableToExcel('export', 'W3C Example Table')" value="Export to Excel"	></center>
					</p>	
<?php }
		################################## End Of Stamp Report For BDO ############################################# 

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