Example #1
0
 public function indexAction()
 {
     $this->view->form = $searchform = new Individual_Form_Search();
     $villagelist = $this->view->adm->viewRecord('ourbank_master_villagelist', 'id', 'asc');
     // get village list
     // Zend_Debug::dump($villagelist);
     foreach ($villagelist as $villages) {
         $searchform->village->addMultiOption($villages['id'], $villages['name']);
     }
     if ($this->_request->isPost() && $this->_request->getPost('Search')) {
         $result = $this->view->db->searchDetails($this->_request->getPost());
         // get search criteria values
         $page = $this->_getParam('page', 1);
         $paginator = Zend_Paginator::factory($result);
         // assign searched values for pagination
         $paginator->setItemCountPerPage($this->view->adm->paginator());
         $paginator->setCurrentPageNumber($page);
         $this->view->paginator = $paginator;
         $this->view->search = true;
     } else {
         $this->view->title = "Individual member";
         $storage = new Zend_Auth_Storage_Session();
         $data = $storage->read();
         if (!$data) {
             $this->_redirect('index/login');
         }
         $page = $this->_getParam('page', 1);
         $paginator = Zend_Paginator::factory($this->view->db->getMemberdetails());
         // assign default values for pagination
         $this->view->paginator = $paginator;
     }
     $paginator->setItemCountPerPage($this->view->adm->paginator());
     $paginator->setCurrentPageNumber($page);
 }
Example #2
0
 public function __construct()
 {
     $this->auth = Zend_Auth::getInstance();
     $storage_session = new Zend_Auth_Storage_Session($this->name);
     $storage_session->setExpirationSeconds(300000);
     $this->auth->setStorage($storage_session);
 }
 public function init()
 {
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     /*********** To check for publisher session data *********************/
     $storage_publisher = new Zend_Auth_Storage_Session('publisher_type');
     $publisher_data = $storage_publisher->read();
     $storage_company = new Zend_Auth_Storage_Session('company_type');
     $company_data = $storage_company->read();
     if ($publisher_data && $publisher_data != null) {
         $this->modelPublisher = new Model_DbTable_Users();
         $this->sessPublisherInfo = $this->modelPublisher->getInfoByUserId($publisher_data->id);
         $this->view->sessPublisherInfo = $this->sessPublisherInfo;
     } elseif ($company_data && $company_data != null) {
         $this->modelCompany = new Model_DbTable_Companies();
         $this->sessCompanyInfo = $this->modelCompany->getInfoByUserId($company_data->id);
         $this->view->sessCompanyInfo = $this->sessCompanyInfo;
     }
     $this->modelPage = new Model_DbTable_Page();
     $this->modelEnquiry = new Admin_Model_DbTable_Enquirys();
     /************* To Set The active section and links *******************/
     $controller = $this->_getParam('controller');
     $action = $this->_getParam('action');
     $title = $this->_getParam('title');
     $this->view->currentController = $controller;
     $this->view->currentAction = $action;
     $this->view->currentTitle = $title;
     $this->view->class_active = 'class="active"';
     /************* To Set The active section and links *******************/
     if ($title == 'contact-us') {
         $captcha = new Zend_Captcha_Image();
         $captcha->setImgDir('public/css/captcha/images/');
         $captcha->setImgUrl($this->view->serverUrl . $this->view->baseUrl() . '/public/css/captcha/images/');
         $captcha->setFont('public/css/captcha/fonts/times_new_yorker.ttf');
         $captcha->setWordlen(5);
         $captcha->setFontSize(28);
         $captcha->setLineNoiseLevel(3);
         $captcha->setWidth(161);
         $captcha->setHeight(75);
         $captcha->generate();
         /*$captcha= new Zend_Form_Element_Captcha('captcha', array(
                             'label' => "Please verify you're a human",
         
                             'captcha' => array(
                                 'captcha' => 'image',
         
                                 'font'=>'public/css/captcha/fonts/times_new_yorker.ttf',
                                 'imgDir'=>'public/css/captcha/images/',
                                 'imgUrl'=>$this->view->serverUrl.$this->view->baseUrl().'/public/css/captcha/images/',
                                 'wordLen' => 4,
                                 'fsize'=>20,
                                 'height'=>60,
                                 'width'=>250,
                                 'gcFreq'=>50,
                                 'expiration' => 300
                             )
                         ));
         				*/
         $this->view->captcha = $captcha;
     }
 }
