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"]);
}
示例#2
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(' ');
}