Esempio n. 1
0
 public function indexAction()
 {
     $this->view->title = "Pages";
     //echo "sdfdfsdfsdf";exit;
     $this->view->headTitle(" - " . $this->view->title);
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $model = new Application_Model_Page();
     $page = $this->_getParam('page', 1);
     $fixedPages = implode(",", $this->fixedOtherCMSPages);
     $where = "id IS NOT NULL AND identifire NOT IN ('advice', 'work-study-volunteer')";
     $order = "addedon ASC";
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, $order);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->fixedPages = $this->fixedPages;
 }
Esempio n. 2
0
 public function indexAction()
 {
     $this->view->type = $type = $this->_getParam('type', "other");
     $this->view->title = ucfirst($type) . " Category ";
     //change title for Journals
     if ($type == "blog") {
         $this->view->title = "Journal Category ";
     }
     $this->view->headTitle(" -  " . $this->view->title);
     $model = new Application_Model_Category();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $where = "status!='deleted' AND type='{$type}'";
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, "weight ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     if (isset($_SESSION['errorMsg'])) {
         $this->view->msg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     } else {
         $this->view->errorMsg = "";
     }
 }
Esempio n. 3
0
 public function indexAction()
 {
     $where = "id IS NOT NULL";
     $model = new Application_Model_Content();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $type = "module";
     if ($this->_getParam('type') != "") {
         $type = $this->_getParam('type');
     }
     $this->view->type = $type;
     if ($type == "logout") {
         $where .= " AND id IN ({$this->logoutTopContents})";
     } else {
         if ($type == "login") {
             $where .= " AND id IN ({$this->loginTopContents})";
         } else {
             $where .= " AND id IN ({$this->loginModules})";
         }
     }
     //echo "ssss=".$where;exit;
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, $where, "weight ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->fixedTextMod = $this->fixedTextMod;
     $this->view->fixedModules = $this->fixedModules;
 }
 public function indexAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($settings, $page, $page_size);
     $this->view->total_settings = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
Esempio n. 5
0
 /**
  * Wyświetlenie użytkowników
  */
 public function indexAction()
 {
     $model = new Feedback();
     $select = $model->select()->from('feedback');
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'created_at');
     $order = $request->getParam('order', 'desc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_at', 'message_content');
 }
Esempio n. 6
0
 /**
  * The default action - show the home page
  */
 public function viewAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $userModel = new Application_Model_UserLevel();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($userModel, $page, $page_size);
     $this->view->total_users = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $request = $this->getRequest();
     //$request->getControllerName();
 }
Esempio n. 7
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $announcementModel = new Announcement();
     $select = $announcementModel->select()->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_at', 'title', 'created_by', 'valid_since', 'valid_until', 'id_branch');
 }
Esempio n. 8
0
 public function indexAction()
 {
     $model = new Message();
     $select = $model->select()->from('message');
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('message', 'is_important');
 }
Esempio n. 9
0
 public function indexAction()
 {
     $this->view->title = "Url Rewrite Management";
     $this->view->headTitle(" - " . $this->view->title);
     $model = new Application_Model_SeoUrl();
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
Esempio n. 10
0
 public function myPhotosAction()
 {
     $userNs = new Zend_Session_Namespace('members');
     $userId = $userNs->userId;
     $albumM = new Album_Model_UserAlbum();
     $where = "user_id = {$userId}";
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($albumM, $page, $page_size, $where);
     $this->view->total = $pageObj->getTotalCount();
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
     $this->view->paginator = $paginator;
 }
Esempio n. 11
0
 public function indexAction()
 {
     $this->view->title = "Region";
     $this->view->headTitle($this->view->title);
     $model = new Application_Model_Region();
     //$settings=new Admin_Model_GlobalSettings();
     //$page_size=$settings->settingValue('pagination_size');
     $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, NULL, "name ASC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->msg = base64_decode($this->_getParam('msg', ''));
 }
Esempio n. 12
0
 public function indexAction()
 {
     $model = new GroupMain();
     $select = $model->select();
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'group_main_name');
     $order = $request->getParam('order', 'asc');
     $select->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('group_main_name');
 }