Example #4
0
 function indexAction()
 {
     $personalsavings = new Personalsavings_Model_personalsavings();
     $savingsSelect = $personalsavings->accountDetails();
     $this->view->savingslist = $savingsSelect;
     $globalsession = new App_Model_Users();
     $this->view->globalvalue = $globalsession->getSession();
     // get session values
     $this->view->createdby = $this->view->globalvalue[0]['id'];
     $this->view->username = $this->view->globalvalue[0]['username'];
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     // 	$paginator = Zend_Paginator::factory($savingsSelect);
     //         $paginator->setCurrentPageNumber($this->_getParam("page"));
     //         $paginator->setItemCountPerPage(35);
     //         $paginator->setPageRange(36);
     //         $this->view->page=$this->_request->getParam('page');
     //         $this->view->paginator = $paginator;
     //         $this->view->depositeAmount = 0;
     //         $this->view->withdrawlAmount = 0;
     //         $this->view->totalAmount = 0;
 }
Example #5
0
 public function init()
 {
     $this->view->pageTitle = $this->view->translate("Funder");
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $login = new App_Model_Users();
     $loginname = $login->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $this->view->adm = new App_Model_Adm();
     $this->view->funder = new Fundercommonview_Model_fundercommon();
     $module = $this->view->funder->getmodule('Funder');
     foreach ($module as $module_id) {
     }
     $this->view->mod_id = $module_id['parent'];
     $this->view->sub_id = $module_id['module_id'];
 }
Example #6
0
 public function init()
 {
     $this->view->pageTitle = $this->view->translate("New Office");
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     // get the module name and it used to change the side bar dynamically
     $this->view->createdby = $sessionName->primaryuserid;
     $this->view->subId = $subId = $this->_getParam('subId');
     $this->view->modId = $modId = $this->_getParam('modId');
     $addressmodel = new Address_Model_addressInformation();
     $module_name = $addressmodel->getmodule($subId);
     foreach ($module_name as $module_view) {
         $address = $module_view['module_description'];
     }
     $this->view->pageTitle = $address . ' address details';
     //         $globalsession = new App_Model_Users();
     //         $this->view->globalvalue = $globalsession->getSession();
     //         $this->view->createdby = $this->view->globalvalue[0]['id'];
     //         $this->view->username = $this->view->globalvalue[0]['username'];
     //         if (($this->view->globalvalue[0]['id'] == 0)) {
     //                 $this->_redirect('index/logout');
     //         }
     $this->view->adm = new App_Model_Adm();
 }
Example #7
0
 public function indexAction()
 {
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $this->view->title = "Group meeting";
     $searchForm = new Meeting_Form_Search();
     $this->view->form = $searchForm;
     $days = $this->view->adm->viewRecord("ourbank_master_weekdays", "id", "ASC");
     foreach ($days as $days) {
         $searchForm->search_weekdays->addMultiOption($days['id'], $days['name']);
     }
     $meeting = new Meeting_Model_Meeting();
     $result = $meeting->fetchAllmeetingdetails();
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($result);
     $paginator->setItemCountPerPage(5);
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     if ($this->_request->isPost() && $this->_request->getPost('Search')) {
         $formData = $this->_request->getPost();
         if ($searchForm->isValid($formData)) {
             $meeting = new Meeting_Model_Meeting();
             $result = $meeting->SearchMeeting($formData);
             $page = $this->_getParam('page', 1);
             $paginator = Zend_Paginator::factory($result);
             $paginator->setItemCountPerPage(5);
             $paginator->setCurrentPageNumber($page);
             $this->view->paginator = $paginator;
         }
     }
 }
