本文整理汇总了PHP中getRoleCategory函数的典型用法代码示例。如果您正苦于以下问题:PHP getRoleCategory函数的具体用法?PHP getRoleCategory怎么用?PHP getRoleCategory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRoleCategory函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: while
$count = 0;
$rowNum = "odd";
while ($row = $resultLike->fetch()) {
if ($count % 2 == 0) {
$rowNum = "even";
} else {
$rowNum = "odd";
}
$count++;
//COLOR ROW BY STATUS!
print "<tr class={$rowNum}>";
print "<td>";
print getUserPhoto($guid, $row["image_240"], 75);
print "</td>";
print "<td>";
$roleCategory = getRoleCategory($row["gibbonRoleIDPrimary"], $connection2);
if ($roleCategory == "Student" and isActionAccessible($guid, $connection2, "/modules/Students/student_view_details.php")) {
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Students/student_view_details.php&gibbonPersonID=" . $row["gibbonPersonID"] . "'>" . formatName("", $row["preferredName"], $row["surname"], $roleCategory, false) . "</a><br/>";
print "<span style='font-size: 85%; font-style: italic'>" . _($roleCategory) . "</i>";
} else {
print formatName("", $row["preferredName"], $row["surname"], $roleCategory, false) . "<br/>";
print "<span style='font-size: 85%; font-style: italic'>" . _($roleCategory) . "</i>";
}
print "</td>";
print "<td>";
print _($row["title"]) . "<br/>";
print "<span style='font-size: 85%; font-style: italic'>" . $row["comment"] . "</span>";
print "</td>";
print "<td>";
print dateConvertBack($guid, substr($row["timestamp"], 0, 10));
print "</td>";
开发者ID:dpredster,项目名称:core,代码行数:31,代码来源:likes.php
示例2: catch
} catch (PDOException $e) {
print "<div class='error'>" . $e->getMessage() . "</div>";
}
}
}
if ($result->rowCount() != 1) {
print "<div class='error'>";
print _("The selected record does not exist, or you do not have access to it.");
print "</div>";
} else {
$row = $result->fetch();
print "<div class='trail'>";
print "<div class='trailHead'><a href='" . $_SESSION[$guid]["absoluteURL"] . "'>" . _("Home") . "</a> > <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_GET["q"]) . "/" . getModuleEntry($_GET["q"], $connection2, $guid) . "'>" . _(getModuleName($_GET["q"])) . "</a> > </div><div class='trailEnd'>" . _('Planner') . " " . $row["course"] . "." . $row["class"] . "</div>";
print "</div>";
//Get Smart Workflow help message
$category = getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2);
if ($category == "Staff") {
$smartWorkflowHelp = getSmartWorkflowHelp($connection2, $guid, 3);
if ($smartWorkflowHelp != false) {
print $smartWorkflowHelp;
}
}
if (isset($_GET["updateReturn"])) {
$updateReturn = $_GET["updateReturn"];
} else {
$updateReturn = "";
}
$updateReturnMessage = "";
$class = "error";
if (!($updateReturn == "")) {
if ($updateReturn == "fail0") {
开发者ID:actcattest001,项目名称:core,代码行数:31,代码来源:planner.php
示例3: array
?>
</i></span>
</td>
<td class="hiddenReveal right">
<select name="activities[]" id="activities[]" multiple style="width: 302px; height: 100px">
<?php
try {
if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_activities_any")) {
$dataSelect = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
$sqlSelect = "SELECT * FROM gibbonActivity WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND active='Y' ORDER BY name";
} else {
if (getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2) == "Staff") {
$dataSelect = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sqlSelect = "SELECT * FROM gibbonActivity JOIN gibbonActivityStaff ON (gibbonActivityStaff.gibbonActivityID=gibbonActivity.gibbonActivityID) WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND active='Y' ORDER BY name";
}
if (getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2) == "Student") {
$dataSelect = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sqlSelect = "SELECT * FROM gibbonActivity JOIN gibbonActivityStudent ON (gibbonActivityStudent.gibbonActivityID=gibbonActivity.gibbonActivityID) WHERE gibbonPersonID=:gibbonPersonID AND gibbonSchoolYearID=:gibbonSchoolYearID AND status='Accepted' AND active='Y' ORDER BY name";
}
}
$resultSelect = $connection2->prepare($sqlSelect);
$resultSelect->execute($dataSelect);
} catch (PDOException $e) {
}
while ($rowSelect = $resultSelect->fetch()) {
print "<option value='" . $rowSelect["gibbonActivityID"] . "'>" . htmlPrep($rowSelect["name"]) . "</option>";
}
?>
</select>
</td>
</tr>
开发者ID:dpredster,项目名称:core,代码行数:31,代码来源:messenger_post.php
示例4: _
}
if ($result->rowCount() != 1) {
print "<div class='error'>";
print _("The specified record cannot be found.");
print "</div>";
} else {
//Let's go!
$row = $result->fetch();
//Get categories
$staff = FALSE;
$student = FALSE;
$parent = FALSE;
$other = FALSE;
$roles = explode(",", $row["gibbonRoleIDAll"]);
foreach ($roles as $role) {
$roleCategory = getRoleCategory($role, $connection2);
if ($roleCategory == "Staff") {
$staff = TRUE;
}
if ($roleCategory == "Student") {
$student = TRUE;
}
if ($roleCategory == "Parent") {
$parent = TRUE;
}
if ($roleCategory == "Other") {
$other = TRUE;
}
}
$search = "";
if (isset($_GET["search"])) {
开发者ID:dpredster,项目名称:core,代码行数:31,代码来源:user_manage_edit.php
示例5: sidebar
//.........这里部分代码省略.........
}
print "<p style='padding-top: 5px; text-align: right'>";
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Messenger/messageWall_view.php'>" . _('View Message Wall') . "</a>";
print "</p>";
}
}
}
}
//Show upcoming deadlines
if ($_SESSION[$guid]["address"] == "" and isActionAccessible($guid, $connection2, "/modules/Planner/planner.php")) {
$highestAction = getHighestGroupedAction($guid, "/modules/Planner/planner.php", $connection2);
if ($highestAction == "Lesson Planner_viewMyClasses" or $highestAction == "Lesson Planner_viewAllEditMyClasses" or $highestAction == "Lesson Planner_viewEditAllClasses") {
print "<h2>";
print _("Homework & Deadlines");
print "</h2>";
try {
$data = array("gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"], "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sql = "\n\t\t\t\t(SELECT 'teacherRecorded' AS type, gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, date, timeStart, timeEnd, viewableStudents, viewableParents, homework, homeworkDueDateTime, role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' AND homework='Y' AND (role='Teacher' OR (role='Student' AND viewableStudents='Y')) AND homeworkDueDateTime>'" . date("Y-m-d H:i:s") . "' AND ((date<'" . date("Y-m-d") . "') OR (date='" . date("Y-m-d") . "' AND timeEnd<='" . date("H:i:s") . "')))\n\t\t\t\tUNION\n\t\t\t\t(SELECT 'studentRecorded' AS type, gibbonPlannerEntry.gibbonPlannerEntryID, gibbonUnitID, gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonPlannerEntry.name, date, timeStart, timeEnd, 'Y' AS viewableStudents, 'Y' AS viewableParents, 'Y' AS homework, gibbonPlannerEntryStudentHomework.homeworkDueDateTime, role FROM gibbonPlannerEntry JOIN gibbonCourseClass ON (gibbonPlannerEntry.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourseClassPerson ON (gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID) JOIN gibbonPlannerEntryStudentHomework ON (gibbonPlannerEntryStudentHomework.gibbonPlannerEntryID=gibbonPlannerEntry.gibbonPlannerEntryID AND gibbonPlannerEntryStudentHomework.gibbonPersonID=gibbonCourseClassPerson.gibbonPersonID) WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID AND NOT role='Student - Left' AND NOT role='Teacher - Left' AND (role='Teacher' OR (role='Student' AND viewableStudents='Y')) AND gibbonPlannerEntryStudentHomework.homeworkDueDateTime>'" . date("Y-m-d H:i:s") . "' AND ((date<'" . date("Y-m-d") . "') OR (date='" . date("Y-m-d") . "' AND timeEnd<='" . date("H:i:s") . "')))\n\t\t\t\t ORDER BY homeworkDueDateTime, type";
$result = $connection2->prepare($sql);
$result->execute($data);
} catch (PDOException $e) {
print $e->getMessage();
}
if ($result->rowCount() < 1) {
print "<div class='success'>";
print _("No upcoming deadlines. Yay!");
print "</div>";
} else {
print "<ol>";
$count = 0;
while ($row = $result->fetch()) {
if ($count < 5) {
$diff = (strtotime(substr($row["homeworkDueDateTime"], 0, 10)) - strtotime(date("Y-m-d"))) / 86400;
$category = getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2);
$style = "padding-right: 3px;";
if ($category == "Student") {
//Calculate style for student-specified completion of teacher-recorded homework
try {
$dataCompletion = array("gibbonPlannerEntryID" => $row["gibbonPlannerEntryID"], "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sqlCompletion = "SELECT gibbonPlannerEntryID FROM gibbonPlannerEntryStudentTracker WHERE gibbonPlannerEntryID=:gibbonPlannerEntryID AND gibbonPersonID=:gibbonPersonID AND homeworkComplete='Y'";
$resultCompletion = $connection2->prepare($sqlCompletion);
$resultCompletion->execute($dataCompletion);
} catch (PDOException $e) {
}
if ($resultCompletion->rowCount() == 1) {
$style .= "; background-color: #B3EFC2";
}
//Calculate style for student-specified completion of student-recorded homework
try {
$dataCompletion = array("gibbonPlannerEntryID" => $row["gibbonPlannerEntryID"], "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sqlCompletion = "SELECT gibbonPlannerEntryID FROM gibbonPlannerEntryStudentHomework WHERE gibbonPlannerEntryID=:gibbonPlannerEntryID AND gibbonPersonID=:gibbonPersonID AND homeworkComplete='Y'";
$resultCompletion = $connection2->prepare($sqlCompletion);
$resultCompletion->execute($dataCompletion);
} catch (PDOException $e) {
}
if ($resultCompletion->rowCount() == 1) {
$style .= "; background-color: #B3EFC2";
}
//Calculate style for online submission completion
try {
$dataCompletion = array("gibbonPlannerEntryID" => $row["gibbonPlannerEntryID"], "gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sqlCompletion = "SELECT gibbonPlannerEntryID FROM gibbonPlannerEntryHomework WHERE gibbonPlannerEntryID=:gibbonPlannerEntryID AND gibbonPersonID=:gibbonPersonID AND version='Final'";
$resultCompletion = $connection2->prepare($sqlCompletion);
$resultCompletion->execute($dataCompletion);
} catch (PDOException $e) {
}
开发者ID:dpredster,项目名称:core,代码行数:67,代码来源:functions.php
示例6: renderTTDay
function renderTTDay($guid, $connection2, $gibbonTTID, $schoolOpen, $startDayStamp, $count, $daysInWeek, $gibbonPersonID, $gridTimeStart, $eventsSchool, $eventsPersonal, $eventsSpaceBooking, $diffTime, $maxAllDays, $narrow, $specialDayStart = "", $specialDayEnd = "", $edit = FALSE)
{
$schoolCalendarAlpha = 0.85;
$ttAlpha = 1.0;
if ($_SESSION[$guid]["viewCalendarSchool"] != "N" or $_SESSION[$guid]["viewCalendarPersonal"] != "N" or $_SESSION[$guid]["viewCalendarSpaceBooking"] != "N") {
$ttAlpha = 0.75;
}
$date = date("Y-m-d", $startDayStamp + 86400 * $count);
$self = FALSE;
if ($gibbonPersonID == $_SESSION[$guid]["gibbonPersonID"] and $edit == FALSE) {
$self = TRUE;
$roleCategory = getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2);
}
if ($narrow) {
$width = ceil(515 / $daysInWeek) - 20 . "px";
} else {
$width = ceil(690 / $daysInWeek) - 20 . "px";
}
$output = "";
$blank = TRUE;
$zCount = 0;
$allDay = 0;
if ($schoolOpen == FALSE) {
$output .= "<td style='text-align: center; vertical-align: top; font-size: 11px'>";
$output .= "<div style='position: relative'>";
$output .= "<div class='ttClosure' style='z-index: {$zCount}; position: absolute; width: {$width} ; height: " . ceil($diffTime / 60) . "px; margin: 0px; padding: 0px; opacity: {$ttAlpha}'>";
$output .= "<div style='position: relative; top: 50%'>";
$output .= "<span style='color: rgba(255,0,0,{$ttAlpha});'>" . _('School Closed') . "</span>";
$output .= "</div>";
$output .= "</div>";
$zCount = 1;
//Draw periods from school calendar
if ($eventsSchool != FALSE) {
$height = 0;
$top = 0;
$dayTimeStart = "";
foreach ($eventsSchool as $event) {
if (date("Y-m-d", $event[2]) == date("Y-m-d", $startDayStamp + 86400 * $count)) {
if ($event[1] == "All Day") {
$label = $event[0];
$title = "";
if (strlen($label) > 20) {
$label = substr($label, 0, 20) . "...";
$title = "title='" . $event[0] . "'";
}
$height = "30px";
$top = $maxAllDays * -31 - 8 + $allDay * 30 . "px";
$output .= "<div class='ttSchoolCalendar' {$title} style='z-index: {$zCount}; position: absolute; top: {$top}; width: {$width} ; border: 1px solid #555; height: {$height}; margin: 0px; padding: 0px; opacity: {$schoolCalendarAlpha}'>";
$output .= "<a target=_blank style='color: #fff' href='" . $event[5] . "'>" . $label . "</a>";
$output .= "</div>";
$allDay++;
} else {
$label = $event[0];
$title = "title='" . date("H:i", $event[2]) . " to " . date("H:i", $event[3]) . "'";
if (strlen($label) > 20) {
$label = substr($label, 0, 20) . "...";
$title = "title='" . $event[0] . " (" . date("H:i", $event[2]) . " to " . date("H:i", $event[3]) . ")'";
}
$height = ceil(($event[3] - $event[2]) / 60) . "px";
$top = ceil(($event[2] - strtotime(date("Y-m-d", $startDayStamp + 86400 * $count) . " " . $gridTimeStart)) / 60 + $startPad / 60) . "px";
$output .= "<div class='ttSchoolCalendar' {$title} style='z-index: {$zCount}; position: absolute; top: {$top}; width: {$width} ; border: 1px solid #555; height: {$height}; margin: 0px; padding: 0px; opacity: {$schoolCalendarAlpha}'>";
$output .= "<a target=_blank style='color: #fff' href='" . $event[5] . "'>" . $label . "</a>";
$output .= "</div>";
}
$zCount++;
}
}
}
//Draw periods from personal calendar
if ($eventsPersonal != FALSE) {
$height = 0;
$top = 0;
$bg = "rgba(103,153,207,{$schoolCalendarAlpha})";
foreach ($eventsPersonal as $event) {
if (date("Y-m-d", $event[2]) == date("Y-m-d", $startDayStamp + 86400 * $count)) {
if ($event[1] == "All Day") {
$label = $event[0];
$title = "";
if (strlen($label) > 20) {
$label = substr($label, 0, 20) . "...";
$title = "title='" . $event[0] . "'";
}
$height = "30px";
$top = $maxAllDays * -31 - 8 + $allDay * 30 . "px";
$output .= "<div class='ttPersonalCalendar' {$title} style='z-index: {$zCount}; position: absolute; top: {$top}; width: {$width} ; border: 1px solid #555; height: {$height}; margin: 0px; padding: 0px; opacity: {$schoolCalendarAlpha}'>";
$output .= "<a target=_blank style='color: #fff' href='" . $event[5] . "'>" . $label . "</a>";
$output .= "</div>";
$allDay++;
} else {
$label = $event[0];
$title = "title='" . date("H:i", $event[2]) . " to " . date("H:i", $event[3]) . "'";
if (strlen($label) > 20) {
$label = substr($label, 0, 20) . "...";
$title = "title='" . $event[0] . " (" . date("H:i", $event[2]) . " to " . date("H:i", $event[3]) . ")'";
}
$height = ceil(($event[3] - $event[2]) / 60) . "px";
$top = ceil(($event[2] - strtotime(date("Y-m-d", $startDayStamp + 86400 * $count) . " " . $gridTimeStart)) / 60 + $startPad / 60) . "px";
$output .= "<div class='ttPersonalCalendar' {$title} style='z-index: {$zCount}; position: absolute; top: {$top}; width: {$width} ; border: 1px solid #555; height: {$height}; margin: 0px; padding: 0px; opacity: {$schoolCalendarAlpha}'>";
$output .= "<a target=_blank style='color: #fff' href='" . $event[5] . "'>" . $label . "</a>";
$output .= "</div>";
//.........这里部分代码省略.........
开发者ID:dpredster,项目名称:core,代码行数:101,代码来源:moduleFunctions.php
示例7: _
} else {
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/modules/Planner/plannerProcess.php?gibbonPlannerEntryID=" . $row["gibbonPlannerEntryID"] . "&address=/modules/Planner/planner.php&viewBy=Class&gibbonCourseClassID=" . $row["gibbonCourseClassID"] . "&date=&returnToIndex=Y'><img src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/like_on.png'></a>";
}
}
print "</td>";
print "<td>";
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/Planner/planner_view_full.php&viewBy=class&gibbonCourseClassID=" . $row["gibbonCourseClassID"] . "&gibbonPlannerEntryID=" . $row["gibbonPlannerEntryID"] . "'><img title='" . _('View') . "' src='./themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/plus.png'/></a>";
print "</td>";
print "</tr>";
}
}
print "</table>";
}
}
//Display TT
if (isActionAccessible($guid, $connection2, "/modules/Timetable/tt.php") and $_SESSION[$guid]["username"] != "" and (getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2) == "Staff" or getRoleCategory($_SESSION[$guid]["gibbonRoleIDCurrent"], $connection2) == "Student")) {
?>
<script type="text/javascript">
$(document).ready(function(){
$("#tt").load("<?php
print $_SESSION[$guid]["absoluteURL"];
?>
/index_tt_ajax.php",{"gibbonTTID": "<?php
print @$_GET["gibbonTTID"];
?>
", "ttDate": "<?php
print @$_POST["ttDate"];
?>
", "fromTT": "<?php
print @$_POST["fromTT"];
?>
开发者ID:dpredster,项目名称:core,代码行数:31,代码来源:index.php
示例8: getRoleCategory
$_SESSION[$guid]["passwordStrong"] = $row["passwordStrong"];
$_SESSION[$guid]["passwordStrongSalt"] = $row["passwordStrongSalt"];
$_SESSION[$guid]["passwordForceReset"] = $row["passwordForceReset"];
$_SESSION[$guid]["gibbonPersonID"] = $row["gibbonPersonID"];
$_SESSION[$guid]["surname"] = $row["surname"];
$_SESSION[$guid]["firstName"] = $row["firstName"];
$_SESSION[$guid]["preferredName"] = $row["preferredName"];
$_SESSION[$guid]["officialName"] = $row["officialName"];
$_SESSION[$guid]["email"] = $row["email"];
$_SESSION[$guid]["emailAlternate"] = $row["emailAlternate"];
$_SESSION[$guid]["website"] = $row["website"];
$_SESSION[$guid]["gender"] = $row["gender"];
$_SESSION[$guid]["status"] = $row["status"];
$_SESSION[$guid]["gibbonRoleIDPrimary"] = $row["gibbonRoleIDPrimary"];
$_SESSION[$guid]["gibbonRoleIDCurrent"] = $row["gibbonRoleIDPrimary"];
$_SESSION[$guid]["gibbonRoleIDCurrentCategory"] = getRoleCategory($row["gibbonRoleIDPrimary"], $connection2);
$_SESSION[$guid]["gibbonRoleIDAll"] = getRoleList($row["gibbonRoleIDAll"], $connection2);
$_SESSION[$guid]["image_240"] = $row["image_240"];
$_SESSION[$guid]["lastTimestamp"] = $row["lastTimestamp"];
$_SESSION[$guid]["calendarFeedPersonal"] = $row["calendarFeedPersonal"];
$_SESSION[$guid]["viewCalendarSchool"] = $row["viewCalendarSchool"];
$_SESSION[$guid]["viewCalendarPersonal"] = $row["viewCalendarPersonal"];
$_SESSION[$guid]["viewCalendarSpaceBooking"] = $row["viewCalendarSpaceBooking"];
$_SESSION[$guid]["dateStart"] = $row["dateStart"];
$_SESSION[$guid]["personalBackground"] = $row["personalBackground"];
$_SESSION[$guid]["messengerLastBubble"] = $row["messengerLastBubble"];
$_SESSION[$guid]["gibbonThemeIDPersonal"] = $row["gibbonThemeIDPersonal"];
$_SESSION[$guid]["gibboni18nIDPersonal"] = $row["gibboni18nIDPersonal"];
$_SESSION[$guid]["googleAPIRefreshToken"] = $row["googleAPIRefreshToken"];
$_SESSION[$guid]['receiveNotificationEmails'] = $row["receiveNotificationEmails"];
$_SESSION[$guid]['gibbonHouseID'] = $row["gibbonHouseID"];
开发者ID:dpredster,项目名称:core,代码行数:31,代码来源:index.php
示例9: array
print "</tr>";
//Check if any roles are "Student"
$privacySet = false;
try {
$dataRoles = array("gibbonPersonID" => $row["gibbonPersonID"]);
$sqlRoles = "SELECT gibbonRoleIDAll FROM gibbonPerson WHERE gibbonPersonID=:gibbonPersonID";
$resultRoles = $connection2->prepare($sqlRoles);
$resultRoles->execute($dataRoles);
} catch (PDOException $e) {
}
if ($resultRoles->rowCount() == 1) {
$rowRoles = $resultRoles->fetch();
$isStudent = false;
$roles = explode(",", $rowRoles["gibbonRoleIDAll"]);
foreach ($roles as $role) {
if (getRoleCategory($role, $connection2) == "Student") {
$isStudent = true;
}
}
if ($isStudent) {
$privacySetting = getSettingByScope($connection2, "User Admin", "privacy");
$privacyBlurb = getSettingByScope($connection2, "User Admin", "privacyBlurb");
if ($privacySetting == "Y" and $privacyBlurb != "") {
print "<tr class='even'>";
print "<td>";
print _("Image Privacy");
print "</td>";
print "<td>";
print $row["privacy"];
print "</td>";
print "<td>";
开发者ID:actcattest001,项目名称:core,代码行数:31,代码来源:data_personal_edit.php
示例10: getMessages
function getMessages($guid, $connection2, $mode = "", $date = "")
{
$return = "";
$dataPosts = array();
if ($date == "") {
$date = date("Y-m-d");
}
if ($mode != "print" and $mode != "count" and $mode != "result") {
$mode = "print";
}
//Work out all role categories this user has, ignoring "Other"
$roles = $_SESSION[$guid]["gibbonRoleIDAll"];
$roleCategory = "";
$staff = FALSE;
$student = FALSE;
$parent = FALSE;
for ($i = 0; $i < count($roles); $i++) {
$roleCategory = getRoleCategory($roles[$i][0], $connection2);
if ($roleCategory == "Staff") {
$staff = TRUE;
} else {
if ($roleCategory == "Student") {
$student = TRUE;
} else {
if ($roleCategory == "Parent") {
$parent = TRUE;
}
}
}
}
//If parent get a list of student IDs
if ($parent) {
$children = "(";
try {
$data = array("gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sql = "SELECT * FROM gibbonFamilyAdult WHERE gibbonPersonID=:gibbonPersonID AND childDataAccess='Y'";
$result = $connection2->prepare($sql);
$result->execute($data);
} catch (PDOException $e) {
}
while ($row = $result->fetch()) {
try {
$dataChild = array("gibbonFamilyID" => $row["gibbonFamilyID"], "gibbonSchoolYearID" => $_SESSION[$guid]["gibbonSchoolYearID"]);
$sqlChild = "SELECT * FROM gibbonFamilyChild JOIN gibbonPerson ON (gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID) JOIN gibbonStudentEnrolment ON (gibbonPerson.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID) WHERE gibbonFamilyID=:gibbonFamilyID AND gibbonPerson.status='Full' AND (dateStart IS NULL OR dateStart<='" . date("Y-m-d") . "') AND (dateEnd IS NULL OR dateEnd>='" . date("Y-m-d") . "') AND gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID ORDER BY surname, preferredName ";
$resultChild = $connection2->prepare($sqlChild);
$resultChild->execute($dataChild);
} catch (PDOException $e) {
}
while ($rowChild = $resultChild->fetch()) {
$children .= "gibbonPersonID=" . $rowChild["gibbonPersonID"] . " OR ";
}
}
if ($children != "(") {
$children = substr($children, 0, -4) . ")";
} else {
$children = FALSE;
}
}
//My roles
$roles = $_SESSION[$guid]["gibbonRoleIDAll"];
$sqlWhere = "(";
if (count($roles) > 0) {
for ($i = 0; $i < count($roles); $i++) {
$dataPosts["role" . $roles[$i][0]] = $roles[$i][0];
$sqlWhere .= "id=:role" . $roles[$i][0] . " OR ";
}
$sqlWhere = substr($sqlWhere, 0, -3) . ")";
}
if ($sqlWhere != "(") {
$dataPosts["date1"] = $date;
$dataPosts["date2"] = $date;
$dataPosts["date3"] = $date;
$sqlPosts = "(SELECT gibbonMessenger.*, title, surname, preferredName, authorRole.category AS category, image_240, concat('Role: ', gibbonRole.name) AS source FROM gibbonMessenger JOIN gibbonMessengerTarget ON (gibbonMessengerTarget.gibbonMessengerID=gibbonMessenger.gibbonMessengerID) JOIN gibbonPerson ON (gibbonMessenger.gibbonPersonID=gibbonPerson.gibbonPersonID) JOIN gibbonRole AS authorRole ON (gibbonPerson.gibbonRoleIDPrimary=authorRole.gibbonRoleID) JOIN gibbonRole ON (gibbonMessengerTarget.id=gibbonRole.gibbonRoleID) WHERE gibbonMessengerTarget.type='Role' AND (messageWall_date1=:date1 OR messageWall_date2=:date2 OR messageWall_date3=:date3) AND {$sqlWhere})";
}
//My role categories
try {
$dataRoleCategory = array("gibbonPersonID" => $_SESSION[$guid]["gibbonPersonID"]);
$sqlRoleCategory = "SELECT DISTINCT category FROM gibbonRole JOIN gibbonPerson ON (gibbonPerson.gibbonRoleIDAll LIKE CONCAT('%', gibbonRole.gibbonRoleID, '%')) WHERE gibbonPersonID=:gibbonPersonID";
$resultRoleCategory = $connection2->prepare($sqlRoleCategory);
$resultRoleCategory->execute($dataRoleCategory);
} catch (PDOException $e) {
print $e->getMessage();
}
$sqlWhere = "(";
if ($resultRoleCategory->rowCount() > 0) {
$i = 0;
while ($rowRoleCategory = $resultRoleCategory->fetch()) {
$dataPosts["role" . $rowRoleCategory["category"]] = $rowRoleCategory["category"];
$sqlWhere .= "id=:role" . $rowRoleCategory["category"] . " OR ";
$i++;
}
$sqlWhere = substr($sqlWhere, 0, -3) . ")";
}
if ($sqlWhere != "(") {
$dataPosts["date1"] = $date;
$dataPosts["date2"] = $date;
$dataPosts["date3"] = $date;
$sqlPosts = $sqlPosts . " UNION (SELECT DISTINCT gibbonMessenger.*, title, surname, preferredName, authorRole.category AS category, image_240, concat('Role Category: ', gibbonRole.category) AS source FROM gibbonMessenger JOIN gibbonMessengerTarget ON (gibbonMessengerTarget.gibbonMessengerID=gibbonMessenger.gibbonMessengerID) JOIN gibbonPerson ON (gibbonMessenger.gibbonPersonID=gibbonPerson.gibbonPersonID) JOIN gibbonRole AS authorRole ON (gibbonPerson.gibbonRoleIDPrimary=authorRole.gibbonRoleID) JOIN gibbonRole ON (gibbonMessengerTarget.id=gibbonRole.category) WHERE gibbonMessengerTarget.type='Role Category' AND (messageWall_date1=:date1 OR messageWall_date2=:date2 OR messageWall_date3=:date3) AND {$sqlWhere})";
}
//My year groups
//.........这里部分代码省略.........
开发者ID:dpredster,项目名称:core,代码行数:101,代码来源:moduleFunctions.php
示例11: array
}
if ($resultCheck1->rowCount() == 0) {
//There are no active siblings, so let's check parents to see if we can set anyone to left
try {
$dataCheck2 = array("gibbonFamilyID" => $row["gibbonFamilyID"]);
$sqlCheck2 = "SELECT gibbonPerson.gibbonPersonID, status, gibbonRoleIDAll FROM gibbonPerson JOIN gibbonFamilyAdult ON (gibbonFamilyAdult.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE gibbonFamilyID=:gibbonFamilyID AND NOT status='Left' ORDER BY gibbonPersonID";
$resultCheck2 = $connection2->prepare($sqlCheck2);
$resultCheck2->execute($dataCheck2);
} catch (PDOException $e) {
}
while ($rowCheck2 = $resultCheck2->fetch()) {
//Check to see if parent has any non-staff roles. If not, mark as 'Left'
$nonParentRole = FALSE;
$roles = explode(",", $rowCheck2["gibbonRoleIDAll"]);
foreach ($roles as $role) {
if (getRoleCategory($role, $connection2) != "Parent") {
$nonParentRole = TRUE;
}
}
if ($nonParentRole == FALSE) {
//Update status to 'Left'
try {
$dataUpdate = array("gibbonPersonID" => $rowCheck2["gibbonPersonID"]);
$sqlUpdate = "UPDATE gibbonPerson SET status='Left' WHERE gibbonPersonID=:gibbonPersonID";
$resultUpdate = $connection2->prepare($sqlUpdate);
$resultUpdate->execute($dataUpdate);
} catch (PDOException $e) {
}
$count++;
}
}
开发者ID:actcattest001,项目名称:core,代码行数:31,代码来源:userAdmin_statusCheckAndFix.php
示例12: foreach
//Roles
if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_role")) {
if ($_POST["role"] == "Y") {
$choices = $_POST["roles"];
if ($choices != "") {
foreach ($choices as $t) {
try {
$data = array("AI" => $AI, "t" => $t);
$sql = "INSERT INTO gibbonMessengerTarget SET gibbonMessengerID=:AI, type='Role', id=:t";
$result = $connection2->prepare($sql);
$result->execute($data);
} catch (PDOException $e) {
$partialFail = TRUE;
}
//Get email addresses
$category = getRoleCategory($t, $connection2);
if ($email == "Y") {
if ($category == "Parent") {
try {
$dataEmail = array("gibbonRoleIDAll" => "%{$t}%");
$sqlEmail = "SELECT DISTINCT email, title, surname, preferredName FROM gibbonPerson JOIN gibbonFamilyAdult ON (gibbonFamilyAdult.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE NOT email='' AND gibbonRoleIDAll LIKE :gibbonRoleIDAll AND status='Full' AND contactEmail='Y'";
$resultEmail = $connection2->prepare($sqlEmail);
$resultEmail->execute($dataEmail);
} catch (PDOException $e) {
}
while ($rowEmail = $resultEmail->fetch()) {
$emails .= $rowEmail["email"] . ",";
$emailsReport .= formatName('', $rowEmail["preferredName"], $rowEmail["surname"], "Student", false) . " (" . $rowEmail["email"] . "),";
}
} else {
try {
开发者ID:actcattest001,项目名称:core,代码行数:31,代码来源:messenger_postProcess.php
示例13: _
print "<div class='error'>";
print _("Your request failed because you do not have access to this action.");
print "</div>";
} else {
//Proceed!
//Check if school year specified
$gibbonCourseClassID = $_GET["gibbonCourseClassID"];
$gibbonMarkbookColumnID = $_GET["gibbonMarkbookColumnID"];
$gibbonPersonID = $_GET["gibbonPersonID"];
$gibbonRubricID = $_GET["gibbonRubricID"];
if ($gibbonCourseClassID == "" or $gibbonMarkbookColumnID == "" or $gibbonPersonID == "" or $gibbonRubricID == "") {
print "<div class='error'>";
print _("You have not specified one or more required parameters.");
print "</div>";
} else {
$roleCategory = getRoleCategory($_SESSION[$guid]["gibbonRoleIDPrimary"], $connection2);
$contextDBTableGibbonRubricIDField = "gibbonRubricID";
if ($_GET["type"] == "attainment") {
$contextDBTableGibbonRubricIDField = "gibbonRubricIDAttainment";
} else {
if ($_GET["type"] == "effort") {
$contextDBTableGibbonRubricIDField = "gibbonRubricIDEffort";
}
}
try {
if ($roleCategory == "Staff") {
$data = array("gibbonCourseClassID" => $gibbonCourseClassID);
$sql = "SELECT gibbonCourse.nameShort AS course, gibbonCourseClass.nameShort AS class, gibbonCourseClass.gibbonCourseClassID FROM gibbonCourse, gibbonCourseClass WHERE gibbonCourse.gibbonCourseID=gibbonCourseClass.gibbonCourseID AND gibbonCourseClass.gibbonCourseClassID=:gibbonCourseClassID ORDER BY course, class";
} else {
if ($roleCategory == "Student") {
$data = array("gibbonPersonID" => $gibbonPersonID, "gibbonCourseClassID" => $gibbonCourseClassID);
开发者ID:actcattest001,项目名称:core,代码行数:31,代码来源:markbook_view_rubric.php
注:本文中的getRoleCategory函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论