Esempio n. 13
0
 public function blockadehistoryAction()
 {
     $model = new Blockade();
     $this->view->data = $model->getLast();
     $select = $model->select();
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'created_at');
     $order = $request->getParam('order', 'desc');
     $select->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_by', 'created_at', 'is_blocked');
 }
Esempio n. 14
0
 public function indexAction()
 {
     $menu_title = trim($this->_getParam('menu_title'));
     $this->view->linkArray = array();
     $menu = new Base_Security_Menu();
     $pages = $menu->getChildPages(0, 0);
     $this->view->sortOptions = array();
     $this->view->menu_title = "";
     if ($menu_title != "") {
         $this->view->linkArray['menu_title'] = $menu_title;
         $this->view->menu_title = $menu_title;
         $arrObj = new Base_Array();
         $pages = $arrObj->search($pages, 'menu_title', $menu_title);
         $this->view->sortOptions['menu_title'] = $menu_title;
     }
     /*---sorting ----*/
     $order = trim($this->_getParam('order', ""));
     $col = trim($this->_getParam('col', ""));
     if ($order != "" && $col != "") {
         $arrObj = new Base_Array();
         $arrObj->orderBy($pages, $col, $order);
     }
     /*----------------*/
     $page_size = Zend_Registry::get('page_size');
     $this->view->page = $page = $this->_getParam('page', 1);
     $paginator = Base_Paginator::factory($pages);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
 }
 public function indexAction()
 {
     $code = "fdUserBookmark";
     $usersNs = new Zend_Session_Namespace("members");
     $mapId1 = $usersNs->userId;
     $model = new Security_Model_SystemMapping();
     /*---sorting ----*/
     $order = trim($this->_getParam('order', ""));
     $col = trim($this->_getParam('col', ""));
     if ($order != "" && $col != "") {
         if ($col == "master_value") {
             $strOrderBy = "sm.master_value {$order}";
         } else {
             if ($col == "map_id3") {
                 $strOrderBy = "s.map_id3 {$order}";
             }
         }
     } else {
         $strOrderBy = "s.map_id3";
     }
     $this->view->sortOptions = array();
     /*-----sorting----------*/
     $where = "s.map_id1='{$mapId1}' and s.map_code='{$code}'";
     $this->view->linkArray = array();
     $this->view->search = "";
     $page_size = Zend_Registry::get('page_size');
     $page = $this->_getParam('page', 1);
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("sm" => 'system_master'), array("master_value"))->join(array("s" => "system_mapping"), "s.map_code='fdUserBookmark' and s.map_id1='{$mapId1}'  and sm.master_code='fdMenu' and sm.master_id=s.map_id2", array("map_id1" => 'map_id1', "map_id2" => 'map_id2', "map_id3" => 'map_id3'))->group("s.map_id2")->order($strOrderBy);
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
 public function workflowListAction()
 {
     /*--search---*/
     $search = trim($this->_getParam('search'));
     /*---sorting ----*/
     $order = trim($this->_getParam('order', ""));
     $col = trim($this->_getParam('col', ""));
     if ($order != "" && $col != "") {
         $strOrderBy = "w.{$col} {$order}";
     } else {
         $strOrderBy = "w.workflow_name asc";
     }
     $this->view->sortOptions = array();
     /*-----sorting----------*/
     $where = "w.id<>'-2147483648' and w.is_deleted<>1";
     $this->view->linkArray = array();
     $this->view->search = "";
     if ($search != "") {
         $where = "w.workflow_name like '%{$search}%' and {$where} ";
         $this->view->linkArray = array('search' => $search);
         $this->view->search = $search;
         $this->view->sortOptions['search'] = $search;
     }
     $model = new Security_Model_User();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("w" => 'workflow_master'), array("id", "workflow_name", "row_guid", "is_deleted"))->order($strOrderBy)->where($where);
     //echo $sql = $select->__toString(); exit;
     $page_size = Zend_Registry::get('page_size');
     $page = $this->_getParam('page', 1);
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
Esempio n. 17
0
 public function indexAction()
 {
     $settings = new Admin_Model_GlobalSettings();
     $page_size = $settings->settingValue('pagination_size');
     $model = new Application_Model_Widgets();
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageData($model, $page, $page_size, NULL, "weight DESC");
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
     $this->view->errorMsg = "";
     if (isset($_SESSION['errorMsg'])) {
         $this->view->errorMsg = $_SESSION['errorMsg'];
         unset($_SESSION['errorMsg']);
     }
 }
 public function indexAction()
 {
     /*--search---*/
     $search = trim($this->_getParam('search'));
     $where = "1=1";
     $this->view->linkArray = array();
     $this->view->search = "Search...";
     /*if($search<>"" && $search<>"Search...")
       {
           $where="(first_name like '%{$search}%' or last_name like '%{$search}%' or email like '%{$search}%' or d.title like '%{$search}%' or  username like '%{$search}%' ) and status!='deleted'";
           $this->view->linkArray=array('search'=>$search);
           $this->view->search=$search;
       }*/
     $this->view->page_size = $page_size = Zend_Registry::get('page_size');
     $page = $this->_getParam('page', 1);
     $model = new Application_Model_UserPrivilege();
     $table = $model->getMapper()->getDbTable();
     // $select = $table->select()->setIntegrityCheck(false)->from('user_privilege',array('user_id', 'screen_id', 'action_id','menu_id'))->order('user_id ASC')->where($where);
     $select = $table->select()->setIntegrityCheck(false)->from(array("up" => 'user_privilege'))->join(array("u" => 'user'), 'up.user_id=u.id', array('first_name' => 'first_name', 'last_nae' => 'last_name'))->order('user_id ASC')->where($where);
     $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     // echo '<pre>'; print_r($paginator);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
Esempio n. 19
0
 /**
  * Mapowanie słownikowe wartości
  * Przystosowane do mapowania na wierszu i paginatorze
  *
  * @param Base_Db_Table_Row $row
  * @param string $key
  * @param Base_Paginator $paginator
  * @return string
  */
 public function DictMap($row, $key, $paginator = null)
 {
     if ($row instanceof Base_Db_Table_Row) {
         $ret = $row->getDictMapping($key, $row);
     } elseif ($row instanceof Base_Paginator_Adapter_Array_Row) {
         $ret = $row->getDictMapping($key, $row);
     } else {
         $ret = $paginator->getDictMapping($key);
     }
     if ($ret instanceof Base_Dictionary_Dictionary) {
         $ret = $ret->toArray();
     }
     if (isset($ret[$row[$key]])) {
         return $ret[$row[$key]];
     }
     return $row[$key];
 }
Esempio n. 20
0
 public function fetchPageDataResult($result, $page, $countPerPage = 10)
 {
     $this->setTotalCount(count($result));
     $paginator = Base_Paginator::factory($result);
     $paginator->setItemCountPerPage($countPerPage);
     $paginator->setCurrentPageNumber($page);
     return $paginator;
 }
Esempio n. 21
0
 public function projectsAction()
 {
     /*--search options---*/
     $search = trim($this->_getParam('search'));
     $status = trim($this->_getParam('status'));
     $project_manager_id = trim($this->_getParam('project_manager_id'));
     $team_leader_id = trim($this->_getParam('team_leader_id'));
     $where = '1=1';
     $linkArray = array();
     $this->view->search = "Search...";
     if ($search != "" && $search != "Search...") {
         $where = "(p.title like '%{$search}%' or p.description like '%{$search}%' or p.client_info like '%{$search}%' or p.start_date like '%{$search}%' or p.end_date like '%{$search}%' or pm.first_name like '%{$search}%' or pm.last_name like '%{$search}%' or tl.first_name like '%{$search}%' or tl.last_name like '%{$search}%')";
         $linkArray['search'] = $search;
         $this->view->search = $search;
     }
     if ($status != "") {
         if (is_null($where)) {
             $where .= " p.status='{$status}'";
         } else {
             $where .= " and p.status='{$status}'";
         }
         $linkArray['status'] = $status;
         $this->view->status = $status;
     }
     if ($project_manager_id != "") {
         if (is_null($where)) {
             $where .= " p.project_manager_id='{$project_manager_id}'";
         } else {
             $where .= " and p.project_manager_id='{$project_manager_id}'";
         }
         $linkArray['project_manager_id'] = $project_manager_id;
         $this->view->project_manager_id = $project_manager_id;
     }
     if ($team_leader_id != "") {
         if (is_null($where)) {
             $where .= " p.team_leader_id='{$team_leader_id}'";
         } else {
             $where .= " and p.team_leader_id='{$team_leader_id}'";
         }
         $linkArray['team_leader_id'] = $team_leader_id;
         $this->view->team_leader_id = $team_leader_id;
     }
     /*----search options----*/
     $this->view->linkArray = $linkArray;
     $this->view->page_size = $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $model = new Application_Model_Project();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("p" => 'project'))->join(array("pm" => "user"), 'pm.id=p.project_manager_id', array("pm_first_name" => 'first_name', "pm_last_name" => 'last_name', 'pm_id' => 'id'))->join(array("tl" => "user"), 'tl.id=p.team_leader_id', array("tl_first_name" => 'first_name', "tl_last_name" => 'last_name', 'tl_id' => 'id'))->order('status Asc')->order('addedon desc')->where($where);
     //echo $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
     $this->view->projectManagers = $model->getActiveProjectManagers();
     $this->view->teamLeaders = $model->getActiveTeamLeaders();
 }