Example #8
0
 public function init()
 {
     /* creating flashMessanger object to display message */
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     /* check for admin login */
     $storage = new Zend_Auth_Storage_Session('admin_type');
     $data = $storage->read();
     if ($data) {
         $this->modelAdmiUsers = new Admin_Model_DbTable_AdminUsers();
         $this->sessAdminInfo = $this->modelAdmiUsers->fetchRow("id=" . $data->id);
     }
     if (!$this->sessAdminInfo) {
         $this->_redirect('admin/auth/');
     }
     $this->sessAdminInfo->modules = explode(",", $this->sessAdminInfo->modules);
     $this->view->sessAdminInfo = $this->sessAdminInfo;
     /* creating model object */
     $this->modelUsers = new Admin_Model_DbTable_Users();
     $this->modelModuleMenus = new Admin_Model_DbTable_ModulesMenus();
     $this->view->modelModuleMenus = $this->modelModuleMenus->getModuleMenusList();
     /************* To Set The active section and links *******************/
     $controller = $this->_getParam('controller');
     $action = $this->_getParam('action');
     $this->view->currentController = $controller;
     $this->view->currentAction = $action;
     /************* To Set The active section and links *******************/
     $moduleAccessRow = $this->modelModuleMenus->fetchRow("controller='{$controller}' AND action LIKE '%" . $action . "%'");
     $currentModuleId = $moduleAccessRow['id'];
     if (!in_array($currentModuleId, $this->sessAdminInfo->modules)) {
         $this->_flashMessenger->addMessage('<div class="div-error">"' . $moduleAccessRow['menu_name'] . '"   module not accessable to you</div>');
         $this->_redirect('admin/');
     }
 }
Example #9
0
 public function init()
 {
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     /**********************************************************/
     $storage = new Zend_Auth_Storage_Session('publisher_type');
     $data = $storage->read();
     //$this->modelPublishers = new Publisher_Model_DbTable_Publishers();
     $storage1 = new Zend_Auth_Storage_Session('company_type');
     $data1 = $storage1->read();
     //$this->modelCompanies = new Company_Model_DbTable_Companies();
     if (!empty($data) || !empty($data1)) {
         $this->_redirect('/');
     }
     /******************************************************************/
     //$storeId=$this->getRequest()->getCookie('sid');
     //$storeName=$this->getRequest()->getCookie('sname');
     $storeSession = new Zend_Session_Namespace('storeInfo');
     if (!empty($storeSession->sid) && !empty($storeSession->sid) && !empty($storeSession->sname) && !empty($storeSession->sid) && !empty($storeSession->cid) && !empty($storeSession->cname)) {
         $this->view->storeId = $storeSession->sid;
         $this->view->storeName = $storeSession->sname;
     } else {
         //$modelCountry = new Admin_Model_DbTable_Countries();
         //$country_info = $modelCountry->fetchRow('country="Nigeria"');
         //$this->_redirect('/auth/storechange/storeid/'.$country_info->id);
         $this->_redirect('/auth/storechange/');
     }
     $modelBooks = new Publisher_Model_DbTable_Books();
     $allStored = $modelBooks->getAllStores();
     $this->view->allStored = $allStored;
     /******************************************************************/
 }
Example #10
0
 public function init()
 {
     $this->view->pageTitle = 'Loan request';
     $this->view->title = 'Accounting';
     $this->view->accounts = new Loanprocess_Model_Loanprocess();
     $this->view->cl = new App_Model_Users();
     $this->view->adm = new App_Model_Adm();
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $loginname = $this->view->cl->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $finduser = $this->view->accounts->finduser($this->view->createdby);
     if ($finduser) {
         $levelid = $finduser[0]['officetype_id'];
         $designation = $finduser[0]['designation'];
         $hierarchy = $this->view->accounts->findhierarchy($levelid);
         $this->view->levelname = $levelname = $hierarchy[0]['type'];
         $this->view->levelid = $levelname = $hierarchy[0]['id'];
     }
 }
