<!DOCTYPE html>
<?php
require_once('connection/db.php');
require_once('convert_marathi.php');
// like i said, we must never forget to start the session
session_start();
// is the one accessing this page logged in or not?
if (!isset($_SESSION['logged_in'])|| $_SESSION['logged_in'] !== true)
{
	// not logged in, move to login page
	header('Location: index.php');
	exit;
}
$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" />
<title>Tapal Admin System</title>
<link rel="stylesheet" href="css/style.default.css" type="text/css" />
<link rel="stylesheet" href="css/bootstrap-fileupload.min.css" type="text/css" />
<link rel="stylesheet" href="css/bootstrap-timepicker.min.css" type="text/css" />
<link rel="stylesheet" href="css/responsive-tables.css">
<script type="text/javascript" src="js/jsapi.js"></script>
<script type="text/javascript" src="unicode.js"></script>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery-migrate-1.1.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="js/bootstrap-timepicker.min.js"></script>
<script type="text/javascript" src="js/jquery.uniform.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="js/jquery.autogrow-textarea.js"></script>
<script type="text/javascript" src="js/charCount.js"></script>
<script type="text/javascript" src="js/colorpicker.js"></script>
<script type="text/javascript" src="js/ui.spinner.min.js"></script>
<script type="text/javascript" src="js/chosen.jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/modernizr.min.js"></script>
<script type="text/javascript" src="js/responsive-tables.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript" src="js/forms.js"></script>
<!-- Script required of tab functioning -->	 
<script type="text/javascript" src="prettify/prettify.js"></script>
<script type="text/javascript" src="js/elements.js"></script>
<script type="text/javascript">
    jQuery(document).ready(function(){
        // dynamic table
        jQuery('#dyntable').dataTable({
            "sPaginationType": "full_numbers",
            "aaSortingFixed": [[0,'asc']],
            "fnDrawCallback": function(oSettings) {
                jQuery.uniform.update();
            }
        });
        
        jQuery('#dyntable2').dataTable( {
            "bScrollInfinite": true,
            "bScrollCollapse": true,
            "sScrollY": "300px"
        });   
    });
</script>
<script>
document.addEventListener("contextmenu", function(e){
    e.preventDefault();
}, false);
</script>
</head>

