$b .= "<center>\n <form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=students>" . make_selection_list($los, $sid, 'student_id', 'students', 'Student', 'on') . "\n <input type=hidden name=\"new_referral\" value=\"New\" />\n </form></center>"; } else { $sql = "SELECT users.first_name, users.last_name, schools.school_name\n FROM users, schools\n WHERE schools.school_id=users.school_id\n AND users.user_id=" . $sid; $result = $db->query($sql); $row = $result->fetch_assoc(); $sfName = $row['first_name']; $slName = $row['last_name']; $sDistrict = $row['school_name']; include 'referral_form.php'; $b .= $form; } $main .= make_box($t, $b); } elseif (isset($_POST['incident_referral_id']) || isset($_POST['send_referral'])) { include 'referral_form.php'; $b .= $form; $main .= make_box($t, $b); } else { /** display a list of OPEN referrals for current teacher **/ $result = get_referrals('teacher_id=' . $_SESSION[$_CONF['sess_name'] . '_myUID'], 'N'); $t = "OPEN Referrals"; $b = display_referrals($result, $_SERVER['PHP_SELF'] . "?lev=" . $_GET['lev'] . "&cat=" . $_GET['cat'], 'N', 'Y'); $main .= make_box($t, $b); /** display a list of CLOSED referrals for current teacher **/ $result = get_referrals('teacher_id=' . $_SESSION[$_CONF['sess_name'] . '_myUID'], 'Y'); $t = "CLOSED Referrals"; $b = display_referrals($result, $_SERVER['PHP_SELF'] . "?lev=" . $_GET['lev'] . "&cat=" . $_GET['cat'], 'Y', 'N'); $main .= make_box($t, $b); } } else { $main .= login_error(); }
$b .= "\n <th>\n <form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=searchByTeacher>"; $b .= make_selection_list($lot, $tid, "teacher_id", "searchByTeacher", "Teacher", "on"); $b .= " \n <input type=hidden name=searchByTeacher />\n </form>\n </th>\n </tr>"; $b .= "\n </table></center>"; $main .= make_box($t, $b . $teacherReferrals); /** Search by Student **/ $t = "Search By Student"; $b = ""; $sid = -1; if (isset($_POST['student_id'])) { $sid = $_POST['student_id']; } $b .= "\n <center><table border=0 cellspacing=0 cellpadding=3>"; $b .= "\n <th>\n <form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=searchByStudent>"; $b .= make_selection_list($los, $sid, "student_id", "searchByStudent", "Student", "on"); $b .= " \n <input type=hidden name=searchByStudent />\n </form>\n </th>\n </tr>"; $b .= "\n </table></center>"; $main .= make_box($t, $b . $studentReferrals); /** display a list of OPEN referrals **/ $result = get_referrals('', 'N'); $t = "OPEN Referrals"; $b = display_referrals($result, $_SERVER['PHP_SELF'] . "?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'], 'N', 'N'); $main .= make_box($t, $b); /** display a list of CLOSED referrals **/ $result = get_referrals('', 'Y'); $t = "CLOSED Referrals"; $b = display_referrals($result, $_SERVER['PHP_SELF'] . "?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'], 'Y', 'N'); $main .= make_box($t, $b); } else { $main .= login_error(); }