/** * This method lists all online users. * @param null * @return void */ public function online() { $online = LogModel::where('online = ?', true)->count(); $users = LogModel::where('online = ?', true)->all(); $users = $users->result(); View::with('users', $users)->with('online', $online->num_rows())->render('admin/online'); }
/** *This method loads the homepage * *@param null *@return void */ public function index() { //get all list names from the database $data['lists'] = ListsModel::all(); //get the ending date today View::render('home/home', $data); }
/** * This method loads the users edit profile page. * @param int $user_id The unique id of the user whose information to update */ public function getUpdate($user_id) { $user = UsersModel::where('id = ?', $user_id)->all(); $user = $user->result_array(); $data['user'] = $user[0]; //get the ending date today View::render('users/update', $data); }
/** * Compile the include statements into valid PHP. * * @param string $expression * @return string */ protected function compileInclude($pathExpression) { $fileName = substr($pathExpression, strpos($pathExpression, '\'') + 1, -(strlen($pathExpression) - strripos($pathExpression, '\''))); $includeContent = ViewHelper::getContents($fileName, true); return $includeContent; /*return "<?php echo \$__env->make($expression, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";*/ }
/** *This method loads the caching page * *@param null *@return void */ public function getCaching() { //get the ending date today View::render('caching'); }
/** *This method loads the users and admin homepage * *@param null *@return void */ public function postDelete() { //get the ending date today View::render('admin/home'); }
/** *This method loads the homepage *@param int $id The user id *@return void */ public function getIndex($id) { $data['title'] = $this->site_title; $data['request_time'] = $this->request_exec_time(); View::render('index', $data); }
/** *This method loads a csv file content into the database for a new list * *@param null *@return void */ public function getManagenew() { //get the list id to manage $list_id = Input::get('list_id'); //get information about this list $list_info = ListsModel::getById($list_id); //open the csv file $full_path = Path::base() . $list_info[0]['csv_file_path']; //get the first 10 lines $file_pointer = fopen($full_path, 'r'); $itr = 5; while (!feof($file_pointer)) { if ($itr == 0) { break; } //read data into csv $data['list_data'][] = fgetcsv($file_pointer); --$itr; } //get the column list $data['column_list'] = $data['list_data'][0]; //get table fielnames $data['table_fields'] = SubscribersModel::getTableColumnNames(); //lod the view page with this information View::render('lists/managenew', $data); }
/** *This method loads the login form * *@param null *@return void */ public function getLogout() { LogModel::where('id = ?', Session::get('log_id'))->save(array('online' => false)); UsersModel::where('id = ?', Session::get('userInfo')['id'])->save(array('online' => false)); //destry all session data Session::flush(); //load the login form View::render('login/form'); }
/** *This method loads the login form * *@param null *@return void */ public function getLogout() { //load the login form View::render('login/form'); }
/** *This method loads the signup form * *@param null *@return void */ public function getIndex() { //load the singup form View::render('signup/form'); }
/** *This method loads the homepage * *@param null *@return void */ public function index() { //get the ending date today View::render('home/home'); }