Example #11
0
 public function indexAction()
 {
     $searchForm = new Groupm_Form_Search();
     $group = new Groupm_Model_Group();
     $this->view->form = $searchForm;
     if ($this->_request->isPost() && $this->_request->getPost('Search')) {
         $result = $group->searchDetails($this->_request->getPost());
         // get search criteria values
         $page = $this->_getParam('page', 1);
         $paginator = Zend_Paginator::factory($result);
         // assign searched values for pagination
         $paginator->setItemCountPerPage($this->view->adm->paginator());
         $paginator->setCurrentPageNumber($page);
         $this->view->paginator = $paginator;
         $this->view->search = true;
     } else {
         $this->view->title = "Group member";
         $storage = new Zend_Auth_Storage_Session();
         $data = $storage->read();
         if (!$data) {
             $this->_redirect('index/login');
         }
         $page = $this->_getParam('page', 1);
         $paginator = Zend_Paginator::factory($group->getGroupDetails());
         // assign default values for pagination
         $this->view->paginator = $paginator;
     }
     $paginator->setItemCountPerPage($this->view->adm->paginator());
     $paginator->setCurrentPageNumber($page);
 }
Example #12
0
 public function init()
 {
     $this->view->pageTitle = $this->view->translate('Membership');
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $login = new App_Model_Users();
     $loginname = $login->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $this->view->id = $subId = $this->_getParam('id');
     $this->view->subId = $subId = $this->_getParam('subId');
     $this->view->modId = $modId = $this->_getParam('modId');
     $addressmodel = new Familycommonview_Model_familycommonview();
     $module_name = $addressmodel->getmodule($subId);
     foreach ($module_name as $module_view) {
         $address = $module_view['module_description'];
     }
     $this->view->pageTitle = 'Individual crop details';
     $this->view->adm = new App_Model_Adm();
 }
Example #13
0
 public function init()
 {
     $this->view->title = "Savings";
     $this->view->pageTitle = "Savings withdrawal";
     $this->view->type = 'savings';
     $this->view->savingsModel = new Savingswithdrawal_Model_Withdrawal();
     $this->view->cl = new App_Model_Users();
     $this->view->adm = new App_Model_Adm();
     $this->view->dc = new App_Model_dateConvertor();
     $this->view->ms = new Msdetails_Model_msdetails();
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $loginname = $this->view->cl->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
 }
Example #14
0
 public function init()
 {
     $this->view->pageTitle = "Group";
     $test = new DH_ClassInfo(APPLICATION_PATH . '/modules/groupm/controllers/');
     // create instance to get controller name
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $login = new App_Model_Users();
     $loginname = $login->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $this->view->adm = new App_Model_Adm();
     // create instance for common adm model page
     $module = $test->getControllerClassNames();
     $modulename = explode("_", $module[0]);
     $this->view->modulename = strtolower($modulename[0]);
     $this->view->dbobj = new Groupmdefault_Model_Groupdefault();
 }
Example #15
0
 public function init()
 {
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     $storage = new Zend_Auth_Storage_Session('publisher_type');
     $data = $storage->read();
     if ($data && $data != null) {
         $this->modelPublisher = new Publisher_Model_DbTable_Publishers();
         $this->modelIssue = new Publisher_Model_DbTable_Issues();
         $this->modelBooks = new Publisher_Model_DbTable_Books();
         $this->sessPublisherInfo = $this->modelPublisher->getInfoByPublisherId($data->id);
         $this->view->sessPublisherInfo = $this->sessPublisherInfo;
         $this->parentPublisherId = !empty($this->sessPublisherInfo->parent_id) ? $this->sessPublisherInfo->parent_id : $this->sessPublisherInfo->id;
         $this->view->parentPublisherId = $this->parentPublisherId;
         $tab_ajax = $this->_request->getParam('tab_ajax', 0);
         if (empty($tab_ajax)) {
             $this->_redirect('publisher/');
         }
         if ($data->user_type != 'publisher' && $data->user_type != 'Pmanager' && $data->user_type != 'Amanager') {
             $this->_redirect('publisher/access/');
         }
         $this->modelSiteSetting = new Admin_Model_DbTable_SiteSettings();
     } else {
         $this->_redirect('publisher/auth/');
     }
 }
