"); $sql = "SELECT DATE(NOW()) as 'current_date', DATE(NOW()) - INTERVAL 1 WEEK as 'week_start'"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_array($result)) { $current_date = $row['current_date']; $week_start = $row['week_start']; } if (isset($_GET['fromdate'])) { $fromdate = $_GET['fromdate']; } else { $fromdate = $week_start; } if (isset($_GET['todate'])) { $todate = $_GET['todate']; $todatefront = $_GET['todate']; } else { $todate = $current_date; $todatefront = $current_date; } $date = $todate; $date1 = str_replace('-', '/', $date); $todate = date('Y-m-d',strtotime($date1 . "+1 days")); $sql = "SELECT (5 * (DATEDIFF('$todate', '$fromdate') DIV 7) + MID('0123455501234445012333450122234501101234000123450', 7 * WEEKDAY('$fromdate') + WEEKDAY('$todate') + 1, 1)) * 8.5 AS TotalResolutionTimeBusinessDays "; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_array($result)) { $corehours = $row['TotalResolutionTimeBusinessDays']; } ?> '; } ?> Date Selection
PRINT
"; } ?>


Summary Chart
UNIX_TIMESTAMP(DATE_FORMAT('$fromdate','%Y-%m-%d')) and e.zef_in < UNIX_TIMESTAMP(DATE_FORMAT('$todate','%Y-%m-%d')) group by u.usr_name "; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_array($result)) { $name = $row['alias']; $time_spent = $row['time_spent']; $needed_time = $row['needed_time']; $diff = $row['diff']; $html .= ""; } ?>
Name Total Hours Core Working Hours Difference
$name$time_spent$needed_time$diff

Detailed Summary UNIX_TIMESTAMP(DATE_FORMAT('$fromdate','%Y-%m-%d')) and e.zef_in < UNIX_TIMESTAMP(DATE_FORMAT('$todate','%Y-%m-%d')) group by u.usr_name "; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_array($result)) { $name = $row['name']; $alias = $row['alias']; $html .= ""; $names[] = $name; } ?> UNIX_TIMESTAMP(DATE_FORMAT('$fromdate','%Y-%m-%d')) and e.zef_in < UNIX_TIMESTAMP(DATE_FORMAT('$todate','%Y-%m-%d')) group by p.pct_name "; $result = mysqli_query($conn, $sql); $totalforreport = 0; while ($row = mysqli_fetch_array($result)) { $projecttotal = $row['project_total']; $project = $row['project']; $html .= ""; foreach ($names as $name) { $sqla = "select ROUND(SUM(e.zef_time) / 3600, 1) as 'totaltime' from kimai_zef e inner join kimai_usr u on e.zef_usrID=u.usr_ID inner join kimai_pct p on e.zef_pctID=p.pct_ID where e.zef_in > UNIX_TIMESTAMP(DATE_FORMAT('$fromdate','%Y-%m-%d')) and e.zef_in < UNIX_TIMESTAMP(DATE_FORMAT('$todate','%Y-%m-%d')) and p.pct_name = '$project' and u.usr_name = '$name' group by p.pct_name;"; $result1 = mysqli_query($conn, $sqla); $total = 0; if (mysqli_num_rows($result1) != 0) { while ($row = mysqli_fetch_array($result1)) { $time = $row['totaltime']; $html .= ""; } } else { $html .= ""; } } $html .= ""; $html .= ""; $totalforreport = $totalforreport + $projecttotal; } ?> UNIX_TIMESTAMP(DATE_FORMAT('$fromdate','%Y-%m-%d')) and e.zef_in < UNIX_TIMESTAMP(DATE_FORMAT('$todate','%Y-%m-%d')) and u.usr_name = '$name' group by u.usr_name;"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_array($result)) { $time = $row['totaltime']; $html .= ""; } } $html .= ""; ?> $corehours"; $totalcorehours = $totalcorehours + $corehours; } $html .= ""; ?> UNIX_TIMESTAMP(DATE_FORMAT('$fromdate','%Y-%m-%d')) and e.zef_in < UNIX_TIMESTAMP(DATE_FORMAT('$todate','%Y-%m-%d')) and u.usr_name = '$name' group by u.usr_name;"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_array($result)) { $time = $row['totaltime'] - $corehours; $html .= ""; } } $difference = $totalforreport - $totalcorehours; $html .= ""; ?>
Project Name $aliasTOTAL
$project$time$projecttotal
TOTAL $time$totalforreport
Core Working Hours $totalcorehours
Difference $time$difference
'; } ?> ' . '$(document).ready(function(){window.print();window.history.back();});' . ''; } ?>