<body oncontextmenu="return false">
<div class="mainwrapper">
   <div class="header">
        <div class="logo">
            <div style="float:left;"><img src="images\t-soba.png" style="height:95px;width:95px;" alt="" /></div>
			<div style="float:right;margin-top:10px;margin-right:5px;"><font color="white" size="2px;">पोलीस अधिक्षक <br> कार्यालय,<br>जिल्हा रायगड</font></a></div>        </div>
        <div class="headerinner">
            <ul class="headmenu">
                <li class="odd">
					<!---------------------------------------------------------------------------------------------
										Notification Code
					----------------------------------------------------------------------------------------------->
					<a class="dropdown-toggle" data-toggle="dropdown" href="#">
					<?php 
					convert_marathi();
					$qry1=mysql_query("Select * FROM incoming_letters_transaction WHERE dept_id='0' AND status!='approve' ") OR die("".mysql_error());
					$cnt=mysql_num_rows($qry1);
					?>
					<span class="count"><?php echo $cnt;?></span>
                    <center><img src="images/silver-bell-md.png" style="height:40px;width:50px;" class="headmenu-label"></center>
                    <span class="headmenu-label">विभाग लावणे <br>बाकी  </span>
                    </a>
                    <ul class="dropdown-menu">
						<table>
                        <?php 
						echo "<li style=width:600px;><tr><td>&nbsp&nbsp&nbsp&nbsp <b>आवक_क्र. </b></td>
						<td>&nbsp&nbsp&nbsp&nbsp <b> विषय </b></td>
						<td>&nbsp&nbsp&nbsp&nbsp <b> कोणाकडून प्राप्त झाला  </b></td></tr><tr><td colspan=3>&nbsp;</td></tr></li>";
				
						while($row=mysql_fetch_array($qry1))
						{ 
						echo "<li style=width:600px;><tr style=height:20px;><td style=height:15px;width:100px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td><td style=height:15px;width:200px;>&nbsp&nbsp&nbsp&nbsp".$row['sender_name']."</td></tr></li>";
						}
						?>
						</table>
                    </ul>
                </li>
				<li class="odd">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
					<?php 
					convert_marathi();
					$qry1=mysql_query("Select * FROM stamp_master where stock <= min_stock_range") OR die("".mysql_error());
					$cnt=mysql_num_rows($qry1);
					?>
					<span class="count"><?php echo $cnt;?></span>
                    <center><img src="images/silver-bell-md.png" style="height:40px;width:50px;" class="headmenu-label"></center>
                    <span class="headmenu-label">तिकीटाचा <br>स्टॉक</span>
                    </a>
                    <ul class="dropdown-menu">
						<table><li><tr><td style="height:15px;">&nbsp <b> तिकीट  </b></td><td>&nbsp&nbsp&nbsp  <b> स्टॉक  </b></td><td>&nbsp&nbsp&nbsp  <b> रक्कम  </b></td></tr></li>
                        <?php 
						while($row=mysql_fetch_array($qry1))
						{ 
							$curstock=$row['stock'];
							$minstock=$row['min_stock_range'];
							if($curstock <= $minstock )
							{
								$total=$row['stock']*$row['value'];
								echo "<li style=width:200px;><tr style=height:20px;><td style=height:15px;>&nbsp&nbsp&nbsp&nbsp".$row['stamp_nm']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['stock']."</td><td>&nbsp&nbsp&nbsp&nbsp".$total."</td></tr></li>";
							}
						}
						?>
						</table>
                    </ul>
                </li>
				<li class="odd">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
					<?php 
					convert_marathi();
					$qry1=mysql_query("Select * FROM incoming_letters_transaction WHERE dept_id='0' and status='closed'") OR die("".mysql_error());						
					$cnt=mysql_num_rows($qry1);						
					?>
					<span class="count"><?php echo $cnt;?></span>
                    <center><img src="images/silver-bell-md.png" style="height:40px;width:50px;" class="headmenu-label"></center>
                    <span class="headmenu-label">विभागाकडून <br>परत </span>
                    </a>
                    <ul class="dropdown-menu">
						<table>
                        <?php
						echo "<li style=width:500px;><tr><td>&nbsp&nbsp&nbsp&nbsp <b>आवक_क्र. </b></td>
						<td>&nbsp&nbsp&nbsp&nbsp <b> विषय </b></td>
						<td>&nbsp&nbsp&nbsp&nbsp <b> कोणाकडून प्राप्त झाला  </b></td></tr><tr><td colspan=3>&nbsp;</td></tr>
						</li>";
						while($row=mysql_fetch_array($qry1))
						{ 
						echo "<li style=width:500px;><tr><td style=height:15px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td></td><td>&nbsp&nbsp&nbsp&nbsp".$row['sender_name']."</td></tr></li>";
						}
						?>
						</table>
                    </ul>
                </li>
				<!---------------------------------------------------------------------------------------------
										End Of Notification Code
				----------------------------------------------------------------------------------------------->
                <li class="right">
                    <div class="userloggedinfo">
                        <img src="images/departments.jpg" alt="" />
                        <div class="userinfo" style="width:150px;">   
                            <ul> 
                                <li><h5><?php echo "Welcome </h5><h4 style=font-weight:bold;>".$_SESSION['User_Name']."</h4>";?></li>
                                <li><a href="logout.php">Sign Out</a></li>
                            </ul>
                        </div>
                    </div>
                </li>
            </ul><!--headmenu-->
        </div>
    </div>
    <div class="leftpanel">
        <div class="leftmenu">        
            <ul class="nav nav-tabs nav-stacked">
            	<li class="nav-header">Navigation</li>
                <li class="active"><a href="tapal_home.php"><span class="iconfa-laptop"></span>होम </a></li>
				<li class="active"><a href="letterentry.php"><span class="iconfa-envelope"></span>आवक बारनिशी</a></li>
                <!--<li><a href="buttons.html"><span class="iconfa-hand-up"></span> Buttons &amp; Icons</a></li>-->
				<li class="active"><a href="assign_dept.php"><span class="iconfa-th-list"></span>विभाग लावा</a></li>
				<li class="active"><a href="allocatestamptable.php"><span class="iconfa-pencil"></span> जावक बारनिशी  </a>
                </li>
                <li class="active"><a href="stamp_purchase_details.php"><span class="iconfa-plus"></span>तिकीट खरेदीची माहिती टाका </a>
                </li>
				<li class="active"><a href="sadyasthiti_bdo_tapal.php?user=tapal"><span class="iconfa-laptop"></span>कार्यविवरण नोंदवही / वर्कशिट </a></li>
				<!--<li class="active"><a href="direct_javak_inward.php"><span class="iconfa-envelope"></span>थेट जावक बारनिशी</a></li>-->
                <li class="dropdown active"><a href=""><span class="iconfa-briefcase"></span>रिपोर्ट्स </a>
                	<ul>
						<li><a href="report_dptwise.php?no=2">विभागानुसार रिपोर्ट्स</a></li>
                    	<li><a href="report_dpt_sandharbha.php?no=2&username=<?php echo $username;?>"> संदर्भप्रकारानुसार रिपोर्ट्स </a></li>
                        <li><a href="report_jatanprakar_tapal.php?no=2">जतन प्रकारानुसार  रिपोर्ट्स</a></li>
					<!--	<li><a href="report_dpt_priority.php?no=2">प्राधान्यनुसार  रिपोर्ट्स</a></li> -->
					<!--	<li><a href="report_dpt_deskwise.php?no=2">डेस्क नुसार रिपोर्ट्स</a></li>  -->
						<li><a href="goshwara_tapal.php">गोषवारा </a></li>
						<li><a href="report_stamp.php?no=1">तिकिटाचे स्टॉक रिपोर्ट्स (B Register) </a></li>
						<li><a href="report_stamp_purchase.php?no=1">तिकीट खरेदीचे रिपोर्ट्स (A register) </a></li>
						<li><a href="freq_dept2.php?type=tpo"> वारंवार येणारे पत्र  </a></li>
                    </ul>
                </li>
				<?php 
				$q=mysql_query("select user_type from login where login_id='$username'") or die("".mysql_error());
				$qs=mysql_fetch_array($q);
				$v=$qs['user_type'];
				?>
				<li class="active"><a href="changeseq.php?no=<?php echo $v; ?>"><span class="iconfa-pencil"></span>सेक्युरिटी प्रश्न बदला </a></li>
                <li class="active"><a href="changepw.php?no=<?php echo $v; ?>"><span class="iconfa-pencil"></span>पासवर्ड बदला</a></li> 
            </ul>
        </div><!--leftmenu-->
    </div><!-- leftpanel -->