Example #16
0
 public function indexAction()
 {
     $this->view->title = 'Loan Process';
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $searchForm = $this->view->form = new Affidavit_Form_Search();
     if ($this->_request->isPost() && $this->_request->getPost('Submit')) {
         $formData = $this->_request->getPost();
         if ($searchForm->isValid($formData)) {
             $this->view->withdrawalamount = $this->_request->getParam('amount');
             $this->view->membercode = $this->_request->getParam('membercode');
             $result = $this->view->Dbobj->getMember($this->_request->getParam('membercode'));
             $page = $this->_getParam('page', 1);
             $paginator = Zend_Paginator::factory($result);
             // assign searched values for pagination
             $paginator->setItemCountPerPage($this->view->adm->paginator());
             $paginator->setCurrentPageNumber($page);
             $this->view->paginator = $paginator;
             $paginator->setItemCountPerPage($this->view->adm->paginator());
             $paginator->setCurrentPageNumber($page);
             $this->view->search = true;
         }
     }
 }
Example #17
0
 public function init()
 {
     $this->view->pageTitle = $this->view->translate("Meeting Book");
     $this->view->title = $this->view->translate('Reports');
     $this->view->type = $this->view->translate("financialReports");
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $login = new App_Model_Users();
     $loginname = $login->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $this->view->adm = new App_Model_Adm();
     $this->view->dateconvert = new App_Model_dateConvertor();
     $test = new DH_ClassInfo(APPLICATION_PATH . '/modules/meetingbookindex/controllers/');
     $module = $test->getControllerClassNames();
     $modulename = explode("_", $module[0]);
     $this->view->modulename = strtolower($modulename[0]);
     //date format instance
     $this->view->dateconvertor = new App_Model_dateConvertor();
 }
Example #18
0
 public function init()
 {
     /*creating flashMessanger object to display message*/
     $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
     /* check for admin login*/
     $storage = new Zend_Auth_Storage_Session('admin_type');
     $data = $storage->read();
     if ($data) {
         $this->modelAdmiUsers = new Admin_Model_DbTable_AdminUsers();
         $this->sessAdminInfo = $this->modelAdmiUsers->fetchRow("id=" . $data->id);
     }
     if (!$this->sessAdminInfo) {
         $this->_redirect('admin/auth/');
     }
     $this->sessAdminInfo->modules = explode(",", $this->sessAdminInfo->modules);
     $this->view->sessAdminInfo = $this->sessAdminInfo;
     /* creating model object */
     $this->modelModuleMenus = new Admin_Model_DbTable_ModulesMenus();
     $this->view->modelModuleMenus = $this->modelModuleMenus->getModuleMenusList();
     $this->modelUsers = new Admin_Model_DbTable_Users();
     $this->modelAdminUsers = new Admin_Model_DbTable_SubAdminUsers();
     /************* To Set The active section and links *******************/
     $controller = $this->_getParam('controller');
     $action = $this->_getParam('action');
     $this->view->currentController = $controller;
     $this->view->currentAction = $action;
     /************* To Set The active section and links *******************/
 }
Example #19
0
 public function init()
 {
     $this->view->pageTitle = 'Office meetings';
     /* Initialize action controller here */
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $globalsession = new App_Model_Users();
     $loginname = $globalsession->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $this->view->adm = new App_Model_Adm();
     $this->view->dateconvert = new App_Model_dateConvertor();
     $test = new DH_ClassInfo(APPLICATION_PATH . '/modules/meetingindex/controllers/');
     $module = $test->getControllerClassNames();
     $modulename = explode("_", $module[0]);
     $this->view->modulename = strtolower($modulename[0]);
 }
