Example #1
0
writeHtmlSelected($timefilter, 24);
echo ">last day</option>";
echo "<option value=168 ";
writeHtmlSelected($timefilter, 168);
echo ">last week</option>";
echo "<option value=720 ";
writeHtmlSelected($timefilter, 720);
echo ">last month</option>";
echo "<option value=8760 ";
writeHtmlSelected($timefilter, 8760);
echo ">last year</option>";
echo "</select>";
echo " Last name: <input type=text id=\"lnfilter\" value=\"{$lnfilter}\" />";
echo "<input type=button value=\"Filter by name\" onclick=\"chglnfilter()\" />";
echo "</div>";
$gbt = gbinstrdisp();
echo "</form>";
echo "</div>";
require "../footer.php";
//echo "Meanings:  IP-In Progress, OT-overtime, PT-practice test, EC-extra credit, NC-no credit<br/><sup>*</sup> Has feedback, <sub>d</sub> Dropped score\n";
echo "Meanings:   NC-no credit";
/*if ($isteacher) {
	echo "<div class=cp>";
	echo "<a href=\"addgrades.php?cid=$cid&gbitem=new&grades=all\">Add Offline Grade</a><br/>";
	echo "<a href=\"gradebook.php?stu=$stu&cid=$cid&export=true\">Export Gradebook</a><br/>";
	echo "Email gradebook to <a href=\"gradebook.php?stu=$stu&cid=$cid&emailgb=me\">Me</a> or <a href=\"gradebook.php?stu=$stu&cid=$cid&emailgb=ask\">to another address</a><br/>";
	echo "<a href=\"gbsettings.php?cid=$cid\">Gradebook Settings</a>";
	echo "<div class=clear></div></div>";
}
*/
function gbinstrdisp()
Example #2
0
//0: show all, 1 stu visisble (cntingb not 0), 2 hide all (cntingb 1 or 2)
$availshow = $gbmode % 10;
//0: past, 1 past&cur, 2 all
require "gbtable2.php";
$includecomments = true;
if ($_POST['submit'] == "Download Gradebook for Excel") {
    header('Content-type: application/vnd.ms-excel');
    header('Content-Disposition: attachment; filename="gradebook-' . $cid . '.xls"');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    echo '<html><head>';
    echo '<style type="text/css">';
    require "../imascore.css";
    require "../themes/modern.css";
    echo '</style></head><body>';
    gbinstrdisp();
    echo '</body></html>';
    exit;
} else {
    $gb = gbinstrexport();
    if (isset($_GET['export']) && $_GET['export'] == "true") {
        header('Content-type: text/csv');
        header("Content-Disposition: attachment; filename=\"gradebook-{$cid}.csv\"");
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
        foreach ($gb as $gbline) {
            $line = '';
            foreach ($gbline as $val) {
                # remove any windows new lines, as they interfere with the parsing at the other end
                $val = str_replace("\r\n", "\n", $val);
                $val = str_replace("\n", " ", $val);