コード例 #1
0
ファイル: prescasy.php プロジェクト: rpodgorny/attendance
$total = 0;
for ($day = 1; checkdate($_GET["month"], $day, $_GET["year"]); $day++) {
    $date = date_to_string($_GET["year"], $_GET["month"], $day);
    $time = db_get_condition("overtimes", "time", "date='" . $date . "' AND employee='" . $_GET["employee"] . "'");
    if (!$time) {
        continue;
    }
    $time = datetime_to_secs($time);
    if ($time == 0) {
        continue;
    }
    $daytype = weekdayname($_GET["year"], $_GET["month"], $day);
    if (db_get_condition("vacancies", "date", "date='" . $date . "'")) {
        $daytype .= " + svatek";
    }
    $note = db_get_condition("comments", "text", "date='" . $date . "' AND employee='" . $_GET["employee"] . "'");
    $total += $time;
    echo "<tr>";
    echo "<td>" . $day . "." . $_GET["month"] . ". " . $_GET["year"] . "</td>";
    echo "<td>" . $daytype . "</td>";
    echo "<td>" . secs_to_time($time) . "</td>";
    echo "<td>" . $note . "</td>";
    echo "</tr>";
    echo "\n";
}
?>
</table>

<table>
	<tr>
		<th>celkem</th>
コード例 #2
0
ファイル: stat.php プロジェクト: rpodgorny/attendance
        echo "</p>";
        //break;
    }
    $prev_tots["plusminus"] += $mt["plusminus"] - $mt["overtime"];
    if ($y == $_GET["year"]) {
        $prev_tots["days_dovolena"] += $mt["days_dovolena"];
    }
    $m++;
    if ($m > 12) {
        $y++;
        $m = 1;
    }
}
$cur_tots = month_totals($_GET["year"], $_GET["month"], $_GET["employee"], true);
$dovolena_narok = db_get_condition("dovolene", "days", "employee=" . $_GET["employee"] . " AND year='" . $_GET["year"] . "'");
$dovolena_zminula = db_get_condition("dovolene", "days_lastyear", "employee=" . $_GET["employee"] . " AND year='" . $_GET["year"] . "'");
$cur_tots_noemployee = month_totals($_GET["year"], $_GET["month"], 0, false);
?>

<table>
	<tr>
		<th>odpracováno tento měsíc</th>
		<td><?php 
echo secs_to_time($cur_tots["odpracovano"]);
?>
</td>
	</tr>
	<tr>
		<th>uznané přesčasy</th>
		<td><?php 
echo secs_to_time($cur_tots["overtime"]);