<!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'];
convert_marathi();
?>
<html>
<head>
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<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>
        <!-- style="font-weight:bold"-->
        </div>
        <div class="headerinner">
            <ul class="headmenu">
				<!-- -------------------------------------------------------------------------------------------
										Notification Code
				--------------------------------------------------------------------------------------------- -->
				<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='pending'") 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>
						<td>&nbsp&nbsp&nbsp&nbsp <b> विभगाचे नाव  </b></td></tr>
						<tr><td colspan=3>&nbsp;</td></tr>
						</li>";
						while($row=mysql_fetch_array($qry1))
						{ 
						$deptid1=$row['dept_id'];
						$qey3=mysql_query("Select dept_nm from department_master where dept_id='$deptid1'");
						$dpt=mysql_fetch_array($qey3);
						echo "
						<li style=width:500px;><tr style=height:20px;><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></td><td>&nbsp&nbsp&nbsp&nbsp".$dpt['dept_nm']."</td></tr></li>";
						}
						?>
						</table>
                    </ul>
                </li>
				<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: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:600px;><tr style=height:20px;><td style=height:15px;width:100px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td style=height:15px;width:100px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td><td>&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'];
												$total=$row['stock']*$row['value'];
												if($curstock <= $minstock )
												{
													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 incoming_letters_transaction.ltr_inword_no, incoming_letters_transaction.subject, incoming_letters_transaction.sender_name FROM incoming_letters_transaction, tapal_to_dpt_transaction, desk_transaction WHERE desk_transaction.dpt_ltr_id=tapal_to_dpt_transaction.dpt_ltr_id AND incoming_letters_transaction.ltr_id=tapal_to_dpt_transaction.ltr_id AND (desk_transaction.flag='')") 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><b>आवक_क्र. </b></td>
							<td><b>कोणाकडून प्राप्त झाला  </b></td>
							<td><b> विषय </b></td></tr>
							<tr><td colspan=3>&nbsp;</td></tr>
							</li>";
							while($row=mysql_fetch_array($qry1))
									{ 
										echo "<li style=width:500px;><tr style=height:20px;><td style=height:15px;width:90px;>".$row['ltr_inword_no']."</td><td style=height:15px;width:150px;>".$row['sender_name']."</td><td style=height:15px;>".$row['subject']."</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="bdo_home.php"><span class="iconfa-home"></span>होम </a></li>
				<!--<li class="active"><a href="bdo_javakbarnishi.php"><span class="iconfa-laptop"></span>जावक बारनिशी </a></li>-->
                <li class="dropdown active"><a href=""><span class="iconfa-pencil"></span>नवीन मास्टर एन्ट्री </a>
                <ul>
                    <li class="dropdown"><a href="">युजर माहिती </a>
						<ul>
							<li><a href="adduser.php?no=1">नवीन युजर जोडा</a></li>
							<li><a href="edituser.php">युजर अद्यावत करा  </a></li>
						</ul>
                    </li>
                    <li class="dropdown"><a href="adduser.php">तिकीट माहिती</a>
						<ul> 
						    <li><a href="addstamp.php?no=1">नवीन तिकीट जोडा </a></li>
                            <li><a href="addstamp.php?no=2">तिकीट अद्यावत करा </a></li>
                        </ul>
                    </li>
					<li class="dropdown"><a href="">विभाग  माहिती</a>
                        <ul>
						    <li><a href="adddepartment.php?no=1">विभाग जोडा</a></li>
                            <li><a href="adddepartment.php?no=2"> विभाग अद्यावत करा </a></li>
                            <li><a href="addother_dept.php">विभाग जोडा (For Await Register)</a></li>
                        </ul>
                    </li>
                    <li class="dropdown"><a href="">डेस्क माहिती</a>
                        <ul> 
						    <li><a href="adddesk.php?no=1">नवीन डेस्क जोडा </a></li>
                            <li><a href="adddesk.php?no=2">डेस्क अद्यावत  करा </a></li>
                        </ul>
                    </li>
					<li class="dropdown"><a href="">संदर्भ माहिती</a>
                        <ul> 
						    <li><a href="addsandhrbha.php?no=1">नवीन संदर्भ जोडा</a></li>
                            <li><a href="addsandhrbha.php?no=2">संदर्भ अद्यावत करा </a></li>
                        </ul>
					</li>
					<li class="dropdown"><a href="">कार्यवाही माहिती  </a>
                        <ul> 
						    <li><a href="enteraction.php?no=1">कार्यवाही माहिती टाका </a></li>
                        </ul>
					</li>
				</ul>
				<li class="active"><a href="sadyasthiti_bdo_tapal.php?user=bdo"><span class="iconfa-laptop"></span>कार्यविवरण नोंदवही / वर्कशिट </a></li>
                <li class="active"><a href="await_register_bdo.php"><span class="iconfa-laptop"></span>Await Register</a></li>
                <li class="dropdown active"><a href=""><span class="iconfa-briefcase"></span>रिपोर्ट्स</a>
                	<ul>
                    	<li><a href="report_dptwise.php?no=3">विभागानुसार रिपोर्ट्स </a></li>
                        <li><a href="report_dpt_sandharbha.php?no=3">संदर्भप्रकारानुसार रिपोर्ट्स </a></li>
                        <li><a href="report_jatanprakar_bdo.php?no=3">जतन प्रकारानुसार  रिपोर्ट्स </a></li>
					<!--	<li><a href="report_dpt_priority.php?no=3">प्राधान्यनुसार  रिपोर्ट्स </a></li> -->
						<li><a href="report_stamp.php?no=2">तिकिटाचे स्टॉक रिपोर्ट्स</a></li>
						<li><a href="report_stamp_purchase.php?no=2">तिकीट खरेदीचे रिपोर्ट्स</a></li>
						<li><a href="freq_dept3.php?type=bdo"> वारंवार येणारे पत्र  </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="sms_vibhag.php"><span class="iconfa-pencil"></span>new notice</a></li>
				<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 -->
</script>
</body>
</html>