Esempio n. 22
0
 public function abuseReportAction()
 {
     $sSQL = "SELECT ra.id, ra.item_id, ra.item_type, ra.addedon";
     $sSQL .= " ,u.email, u.username, u.first_name, u.last_name, u.sex";
     $sSQL .= " FROM report_abuse AS ra";
     $sSQL .= " JOIN user AS u ON u.id = ra.user_id";
     $sSQL .= " WHERE u.status!='deleted' AND ra.status=1";
     $sSQL .= " ORDER BY ra.addedon DESC";
     //$settings	=	new Admin_Model_GlobalSettings();
     //$page_size	=	$settings->settingValue('pagination_size');
     $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $pageObj = new Base_Paginator();
     $paginator = $pageObj->fetchPageDataRaw($sSQL, $page, $page_size);
     //set view variables
     $this->view->total = $pageObj->getTotalCount();
     $this->view->paginator = $paginator;
 }
Esempio n. 23
0
 /**
  * indexAction() - pokazuje listę wszystkich filtrów
  *
  * @todo prawodpodobnie do zmiany (będzie w ogóle lista wszystkich filtrów?)
  */
 public function indexAction()
 {
     $model = new Filter();
     $select = $model->select()->from('filter')->where('ghost = false');
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     //$logic = new Logic_Kontakt();
     //$table =  $this->addStandardActions($paginator, $logic->getTableActions());
     //$this->view->headerMappings  = $logic->getHeaderMappings();
     //        debug($paginator->getCurrentItems());die;
     $this->view->paginator = $paginator;
     $this->view->headers = array('filter_name', 'form_name', 'is_public');
 }
 public function indexAction()
 {
     /*--search---*/
     $search_name = trim($this->_getParam('search_name'));
     $search_city = trim($this->_getParam('search_city'));
     $search_phone = trim($this->_getParam('search_phone'));
     $search_email = trim($this->_getParam('search_email'));
     //$status = trim($this->_getParam('status'));
     /*---sorting ----*/
     $order = trim($this->_getParam('order', ""));
     $col = trim($this->_getParam('col', ""));
     if ($order != "" && $col != "") {
         if ($col == "phone") {
             $strOrderBy = "c.phone {$order}";
         } else {
             if ($col == "fax") {
                 $strOrderBy = "c.fax {$order}";
             } else {
                 if ($col == "email") {
                     $strOrderBy = "c.email {$order}";
                 }
             }
         }
     } else {
         $strOrderBy = "c.first_name asc";
     }
     $this->view->sortOptions = array();
     /*-----sorting----------*/
     $where = "c.id<>'-2147483648'";
     $this->view->linkArray = array();
     $this->view->search = "";
     if ($search_name != "" || $search_city != "" || $search_phone != "" || $search_email != "") {
         $where = "((first_name like '%{$search_name}%') OR (bfirst_name like '%{$search_name}%') OR (last_name like '%{$search_name}%') OR (blast_name like '%{$search_name}%')) AND ((city like '%{$search_city}%') OR (bcity like '%{$search_city}%')) AND (phone like '%{$search_phone}%') AND (email like '%{$search_email}%') and {$where} ";
         $this->view->linkArray = array('search_name' => $search_name);
         $this->view->search_name = $search_name;
         $this->view->search_city = $search_city;
         $this->view->search_phone = $search_phone;
         $this->view->search_email = $search_email;
         $this->view->sortOptions['search_name'] = $search_name;
         $this->view->sortOptions['search_city'] = $search_city;
         $this->view->sortOptions['search_phone'] = $search_phone;
         $this->view->sortOptions['search_email'] = $search_email;
     }
     $page_size = Zend_Registry::get('page_size');
     $page = $this->_getParam('page', 1);
     $model = new Admin_Model_Customer();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("c" => 'customer'))->order("{$strOrderBy}")->where($where);
     $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
