Location: PHPKode > projects > CMS Admin > www/index.php
<?php
require_once dirname(__FILE__).'/layout/layout.php';
require_once dirname(__FILE__).'/classes/user.php';
require_once dirname(__FILE__).'/classes/course.php';

$module = new FrontPage();

require_once dirname(__FILE__).'/include/login.php';

Class FrontPage
{
	function main(User $user, Permissions $perm, $course)
	{
		if($user->userLevel <= $perm->permissions['adminMain'])
			if($course)
				$this->admin_main_course($user, $course);
			else
				$this->admin_main($user);
		else if($course)
			$this->student_main_course($user, $course);
		else
			$this->student_main($user);
	}


	function admin_main(User $user)
	{
		$u = new Users;
		Layout::header('index.php');
		Layout::sidebar($user, 0);

	    echo '<div id="main">';
	    echo 'Welcome ' . $user->firstName . ' ' . $user->lastName . ' (' . $user->email . ')';

	    Layout::footer();
	}

	function admin_main_course(User $user, $courseID)
	{
	    Layout::header('index.php');

		Layout::sidebar($user, $courseID);				

	    echo '<div id="main">';
	    echo 'Welcome ' . $user->firstName . ' ' . $user->lastName . ' (' . $user->email . ')';
	    echo '</div>';

		Layout::footer();	
	}

	function student_main(User $user)
	{
		$u = new Users;
		$data = $u->UserCourseList($user->userID);

	    Layout::header('index.php');
	
		Layout::sidebar($user, 0);

	    echo '<div id="main">';
	    echo 'Welcome ' . $user->firstName . ' ' . $user->lastName . ' (' . $user->email . ')';
   	    echo '</div>';

	    Layout::footer();
	}

	function student_main_course(User $user, $courseID)
	{
	    Layout::header('index.php');

		Layout::sidebar($user, $courseID);

	    echo '<div id="main">';
	    echo 'Welcome ' . $user->firstName . ' ' . $user->lastName . ' (' . $user->email . ')';
	    echo '</div>';

		Layout::footer();	
	}

}


?>
Return current item: CMS Admin