📄 get_csv.php
字号:
$tmp_z++; } } else { if (strtolower($user_or_display) == "display") { $string .= "$employees_displayname[$x], $info_date[$y], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_date[$y], $hours, ,\n"; } } $secs = 0; $punch_cnt = 0; } } } else { //// print totals for previous day //// //// if the previous has only a single In punch and no Out punches, configure the $secs //// if (isset($tmp_info_date)) { if ($status == "out") { $secs = $secs; } elseif ($status == "in") { $secs = $secs + ($previous_days_end_time - $in_time); } $hours = secsToHours($secs, $tmp_round_time); $total_hours = $total_hours + $hours; $hours = number_format($hours, 2); $row_color = $color2; // Initial row color if (empty($y)) { $yy = 0; } else { $yy = $y - 1; } if ($tmp_show_details == "1") { for ($z=$tmp_z;$z<=$punch_cnt;$z++) { $time_formatted = date($timefmt, $info_timestamp[$z]); if (strtolower($user_or_display) == "display") { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_notes[$z], , ,\n"; } } } else { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$yy], $info_notes[$z], , ,\n"; } } } $tmp_z++; } } else { if (strtolower($user_or_display) == "display") { $string .= "$employees_displayname[$x], $info_date[$yy], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_date[$yy], $hours, ,\n"; } } $secs = 0; unset($in_time); unset($out_time); unset($previous_days_end_time); unset($status); unset($tmp_info_date); unset($date_formatted); } $tmp_info_date = $info_date[$y]; $previous_days_end_time = $info_end_time[$y] + 1; $punch_cnt++; if (empty($punchlist_in_or_out[$y])) { $status = "out"; $secs = $info_timestamp[$y] - $info_start_time[$y]; $out_time = $info_timestamp[$y]; $previous_days_end_time = $info_end_time[$y] + 1; if ($y == $info_cnt - 1) { $hours = secsToHours($secs, $tmp_round_time); $total_hours = $total_hours + $hours; $hours = number_format($hours, 2); if ($tmp_show_details == "1") { for ($z=$tmp_z;$z<=$punch_cnt;$z++) { $time_formatted = date($timefmt, $info_timestamp[$z]); if (strtolower($user_or_display) == "display") { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], , ,\n"; } } } else { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], , ,\n"; } } } $tmp_z++; } } else { if (strtolower($user_or_display) == "display") { $string .= "$employees_displayname[$x], $info_date[$y], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_date[$y], $hours, ,\n"; } } $secs = 0; $punch_cnt = 0; } } else { if ($y == $info_cnt - 1) { if (($info_timestamp[$y] <= $rpt_stamp) && ($rpt_stamp < ($to_timestamp + $tzo)) && ($info_date[$y] == $rpt_date)) { $secs = $secs + ($rpt_stamp - $info_timestamp[$y]); $currently_punched_in = '1'; } elseif (($info_timestamp[$y] <= $rpt_stamp) && ($info_date[$y] == $rpt_date)) { $secs = $secs + (($to_timestamp + $tzo) - $info_timestamp[$y]); $currently_punched_in = '1'; } else { $secs = $secs + (($info_end_time[$y] + 1) - $info_timestamp[$y]); } } else { $status = "in"; $in_time = $info_timestamp[$y]; $previous_days_end_time = $info_end_time[$y] + 1; } if ($y == $info_cnt - 1) { $hours = secsToHours($secs, $tmp_round_time); $total_hours = $total_hours + $hours; $hours = number_format($hours, 2); if ($tmp_show_details == "1") { for ($z=$tmp_z;$z<=$punch_cnt;$z++) { $time_formatted = date($timefmt, $info_timestamp[$z]); if (strtolower($user_or_display) == "display") { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], , ,\n"; } } } else { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], , ,\n"; } } } $tmp_z++; } } else { if (strtolower($user_or_display) == "display") { $string .= "$employees_displayname[$x], $info_date[$y], $hours, ,\n"; } else { $string .= "$employees_empfullname[$x], $info_date[$y], $hours, ,\n"; } } $secs = 0; $punch_cnt = 0; } } } } else { ///// this is for the start of the first entry for the first day ///// $tmp_info_date = $info_date[$y]; $previous_days_end_time = $info_end_time[$y] + 1; if (empty($punchlist_in_or_out[$y])) { $out = 1; $status = "out"; if ($info_date[$y] == $from_date) { $secs = $info_timestamp[$y] - $from_timestamp - $tzo; } else { $secs = $info_timestamp[$y] - $info_start_time[$y]; } $out_time = $info_timestamp[$y]; $previous_days_end_time = $info_end_time[$y] + 1; if ($y == $info_cnt - 1) { $hours = secsToHours($secs, $tmp_round_time); $total_hours = $total_hours + $hours; $hours = number_format($hours, 2); if ($y == $info_cnt - 1) { $hours = secsToHours($secs, $tmp_round_time); $total_hours = $total_hours + $hours; if ($tmp_show_details == "1") { for ($z=$tmp_z;$z<=$punch_cnt;$z++) { $time_formatted = date($timefmt, $info_timestamp[$z]); if (strtolower($user_or_display) == "display") { if (!empty($tmp_display_ip)) { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_ipaddress[$z], $info_notes[$z], , ,\n"; } } else { if ($z == $punch_cnt) { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], $hours, ,\n"; } else { $string .= "$employees_displayname[$x], $info_inout[$z], $time_formatted, $info_date[$y], $info_notes[$z], , ,\n"; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -