//$userRole = get_record('role_assignments', 'userid', $USER->id); // Check if user was an admin $url = $CFG->wwwroot; $newuserurl = "{$CFG->wwwroot}/user/editadvanced.php?id=-1"; $newcourseurl = "{$CFG->wwwroot}/course/index.php?categoryedit=on"; $regexam = "{$CFG->wwwroot}/reg_exam.php"; $unregexam = "{$CFG->wwwroot}/unreg_exam.php"; $coursestatus = "{$CFG->wwwroot}/courseinfo.php"; $quizattempts = "{$CFG->wwwroot}/quizattempts.php"; // Temp $clearexams = "{$CFG->wwwroot}/clearexm.php?"; if (isloggedin() and !isguest() and isset($CFG->frontpageloggedin)) { //echo "Logged-In: $userRole->roleid"; } else { $url = "{$CFG->wwwroot}"; displayWelcome(); } if (!empty($userRole)) { if ($userRole->roleid == 1) { // Administrator Role echo "<h3>Admin User Options</h3>"; echo "<ol>"; echo "<li><a href='" . $newuserurl . "'>Add a New User</a></li>"; echo "<li><a href='" . $newcourseurl . "'>Add a New Course</a></li>"; echo "<li><a href='" . $regexam . "'>Register Student for Exam</a></li>"; echo "<li><a href='{$coursestatus}'>Courses Status</a></li>"; echo "<li><a href='{$quizattempts}'>Quiz Attempts (Debug Tool)</a></li>"; echo "</ol>"; echo "<b>Existing Courses</b><br/><br/>"; //$courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC'); //$courses = get_records('course','category',1);
function displayContent($wts_content, $config) { if ($wts_content->isHome) { ?> <div class="post"><?php displayWelcome($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php displayAnnounce($config); } if ($wts_content->isWelcome()) { ?> <div class="post"><?php displayWelcome($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isAbout) { ?> <div class="post"><?php displayAbout($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if (isValidUser($config)) { if ($wts_content->isAnounceAdmin) { ?> <div class="post"><?php displayAdminAnnounce($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isLeaveForm) { ?> <div class="post"><?php displayLeaveForm($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isTimeRequestForm) { ?> <div class="post"><?php displayNewTimeRequestForm($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isSubmittedRequests) { ?> <div class="post"><?php displaySubmittedRequests($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isSubmittedRequestsNEW) { ?> <div class="post"><?php displaySubmittedRequestsNEW($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isLeaveApproval) { ?> <div class="post"><?php displayLeaveApprovalNEW($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isUserMenu) { ?> <div class="post"><?php displayUserMenu($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isLogout()) { logoutUser($config, "You have logged out"); } if ($wts_content->isSearching) { ?> <div class="post"><?php searchPage($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isUpdateProfile) { ?> <div class="post"><?php displayUpdateProfile($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isLookup) { ?> <div class="post"><?php displayRequestLookup($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isUseReport) { ?> <div class="post"><?php displayTimeUseReport($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isPhpMyEdit) { ?> <div class="post"><?php displayPhpMyEditMenu(); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isMUNIS) { ?> <div class="post"><?php MUNISreport($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isSecLog) { ?> <div class="post"><?php displaySecondaryLog($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isUserLookup) { ?> <div class="post"><?php displayUserLookup($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isSecApprove) { ?> <div class="post"><?php displaySecondaryLog($config, $approve = true); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isResManage) { ?> <div class="post"><?php displayReserves($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isUserVerify) { ?> <div class="post"><?php displayUserVerify($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isMySubmitReq) { ?> <div class="post"><?php displayMySubmittedRequestsNEW($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isReports) { ?> <div class="post"><?php displayReportMenu($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isApprovedUseReport) { ?> <div class="post"><?php approvedTimeUseReport($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->subReqCal) { ?> <div class="post"><?php reportsCal($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->hrEmpRep) { ?> <div class="post"><?php hrPayrolReportByEmployee($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isSickRep) { ?> <div class="post"><?php sickReport($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isEventLogs) { ?> <div class="post"><?php displayLogs($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isOTRep) { ?> <div class="post"><?php overtimeReport($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isRadioLog) { ?> <div class="post"><?php displayRadioLog($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isMyInv) { ?> <div class="post"><?php showMyInventory($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isSecLogRep) { ?> <div class="post"><?php displaySecLogReport($config); ?> <div class="clear"></div></div><div class="divider"></div> <?php } if ($wts_content->isPrintRequestNo) { ?> <div class="post"><?php $requests = new request_class(); $requests->config = $config; $requests->showPrintFriendlyRequest(); ?> <div class="clear"></div></div><div class="divider"></div> <?php } $reqURI = dirname($_SERVER['REQUEST_URI']); if ($reqURI != "/") { $reqURI = $reqURI . "/"; } //popupmessage(str_replace($reqURI, "", $_SERVER['PHP_SELF']).' URI '.$reqURI.' self '.$_SERVER['PHP_SELF'].' showPrintFriendly:'.$config->showPrinterFriendly); if (str_replace($reqURI, "", $_SERVER['PHP_SELF']) != "printFriendly.php" && $config->showPrinterFriendly) { echo '<a target="_blank" href="printFriendly.php?' . str_replace($_SERVER['PHP_SELF'] . "?", "", $_SERVER['REQUEST_URI']) . '"> Print Tables</a>'; } myAlerts($config, $wts_content); } else { if ($wts_content->isSearching) { ?> <div class="post"><h3>Search Results</h3>Must Login First<div class="clear"></div></div><div class="divider"></div> <?php } } }