예제 #1
0
function GenerateUserReport($data)
{
    $badgeid = $data["BadgeID"];
    $score = CalculateScoreForOne($badgeid);
    $c = $score["Counts"];
    $tm = $c[0] + $c[1] + $c[2];
    $ne = $score["NEvents"];
    RptLine('As of <b>' . $score["LastDay"] . '</b>:');
    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('Attendance score: <b>' . sprintf("%4.1f", $score["Score"]) . '</b>%');
    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(' ');
    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(' ');
    RptLine('Raw Scans:');
    ShowRawScans($data["BadgeID"]);
    ShowCorrections($data["BadgeID"]);
}
            $dir = "Scan Out";
        }
        if ($row["Direction"] == 2) {
            $dir = "?";
        }
        echo '<div style="float: left; width: 100px;">';
        echo $dir;
        echo '</div>' . "\n";
        echo '<div style="float: left; width: 80px;">';
        echo $row["Flags"];
        echo '</div>' . "\n";
        echo '<div style="clear: both;"></div>' . "\n";
        echo '</div>';
    }
    echo '<br>';
    ShowCorrections($badgeid);
}
echo '</div>';
include "forms/footer.php";
function RptLine($s, $t = "")
{
    echo '<div style="font-size: 12pt; margin-top: 5px; min-height: 10px;">';
    echo $s;
    if (!empty($t)) {
        echo ' <b>' . $t . '</b>';
    }
    echo '</div>' . "\n";
}
function ShowCorrections($badgeid)
{
    $loc = "attendance_user.php->ShowRawScans()";