<!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/jquery-1.9.1.js"></script>
<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>
<style>
/* Firefox old*/
@-moz-keyframes blink {
    0% {
        opacity:1;
    }
    50% {
        opacity:0;
    }
    100% {
        opacity:1;
    }
} 

@-webkit-keyframes blink {
    0% {
        opacity:1;
    }
    50% {
        opacity:0;
    }
    100% {
        opacity:1;
    }
}
/* IE */
@-ms-keyframes blink {
    0% {
        opacity:1;
    }
    50% {
        opacity:0;
    }
    100% {
        opacity:1;
    }
} 
/* Opera and prob css3 final iteration */
@keyframes blink {
    0% {
        opacity:1;
    }
    50% {
        opacity:0;
    }
    100% {
        opacity:1;
    }
} 
.blink-image {
    -moz-animation: blink normal 2s infinite ease-in-out; /* Firefox */
    -webkit-animation: blink normal 2s infinite ease-in-out; /* Webkit */
    -ms-animation: blink normal 2s infinite ease-in-out; /* IE */
    animation: blink normal 2s infinite ease-in-out; /* Opera and prob css3 final iteration */
}
</style>
</head>
<body>
<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:-50px;margin-right:5px;"><font color="white" size="3px;" style="font-weight:bold">पोलीस अधिक्षक कार्यालय, <br><br>जि.रायगड</font></a></div>
        </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 i
						WHERE i.dept_id!='0' AND i.status='pending' AND i.dept_id=(select dept_id from login where login_id='$username')") 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></tr>
						<tr><td colspan=3>&nbsp;</td></tr>
						</li>";
						while($row=mysql_fetch_array($qry1))
						{ 
						echo "<li style=width:400px;><tr><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td></tr></li>";
						}
						?>
						</table>
                    </ul>
                </li>
				
				
				<li class="odd">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
					<?php 
						convert_marathi();
						$date123 = date('Y-m-d');
						
						//accepted by dept but nt taken ny action
						$result = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, i.priority_days, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
						FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
						LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
						WHERE t.ltr_status='' AND t.returned_choice=''
						AND t.dept_id_from = ( SELECT dept_id from login where login_id = '$username' )") or die("cccc".mysql_error());
							
						//not accepted by dept
						$result1 = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.priority_days, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
						FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
						LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
						WHERE i.status='pending' 
						AND i.dept_id = (SELECT dept_id from login where login_id = '$username')") or die("cccc2".mysql_error());
						
						$cnt=0;
						while($row=mysql_fetch_array($result))
						{ 
							
							$priority_days=$row['priority_days'];
							$receive_dt	=strtotime($row['receive_dt']);

							$to_dt=strtotime("+".$priority_days." days",$receive_dt);
							//echo date("d-m-Y",$to_dt)."aa";
							
							$frm_dt=strtotime("-2 days",$to_dt);
							if(strtotime($date123)>$to_dt)
							{
								$cnt++;
							}
						}
						
						//echo $cnt."--";
						while($row=mysql_fetch_array($result1))
						{ 
							
							$priority_days=$row['priority_days'];
							$receive_dt	=strtotime($row['receive_dt']);

							$to_dt=strtotime("+".$priority_days." days",$receive_dt);
							//echo date("d-m-Y",$to_dt)."aa";
							
							$frm_dt=strtotime("-2 days",$to_dt);
							if(strtotime($date123)>$to_dt)
							{
								$cnt++;
							}
						}
						//echo $cnt;
						
						?>
						<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> &nbsp;&nbsp; </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>
						<td>&nbsp&nbsp&nbsp&nbsp <b> मुदत </b></td></tr>
						<tr><td colspan=3>&nbsp;</td></tr>
						</li>";
						
						//accepted by dept but nt taken ny action
						$result = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, i.priority_days, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
						FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
						LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
						WHERE t.ltr_status='' AND t.returned_choice=''
						AND t.dept_id_from = ( SELECT dept_id from login where login_id = '$username' )") or die("cccc".mysql_error());
						
						while($row=mysql_fetch_array($result))
						{ 
							$priority_days=$row['priority_days'];
							$receive_dt	=strtotime($row['receive_dt']);

							$to_dt=strtotime("+".$priority_days." days",$receive_dt);
							//echo date("d-m-Y",$to_dt)."aa";
							
							$frm_dt=strtotime("-2 days",$to_dt);
							if(strtotime($date123)>$to_dt)
							{
								echo "<tr style=height:20px;>
									<td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td>
									<td>&nbsp&nbsp&nbsp&nbsp".$row['ref_no']."</td>
									<td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td>
									<td>&nbsp&nbsp&nbsp&nbsp विभागाने कार्यवाही करणे बाकी </td>
									<td> &nbsp&nbsp&nbsp&nbsp ".date('d-m-Y',$to_dt)." </td>
								</tr>";
							}
						}
						
						
						//not accepted by dept
						$result1 = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.priority_days, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
						FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
						LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
						WHERE i.status='pending' 
						AND i.dept_id = (SELECT dept_id from login where login_id = '$username')") or die("cccc2".mysql_error());
						while($row=mysql_fetch_array($result1))
						{ 
							$priority_days=$row['priority_days'];
							$receive_dt	=strtotime($row['receive_dt']);

							$to_dt=strtotime("+".$priority_days." days",$receive_dt);
							//echo date("d-m-Y",$to_dt)."aa";
							
							$frm_dt=strtotime("-2 days",$to_dt);
							if(strtotime($date123)>$to_dt)
							{
								echo "<tr style=height:20px;>
									<td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td>
									<td>&nbsp&nbsp&nbsp&nbsp".$row['ref_no']."</td>
									<td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td>
									<td>&nbsp&nbsp&nbsp&nbsp विभागाने स्वीकारणे बाकी </td>
									<td> &nbsp&nbsp&nbsp&nbsp ".date('d-m-Y',$to_dt)." </td>
								</tr>";
							}
							
						}
						
						
						?>
						</table>
                    </ul>
                </li>
				
				
				
				
				
				<li class="odd">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
					<?php 
						convert_marathi();
						$date123 = date('Y-m-d');
						
					/*	$result5=mysql_query("SELECT * FROM  incoming_letters_transaction WHERE 
						(incoming_letters_transaction.sent_dt < DATE_SUB('$date123',INTERVAL 7 DAY) AND (incoming_letters_transaction.sent_dt > DATE_SUB('$date123',INTERVAL 15 DAY)) AND incoming_letters_transaction.dept_id!='0' AND incoming_letters_transaction.status='pending') AND incoming_letters_transaction.dept_id =(SELECT dept_id from login where login_id = '$username')") or die("".mysql_error()); */
						
								//accepted by dept but nt taken ny action
								$result = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
								FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
								LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
								WHERE (t.dpt_ltr_rec_dt < DATE_SUB('$date123',INTERVAL 7 DAY) ) 
								AND t.ltr_status='' AND t.returned_choice=''
								AND t.dept_id_from = ( SELECT dept_id from login where login_id = '$username' )") or die("cccc".mysql_error());
									
								//not accepted by dept
								$result1 = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
								FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
								LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
								WHERE i.status='pending' AND i.sent_dt < DATE_SUB('$date123',INTERVAL 7 DAY)
								AND i.dept_id = (SELECT dept_id from login where login_id = '$username')") or die("cccc2".mysql_error());
								
						$cnt=mysql_num_rows($result);
						$cnt1=mysql_num_rows($result1);
						$count=$cnt+$cnt1;
						
						?>
						<span class="count"><?php echo $count;?></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($result))
						{ 
							echo "<li style=width:500px;><tr style=height:20px;><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['ref_no']."</td><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td>
							<td>&nbsp&nbsp&nbsp&nbsp विभागाने कार्यवाही करणे बाकी </td>
							</tr></li>";
						}
						
						while($row=mysql_fetch_array($result1))
						{ 
							echo "<li style=width:500px;><tr style=height:20px;><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['ref_no']."</td><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td>
							<td>&nbsp&nbsp&nbsp&nbsp विभागाने स्वीकारणे बाकी </td>
							</tr></li>";
						}
						
						
						?>
						</table>
                    </ul>
                </li>
				
				
				<li class="odd">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
					<?php 
						convert_marathi();
						$date123 = date('Y-m-d');
					/*	$result5=mysql_query("SELECT * FROM  incoming_letters_transaction WHERE 
						(incoming_letters_transaction.sent_dt < DATE_SUB('$date123',INTERVAL 30 DAY)  AND incoming_letters_transaction.dept_id!='0' AND incoming_letters_transaction.status='pending') AND incoming_letters_transaction.dept_id =(SELECT dept_id from login where login_id = '$username')") or die("".mysql_error()); */
						
							//accepted by dept but nt taken ny action
								$result = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
								FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
								LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
								WHERE (t.dpt_ltr_rec_dt < DATE_SUB('$date123',INTERVAL 14 DAY) ) 
								AND t.ltr_status='' AND t.returned_choice=''
								AND t.dept_id_from = ( SELECT dept_id from login where login_id = '$username' )") or die("cccc".mysql_error());
									
								//not accepted by dept
								$result1 = mysql_query("SELECT t.action_taken, t.dpt_inword_no, t.dpt_ltr_id, t.dpt_ltr_rec_dt, t.dpt_inword_no, t.desk_id, t.dept_id_from, i.subject, t.update_date, t.dispatched_date, t.status, di.addressed_to, t.ltr_status, i.sender_name, i.ltr_id, i.ltr_inword_no, i.receive_dt, i.ref_dt, i.ref_no, i.dept_id, i.document, t.scan_doc, di.outword_no, di.dispatched_to, t.ltr_category, t.assign_no 
								FROM incoming_letters_transaction i LEFT OUTER JOIN tapal_to_dpt_transaction t ON i.ltr_id = t.ltr_id 
								LEFT OUTER JOIN dispatched_transaction di ON ( di.ltr_id = t.ltr_id AND di.desk_ltr_id='0')
								WHERE i.status='pending' AND i.sent_dt < DATE_SUB('$date123',INTERVAL 14 DAY)
								AND i.dept_id = (SELECT dept_id from login where login_id = '$username')") or die("cccc2".mysql_error());
								
						$cnt=mysql_num_rows($result);
						$cnt1=mysql_num_rows($result1);
						$count=$cnt+$cnt1;
						
						?>
						<span class="count"><?php echo $count;?></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($result))
						{ 
							echo "<li style=width:500px;><tr style=height:20px;><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['ref_no']."</td><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td>
							<td>&nbsp&nbsp&nbsp&nbsp विभागाने कार्यवाही करणे बाकी </td>
							</tr></li>";
						}
						
						while($row=mysql_fetch_array($result1))
						{ 
							echo "<li style=width:500px;><tr style=height:20px;><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['ltr_inword_no']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row['ref_no']."</td><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row['subject']."</td>
							<td>&nbsp&nbsp&nbsp&nbsp विभागाने स्वीकारणे बाकी </td>
							</tr></li>";
						}
						?>
						</table>
                    </ul>
                </li>
				
								<li class="odd">
                   
					<?php 
						
						
						convert_marathi();

							// dept accepted,desk accepted
							$q=mysql_query("SELECT * from login where login_id='$username' ");
							$r=mysql_fetch_array($q);
							$dpt_id=$r['dept_id'];
							$q1=mysql_query("SELECT count(dpt_id)  as cnt from sms_vibhag where dpt_id='$dpt_id'");
							$r1=mysql_fetch_array($q1);
							$cnt=$r1['cnt'];

						$q111=mysql_query("SELECT max(sms_id) as max  from sms_vibhag where dpt_id='$dpt_id'");
						$row222=mysql_fetch_array($q111);
						$max=$row222['max'];
						$q1111=mysql_query("SELECT cnt  from sms_vibhag where sms_id='$max'");
						$row2222=mysql_fetch_array($q1111);
						$row22222=mysql_num_rows($q1111);
						$cnt1=$row2222['cnt'];
						if($cnt1=='' and $row22222!=0)
						{
						
						?>
						  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
						<span class="count"><?php echo $cnt;?></span>
                        <center><a href="show_notice_new.php"><img src="images/notice.png" style="height:70px;width:80px;" class="blink-image"></a></center>
                       
                       </a>
						<?php }
						else
						{
							?>
						<a class="dropdown-toggle" data-toggle="dropdown" href="#">
						<span class="count"><?php echo $cnt;?></span>
                        <center><a href="show_notice_new.php"><img src="images/notice.png" style="height:70px;width:80px;" ></a></center>
                       
                       </a>
						<?php } ?>
							
						
                  <!--  <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><tr><tr><td colspan=3>&nbsp;</td></tr>
						</li>";
						$q11=mysql_query("SELECT *   from sms_vibhag where dpt_id='$dpt_id'");
							
						while($row22=mysql_fetch_array($q11))
						{ 
						echo "<li style=width:400px;><tr><td style=height:18px;>&nbsp&nbsp&nbsp&nbsp".$row22['suchna']."</td><td>&nbsp&nbsp&nbsp&nbsp".$row22['sms_dt']."</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="dept_home.php"><span class="iconfa-laptop"></span> होम </a></li>
				<li class="active"><a href="letterentry1.php?flag=n"><span class="iconfa-envelope"></span>आवक बारनिशी</a></li>
				<li class="active"><a href="acceptletter.php"><span class="iconfa-laptop"></span>पत्र स्वीकृती</a></li>
               <li class="active"><a href="performaction.php?flag=n"><span class="iconfa-laptop"></span>संदर्भ लावा </a></li>
				<li class="active"><a href="desk_action_perform.php?flag=n"><span class="iconfa-laptop"></span>कार्यवाही करा </a></li>
				<li class="active"><a href="sadyasthiti_department.php?flag=n"><span class="iconfa-laptop"></span>कार्यविवरण नोंदवही / वर्कशिट </a></li>
				<li class="active"><a href="prakaran_nondwahi.php?flag=n"><span class="iconfa-laptop"></span>प्रकरण नोंदवही </a></li>
                <li class="active"><a href="await_register.php?flag=n"><span class="iconfa-laptop"></span>Await Register</a></li>
				 <li class="active"><a href="direct_aavak_report_dpt.php?id=new"><span class="iconfa-envelope"></span>थेट आवक बारनिशी</a></li>
               <li class="active"><a href="direct_javak_dpt_new.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_dpt_sandharbha.php?no=1&username=<?php echo $username;?>&flag=n">संदर्भप्रकारानुसार रिपोर्ट्स </a></li>
						<li><a href="report_dpt_jatanprakar.php?no=1&flag=n">जतन प्रकारानुसार  रिपोर्ट्स</a></li>
						<!--<li><a href="report_dpt_priority.php?no=1&flag=n">प्राधान्यनुसार  रिपोर्ट्स</a></li>
						<li><a href="report_dpt_deskwise.php?no=1">डेस्क नुसार रिपोर्ट्स</a></li>
						<li><a href="report_dpt_refwise.php?flag=n">संदर्भानुसार रिपोर्ट्स</a></li> -->
						<li><a href="report_dpt_ltr_transfer.php?flag=n">पत्र फिर्तीनुसार रिपोर्ट्स </a></li>
						<li><a href="goshwara_dpt.php?flag=n">गोषवारा </a></li>
						<li><a href="freq_dept.php"> वारंवार येणारे पत्र  </a></li>
						<li><a href="direct_javak_report_dpt.php?id=new"> थेट जावक बारनिशी  रिपोर्ट्स</a></li>
					</ul>
                </li>
				
				
				<li class="active"><a href="rec_sort_jatanprakar.php?flag=n"><span class="iconfa-laptop"></span>रेकॉर्ड सॉर्टिंग </a></li>
				
				
				<li class="active"><a href="dept_accepted_rtn_table.php?flag=n"><span class="iconfa-pencil"></span>स्वीकृत पत्र परत पाठवा </a></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?flag=n&no=<?php echo $v; ?>"><span class="iconfa-pencil"></span>सेक्युरिटी प्रश्न बदला </a></li>
                <li class="active"><a href="changepw.php?flag=n&no=<?php echo $v; ?>"><span class="iconfa-pencil"></span>पासवर्ड बदला </a></li>
            </ul>
        </div><!--leftmenu-->
    </div><!-- leftpanel -->
</script>
</body>
</html>