????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.3 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : 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, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/scanreport/ |
Upload File : |
<?php
session_start();
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>TIMRAPPORT</title>
</head>
<body style="font-family:Arial, Helvetica, sans-serif;font-size:12px">
<center>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%"><a href="report.php?month=<?php echo($_GET['month']);?>"><< Tillbaka</a></td>
<td width="74%" align="center"><a href="?month=<?php echo($_GET['month']-1);?>&projectId=<?php echo($_GET['projectId']);?>"><< Föregående Månad</a> Aktuell period:
<?php
function lastday($month = '', $year = '') {
if (empty($month)) {
$month = date('m');
}
if (empty($year)) {
$year = date('Y');
}
$result = strtotime("{$year}-{$month}-01");
$result = strtotime('-1 second', strtotime('+1 month', $result));
return date('d', $result);
}
if($_GET['month'] == ""){
$month = 0;
}else{
$month = $_GET['month'];
}
$start = date("Y-m",strtotime("".$month." month"))."-01";
$end = date("Y-m",strtotime("".$month." month"))."-".lastday(date("m",strtotime("".$month." month")),date("Y"));
echo($start." - ".$end);
?>
<a href="?month=<?php echo($_GET['month']+1);?>&projectId=<?php echo($_GET['projectId']);?>">Nästa Månad >></a></td>
<td width="13%"> </td>
</tr>
</table>
<br /><br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><strong>Datum</strong></td>
<td><strong>ProjektID</strong></td>
<td><strong>Admintid</strong></td>
<td><strong>Projekttid</strong></td>
<td><strong>Väntetid</strong></td>
<td><strong>Övertid</strong></td>
<td><strong>Resor Etc</strong></td>
<td><strong>Kommentar</strong></td>
<td><strong>Kostnader</strong></td>
<td><strong>Traktamente (Natt)</strong></td>
<td><strong>Traktamente (Dag)</strong></td>
<td><strong>Användare</strong></td>
</tr>
<?php
$sql = "SELECT * FROM `ProjectTime` where EntryDate >= '".$start." 00:00:00' and EntryDate <= '".$end." 23:59:59' and ProjectId = '".$_GET['projectId']."' order by EntryDate asc";
$result = mysql_query($sql);
$x = 0;
$TimeSpent_X = 0;
$Waittime_X = 0;
$Overtime_X = 0;
$Extra_X = 0;
$Admin_X = 0;
$temp = "";
$TOTTOT =0;
$TimeSpent_XX =0;
$Waittime_XX=0;
$Overtime_XX =0;
$Extra_XX =0;
$AdmintSpent_XX=0;
while ($row = mysql_fetch_assoc($result)){
$Username = $row['Username'];
$ProjectId = $row['ProjectId'];
$AdminSpent = $row['AdminSpent'];
$AdminSpentMIN = $row['AdminSpentMIN'];
$TimeSpent = $row['TimeSpent'];
$TimeSpentMIN = $row['TimeSpentMIN'];
$Waittime = $row['Waittime'];
$WaittimeMIN = $row['WaittimeMIN'];
$Overtime = $row['Overtime'];
$OvertimeMIN = $row['OvertimeMIN'];
$EntryDate = $row['EntryDate'];
$Comment = $row['Comment'];
$Costs = $row['Costs'];
$Extra = $row['Extra'];
$Traktamente = $row['Traktamente'];
$TraktamenteDAG = $row['TraktamenteDAG'];
$AdminSpent += floor($AdminSpentMIN / 60);
$AdminSpentMIN = (($AdminSpentMIN % 60)/60);
$AdminSpent = $AdminSpent + $AdminSpentMIN;
$TimeSpent += floor($TimeSpentMIN / 60);
$TimeSpentMIN = (($TimeSpentMIN % 60)/60);
$TimeSpent = $TimeSpent + $TimeSpentMIN;
$Waittime += floor($WaittimeMIN / 60);
$WaittimeMIN = (($WaittimeMIN % 60)/60);
$Waittime = $Waittime + $WaittimeMIN;
$Overtime += floor($OvertimeMIN / 60);
$OvertimeMIN = (($OvertimeMIN % 60)/60);
$Overtime =$Overtime + $OvertimeMIN;
$Extra += floor($ExtraMIN / 60);
$ExtraMIN = (($ExtraMIN % 60)/60);
$Extra = $Extra + $ExtraMIN;
$TimeSpent_TOT += $TimeSpent;
$Overtime_TOT += $Overtime;
$Waittime_TOT += $Waittime;
$Extra_TOT += $Extra;
$AdminSpent_TOT += $AdminSpent;
if($temp == ""){
$temp = substr($EntryDate,0,10);
$TimeSpent_X = 0;
$Waittime_X = 0;
$Overtime_X = 0;
$Extra_X = 0;
$AdminSpent_X = 0;
}
if($temp != substr($EntryDate,0,10)){
//$x=$x-1;
echo(" <tr bgcolor='#999999'><td></td>");
echo("<td></td>");
echo("<td> $AdminSpent_X</td>");
echo("<td> $TimeSpent_X</td>");
echo("<td>$Waittime_X</td>");
echo("<td>$Overtime_X</td>");
echo("<td>$Extra_X</td>");
echo("<td>Tot: $TOT</td>");
echo("<td><br><br></td>");
echo("<td> </td>");
echo("<td> </td></tr>");
$TimeSpent_X = 0;
$Waittime_X = 0;
$Overtime_X = 0;
$Extra_X = 0;
$AdminSpent_X = 0;
}
$temp = substr($EntryDate,0,10);
?>
<tr>
<td width="10%"><?php echo($EntryDate);?></td>
<td width="10%"><?php echo($ProjectId);?></td>
<td width="10%"><?php echo($AdminSpent);?></td>
<td width="10%"><?php echo($TimeSpent);?></td>
<td width="10%"><?php echo($Waittime);?></td>
<td width="10%"><?php echo($Overtime);?></td>
<td width="10%"><?php echo($Extra);?></td>
<td width="10%"><?php echo($Comment);?></td>
<td width="10%"><?php echo($Costs);?></td>
<td width="10%"><?php echo($Traktamente);?></td>
<td width="10%"><?php echo($TraktamenteDAG);?></td>
<td width="10%"><?php echo($Username);?></td>
</tr>
<?php
$TimeSpent_X += $TimeSpent;
$Waittime_X += $Waittime;
$Overtime_X += $Overtime;
$Extra_X += $Extra;
$AdmintSpent_X += $AdminSpent;
$TimeSpent_XX += $TimeSpent;
$Waittime_XX += $Waittime;
$Overtime_XX += $Overtime;
$Extra_XX += $Extra;
$AdmintSpent_XX += $AdmintSpent;
$TOT = $TimeSpent_X + $Waittime_X + $Overtime_X + $Extra_X + $AdminSpent_X;
$TOTTOT += $TimeSpent+ $Waittime + $Overtime + $Extra +$AdmintSpent;
}
echo(" <tr bgcolor='#999999'><td></td>");
echo("<td></td>");
echo("<td> $AdminSpent_X</td>");
echo("<td> $TimeSpent_X</td>");
echo("<td>$Waittime_X</td>");
echo("<td>$Overtime_X</td>");
echo("<td>$Extra_X</td>");
echo("<td>Tot: $TOT</td>");
echo("<td><br><br></td>");
echo("<td> </td>");
echo("<td> </td></tr>");
echo(" <tr bgcolor='#CCCCCC'><td></td>");
echo("<td></td>");
echo("<td> $AdminSpent_XX</td>");
echo("<td> $TimeSpent_XX</td>");
echo("<td>$Waittime_XX</td>");
echo("<td>$Overtime_XX</td>");
echo("<td>$Extra_XX</td>");
echo("<td>Tot: $TOTTOT</td>");
echo("<td><br><br></td>");
echo("<td> </td>");
echo("<td> </td></tr>");
?>
</table>
</center>
</body>
</html>