0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.144.6.9


Current Path : /var/www/misc/public_html/oums_old/phpscript/
Upload File :
Current File : /var/www/misc/public_html/oums_old/phpscript/header_note.php

<?php
	include("sys_connect.php");
	include("sys_mainphp.php");
	include("sys_session.php");	
	
	//birthday notifications
	$date1=date('m-d');
	if($type_id=='ADMIN')
	{
		$mysql="select * from masempl where right(femplbday,5)= '$date1' order by femplname";
	}
	elseif($type_id=='CHIEF')
	{
		$mysql="select * from masempl where right(femplbday,5)= '$date1' order by femplname";
	}
	elseif($type_id=='SUPER')
	{
		$mysql="select * from masempl where right(femplbday,5)= '$date1' order by femplname";
	}
	else
	{
		$mysql="select * from masempl where fdeptcode='$dept_id' and right(femplbday,5)= '$date1' order by femplname";
	}				
	$myres = mysqli_query($mycon,$mysql) or die(mysqli_error($mycon));
	$mycnt=mysqli_num_rows($myres);						
	if($mycnt!=0)
	{
		echo "<a onClick=window.location='#'>";
		echo "<span class='glyphicon glyphicon-gift' aria-hidden='true'></span> $mycnt</a>";
	}			
									
	//Movement notifications
	$strt_date=date('Y-m-d',strtotime("yesterday"));
	$mysql="select * from staffmove where left(fstrtdate,10) > '$strt_date' order by fstrtdate desc";
	$myres = mysqli_query($mycon,$mysql) or die(mysqli_error($mycon));
	$mycnt=mysqli_num_rows($myres);					
	if($mycnt!=0)
	{
		echo "<a onClick=window.location='staff_move.php'>";
		echo "<span class='glyphicon glyphicon-briefcase' aria-hidden='true'></span> $mycnt</a>";
	}		

	//work status-----------------------------------
	$mywork=0;	
	$strt_date = date('Y-m-01');
	$work_days = date('d');
	for ($i= 0; $i < $work_days; $i++) 
	{
		$work_date = date('Y-m-d',strtotime("+$i day", strtotime($strt_date)));
		$mysql = "select * from workentry where femplcode='$empl_id' and left(fworkdate,10)='$work_date'";
		$myres = mysqli_query($mycon,$mysql);
		$mycnt = mysqli_num_rows($myres);								
		if($mycnt==0)
		{
			$mywork++;
		}								
	}
	if($mywork!=0)
	{
		echo "<a onClick=window.location='work_entry.php'>";
		echo "<span class='glyphicon glyphicon-list-alt' aria-hidden='true'></span> $mywork</a>";
	}		
	
	//----------------------------------------------------------------------------------------------------
	//attendance
	if($type_id=='ADMIN')
	{
		$mysql="select * from masdept where ifnull(fdeptstat,'')<>'F' order by fdeptname" or die();
	}
	elseif($type_id=='CHIEF')
	{
		$mysql="select * from masdept where fdepthead='$empl_id' and ifnull(fdeptstat,'')<>'F' order by fdeptname" or die();
	}
	elseif($type_id=='SUPER')
	{
		$mysql="select * from masdept where fdeptcode='$dept_id' and ifnull(fdeptstat,'')<>'F' order by fdeptname" or die();
	}
	else
	{
		$mysql="select * from masdept where fdeptcode='$dept_id' and ifnull(fdeptstat,'')<>'F' order by fdeptname" or die();
	}				
	$myres = mysqli_query($mycon,$mysql) or die(mysqli_error($mycon));
	$total=0;
	while($row = mysqli_fetch_assoc($myres))
	{
		$dept_code= $row['fdeptcode']; 						
		$strt_date = date('Y-m-01');
		$attn_days = date('d');
		for ($i= 0; $i < $attn_days; $i++) 
		{
			$date2 = date('Y-m-d',strtotime("+$i day", strtotime($strt_date)));
			$mysql1="select fdeptcode, count(*) as fattnentr from attendance where fdeptcode='$dept_code' and left(fattndate,10)='$date2'";
			$myres1 = mysqli_query($mycon,$mysql1);
			while($row1 = mysqli_fetch_assoc($myres1))
			{
				$attn_entr= $row1['fattnentr']; 
				if($attn_entr==0)
				{
					$total=$total+1;
				}
			}						
		}
	}											
	if($total!=0)
	{
		echo "<a onClick=window.location='attendance.php'>";
		echo "<span class='glyphicon glyphicon-time' aria-hidden='true'></span> $total</a>";
	}			

	//salary notifications
	$total=0;
	if($type_id=='ADMIN')
	{
		$mysql="select * from masdept where ifnull(fsalrcomp,'F')<>'F' and ifnull(fdeptstat,'')<>'F'order by fdeptname";
	}
	elseif($type_id=='CHIEF')
	{
		$mysql="select * from masdept where fdeptcode='$dept_id' and ifnull(fsalrcomp,'F')<>'F' and ifnull(fdeptstat,'')<>'F' order by fdeptname";
	}
	elseif($type_id=='SUPER')
	{
		$mysql="select * from masdept where fdeptcode='$dept_id'  and ifnull(fsalrcomp,'F')<>'F' and ifnull(fdeptstat,'')<>'F' order by fdeptname";
	}
	else
	{
		$mysql="select * from masdept where fdeptcode='' and ifnull(fsalrcomp,'F')<>'F' and ifnull(fdeptstat,'')<>'F' order by fdeptname";
	}				
	$myres = mysqli_query($mycon,$mysql) or die(mysqli_error($mycon));
	while($row = mysqli_fetch_assoc($myres))
	{
		$dept_code= $row['fdeptcode']; 						
		$mnth1 = date('Y-m',strtotime("first day of last month"));
		$mysql1="select fdeptcode,count(*) as salcount from salary where fsalrmnth='$mnth1' and fdeptcode='$dept_code' order by fdeptcode";		
		$myres1 = mysqli_query($mycon,$mysql1);
		while($row1 = mysqli_fetch_assoc($myres1))
		{
			if($row1['salcount']==0)		
			{
				$dept_name=substr($row['fdeptname'],0,60);
				$mnth1=date('M-Y',strtotime($mnth1));
				$total=$total+1;
			}
		}						
	}												
	if($total!=0)
	{
		echo "<a onClick=window.location='salary.php'>";
		echo "<span class='glyphicon glyphicon-th-list' aria-hidden='true'></span> $total</a>";
	}	
?>