Ejemplo n.º 1
0
 public function listdevoteesAction()
 {
     $a = new Rgm_UserServices();
     // action body
     $page = $this->_getParam('page', 1);
     $PAGE_SIZE = 10;
     $offset = ($page - 1) * $PAGE_SIZE;
     //FOR PAGINATION--------------------------------------------
     $devotees = new Application_Model_DbTable_Devotee();
     $listOfDevotees = $devotees->getDevotees($PAGE_SIZE, $offset);
     $this->view->listdevotees = $listOfDevotees;
     $dids = $devotees->getAllDids();
     $paginator = Zend_Paginator::factory($dids);
     $paginator->setItemCountPerPage($PAGE_SIZE);
     // Number of items in a page. I have kept 10 so you can easily see the
     //pagination when there is more than 10 items inserted to devotee table.
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     //FOR NUMBER RECORDS FOUND----------------------------------
     $num_rec_found = $devotees->getNumberOfRecords();
     $this->view->number_of_records_found = $num_rec_found;
     //FOR LIST OF COUNSELORS------------------------------------
     $counselors = new Application_Model_DbTable_MstCounselor();
     $counselor = $counselors->getCounselor();
     $this->view->counselor = $counselor;
     //FOR LIST OF ISKCON CENTERS--------------------------------
     $centers = new Application_Model_DbTable_MstCenter();
     $center = $centers->getKeyValues();
     $this->view->center = $center;
     //FOR LIST OF DIKSA GURU------------------------------------
     $gurus = new Application_Model_DbTable_MstGuru();
     $guru = $gurus->seekGuru();
     $this->view->guru = $guru;
     //FOR LIST OF MENTORS ---------------------------------------
     $mentors = new Application_Model_DbTable_MstAstCounselor();
     $mentor = $mentors->getMentor();
     $this->view->mentor = $mentor;
     $this->view->searchOptions = Rgm_Basics::getDevoteeSearchOptions();
     $this->view->selSearchBy = 'display_name';
     /*-------------------Counselor List--------------------------*/
     $con = new Application_Model_DbTable_MstCounselor();
     $rs = new stdClass();
     $rs->result = $con->listIdNames('');
     $this->view->jsonCounselor = Zend_Json::encode($rs);
     /*-------------------Asram List------------------------------*/
     $asram = new Application_Model_DbTable_MstAsram();
     $this->view->asram = $asram->listPairs();
     $this->view->selAsramIds = $asram->listIds();
     /*-------------------Blood Group List------------------------*/
     $this->view->bloodGroup = Rgm_Basics::getBloodGroupsAsoArr();
     $this->view->selBloodGroup = Rgm_Basics::getBloodGroupsIds();
     /*-------------------Initiation Status List------------------*/
     $this->view->initStatus = array(1 => 'Not initiated', 2 => 'Harinaam Initiated', 3 => 'Brahman Initiated', 4 => 'Sanyas Initiated');
     $this->view->selInitStatusIds = array(1, 2, 3, 4);
     /*-------------------Status List-----------------------------*/
     $this->view->status = array('A' => 'Active', 'I' => 'Inactive', 'E' => 'Deceased');
     $this->view->selStatusIds = array('A', 'I', 'E');
 }