Ejemplo n.º 1
0
         print "<div class='linkTop'>";
         print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/User Admin/medicalForm_manage_add.php'>Add Medical Form<img style='margin: 0 0 -4px 3px' title='Add Medical Form' src='./themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/page_new.png'/></a> ";
         print "</div>";
     }
     print "<div class='error'>";
     print _("There are no records to display.");
     print "</div>";
 } else {
     $rowMedical = $resultMedical->fetch();
     if (isActionAccessible($guid, $connection2, "/modules/User Admin/medicalForm_manage.php") == TRUE) {
         print "<div class='linkTop'>";
         print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/User Admin/medicalForm_manage_edit.php&gibbonPersonMedicalID=" . $rowMedical["gibbonPersonMedicalID"] . "'>" . _('Edit') . "<img style='margin: 0 0 -4px 5px' title='" . _('Edit') . "' src='./themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/config.png'/></a> ";
         print "</div>";
     }
     //Medical alert!
     $alert = getHighestMedicalRisk($gibbonPersonID, $connection2);
     if ($alert != FALSE) {
         $highestLevel = $alert[1];
         $highestColour = $alert[3];
         $highestColourBG = $alert[4];
         print "<div class='error' style='background-color: #" . $highestColourBG . "; border: 1px solid #" . $highestColour . "; color: #" . $highestColour . "'>";
         print "<b>" . sprintf(_('This student has one or more %1$s risk medical conditions'), strToLower($highestLevel)) . "</b>.";
         print "</div>";
     }
     //Get medical conditions
     try {
         $dataCondition = array("gibbonPersonMedicalID" => $rowMedical["gibbonPersonMedicalID"]);
         $sqlCondition = "SELECT * FROM gibbonPersonMedicalCondition WHERE gibbonPersonMedicalID=:gibbonPersonMedicalID ORDER BY name";
         $resultCondition = $connection2->prepare($sqlCondition);
         $resultCondition->execute($dataCondition);
     } catch (PDOException $e) {
Ejemplo n.º 2
0
function getAlertBar($guid, $connection2, $gibbonPersonID, $privacy = "", $divExtras = "", $div = TRUE, $large = FALSE)
{
    $output = "";
    $width = "14";
    $height = "13";
    $fontSize = "12";
    $totalHeight = "16";
    if ($large) {
        $width = "42";
        $height = "35";
        $fontSize = "39";
        $totalHeight = "45";
    }
    $highestAction = getHighestGroupedAction($guid, "/modules/Students/student_view_details.php", $connection2);
    if ($highestAction == "View Student Profile_full") {
        if ($div == TRUE) {
            $output .= "<div {$divExtras} style='width: 83px; text-align: right; height: " . $totalHeight . "px; padding: 3px 0px; margin: auto'><b>";
        }
        //Individual Needs
        try {
            $dataAlert = array("gibbonPersonID" => $gibbonPersonID);
            $sqlAlert = "SELECT * FROM gibbonINPersonDescriptor JOIN gibbonAlertLevel ON (gibbonINPersonDescriptor.gibbonAlertLevelID=gibbonAlertLevel.gibbonAlertLevelID) WHERE gibbonPersonID=:gibbonPersonID ORDER BY sequenceNumber DESC";
            $resultAlert = $connection2->prepare($sqlAlert);
            $resultAlert->execute($dataAlert);
        } catch (PDOException $e) {
        }
        if ($resultAlert->rowCount() > 0) {
            $rowAlert = $resultAlert->fetch();
            $highestLevel = _($rowAlert["name"]);
            $highestColour = $rowAlert["color"];
            $highestColourBG = $rowAlert["colorBG"];
            if ($resultAlert->rowCount() == 1) {
                $title = $resultAlert->rowCount() . " " . sprintf(_('Individual Needs alert is set, with an alert level of %1$s.'), $rowAlert["name"]);
            } else {
                $title = $resultAlert->rowCount() . " " . sprintf(_('Individual Needs alerts are set, up to a maximum alert level of %1$s.'), $rowAlert["name"]);
            }
            $output .= "<a style='font-size: " . $fontSize . "px; color: #" . $highestColour . "; text-decoration: none' href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Students/student_view_details.php&gibbonPersonID=" . $gibbonPersonID . "&subpage=Individual Needs'><div title='{$title}' style='float: right; text-align: center; vertical-align: middle; max-height: " . $height . "px; height: " . $height . "px; width: " . $width . "px; border-top: 2px solid #" . $highestColour . "; margin-right: 2px; background-color: #" . $highestColourBG . "'>" . _('IN') . "</div></a>";
        }
        //Academic
        $gibbonAlertLevelID = "";
        try {
            $dataAlert = array("gibbonPersonIDStudent" => $gibbonPersonID, "gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
            $sqlAlert = "SELECT * FROM gibbonMarkbookEntry JOIN gibbonMarkbookColumn ON (gibbonMarkbookEntry.gibbonMarkbookColumnID=gibbonMarkbookColumn.gibbonMarkbookColumnID) JOIN gibbonCourseClass ON (gibbonMarkbookColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE gibbonPersonIDStudent=:gibbonPersonIDStudent AND (attainmentConcern='Y' OR effortConcern='Y') AND complete='Y' AND gibbonSchoolYearID=:gibbonSchoolYearID";
            $resultAlert = $connection2->prepare($sqlAlert);
            $resultAlert->execute($dataAlert);
        } catch (PDOException $e) {
            $_SESSION[$guid]["sidebarExtra"] .= "<div class='error'>" . $e->getMessage() . "</div>";
        }
        if ($resultAlert->rowCount() > 1 and $resultAlert->rowCount() <= 4) {
            $gibbonAlertLevelID = 03;
        } else {
            if ($resultAlert->rowCount() > 4 and $resultAlert->rowCount() <= 8) {
                $gibbonAlertLevelID = 02;
            } else {
                if ($resultAlert->rowCount() > 8) {
                    $gibbonAlertLevelID = 01;
                }
            }
        }
        if ($gibbonAlertLevelID != "") {
            $alert = getAlert($connection2, $gibbonAlertLevelID);
            if ($alert != FALSE) {
                $title = sprintf(_('Student has a %1$s alert for academic concern in the current academic year.'), _($alert["name"]));
                $output .= "<a style='font-size: " . $fontSize . "px; color: #" . $alert["color"] . "; text-decoration: none' href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Students/student_view_details.php&gibbonPersonID=" . $gibbonPersonID . "&subpage=Markbook&filter=" . $_SESSION[$guid]["gibbonSchoolYearID"] . "'><div title='{$title}' style='float: right; text-align: center; vertical-align: middle; max-height: " . $height . "px; height: " . $height . "px; width: " . $width . "px; border-top: 2px solid #" . $alert["color"] . "; margin-right: 2px; background-color: #" . $alert["colorBG"] . "'>" . _('A') . "</div></a>";
            }
        }
        //Behaviour
        $gibbonAlertLevelID = "";
        try {
            $dataAlert = array("gibbonPersonID" => $gibbonPersonID);
            $sqlAlert = "SELECT * FROM gibbonBehaviour WHERE gibbonPersonID=:gibbonPersonID AND type='Negative' AND date>'" . date("Y-m-d", time() - 24 * 60 * 60 * 60) . "'";
            $resultAlert = $connection2->prepare($sqlAlert);
            $resultAlert->execute($dataAlert);
        } catch (PDOException $e) {
            $_SESSION[$guid]["sidebarExtra"] .= "<div class='error'>" . $e->getMessage() . "</div>";
        }
        if ($resultAlert->rowCount() > 1 and $resultAlert->rowCount() <= 4) {
            $gibbonAlertLevelID = 03;
        } else {
            if ($resultAlert->rowCount() > 4 and $resultAlert->rowCount() <= 8) {
                $gibbonAlertLevelID = 02;
            } else {
                if ($resultAlert->rowCount() > 8) {
                    $gibbonAlertLevelID = 01;
                }
            }
        }
        if ($gibbonAlertLevelID != "") {
            $alert = getAlert($connection2, $gibbonAlertLevelID);
            if ($alert != FALSE) {
                $title = sprintf(_('Student has a %1$s alert for behaviour over the past 60 days.'), _($alert["name"]));
                $output .= "<a style='font-size: " . $fontSize . "px; color: #" . $alert["color"] . "; text-decoration: none' href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Students/student_view_details.php&gibbonPersonID=" . $gibbonPersonID . "&subpage=Behaviour'><div title='{$title}' style='float: right; text-align: center; vertical-align: middle; max-height: " . $height . "px; height: " . $height . "px; width: " . $width . "px; border-top: 2px solid #" . $alert["color"] . "; margin-right: 2px; background-color: #" . $alert["colorBG"] . "'>" . _('B') . "</div></a>";
            }
        }
        //Medical
        $alert = getHighestMedicalRisk($gibbonPersonID, $connection2);
        if ($alert != FALSE) {
            $highestLevel = $alert[1];
            $highestColour = $alert[3];
            $highestColourBG = $alert[4];
            $title = sprintf(_('Medical alerts are set, up to a maximum of %1$s'), $highestLevel);
            $output .= "<a style='font-size: " . $fontSize . "px; color: #" . $highestColour . "; text-decoration: none' href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Students/student_view_details.php&gibbonPersonID=" . $gibbonPersonID . "&subpage=Medical'><div title='{$title}' style='float: right; text-align: center; vertical-align: middle; max-height: " . $height . "px; height: " . $height . "px; width: " . $width . "px; border-top: 2px solid #" . $highestColour . "; margin-right: 2px; background-color: #" . $highestColourBG . "'><b>" . _('M') . "</b></div></a>";
        }
        //Privacy
        $privacySetting = getSettingByScope($connection2, "User Admin", "privacy");
        if ($privacySetting == "Y" and $privacy != "") {
            $alert = getAlert($connection2, 01);
            $title = sprintf(_('Privacy is required: %1$s'), $privacy);
            $output .= "<div title='{$title}' style='font-size: " . $fontSize . "px; float: right; text-align: center; vertical-align: middle; max-height: " . $height . "px; height: " . $height . "px; width: " . $width . "px; border-top: 2px solid #" . $alert["color"] . "; margin-right: 2px; color: #" . $alert["color"] . "; background-color: #" . $alert["colorBG"] . "'>" . _('P') . "</div>";
        }
        if ($div == TRUE) {
            $output .= "</div>";
        }
    }
    return $output;
}