<?php session_start(); header("Cache-control: private"); require_once "global/library.php"; $g_default_save_form_empty_str = "Enter form name here."; $_SESSION["account_id"] = 1; $forms = get_forms($_SESSION["account_id"]); $next_year = mktime(0, 0, 0, date("m"), date("d"), date("Y") + 1); $next_year = date("m/d/Y", $next_year); $last_year = mktime(0, 0, 0, date("m"), date("d"), date("Y") - 1); $last_year = date("m/d/Y", $last_year); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title><?php echo $g_title; ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="GenerateData.com: free, GNU-licensed, random custom data generator for testing software" /> <meta name="keywords" content="Random Data, Test Data, Sample Data, data generator, generate, data, Ben Keen, Benjamin Keen" /> <script type="text/javascript"> var g_logged_in = true; var g_default_save_form_empty_str = "<?php echo $g_default_save_form_empty_str; ?> ";
<?php require_once '../lib/lib.everything.php'; enforce_master_on_off_switch($_SERVER['HTTP_ACCEPT_LANGUAGE']); $context = default_context(True); /**** ... ****/ $pagination = array('page' => $_GET['page'], 'perpage' => $_GET['perpage']); $forms = get_forms($context->db, null, $pagination); foreach ($forms as $i => $form) { $user = get_user($context->db, $form['user_id']); if ($user['name']) { $forms[$i]['user'] = $user['name']; } else { $forms[$i]['user'] = '******'; } } list($count, $offset, $perpage, $page) = get_pagination($pagination); $context->sm->assign('forms', $forms); $context->sm->assign('count', $count); $context->sm->assign('offset', $offset); $context->sm->assign('perpage', $perpage); $context->sm->assign('page', $page); header("Content-Type: text/html; charset=UTF-8"); print $context->sm->fetch("forms.html.tpl");
$result = DB_query($sql, $db); $myrow = DB_fetch_row($result); $grade_id = $myrow[0]; $LeftOvers = $pdf->addTextWrap(450, $YPos - 10, 300, $FontSize, _('Mean Grade') . ' :' . $grade); $YPos -= 1.5 * $line_height; $LeftOvers = $pdf->addTextWrap(250, $YPos - 10, 300, $FontSize, _('Student Tracking Record')); $LeftOvers = $pdf->addTextWrap(250, $YPos - 11, 60, $FontSize, '______________________________________________________________________________'); $FontSize = 8; $YPos -= 2.5 * $line_height; $pdf->line($Left_Margin, $YPos + $line_height, $Page_Width - $Right_Margin, $YPos + $line_height, $style); $YPos3 = $YPos; $pdf->line($Left_Margin, $YPos - 70, $Left_Margin, $YPos + 12, $style); $pdf->line(565, $YPos - 70, 565, $YPos + 12, $style); $LeftOvers = $pdf->addTextWrap($Left_Margin + 5, $YPos + 1, 300, $FontSize, _('CLASSES')); $LeftOvers = $pdf->addTextWrap($Left_Margin + 5, $YPos - 10, 300, $FontSize, _('TERMS')); $forms_array = get_forms($db); $terms_array = get_form_terms($db); $nw = new Numbers_Words(); foreach ($forms_array as $farr => $form) { $LeftOvers = $pdf->addTextWrap($XPos5 + 45, $YPos + 1, 300, $FontSize, $form['grade_level']); $pdf->line($XPos5 + 35, $YPos - 70, $XPos5 + 35, $YPos + 12, $style); foreach ($terms_array as $tarr => $term) { $sql = "SELECT tcr.mean,tcr.class_id,tcr.class_rank,cm.mean,cp.id,tcr.meanscore FROM termly_class_ranks tcr\n\t\t\t\tINNER JOIN collegeperiods cp ON cp.id=tcr.period_id\n\t\t\t\tINNER JOIN class_means cm ON cm.class=tcr.class_id\n\t\t\t\tWHERE student_id = '" . $myrowclass['student_id'] . "'\n\t\t\t\tAND cp.term_id='" . $term['id'] . "'\n\t\t\t\tAND tcr.class_id ='" . $form['id'] . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); $tracking_mean_grade = $myrow[5]; $classid = $myrow[1]; $classrank = $myrow[2]; $classmean = $myrow[3]; $periodic = $myrow[4]; $sql = "SELECT grade,comment FROM reportcardgrades\n\t\t\t\tWHERE title= '" . $tracking_mean_grade . "'\n\t\t\t\tAND grading LIKE 'other'";
} else { $heading = get_string('formslist', 'local_obu_forms'); } } $PAGE->set_title($heading); $PAGE->set_heading($heading); $staff_forms = substr($USER->username, 0, 1) == 'p' && is_numeric(substr($USER->username, 1)); // Can view staff forms $pg_forms = $staff_forms || is_student($USER->id, 'PG'); // Can view PG student forms $ump_forms = $staff_forms || is_student($USER->id, 'UMP'); // Can view UMP student forms if ($type == 'student') { // Exclude staff forms $staff_forms = false; } if ($type == 'staff') { // Exclude student forms $pg_forms = false; $ump_forms = false; } // The page contents echo $OUTPUT->header(); echo $OUTPUT->heading($heading); $forms = get_forms(is_manager(), $staff_forms, $pg_forms, $ump_forms); $url = new moodle_url('/local/obu_forms/form.php'); foreach ($forms as $form) { echo '<h3><a href="' . $url . '?ref=' . $form->formref . '">' . $form->formref . ': ' . $form->name . '</a></h3>'; echo $form->description; } echo $OUTPUT->footer();