public function go()
 {
     if (isset($_GET['source']) && $_GET['source'] == "del") {
         $this->addSuccessMessage("User has been deleted succesfully");
     } elseif (isset($_GET['source']) && $_GET['source'] == "add") {
         $this->addSuccessMessage("User has been added succesfully");
     } elseif (isset($_GET['source']) && $_GET['source'] == "addclass") {
         $this->addSuccessMessage("Class has been added succesfully");
     } elseif (isset($_GET['source']) && $_GET['source'] == "addtoclass") {
         $this->addSuccessMessage("User has been added to the class succesfully");
     }
     if (isset($_GET['search']) && isset($_GET['category']) && $_GET['search'] != '' && $_GET['category'] != '') {
         $total_pages = User::getNumberofUsers($_GET['search'], $_GET['category']);
     } else {
         $total_pages = User::getNumberOfUsers();
     }
     if (isset($_GET['limit']) && $_GET['limit'] != "") {
         $limit = $_GET['limit'];
     } else {
         $limit = 25;
     }
     $targetpage = SOURCE_ROOT_PATH . "admin/pages/usermanager.php";
     $stages = 3;
     $page = 0;
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     if ($page) {
         $start = ($page - 1) * $limit;
     } else {
         $start = 0;
     }
     // Initial page num setup
     if ($page == 0) {
         $page = 1;
     }
     $prev = $page - 1;
     $next = $page + 1;
     $lastpage = ceil($total_pages / $limit);
     $LastPagem1 = $lastpage - 1;
     $pagination = array('lastpage' => $lastpage, 'page' => $page, 'targetpage' => $targetpage, 'prev' => $prev, 'next' => $next, 'stages' => $stages, 'last_page_m1' => $LastPagem1);
     if (isset($_GET['search']) && isset($_GET['category']) && $_GET['search'] != '' && $_GET['category'] != '') {
         $users = User::getNUsers($start, $limit, $_GET['search'], $_GET['category']);
     } else {
         $users = User::getNUsers($start, $limit);
     }
     $this->addToView('users', $users);
     $this->addToView('total_pages', $total_pages);
     $this->addToView('pagination', $pagination);
     $this->setViewTemplate('usermanager.tpl');
     $this->generateView();
 }
Example #2
0
<? if ($userid == "" || !$userid): ?>
<div id="content_padder" class="welcome_text">

	<div class="content_box">
	    <p>
	    Musique is an online streaming media player allowing you to listen to 
	    all your favourite music and share it easily with your friends.
	    
	    With an ever-growing library of artists and new ones being added all the time, 
	    you can be sure that whatever your taste, there is music for you waiting inside.
	    </p>
	</div>
	
	<div class="feature_box">
		<h3><?php 
echo User::getNumberOfUsers();
?>
</h3>
		<p>registered users</p>
	</div>
	
	<div class="feature_box">
		<h3><?php 
echo Track::getNumberOfTracks();
?>
</h3>
		<p>total tracks</p>
	</div>
	
	<div class="feature_box">
		<h3><?php