Esempio n. 25
0
 /**
  * Mapowanie parametrów w nawigacji
  * Jeśli dla parametru sposób mapowania nie jest określony,
  * to przyjmuje się, że mapowanie z obiektu ma pierwszeństwo
  * przed parametrem z linku, mapowany jest parametr id oraz
  * parametr jest hashowany
  *
  * @param Base_Db_Table_Row $row
  * @param Base_Paginator $paginator
  * @return Zend_Navigation
  */
 public function NavMap($row, $paginator)
 {
     $actions = null;
     if ($paginator->moreActions !== null && is_array($paginator->moreActions) && count($paginator->moreActions) > 0) {
         $actions = $paginator->moreActions;
     }
     $container = array();
     if ($row instanceof Base_Db_Table_Row or is_subclass_of($row, 'Base_Paginator_Adapter_Array_Row')) {
         $container = $row->getActions($actions, $paginator->getIgnoreActionsFlag());
     } else {
         $container = $paginator->getActions();
     }
     $request = Zend_Controller_Front::getInstance()->getRequest();
     foreach ($container as $key => $page) {
         if (isset($page['params']) && is_array($page['params'])) {
             foreach ($page['params'] as $k => $param) {
                 $source = isset($param['source']) ? $param['source'] : self::SOURCE_OBJECT;
                 $val = $param['param'] ? $param['param'] : null;
                 $tmp_req = $request->getParam(!is_null($val) ? $val : 'id');
                 $rowParam = isset($param['param']) ? $param['param'] : $k;
                 $tmp_obj = isset($row[$rowParam]) ? $row[$rowParam] : null;
                 switch ($source) {
                     case self::SOURCE_REQUEST:
                         $tmp = $tmp_req ? $tmp_req : $tmp_obj;
                         break;
                     case self::SOURCE_OBJECT:
                         $tmp = $tmp_obj ? $tmp_obj : $tmp_req;
                         break;
                     case self::SOURCE_STATIC:
                         $tmp = $val;
                         break;
                     default:
                         throw new Exception('Unknown data processing method');
                 }
                 $idConvert = Zend_Controller_Action_HelperBroker::getStaticHelper('IdConvert');
                 $container[$key]['params'][$k] = isset($param['hash']) ? $param['hash'] ? $idConvert->StrToHex($tmp) : $tmp : $idConvert->StrToHex($tmp);
             }
         }
     }
     return new Zend_Navigation($container);
 }