Example #20
0
 public function init()
 {
     $this->view->pageTitle = $this->view->translate('Family information');
     $globalsession = new App_Model_Users();
     $this->view->globalvalue = $globalsession->getSession();
     // get session values
     $this->view->createdby = $this->view->globalvalue[0]['id'];
     $this->view->username = $this->view->globalvalue[0]['username'];
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     //getting module name and change the side bar dynamically
     $this->view->id = $subId = $this->_getParam('id');
     //         $this->view->subId=$subId=$this->_getParam('subId');
     //         $this->view->modId=$modId=$this->_getParam('modId');
     $addressmodel = $this->view->familycommon = new Familycommonview_Model_familycommonview();
     //         $module_name=$addressmodel->getmodule($subId);
     //         foreach($module_name as $module_view)
     //         {
     //             $address=$module_view['module_description'];
     //         }
     $this->view->pageTitle = 'Family Member Details';
     $this->view->adm = new App_Model_Adm();
     $this->view->dateconvertor = new App_Model_dateConvertor();
     $this->view->baseurl = $this->view->baseUrl();
     $this->view->modelfamily = new Familymembers_Model_Familymembers();
 }
Example #21
0
 public function init()
 {
     $this->view->pageTitle = 'Fee';
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $login = new App_Model_Users();
     $loginname = $login->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     //         if (($this->view->globalvalue[0]['id'] == 0)) {
     //              $this->_redirect('index/logout');
     //         }
     $this->view->adm = new App_Model_Adm();
     $ledger = new Ledger_Model_Ledger();
     $ledger1 = $ledger->fetchAllLedger1();
     $flag = 0;
     $date = date("y/m/d H:i:s");
     foreach ($ledger1 as $ledger2) {
         if ($ledger2->header == 'Fee') {
             $flag = 1;
         }
     }
     if ($flag == 0) {
         $glInsert = $ledger->insertGlcode(array('id' => '', 'glcode' => 'I01000', 'ledgertype_id' => 1, 'header' => 'Fee', 'description' => 'Fee in income', 'created_date' => $date, 'created_by' => 1));
     }
 }
Example #22
0
 public function indexAction()
 {
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $this->view->title = $this->view->translate('Loans');
     $searchForm = new Management_Form_Search();
     $this->view->form = $searchForm;
     $loan = new Loans_Model_Loan();
     $result = $loan->getLoan();
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($result);
     $paginator->setItemCountPerPage(5);
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     if ($this->_request->isPost() && $this->_request->getPost('Search')) {
         $formData = $this->_request->getPost();
         if ($this->_request->isPost()) {
             $formData = $this->_request->getPost();
             if ($searchForm->isValid($formData)) {
                 $loan = new Loans_Model_Loan();
                 $result = $loan->searchLoan($searchForm->getValues());
                 $page = $this->_getParam('page', 1);
                 $paginator = Zend_Paginator::factory($result);
                 $paginator->setItemCountPerPage(5);
                 $paginator->setCurrentPageNumber($page);
                 $this->view->paginator = $paginator;
             }
         }
     }
 }
Example #23
0
 public function init()
 {
     $this->view->pageTitle = $this->view->translate('Family Information');
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $sessionName = new Zend_Session_Namespace('ourbank');
     $userid = $this->view->createdby = $sessionName->primaryuserid;
     // get the stored session id
     $login = new App_Model_Users();
     $loginname = $login->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
     $model = new Familydefault_Model_familydefault();
     $officetype = $model->getofficehierarchy();
     $this->view->lastlevelid = $officetype[0]['hierarchyid'] - 1;
     $this->view->adm = new App_Model_Adm();
     $this->view->commonmodel = $individualcommon = new Familycommonview_Model_familycommonview();
     //get the module id and submodule id
     $module = $individualcommon->getmodule('Office');
     foreach ($module as $module_id) {
     }
     $this->view->mod_id = $module_id['parent'];
     $this->view->sub_id = $module_id['module_id'];
 }
