/** * Index Page for this controller or List all Users. * * Primary View is views/admin/blocks/users/index * @param integer $q User Group ID * @param integer $offset */ public function index($q = 4, $offset = 0) { $limit = AZ::setting('record_per_page'); $total_users = $this->user->getUsers('*', array('gid' => $q), 0, 0, true); $pagination = AZ::pagination('admin/users/index/' . $q, 5, $limit, $total_users); $users = $this->user->getUsers('id,gid,username,name,email,status,last_login,user_profiles.avatar,user_profiles.country', array('gid' => $q), $offset, $limit); AZ::layout('left-content', array('block' => 'users/index', 'group_A' => user_groups_A(), 'users' => $users, 'total_users' => $total_users, 'pagination' => $pagination, 'q' => $q)); }
/** * Search Messages By Keywords * * Primary View is views/admin/blocks/messages/search * * @param string $keyword * @param integer $message_id * @param integer $offset */ public function search_messages($keyword = '', $message_id = 0, $offset = 0) { $post = $this->input->post(); if (!isset($post['keyword'])) { return false; } if (empty($keyword)) { $keyword = trim($post['keyword']); } $limit = AZ::setting('record_per_page'); $total_message = $this->message->getMessagesByKeyword($keyword, $offset, $limit, true); $pagination = AZ::pagination('admin/dashboard/search_messages/', 5, $limit, $total_message); $messages = $this->message->getMessagesByKeyword($keyword, $offset, $limit); $labels = $this->message->getLabels(); $selected_message = $this->message->getMessageByKeyword($keyword); $count_unread_message = $this->message->getMessages('*', array('messages.trash' => 0, 'messages.is_read' => 0, 'messages.receiver' => user::id()), 0, 0, true); AZ::layout('left-content', array('block' => 'messages/search', 'keyword' => $keyword, 'labels' => $labels, 'messages' => $messages, 'selected_message' => $selected_message, 'total_message' => $total_message, 'pagination' => $pagination, 'count_unread_message' => $count_unread_message)); }
/** * Content Fields Page for this controller. * * Primary View is views/admin/blocks/contents/fields * @param integer $q Content Field Group (Fieldset) * @param integer $offset */ public function fields($q = 1, $offset = 0) { $fieldset_A = $this->content->fieldset_A(); $limit = AZ::setting('record_per_page'); $total_fields = $this->content->getFields('*', array('group_id' => $q), 0, 0, true); $pagination = AZ::pagination('admin/contents/fields/' . $q, 5, $limit, $total_fields); $fields = $this->content->getFields('id,label,type,enabled,system,in_list,in_view', array('group_id' => $q), $offset, $limit); AZ::layout('left-content', array('block' => 'contents/fields', 'total_fields' => $total_fields, 'pagination' => $pagination, 'fields' => $fields, 'fieldset_A' => $fieldset_A, 'q' => $q)); }
/** * Group Category Page By Alias * * Primary View is views/front/blocks/content/page * * @param string $alias */ public function search($keyword, $offset = 0) { $total_contents = $this->content->getContentsByWords($keyword, 0, 0, true); $pagination = AZ::pagination('search?words=' . $keyword, 2, 5, $total_contents, true, true); $contents = $this->content->getContentsByWords($keyword, $offset, 5); $varriables = array('block' => 'content/search', 'contents' => $contents, 'total_contents' => $total_contents, 'pagination' => $pagination); if (isset($group->name)) { $varriables['page_title'] = 'Search Result for ' . $keyword; } AZ::layout('content-right', $varriables); //$this->content->track(); // uncomment for enabled self tracking into Visitors }
public function getMessagesData($mode = 'inbox', $message_id = 0, $offset = 0) { switch ($mode) { case 'inbox': $limit = AZ::setting('record_per_page'); $total_message = $this->getMessages('*', array('messages.trash' => 0, 'messages.receiver' => user::id()), 0, 0, true); $pagination = AZ::pagination('admin/dashboard/messages/' . $mode . '/' . $message_id, 6, $limit, $total_message); $messages = $this->getMessages('users.name,messages.id,messages.label,messages.is_read,messages.is_star,messages.subject,messages.body,messages.created,messages.author,messages.have_attachment', array('messages.trash' => 0, 'messages.receiver' => user::id()), $offset, $limit); break; case 'stared': $limit = AZ::setting('record_per_page'); $total_message = $this->getMessages('*', array('messages.trash' => 0, 'messages.is_star' => 1, 'messages.receiver' => user::id()), 0, 0, true); $pagination = AZ::pagination('admin/dashboard/messages/' . $mode . '/' . $message_id, 6, $limit, $total_message); $messages = $this->getMessages('users.name,messages.id,messages.label,messages.is_read,messages.is_star,messages.subject,messages.body,messages.created,messages.author,messages.have_attachment', array('messages.trash' => 0, 'messages.is_star' => 1, 'messages.receiver' => user::id()), $offset, $limit); break; case 'outbox': $limit = AZ::setting('record_per_page'); $total_message = $this->getMessages('*', array('messages.trash' => 0, 'messages.author' => user::id()), 0, 0, true); $pagination = AZ::pagination('admin/dashboard/messages/' . $mode . '/' . $message_id, 6, $limit, $total_message); $messages = $this->getMessages('users.name,messages.id,messages.label,messages.is_read,messages.is_star,messages.subject,messages.body,messages.created,messages.author,messages.have_attachment', array('messages.trash' => 0, 'messages.author' => user::id()), $offset, $limit); break; case 'trash': $limit = AZ::setting('record_per_page'); $total_message = $this->getMessages('*', array('messages.trash' => 1, 'messages.receiver' => user::id()), 0, 0, true); $pagination = AZ::pagination('admin/dashboard/messages/' . $mode . '/' . $message_id, 6, $limit, $total_message); $messages = $this->getMessages('users.name,messages.id,messages.label,messages.is_read,messages.is_star,messages.subject,messages.body,messages.created,messages.author,messages.have_attachment', array('messages.trash' => 1, 'messages.receiver' => user::id()), $offset, $limit); break; default: $limit = AZ::setting('record_per_page'); $total_message = $this->getMessages('*', array('messages.trash' => 0, 'messages.receiver' => user::id()), 0, 0, true); $pagination = AZ::pagination('admin/dashboard/messages/' . $mode . '/' . $message_id, 6, $limit, $total_message); $messages = $this->getMessages('users.name,messages.id,messages.label,messages.is_read,messages.is_star,messages.subject,messages.body,messages.created,messages.author,messages.have_attachment', array('messages.trash' => 0, 'messages.receiver' => user::id()), $offset, $limit); break; } $messagesData = array('total_message' => $total_message, 'pagination' => $pagination, 'messages' => $messages); return $messagesData; }