<!DOCTYPE html>
<?php 
$no=$_GET['no'];
 require_once('convert_marathi.php');
########################################### Stamp Purchase Report For Tapal ###################################################
if($no==1)
{
include('dashboard_tapal.php');
$username = $_SESSION['User_Name'];
?>
<html>
<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 				
							echo "<table id='dyntable'  class='table table-bordered'>
								<thead style='align:center'>
								<tr> 
									<th class='head0 center'>खरेदी दिनांक</th>
									<th class='head1 center'>तिकिटाचे नाव </th>
									<th class='head0 center'>नग</th>
									<th class='head1 center'>रक्कम </th>
								</tr>
								</thead><tbody>";
								convert_marathi();
								$qx= mysql_query("SELECT * FROM  stamp_purchase_details sp,stamp_master sm WHERE sm.stamp_id =  sp.stamp_id AND sp.p_s_flag='p' ") or die("".mysql_error());
								while($rwx=mysql_fetch_array($qx)) 
								{
									$date 		= date('d-m-Y',strtotime($rwx['purchase_dt']));
									?>
									<tr class="gradeX">
									<?php 
										echo "<td class='center'>". $date."</td>
										<td class='center'>".$rwx['stamp_nm']."</a></td>
										<td class='center'>". $rwx['quantity']."</td>
										<td class='center'>".$rwx['amount']."</a></td>
										</tr>";         
								}?>
								</tbody>
							</table>
							<?php
							echo "<div id='divToPrint' style='display:none;'>
							<center><table id='export' border='1px' >
							<tr><td colspan='9'><center>तिकीट खरेदीचे रिपोर्ट </center></td></tr>
								<tr> 
									<th>खरेदी दिनांक</th>
									<th>तिकिटाचे नाव </th>
									<th>नग</th>
									<th>रक्कम </th>
									</tr>";
								echo ' <center><h2>पोलीस अधिक्षक कार्यालय, <br> जि.रायगड <h2></center>';
								convert_marathi();
								$qx= mysql_query("SELECT * FROM  stamp_purchase_details sp,stamp_master sm WHERE sm.stamp_id =  sp.stamp_id AND sp.p_s_flag='p'") or die("".mysql_error());
								while($rwx=mysql_fetch_array($qx)) 
								{
									$date 		= date('d-m-Y',strtotime($rwx['purchase_dt']));
									
									echo "<tr>"; 
										echo "<td style='text-align:center;'>". $date."</td>
										<td style='text-align:center;'>".$rwx['stamp_nm']."</td>
										<td style='text-align:center;'>". $rwx['quantity']."</td>
										<td style='text-align:center;'>".$rwx['amount']."</td>
										</tr>";         
								}
							echo "</table></center>
						</div>";

}
############################### End Of Stamp Purchase Report For Tapal #########################

#################################### Stamp Purchase Report For BDO ###################################################
else if($no==2)
{
include('dashboard_bdo.php');
$username = $_SESSION['User_Name'];
?>
<html>
<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 
					echo "<table id='dyntable'  class='table table-bordered'>	
								<thead style='align:center'>
								<tr>
									<th class='head0 center'>खरेदी दिनांक</th>
									<th class='head1 center'>तिकिटाचे नाव </th>
									<th class='head0 center'>नग</th>
									<th class='head1 center'>रक्कम </th>
								</tr>
								</thead><tbody>";
						convert_marathi();
						$qx= mysql_query("SELECT * FROM  stamp_purchase_details sp,stamp_master sm WHERE sm.stamp_id =  sp.stamp_id AND sp.p_s_flag='p' ") or die("".mysql_error());
						while($rwx=mysql_fetch_array($qx)) 
							{
								$date 		= date('d-m-Y',strtotime($rwx['purchase_dt']));
								?>
								<tr class="gradeX">
									<?php 
										echo "<td class='center'>". $date."</td>
										<td class='center'>".$rwx['stamp_nm']."</a></td>
										<td class='center'>". $rwx['quantity']."</td>
										<td class='center'>".$rwx['amount']."</a></td>
										</tr>";
                                                 
							}?>
						</tbody>
					</table>
					<?php
					echo "<div id='divToPrint' style='display:none;'>
							<center><table id='export' border='1px' style='margin-left:50px;'>
							<tr><td colspan='9'><center><h4>तिकीट खरेदीचे रिपोर्ट </h4></center></td></tr>
							<tr>
								<th>खरेदी दिनांक</th>
								<th>तिकिटाचे नाव </th>
								<th>नग</th>
								<th>रक्कम </th>
								</tr>";
						echo ' <center><h2>पोलीस अधिक्षक कार्यालय, <br> जि.रायगड <h2></center>';
						convert_marathi();
						$qx= mysql_query("SELECT * FROM  stamp_purchase_details sp,stamp_master sm WHERE sm.stamp_id =  sp.stamp_id AND sp.p_s_flag='p' ") or die("".mysql_error());
						while($rwx=mysql_fetch_array($qx)) 
							{
								$date 		= date('d-m-Y',strtotime($rwx['purchase_dt']));
								echo "<tr>";
								echo "<td style='text-align:center;'>".$date."</td>
								<td style='text-align:center;'>".$rwx['stamp_nm']."</a></td>
								<td style='text-align:center;'>".$rwx['quantity']."</td>
								<td style='text-align:center;'>".$rwx['amount']."</a></td>
								</tr>";                  
							}
						echo "</table></center></div>";
 }
########################################### Stamp Purchase Report For BDO ###################################################
?>	
			<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>
		</form>
                <br /><br />
                <?php include_once('footer.php'); ?>
            </div><!--maincontentinner-->
        </div><!--maincontent-->  
    </div><!--rightpanel-->
</div><!--mainwrapper-->
</body>
</html>
