| Current Path : /var/www/cesa.co.za/cceadmin/ |
| Current File : /var/www/cesa.co.za/cceadmin/index.php |
<?php
// ini_set('display_errors', 1);
// error_reporting(E_ALL);
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "CCEUsersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
// Create page object
$default = new cdefault();
$Page = &$default;
// Page init
$default->Page_Init();
// Page main
$default->Page_Main();
?>
<?php
$default->Page_Terminate();
?>
<?php
//
// Page class
//
class cdefault
{
// Page ID
var $PageID = 'default';
// Page object name
var $PageObjName = 'default';
// Page name
function PageName()
{
return ew_CurrentPage();
}
// Page URL
function PageUrl()
{
$PageUrl = ew_CurrentPage() . "?";
return $PageUrl;
}
// Page URLs
var $AddUrl;
var $EditUrl;
var $CopyUrl;
var $DeleteUrl;
var $ViewUrl;
var $ListUrl;
// Export URLs
var $ExportPrintUrl;
var $ExportHtmlUrl;
var $ExportExcelUrl;
var $ExportWordUrl;
var $ExportXmlUrl;
var $ExportCsvUrl;
// Update URLs
var $InlineAddUrl;
var $InlineCopyUrl;
var $InlineEditUrl;
var $GridAddUrl;
var $GridEditUrl;
var $MultiDeleteUrl;
var $MultiUpdateUrl;
// Message
function getMessage()
{
return @$_SESSION[EW_SESSION_MESSAGE];
}
function setMessage($v)
{
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
$_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
} else {
$_SESSION[EW_SESSION_MESSAGE] = $v;
}
}
// Show message
function ShowMessage()
{
$sMessage = $this->getMessage();
$this->Message_Showing($sMessage);
if ($sMessage <> "") { // Message in Session, display
echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
}
}
// Validate page request
function IsPageRequest()
{
return TRUE;
}
//
// Page class constructor
//
function __construct()
{
global $conn, $Language;
// Language object
$Language = new cLanguage();
// User table object (CCEUsers)
$GLOBALS["CCEUsers"] = new cCCEUsers;
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'default', TRUE);
// Start timer
$GLOBALS["gsTimer"] = new cTimer();
// Open connection
$conn = ew_Connect();
}
//
// Page_Init
//
function Page_Init()
{
global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
global $CCEUsers;
// Security
$Security = new cAdvancedSecurity();
// Global Page Loading event (in userfn*.php)
Page_Loading();
// Page Load event
$this->Page_Load();
}
//
// Page_Terminate
//
function Page_Terminate($url = "")
{
global $conn;
// Page Unload event
$this->Page_Unload();
// Global Page Unloaded event (in userfn*.php)
Page_Unloaded();
// Close connection
$conn->Close();
// Go to URL if specified
$this->Page_Redirecting($url);
if ($url <> "") {
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header("Location: " . $url);
}
exit();
}
//
// Page main
//
function Page_Main()
{
global $Security, $Language;
if (!$Security->IsLoggedIn())
$Security->AutoLogin();
$Security->LoadUserLevel(); // load User Level
if ($Security->AllowList('CCEStudents'))
$this->Page_Terminate("CCEStudentslist.php"); // Exit and go to default page
if ($Security->AllowList('CCEAssignments'))
$this->Page_Terminate("CCEAssignmentslist.php");
if ($Security->AllowList('CCEBooks'))
$this->Page_Terminate("CCEBookslist.php");
if ($Security->AllowList('CCEConvenorRights'))
$this->Page_Terminate("CCEConvenorRightslist.php");
if ($Security->AllowList('CCECourses'))
$this->Page_Terminate("CCECourseslist.php");
if ($Security->AllowList('CCECourseSchedules'))
$this->Page_Terminate("CCECourseScheduleslist.php");
if ($Security->AllowList('CCEDocCategories'))
$this->Page_Terminate("CCEDocCategorieslist.php");
if ($Security->AllowList('CCEDocuments'))
$this->Page_Terminate("CCEDocumentslist.php");
if ($Security->AllowList('CCEFacilitators'))
$this->Page_Terminate("CCEFacilitatorslist.php");
if ($Security->AllowList('CCEFacilitatorUsers'))
$this->Page_Terminate("CCEFacilitatorUserslist.php");
if ($Security->AllowList('CCEGallery'))
$this->Page_Terminate("CCEGallerylist.php");
if ($Security->AllowList('CCEMessageLog'))
$this->Page_Terminate("CCEMessageLoglist.php");
if ($Security->AllowList('CCEMessages'))
$this->Page_Terminate("CCEMessageslist.php");
if ($Security->AllowList('CCEModAssignments'))
$this->Page_Terminate("CCEModAssignmentslist.php");
if ($Security->AllowList('CCEModuleMarks'))
$this->Page_Terminate("CCEModuleMarkslist.php");
if ($Security->AllowList('CCEModules'))
$this->Page_Terminate("CCEModuleslist.php");
if ($Security->AllowList('CCEModuleSchedules'))
$this->Page_Terminate("CCEModuleScheduleslist.php");
if ($Security->AllowList('CCENoticeBoard'))
$this->Page_Terminate("CCENoticeBoardlist.php");
if ($Security->AllowList('CCEPayments'))
$this->Page_Terminate("CCEPaymentslist.php");
if ($Security->AllowList('CCEResourceGroups'))
$this->Page_Terminate("CCEResourceGroupslist.php");
if ($Security->AllowList('CCEResources'))
$this->Page_Terminate("CCEResourceslist.php");
if ($Security->AllowList('CCESessions'))
$this->Page_Terminate("CCESessionslist.php");
if ($Security->AllowList('CCESessionSchedules'))
$this->Page_Terminate("CCESessionScheduleslist.php");
if ($Security->AllowList('CCEStudentActivities'))
$this->Page_Terminate("CCEStudentActivitieslist.php");
if ($Security->AllowList('CCEStudentAssignments'))
$this->Page_Terminate("CCEStudentAssignmentslist.php");
if ($Security->AllowList('CCEStudentCourses'))
$this->Page_Terminate("CCEStudentCourseslist.php");
if ($Security->AllowList('CCESubjectExperts'))
$this->Page_Terminate("CCESubjectExpertslist.php");
if ($Security->AllowList('CCETemplates'))
$this->Page_Terminate("CCETemplateslist.php");
if ($Security->AllowList('CCEUploads'))
$this->Page_Terminate("CCEUploadslist.php");
if ($Security->AllowList('CCEVenues'))
$this->Page_Terminate("CCEVenueslist.php");
if ($Security->AllowList('CCEPopupMessages'))
$this->Page_Terminate("CCEPopupMessageslist.php");
if ($Security->AllowList('CCEExamTiming'))
$this->Page_Terminate("CCEExamTiminglist.php");
if ($Security->AllowList('CCEAssignmentQuestions'))
$this->Page_Terminate("CCEAssignmentQuestionslist.php");
if ($Security->AllowList('CCEWeeklySessions'))
$this->Page_Terminate("CCEWeeklySessionslist.php");
if ($Security->AllowList('cstAllModules'))
$this->Page_Terminate("cstAllModuleslist.php");
if ($Security->AllowList('cstArchivedAssignments'))
$this->Page_Terminate("cstArchivedAssignmentslist.php");
if ($Security->AllowList('cstArchivedBooks'))
$this->Page_Terminate("cstArchivedBookslist.php");
if ($Security->AllowList('cstArchivedDocuments'))
$this->Page_Terminate("cstArchivedDocumentslist.php");
if ($Security->AllowList('cstArchivedGallery'))
$this->Page_Terminate("cstArchivedGallerylist.php");
if ($Security->AllowList('cstArchivedResources'))
$this->Page_Terminate("cstArchivedResourceslist.php");
if ($Security->AllowList('cstArchivedStudentsAll'))
$this->Page_Terminate("cstArchivedStudentsAlllist.php");
if ($Security->AllowList('cstArchivedTemplates'))
$this->Page_Terminate("cstArchivedTemplateslist.php");
if ($Security->AllowList('cstAssigFeedback'))
$this->Page_Terminate("cstAssigFeedbacklist.php");
if ($Security->AllowList('cstFutureStudents'))
$this->Page_Terminate("cstFutureStudentslist.php");
if ($Security->AllowList('cstPayments'))
$this->Page_Terminate("cstPaymentslist.php");
if ($Security->AllowList('cstScheduledCourses'))
$this->Page_Terminate("cstScheduledCourseslist.php");
if ($Security->AllowList('cstScheduledModules'))
$this->Page_Terminate("cstScheduledModuleslist.php");
if ($Security->AllowList('cstScheduledSessions'))
$this->Page_Terminate("cstScheduledSessionslist.php");
if ($Security->AllowList('cstStudentAssigArchived'))
$this->Page_Terminate("cstStudentAssigArchivedlist.php");
if ($Security->AllowList('cstStudentReadMessages'))
$this->Page_Terminate("cstStudentReadMessageslist.php");
if ($Security->AllowList('cstSubmittedActivities'))
$this->Page_Terminate("cstSubmittedActivitieslist.php");
if ($Security->AllowList('cstSubmittedAssign'))
$this->Page_Terminate("cstSubmittedAssignlist.php");
if ($Security->AllowList('cstCourseYears'))
$this->Page_Terminate("cstCourseYearslist.php");
if ($Security->IsLoggedIn()) {
echo $Language->Phrase("NoPermission");
echo "<br><a href=\"logout.php\">" . $Language->Phrase("BackToLogin") . "</a>";
} else {
$this->Page_Terminate("login.php"); // Exit and go to login page
}
}
// Page Load event
function Page_Load()
{
//echo "Page Load";
}
// Page Unload event
function Page_Unload()
{
//echo "Page Unload";
}
// Page Redirecting event
function Page_Redirecting(&$url)
{
// Example:
//$url = "your URL";
$url = "/cceadmin/" . basename($url);
}
// Message Showing event
function Message_Showing(&$msg)
{
// Example:
//$msg = "your new message";
}
}
?>