????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.222.48.95 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=UTF-8" /> <title>TIMRAPPORT</title> </head> <body style="font-family:Arial, Helvetica, sans-serif;font-size:12px"> <center> <a href="?month=<?php echo($_GET['month']-1);?>"><< 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']; } $month = $month * 31; $month .= " days"; $start = date("Y-m",strtotime("".$month))."-01"; $end = date("Y-m",strtotime("".$month))."-".lastday(date("m",strtotime("".$month)),date("Y")); echo($start." - ".$end); ?> <a href="?month=<?php echo($_GET['month']+1);?>">Nästa Månad >></a><br /><br /> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="600">Projekt</td> <?php if($_GET['deb'] == "true"){ $deb = " and Faktura1 = 'true' "; }else{ $deb = ""; } $sql = "SELECT * FROM `ProjectTime` where EntryDate >= '".$start." 00:00:00' and EntryDate <= '".$end." 23:59:59' $deb group by Username"; $result = mysql_query($sql); $x = 0; $arr = array("","","","","","","","","","","","","","","","","",""); $sum = array("","","","","","","","","","","","","","","","","",""); $tra = array("","","","","","","","","","","","","","","","","",""); $tradag = array("","","","","","","","","","","","","","","","","",""); while ($row = mysql_fetch_assoc($result)){ $Username = $row['Username']; $UsernameShow = ucfirst(substr($row['Username'],0,strpos($row['Username'],".")+2)); echo("<td width='250'><a href='report_employee.php?username=$Username&month=".$_GET['month']."'>$UsernameShow</a></td>"); $arr[$x] = $Username; $x++; } ?> <td width="70">Totalt</td> </tr> <?php $sql = "SELECT * FROM ProjectTime, Project where Project.ProjectId = ProjectTime.ProjectId and ProjectTime.EntryDate >= '".$start." 00:00:00' and ProjectTime.EntryDate <= '".$end." 23:59:59' $deb group by ProjectTime.ProjectId"; $result = mysql_query($sql); $color = 0; while ($row = mysql_fetch_assoc($result)){ $ProjectId = $row['ProjectId']; $Name = iconv('ISO-8859-1', 'UTF-8', $row['Name']); $CompanyId = $row['CompanyId']; $color += 1; if($color % 2 == 0){ $col = "#FFFFFF"; }else{ $col = "#EEEEEE"; } ?> <tr bgcolor="<?php echo($col);?>"> <td><a href="report_project.php?projectId=<?php echo($ProjectId);?>&month=<?php echo($_GET['month']);?>"><?php echo($CompanyId);?>_<?php echo($Name);?> (<?php echo($ProjectId);?>)</a></td> <?php $ProjTot = 0; for ($y=0; $y<$x; $y++) { $sql = "SELECT sum(TimeSpent) as TimeSpent, sum(Waittime) as Waittime, sum(Overtime) as Overtime, sum(Extra) as Extra, sum(Traktamente) as Traktamente, sum(TraktamenteDAG) as TraktamenteDAG, sum(TimeSpentMIN) as TimeSpentMIN, sum(OvertimeMIN) as OvertimeMIN, sum(ExtraMIN) as ExtraMIN, sum(WaittimeMIN) as WaittimeMIN,sum(AdminSpent) as AdminSpent, sum(AdminSpentMIN) as AdminSpentMIN, Comment FROM `ProjectTime` where EntryDate >= '".$start." 00:00:00' and EntryDate <= '".$end." 23:59:59' and ProjectId = $ProjectId and username = '".$arr[$y]."' $deb group by TimeSpent"; $result1 = mysql_query($sql); $Totalt = 0; $TotaltShow = 0; $Comment = ""; while ($row1 = mysql_fetch_assoc($result1)){ $TimeSpent = $row1['TimeSpent']; $Overtime = $row1['Overtime']; $Extra = $row1['Extra']; $Waittime = $row1['Waittime']; $TimeSpentMIN = $row1['TimeSpentMIN']; $OvertimeMIN = $row1['OvertimeMIN']; $AdminSpent = $row1['AdminSpent']; $AdminSpentMIN = $row1['AdminSpentMIN']; $ExtraMIN = $row1['ExtraMIN']; $WaittimeMIN = $row1['WaittimeMIN']; $MIN = $TimeSpentMIN + $OvertimeMIN + $ExtraMIN + $WaittimeMIN + $AdminSpentMIN; $HRS = floor($MIN / 60); $MIN = (($MIN % 60)/60); $Traktamente = $row1['Traktamente']; $TraktamenteDAG = $row1['TraktamenteDAG']; $Comment .= $row1['Comment']; $Totalt = $TimeSpent + $Overtime + $Extra + $Waittime + $AdminSpent + $HRS + $MIN; $TotaltShow += $TimeSpent + $Overtime + $Extra + $Waittime + $AdminSpent+ $HRS + $MIN; $ProjTot += $Totalt; $sum[$y] = $sum[$y] +$Totalt; $tra[$y] = $tra[$y] +$Traktamente; $tradag[$y] = $tradag[$y] +$TraktamenteDAG; if($Comment != ""){ $Comment = "*"; } } echo("<td ><a href='report_details.php?projectId=".$ProjectId."&user=".$arr[$y]."&month=".$_GET['month']."'>".round($TotaltShow,2).$Comment."</a></td>"); } ?> <td ><?php echo(round($ProjTot,2) );?></td> </tr> <?php } ?> <tr> <td height="20"></td> </tr> <tr> <td>Totalt</td> <?php $TotTot = 0; for ($y=0; $y<$x; $y++) { echo("<td>".round($sum[$y],2) ."</td>"); $TotTot +=$sum[$y]; } ?> <td><?php echo(round($TotTot,2));?></td> </tr> <tr> <td>Traktamente (natt)</td> <?php $TotTot = 0; for ($y=0; $y<$x; $y++) { echo("<td>".$tra[$y] ."</td>"); $TotTot +=$tra[$y]; } ?> <td><?php echo($TotTot);?></td> </tr> <tr> <td>Traktamente (dag)</td> <?php $TotTot = 0; for ($y=0; $y<$x; $y++) { echo("<td>".$tradag[$y] ."</td>"); $TotTot +=$tradag[$y]; } ?> <td><?php echo($TotTot);?></td> </tr> </table> </center> </body> </html>