Beispiel #1
0
function ReportSummary($badgeid)
{
    $score = CalculateScoreForOne($badgeid);
    $c = $score["Counts"];
    $tm = $c[0] + $c[1] + $c[2];
    $ne = $score["NEvents"];
    $tlastday = strtotime($score["LastDay"]);
    $slastday = date("l, F j, Y", $tlastday);
    RptLine('As of <b>' . $slastday . '</b>');
    RptLine('Your Attendance Score is <b>' . sprintf("%4.1f", $score["Score"]) . '</b> percent.');
    RptLine(' ');
    RptLine('Total possible meetings:', $tm);
    RptLine('Meeting types: Manditory=<b>' . $c[0] . '</b>, Regular=<b>' . $c[1] . '</b>, Optional=<b>' . $c[2] . '</b>');
    RptLine(' ');
    RptLine('Meetings attended:', $score["Present"]);
    RptLine('Total hours:', sprintf("%5.1f", $score["TotalHours"]));
    RptLine('Hours on days of meetings:', sprintf("%5.1f", $score["InHours"]));
    RptLine('Hours outside of meeting days:', sprintf("%5.1f", $score["OutHours"]));
    RptLine(' ');
    RptLine('Your Record:');
    for ($i = 0; $i < $ne; $i++) {
        $d = $score[$i];
        $sout = $d["Name"] . ': ';
        if ($d["Present"]) {
            $sout .= "Present";
        } else {
            $sout .= "<b>Absent</b>";
        }
        if ($d["Hours"] > 0.001) {
            $sout .= ', Hours: <b>' . sprintf("%4.1f", $d["Hours"]) . '</b>';
        }
        if (isset($d["Correction"])) {
            $sout .= ', **' . $d["Correction"];
        }
        RptLine($sout);
    }
    RptLine(' ');
}
function ShowCorrections($badgeid)
{
    $loc = "attendance_user.php->ShowRawScans()";
    $corrections = GetSqlTable("Corrections");
    RptLine('');
    RptLine('Corrections applied:');
    foreach ($corrections as $c) {
        if ($c["BadgeID"] == '*' || strtolower($badgeid) == strtolower($c["BadgeID"])) {
            echo '<div style="display: block; hieght: 20px; ">';
            echo '<div style="float: left; width: 100px;">';
            echo $c["Action"];
            echo '</div>';
            echo '<div style="float: left; width: 150px;">';
            echo $c["ScanTime"];
            echo '</div>';
            echo '<div style="float: left; width: 350px; margin-left: 10px; ">';
            echo $c["Reason"];
            echo '</div>';
            echo '</div>';
            echo '<div style="clear: both;"></div>' . "\n";
        }
    }
}