Example #24
0
 public function init()
 {
     $storage = new Zend_Auth_Storage_Session('user_type');
     $data = $storage->read();
     if ($data && $data != null) {
         $this->sessUser = $data;
         $this->view->id = $this->sessUser->id;
         $this->view->sessUser = $this->sessUser;
         if ($this->sessUser->usertype == 1) {
             $this->view->contact_person = $this->sessUser->first_name;
         }
         if ($this->sessUser->usertype == 2) {
             $this->view->contact_person = $this->sessUser->contact_person;
         }
     }
     $storeSession = new Zend_Session_Namespace('storeInfo');
     if (!empty($storeSession->sid) && !empty($storeSession->sid) && !empty($storeSession->sname) && !empty($storeSession->sid) && !empty($storeSession->cid) && !empty($storeSession->cname)) {
         $this->view->storeId = $storeSession->sid;
         $this->view->storeName = $storeSession->sname;
     }
     $this->modelBooks = new Publisher_Model_DbTable_Books();
     $this->view->modelBooks = $this->modelBooks;
     $allStored = $this->modelBooks->getAllStores();
     $this->view->allStored = $allStored;
 }
Example #25
0
 public function logoutAction()
 {
     $storage = new Zend_Auth_Storage_Session('company_type');
     $storage->clear();
     $this->_flashMessenger->addMessage('<div class="div-success">You have logged out successfully</div>');
     $this->_redirect('company/auth/');
 }
Example #26
0
 public function init()
 {
     /*********** To check for publisher session data *********************/
     $storage_publisher = new Zend_Auth_Storage_Session('publisher_type');
     $publisher_data = $storage_publisher->read();
     $storage_company = new Zend_Auth_Storage_Session('company_type');
     $company_data = $storage_company->read();
     $storage = new Zend_Auth_Storage_Session('account_type');
     $userSessData = $storage->read();
     if ($publisher_data && $publisher_data != null) {
         $this->modelPublisher = new Model_DbTable_Users();
         $this->sessPublisherInfo = $this->modelPublisher->getInfoByUserId($publisher_data->id);
         $this->view->sessPublisherInfo = $this->sessPublisherInfo;
     } elseif ($company_data && $company_data != null) {
         $this->modelCompany = new Model_DbTable_Companies();
         $this->sessCompanyInfo = $this->modelCompany->getInfoByUserId($company_data->id);
         $this->view->sessCompanyInfo = $this->sessCompanyInfo;
     } elseif ($userSessData && $userSessData != null) {
         $this->modelCompanies = new Company_Model_DbTable_Companies();
         $this->sessUserInfo = $this->modelCompanies->getInfoByCompanyId($userSessData->id);
         $this->view->sessUserInfo = $this->sessUserInfo;
     }
     $this->modelFaqs = new Model_DbTable_Faqs();
     /************* To Set The active section and links *******************/
     $controller = $this->_getParam('controller');
     $action = $this->_getParam('action');
     $title = $this->_getParam('title');
     $this->view->currentController = $controller;
     $this->view->currentAction = $action;
     $this->view->currentTitle = $title;
     $this->view->class_active = 'class="active"';
     /************* To Set The active section and links *******************/
     $this->view->headScript()->appendFile($this->view->serverUrl() . $this->view->baseUrl() . '/public/css/default/js/jquery.accordion.source.js');
     /******************************************************************/
     //$storeId=$this->getRequest()->getCookie('sid');
     //$storeName=$this->getRequest()->getCookie('sname');
     $storeSession = new Zend_Session_Namespace('storeInfo');
     if (!empty($storeSession->sid) && !empty($storeSession->sid) && !empty($storeSession->sname) && !empty($storeSession->sid) && !empty($storeSession->cid) && !empty($storeSession->cname)) {
         $this->view->storeId = $storeSession->sid;
         $this->view->storeName = $storeSession->sname;
     } else {
         //$modelCountry = new Admin_Model_DbTable_Countries();
         //$country_info = $modelCountry->fetchRow('country="Nigeria"');
         //$this->_redirect('/auth/storechange/storeid/'.$country_info->id);
         $this->_redirect('/auth/storechange/');
     }
     $storeSession = new Zend_Session_Namespace('storeInfo');
     if (!empty($storeSession->sid) && !empty($storeSession->sid) && !empty($storeSession->sname) && !empty($storeSession->sid) && !empty($storeSession->cid) && !empty($storeSession->cname)) {
         $this->view->storeId = $storeSession->sid;
         $this->view->storeName = $storeSession->sname;
     }
     /******************************************************************/
     $this->modelBooks = new Publisher_Model_DbTable_Books();
     $this->view->modelBooks = $this->modelBooks;
     $allStored = $this->modelBooks->getAllStores();
     $this->view->allStored = $allStored;
 }
