/**
  * Admin, moderate blocks (action)
  */
 public function adminAction()
 {
     // pre-action
     $this->_getHomeParams();
     // pre-data
     $page = $this->_getParam('page');
     $order = $this->_getParam('order');
     $type = $this->_getParam('type') == 'desc' ? 'DESC' : 'ASC';
     $blocks = $this->_getModel()->findAllForAdminByHomeId($this->getHomeId());
     // order
     switch ($order) {
         case "arrival":
             $blocks->orderBy('hm_date_arrival_id ' . $type);
             break;
         case "departure":
             $blocks->orderBy('hm_date_departure_id ' . $type);
             break;
         case "created":
             $blocks->orderBy('created_at ' . $type);
             break;
     }
     // pagination
     $blocks = new ZendX_Doctrine_Paginator($blocks);
     $blocks->setItemCountPerPage(20)->setPageRange(11)->setCurrentPageNumber($page);
     // view
     $this->view->blocks = $blocks;
     $this->view->layout()->setLayout('submenu');
 }
 public function adminAction()
 {
     $type = $this->_getParam('type') == 'asc' ? 'asc' : 'desc';
     $order = $this->_getParam('order');
     $page = $this->_getParam('page');
     $q = $this->_getModel()->findAllForAdmin();
     if ($order) {
         switch ($order) {
             case 'name':
                 $q->orderBy('c.name ' . $type);
                 break;
             case 'code':
                 $q->orderBy('c.numcode ' . $type);
                 break;
             case 'iso2':
                 $q->orderBy('c.iso2 ' . $type);
                 break;
             case 'iso3':
                 $q->orderBy('c.iso3 ' . $type);
                 break;
         }
     }
     $countries = new ZendX_Doctrine_Paginator($q);
     $countries->setItemCountPerPage(20)->setPageRange(11)->setCurrentPageNumber($page);
     $this->_helper->layout()->setLayout('submenu');
     $this->view->countries = $countries;
 }
 public function adminAction()
 {
     $page = $this->_getParam('page');
     $owners = new ZendX_Doctrine_Paginator(Model_Hm_Owner::findAllForAdmin());
     $owners->setCurrentPageNumber($page)->setItemCountPerPage(20)->setPageRange(11);
     $this->view->owners = $owners;
 }
 public function adminAction()
 {
     $page = $this->_getParam('page');
     $order = $this->_getParam('order');
     $q = $this->_getModel()->findAllForAdmin();
     $type = $this->_getParam('type') == 'asc' ? 'asc' : 'desc';
     if ($order) {
         switch ($order) {
             case 'id':
                 $q->orderBy('u.id ' . $type);
                 break;
             case 'name':
                 $q->orderBy('u.surname ' . $type . ', u.initials ' . $type . ', u.insertion ' . $type);
                 break;
             case 'email':
                 $q->orderBy('u.email ' . $type);
                 break;
             case 'registration':
                 $q->orderBy('u.created_at ' . $type);
                 break;
             case 'username':
                 $q->orderBy('u.username ' . $type);
                 break;
         }
     }
     $users = new ZendX_Doctrine_Paginator($q);
     $users->setItemCountPerPage(20)->setPageRange(11)->setCurrentPageNumber($page);
     $this->_helper->layout()->setLayout('submenu');
     $this->view->users = $users;
 }
 public function adminAction()
 {
     $page = $this->_getParam('page');
     $langs = new ZendX_Doctrine_Paginator($this->_getModel()->findAllForAdmin());
     $langs->setCurrentPageNumber($page)->setPageRange(11)->setItemCountPerPage(15);
     $this->view->langs = $langs;
     $this->_helper->layout()->setLayout('submenu');
 }
 public function adminAction()
 {
     $hid = $this->_getParam('hid');
     $page = $this->_getParam('page');
     $charges = Model_Hm_Invoice_Charge::findAllByHomeIdForAdmin($hid);
     $charges = new ZendX_Doctrine_Paginator($charges);
     $charges->setPageRange(11)->setItemCountPerPage(20)->setCurrentPageNumber($page);
     $this->_helper->layout()->setLayout('submenu');
     $this->view->charges = $charges;
 }
 public function adminAction()
 {
     $holidayHomes = $this->_getModel()->findAllForCalendar();
     // data
     $page = $this->_getParam('page');
     $order = $this->_getParam('order');
     $type = $this->_getParam('type') == 'asc' ? 'asc' : 'desc';
     // ordering
     switch ($order) {
         case "name":
             $holidayHomes->orderBy('name ' . $type);
             break;
     }
     // Homes & Pagination
     $paginator = new ZendX_Doctrine_Paginator($holidayHomes);
     $paginator->setItemCountPerPage(20)->setPageRange(11)->setCurrentPageNumber($page);
     // view
     $this->view->holidayHomes = $paginator;
     $this->view->layout()->setLayout('submenu');
 }
 public function financialAction()
 {
     $page = $this->_getParam('page');
     $sort = $this->_getParam('order');
     $type = $this->_getParam('type') == 'asc' ? 'asc' : 'desc';
     $holidayHomes = Model_Hm_Home::adminIndex();
     $this->_helper->layout()->setLayout('submenu');
     if ($sort) {
         switch ($sort) {
             case 'name':
                 $holidayHomes->orderBy('hm.name ' . $type);
                 break;
             case 'price':
                 $holidayHomes->orderBy('hm.price ' . $type);
                 break;
         }
     }
     $holidayHomes = new ZendX_Doctrine_Paginator($holidayHomes);
     $holidayHomes->setItemCountPerPage(20)->setPageRange(11)->setCurrentPageNumber($page);
     $this->view->holidayHomes = $holidayHomes;
 }
 /**
  * Set default scrolling style
  * This is non static version of {@link setDefaultScrollingStyle()}
  *
  * @see setDefaultScrollingStyle()
  * @access public
  * @param string $style Scrolling style (All|Elastic|Jumping|Sliding)
  * @return ZendX_Doctrine_Paginator
  */
 public function setScrollingStyle($style)
 {
     self::$_defaultScrollingStyle = $style;
     return $this;
 }
 /**
  * Admin (action)
  */
 public function adminAction()
 {
     // pre
     $this->_getHomeParams();
     if ($this->getHomeId()) {
         $reservations = $this->_getModel()->findAllByHomeIdForAdmin($this->getHomeId());
     } else {
         $reservations = $this->_getModel()->findAllForAdmin();
     }
     $order = $this->_getParam('order');
     $type = $this->_getParam('type') == 'desc' ? 'DESC' : 'ASC';
     $page = $this->_getParam('page');
     // order
     switch ($order) {
         case "id":
             $reservations->orderBy('r.id ' . $type);
             break;
         case "user":
             $reservations->orderBy('u.surname ' . $type);
             break;
         case "arrival":
             $reservations->orderBy('da.date ' . $type);
             break;
         case "departure":
             $reservations->orderBy('dd.date ' . $type);
             break;
         case "created":
             $reservations->orderBy('r.created_at ' . $type);
             break;
     }
     // Paginate
     $paginator = new ZendX_Doctrine_Paginator($reservations);
     $paginator->setCurrentPageNumber($page)->setPageRange(11)->setItemCountPerPage(40);
     $reservations = $paginator;
     // view
     $this->view->reservations = $reservations;
     $this->view->layout()->setLayout('submenu');
 }