</div><!--mainwrapper-->
<script type="text/javascript">
    jQuery(document).ready(function() {
        
      // simple chart
		var flash = [[0, 11], [1, 9], [2,12], [3, 8], [4, 7], [5, 3], [6, 1]];
		var html5 = [[0, 5], [1, 4], [2,4], [3, 1], [4, 9], [5, 10], [6, 13]];
      var css3 = [[0, 6], [1, 1], [2,9], [3, 12], [4, 10], [5, 12], [6, 11]];
			
		function showTooltip(x, y, contents) {
			jQuery('<div id="tooltip" class="tooltipflot">' + contents + '</div>').css( {
				position: 'absolute',
				display: 'none',
				top: y + 5,
				left: x + 5
			}).appendTo("body").fadeIn(200);
		}
		var plot = jQuery.plot(jQuery("#chartplace"),
			   [ { data: flash, label: "Flash(x)", color: "#6fad04"},
              { data: html5, label: "HTML5(x)", color: "#06c"},
              { data: css3, label: "CSS3", color: "#666"} ], {
				   series: {
					   lines: { show: true, fill: true, fillColor: { colors: [ { opacity: 0.05 }, { opacity: 0.15 } ] } },
					   points: { show: true }
				   },
				   legend: { position: 'nw'},
				   grid: { hoverable: true, clickable: true, borderColor: '#666', borderWidth: 2, labelMargin: 10 },
				   yaxis: { min: 0, max: 15 }
				 });
		
		var previousPoint = null;
		jQuery("#chartplace").bind("plothover", function (event, pos, item) {
			jQuery("#x").text(pos.x.toFixed(2));
			jQuery("#y").text(pos.y.toFixed(2));
			
			if(item) {
				if (previousPoint != item.dataIndex) {
					previousPoint = item.dataIndex;
						
					jQuery("#tooltip").remove();
					var x = item.datapoint[0].toFixed(2),
					y = item.datapoint[1].toFixed(2);
						
					showTooltip(item.pageX, item.pageY,
									item.series.label + " of " + x + " = " + y);
				}
			
			} else {
			   jQuery("#tooltip").remove();
			   previousPoint = null;            
			}
		
		});
		
		jQuery("#chartplace").bind("plotclick", function (event, pos, item) {
			if (item) {
				jQuery("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + ".");
				plot.highlight(item.series, item.datapoint);
			}
		});  
        //datepicker
        jQuery('#datepicker').datepicker();
        
        // tabbed widget
        jQuery('.tabbedwidget').tabs();
    });
</script>
</body>
</html>