Example #27
0
 public function indexAction()
 {
     $this->view->title = 'Meeting';
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
 }
Example #28
0
 public function indexAction()
 {
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $this->view->pageTitle = 'Management';
 }
Example #29
0
 public function indexAction()
 {
     $this->view->messages = $this->_flashMessenger->getMessages();
     $this->_helper->layout->disableLayout();
     $storage = new Zend_Auth_Storage_Session('publisher_type');
     $data = $storage->read();
     $formData = $this->getRequest()->getPost();
     if (isset($formData['searchword']) && (trim($formData['searchword']) != "" || trim($formData['booktype']) != "")) {
         $bookname = trim($formData['searchword']);
         $booktype = trim($formData['booktype']);
         $getBrandIds = $this->modelBrand->getBrandIds($bookname);
         $whrcls = "";
         if ($bookname != "") {
             $whrcls .= " p.title LIKE '%" . $bookname . "%'";
             if (!empty($getBrandIds)) {
                 $whrcls .= " OR p.title in(" . $getBrandIds . ")";
             }
         }
         if ($booktype != "") {
             if ($bookname != "") {
                 $whrcls .= " AND p.product_type LIKE '%" . $booktype . "%'";
             } else {
                 // $whrcls.=" p.product_type LIKE '%".$booktype."%'";
                 $whrcls .= " p.product_type='" . $booktype . "'";
             }
         }
         $bookList = $this->modelBooks->getList($this->parentPublisherId, $whrcls);
     } else {
         if ($data->user_type == 'Pmanager' || $data->user_type == 'Amanager') {
             $where = "";
             $groupPublicationsList = $this->modelPublisher->getAssignPublicationsList($this->sessPublisherInfo->id);
             foreach ($groupPublicationsList as $group_pub_ids) {
                 $publisher_id .= $group_pub_ids['product_id'] . ",";
             }
             $publisher_id = rtrim($publisher_id, ",");
             $where = " id in (" . $publisher_id . ") OR parent_brand_id in (" . $publisher_id . ")";
         }
         if ($publisher_id != '') {
             $bookList = $this->modelBooks->getListGroupUser($this->parentPublisherId, $where);
         } else {
             $bookList = $this->modelBooks->getList($this->parentPublisherId);
         }
     }
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($bookList);
     $paginator->setItemCountPerPage(10);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalCount = count($bookList);
     $this->view->pageSize = 10;
     $this->view->page = $page;
     $this->view->bookList = $paginator;
     $this->view->parentPublisherId = $this->parentPublisherId;
     $this->view->formData = $formData;
 }
Example #30
0
 public function indexAction()
 {
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $this->view->title = "Maintenance";
     $Transaction = $this->view->dayendobject->transactionByDate();
     $this->view->transaction = $Transaction;
 }