
<link rel="stylesheet" type="text/css" href="js/slidingdiv/slidingdiv.css" />


<script src="js/slidingdiv/slidingdiv.js" type="text/javascript"></script>
<!--<script type="text/javascript" src="js/grid/jquery-1.9.1.js"></script>-->
<script type="text/javascript" language="javascript">
function ChangePassword(){
	window.location='Change_Password.php';	
}

function Logout(){
	window.location='../logout.php';
}

function OpenNotificationWindow(){
  //document.location.href="Form_Notifications.php";
  window.open("Form_Notifications.php","_blank");
}

</script>

<script type="text/javascript">
setInterval(function() {
    $("#notificationblock").load(location.href+" #notificationblock>*","");
    $("#notificationblock2").load(location.href+" #notificationblock2>*","");
}, 10000); // seconds to wait, miliseconds
</script>

<tr  >
  <td  align="center" valign="top" id='header1' class='header-font' >
  <table border='0' width='100%' align="center" cellspacing=0 cellpadding=0>
  <tr height='55px'>
  <td width='5%'>&nbsp;</td>
 <td width='50%' valign='top' style="padding-left:0px;">
<img src="img/imgheader1.jpg" width="210px" height="50px" align="left"/>	</td>
<td align='right' width='250px' bgcolor='#f7f7f7' valign='top'>
	<table><tr><td>
	<button type='button' id='btnPass' name='btnPass' onclick='ChangePassword(); return false;' title='Change Password'><span><span>Change Password</span></span></button>
	</td></tr>
	<tr><td align='right'>
	<button type='button' id='btnlog' name='btnlog' onclick='Logout();'  title='Logout' ><span><span>Logout</span></span></button>
	</td></tr></table></td>		
			</td>



 <?php //require_once ("MenuBar2.php");?>
	<!--<div style='float:left; width:100%;'>
		<div style='position:relative; float:left; width:280px; text-align:left;'  ><?php //echo$_SESSION['logincompanyname'].' '.$_SESSION['loginyear'];?></div>
		
		<div class="dhtmlgoodies_question">Show/Hide</div>
		<div class="dhtmlgoodies_answer"  >
			<div>
				
				<ul>
					<li>Faster loading pages</li>
					<li>Smoother loading pages</li>
					<li>Saved bandwidth</li>
					<li>Separate layout and content</li>
					<li>Easy to change layout</li>
					<li>Increased accessibility</li>
					<li>Different styling for different media(print, screen, pda)</li>
				</ul>
			</div>
		</div>
		  
		<div style='position:relative; float:right; width:150px;'>
			<div style='float:left;' >User : <?php //echo $_SESSION["useraccount"];?>&nbsp;&nbsp;</div>
			<div style='float:right;'> <button type="button" title='Sign Out' onclick="javascript:top.window.location.href='../logout.php';return false;"><span><span>Sign Out</span></span></button></div>
		</div>
		
     </div>-->
		   
		 <td  align='left' valign='top'  style="background: url(design/bg-line-b-s.jpg); background-repeat: no-repeat; background-position: left;width:300px;" colspan='2'>
	<table width='250px' border='0' valign='top' height='70px' cellspacing=0 cellpadding=0><col width='20px'><col width='90px'>
	
	<tr><td>&nbsp;</td><td>
	<font face='Verdana' size='1' color='#ffffff'><b><?php if ($prints != "yes"){ $CompYear = explode('_',$_SESSION["dbName"]); print "Logged User : </td><td><font face='Verdana' size='1' color='#ffffff'>".$_SESSION["useraccount"]."</tr><tr><td>&nbsp;</td><td>
	"."<font face='Verdana' size='1' color='#ffffff'><b>Company : </td><td><font face='Verdana' size='1' color='#ffffff'>".$CompYear[0]."&nbsp;&nbsp; </td></tr>
	<tr><td>&nbsp;</td><td><font face='Verdana' size='1' color='#ffffff'><b>Year : </td><td><font face='Verdana' size='1' color='#ffffff'>".$CompYear[1]; }?></b></font></td></tr>
	
	<tr><td>&nbsp;</td><td><font face='Verdana' size='1' color='#ffffff'><b><?php echo"<a  onMouseOver=\"style.cursor='hand'\"   onclick='OpenNotificationWindow();'>"; ?>Notifications : </b></font></td>
	<td><?php 
	
	$query="select * from notification where ifnull(notification_action,0)=1 and  ifnull(notification_checked,0)=0 and notification_createduser = '".$_SESSION['useraccount']."'";
	$result=mysql_query($query,$connection);
	$ActiveNotification=mysql_num_rows($result);
	
	
	$query="select * from notification where ifnull(notification_action,0)=0 and  ifnull(notification_checked,0)=0 and notification_createduser = '".$_SESSION['useraccount']."'";
	$result=mysql_query($query,$connection);
	$InActiveNotification=mysql_num_rows($result);
	
	echo "<div id='notificationblock' style='width:20px;float:left;border:0px solid #000000;'><font color='orange' size=2>$ActiveNotification </font></div>
		<div style='width:15px;float:left;border:0px solid #000000;'><font color='#ffffff'>/</div>
		<div id='notificationblock2' style='width:30px;float:left;border:0px solid #000000;'><input type='hidden' name='ActiveNotification'  value='$ActiveNotification' readonly size='1' style='height:18px;'>
		<font color='yellow' size=2>$InActiveNotification<input type='hidden' readonly name='InActiveNotification'  value='$InActiveNotification' size='1' style='height:18px;'></div>";?></td></tr>
	
	</table></td></tr>
	
	 </tr> 

	 </table>
	</td> 
</tr>

        
        <tr>
			<td valign="top" id='header2'>
		  <table width="100%" border="0" cellpadding="0" cellspacing="0">
 <Tr height=12px><td></td></tr>
          <tr>
           <td valign="top" style="padding-left:30px;" colspan='2'><?php require_once ("MenuBar.php");?></td> </tr>
		    <tr height="1px;"></tr>
		   
			<!--<td > <div class="dhtmlgoodies_question">Show/Hide</div>
		<div class="dhtmlgoodies_answer"  >
			<div>
				
				<ul>
					<li>Faster loading pages</li>
					<li>Smoother loading pages</li>
					<li>Saved bandwidth</li>
					<li>Separate layout and content</li>
					<li>Easy to change layout</li>
					<li>Increased accessibility</li>
					<li>Different styling for different media(print, screen, pda)</li>
				</ul>
			</div>
		</div><div style='float:right;margin-top:1px;valign:top'> <button type="button" title='Sign Out' onclick="javascript:top.window.location.href='../logout.php';return false;"><span><span>Sign Out</span></span></button></div></td>
			<td width='50px'></td>-->
         
          </table></td>
        </tr>
		<?php 
		

			$query = "select notification_type.notification_name, ifnull(View_Access,0),ifnull(nbrOfDays,0)
					from notification_type
					left join ".$_SESSION['dbLabel'].".Notification_Access as Notification_Access on Notification_Access.Notification_Name= notification_type.Notification_Name
					where ifnull(menubased,0)=1 and user_code='".$_SESSION["useraccount"]."';";
			$result = mysql_query($query,$connection);
			while($rw=mysql_fetch_row($result)){
				$func="call sendNotification( '$rw[0]','".$_SESSION["useraccount"]."',$rw[2],$rw[1],NULL , '');";//echo $func."<br>";
				$res=mysql_query($func);
				
				
			}
		?>