Esempio n. 26
0
 public function indexAction()
 {
     $params['q'] = $this->_getParam('q');
     if (isset($params['q']) && $params['q'] != "" && $params['q'] != "Search Gap Daemon") {
         $this->view->searchtext = $searchtext = $params['q'];
         $settings = new Admin_Model_GlobalSettings();
         $page_size = $settings->settingValue('pagination_size');
         //$page_size				= 	1;
         $modelList = new Application_Model_SearchView();
         $searchData = $modelList->searchResult($searchtext);
         $page = $this->_getParam('page', 1);
         $pageObj = new Base_Paginator();
         $paginator = $pageObj->fetchPageDataResult($searchData, $page, $page_size);
         if ($pageObj->getTotalCount() > 0) {
             $this->view->total = $pageObj->getTotalCount();
             $this->view->paginator = $paginator;
         } else {
             $this->view->message = "No result found for this keyword.";
         }
     } else {
         $this->view->message = "Missing search parameters.";
     }
 }
Esempio n. 27
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $model = new Role();
     $searchForm = new Logic_Role_Form_Filter();
     $this->view->form = $searchForm;
     $filter = $request->getParam('filter_is_deleted', false);
     $ghost = "false";
     if ($filter) {
         $searchForm->getElement('filter_is_active')->setChecked(false);
         $searchForm->getElement('filter_is_deleted')->setChecked(true);
         $ghost = "true";
     }
     $select = $model->select()->from('role')->where('ghost = ' . $ghost);
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('role_name');
     $this->view->headScript()->appendFile('/static/js/filtr_active.js');
 }
 public function indexAction()
 {
     /*--search---*/
     $search = trim($this->_getParam('orgName'));
     //$status = trim($this->_getParam('status'));
     /*---sorting ----*/
     $order = trim($this->_getParam('order', ""));
     $col = trim($this->_getParam('col', ""));
     if ($order != "" && $col != "") {
         if ($col == "city") {
             $strOrderBy = "s.city {$order}";
         } else {
             if ($col == "state") {
                 $strOrderBy = "s.state {$order}";
             } else {
                 if ($col == "zip") {
                     $strOrderBy = "s.zip {$order}";
                 }
             }
         }
     } else {
         $strOrderBy = "s.first_name asc";
     }
     $this->view->sortOptions = array();
     /*-----sorting----------*/
     $where = "s.id<>'-2147483648'";
     $this->view->linkArray = array();
     $this->view->search = "";
     if ($search != "") {
         $where = "(org_name like '%{$search}%')and {$where} ";
         $this->view->linkArray = array('search' => $search);
         $this->view->search = $search;
         $this->view->sortOptions['orgName'] = $search;
     }
     $page_size = Zend_Registry::get('page_size');
     $page = $this->_getParam('page', 1);
     $model = new Admin_Model_Supplier();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("s" => 'supplier'))->order("{$strOrderBy}")->where($where);
     $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
 public function indexAction()
 {
     /*--search---*/
     $this->view->pageHeading = "List Location";
     $search = trim($this->_getParam('title'));
     $this->view->assign('searchText', $search);
     //$status = trim($this->_getParam('status'));
     /*---sorting ----*/
     $order = trim($this->_getParam('order', ""));
     $col = trim($this->_getParam('col', ""));
     if ($order != "" && $col != "") {
         if ($col == "title") {
             $strOrderBy = "l.title {$order}";
         }
         // else if($col=="weight")
         //     $strOrderBy="l.weight {$order}";
     } else {
         $strOrderBy = "l.id desc";
     }
     $this->view->sortOptions = array();
     /*-----sorting----------*/
     $where = "l.id<>'-2147483648'";
     $this->view->linkArray = array();
     $this->view->search = "";
     if ($search != "") {
         $where = "(title like '%{$search}%')and {$where} ";
         $this->view->linkArray = array('search' => $search);
         $this->view->search = $search;
         $this->view->sortOptions['title'] = $search;
     }
     $page_size = Zend_Registry::get('page_size');
     $page = $this->_getParam('page', 1);
     $model = new Admin_Model_Location();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from(array("l" => 'location'))->order("{$strOrderBy}")->where($where);
     $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }
 public function databaseConfigsAction()
 {
     $search = trim($this->_getParam('search'));
     $where = "1=1";
     $this->view->search = "Search...";
     if ($search != "" && $search != "Search...") {
         $where = "(db_server_name like '%{$search}%' or db_name like '%{$search}%' or db_user like '%{$search}%')";
         $this->view->search = $search;
     }
     $this->view->page_size = $page_size = $this->_getParam('page_size', 25);
     $page = $this->_getParam('page', 1);
     $model = new Application_Model_DatabaseConfig();
     $table = $model->getMapper()->getDbTable();
     $select = $table->select()->setIntegrityCheck(false)->from('dbconfiguration')->order('dbcnf_id ASC')->where($where);
     $sql = $select->__toString();
     $paginator = Base_Paginator::factory($select);
     $paginator->setItemCountPerPage($page_size);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalItems = $paginator->getTotalItemCount();
     $this->view->paginator = $paginator;
 }