Exemplo n.º 1
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();
 }
Exemplo n.º 2
0
 public function dynamicaction()
 {
     $act = new App_Model_Users();
     $module = array('institution', 'bank', 'roles', 'user', 'funderdetails', 'fundings', 'fee', 'sectors', 'activity');
     $m = 0;
     $j = 0;
     $lableName = array("Index", "Add Institution", "Edit Institution", "View Institution", "Delete Institution", "Index", "Add Bank", "Edit Bank", "View Bank", "Delete Bank", "Index", "Add Roles", "Edit Roles", "View Roles", "Delete Roles", "Index", "Add User", "Edit User", "View User", "Delete user", "Index", "Add Funder", "Edit Funder", "View Funder", "Delete Funder", "Index", "Add Fundings", "Edit Fundings", "View Fundings", "Delete Fundings", "Index", "Add Fee", "Edit Fee", "View Fee", "Delete Fee", "Index", "Add Sector", "Edit Sector", "View Sector", "Delete Sector", "Index", "Add Activity", "Edit Activity", "View Activity", "Delete Activity");
     $act = new App_Model_Users();
     $acivitycount = count($act->getActivity());
     if ($acivitycount != 36) {
         foreach ($module as $module) {
             $m++;
             $test = new DH_ClassInfo(APPLICATION_PATH . '/modules/' . $module . '/controllers/');
             $ActionNames = $test->getActionNames();
             foreach ($ActionNames as $key => $value) {
                 if ($key != $module . "_IndexController") {
                     $i = 0;
                     foreach ($value as $name) {
                         if ($i != 0) {
                             //                                 substr($name, 0, -6)
                             $n2 = $act->insertAct(array('activity_name' => $lableName[$j], 'activity_description' => $name, 'recordstatus_id' => 3, 'module_id' => 1, 'submodule_id' => $m));
                         }
                         $i++;
                         $j++;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 public function init()
 {
     $this->view->pageTitle = 'Category';
     $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();
     $dbobj = new Category_Model_Category();
     $categoryvalues = $dbobj->getAllCategory();
     $name = array('Savings', 'Loan');
     $desc = array('For savings products', 'For loan products');
     if (empty($categoryvalues)) {
         for ($i = 0; $i <= 1; $i++) {
             $dbobj->insertbaseCategory(array('id' => '', 'name' => $name[$i], 'description' => $desc[$i], 'created_by' => 1, 'created_date' => date("Y-m-d")));
         }
     }
 }
Exemplo n.º 4
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();
 }
Exemplo n.º 5
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();
 }
Exemplo n.º 6
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();
 }
Exemplo n.º 7
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'];
 }
 public function loginAction()
 {
     $this->_helper->layout->setLayout('login');
     $form = new App_Form_Auth_LoginForm();
     $form->setAction('/auth/login');
     $this->view->formResponse = '';
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $formData = $this->_getFormData();
             $authAdapter = $this->_getAuthAdapter($formData);
             $auth = Zend_Auth::getInstance();
             $result = $auth->authenticate($authAdapter);
             if (!$result->isValid()) {
                 $this->view->message = 'Sorry, there was a problem with your submission. Please check the following:';
             } else {
                 $data = $authAdapter->getResultRowObject(null, 'password');
                 $visits = new App_Model_Users();
                 $visits->addVisit($data->id);
                 $auth->getStorage()->write($data);
                 $this->_redirect($this->_redirectUrl);
             }
         } else {
             // ensure that the Auth adapter is cleared
             $auth = Zend_Auth::getInstance();
             $auth->clearIdentity();
             $this->view->formResponse = 'Sorry, there was a problem with your submission. Please check the following:';
             $form->populate($_POST);
         }
     }
     $this->view->form = $form;
 }
Exemplo n.º 9
0
 public function init()
 {
     $this->view->pageTitle = 'Roles';
     $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');
     }
     //  $login=new App_Model_Users();
     //                 $loginname=$login->username($userid);
     //                 foreach($loginname as $loginname) {
     // 	           $this->view->primaryid=$loginname['user_id'];
     // 		   $this->view->id=$loginname['id'];
     //                    $this->view->username=$loginname['username'];
     // 		   $this->view->primaryrole=$loginname['grantname'];
     //                 }
     // 		$dynamic = new App_Model_Dynamic ();
     //        		$dynamic->dynamicaction();
     // create common object for adm model page
     $this->view->adm = new App_Model_Adm();
 }
Exemplo n.º 10
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));
     }
 }
Exemplo n.º 11
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]);
 }
Exemplo n.º 12
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;
 }
Exemplo n.º 13
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'];
 }
Exemplo n.º 14
0
 public function init()
 {
     $this->view->title = "Savings";
     $this->view->pageTitle = "Member saving details";
     $this->view->type = 'savings';
     $this->view->savingsModel = new Savingsdeposit_Model_Savingsdeposit();
     $this->view->cl = new App_Model_dateConvertor();
     $this->view->adm = new App_Model_Adm();
     $this->view->psdetails = new Psdetails_Model_Savingsdeposit();
     $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
     $log = new App_Model_Users();
     $loginname = $log->username($userid);
     foreach ($loginname as $loginname) {
         $this->view->username = $loginname['username'];
         // get the user name
     }
 }
Exemplo n.º 15
0
 public function init()
 {
     $this->view->pageTitle = "Loans";
     $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();
     $dbobj = new Loans_Model_Loan();
     $glcodevalues = $dbobj->getAllGlcode();
     $name = array('loan');
     $saving = "not exist";
     foreach ($glcodevalues as $glcodes) {
         if (in_array($glcodes->header, $name)) {
             $saving = "exist";
         }
     }
     $desc = array('for loan');
     if ($saving == "not exist") {
         for ($i = 0; $i < 1; $i++) {
             $Ledgertypeid = $this->view->adm->getsingleRecord('ourbank_master_ledgertypes', 'id', 'name', 'Assets');
             // Get id for Liability
             $generateGl = $dbobj->generateGlCode($Ledgertypeid);
             // get Maximum value for particular ledger
             $glCode = $generateGl->id;
             $result = $this->view->adm->getRecord('ourbank_master_ledgertypes', 'id', $Ledgertypeid);
             // Get id for Liability
             foreach ($result as $result1) {
                 $headerCon = substr($result1['name'], 0, 1);
             }
             if ($glCode) {
                 $fetchGlcode = $this->view->adm->getsingleRecord('ourbank_glcode', 'glcode', 'id', $glCode);
                 // Get glcode
                 $glCode = substr($fetchGlcode, 1, 2);
                 $glcodeId = str_pad($headerCon . str_pad($glCode + 1, 2, 0, STR_PAD_LEFT), 8 - strlen($glCode), "0");
                 $glcode = $glcodeId;
             } else {
                 $glcodeId = str_pad($headerCon . "01", 6, "0");
                 $glcode = $glcodeId;
             }
             $dbobj->insertGlcode(array('id' => '', 'glcode' => $glcode, 'ledgertype_id' => $Ledgertypeid, 'header' => $name[$i], 'description' => $desc[$i], 'created_date' => date("Y-m-d"), 'created_by' => $this->view->createdby));
         }
     }
 }
Exemplo n.º 16
0
 public function init()
 {
     $this->view->pageTitle = 'Maintenance';
     $users = new App_Model_Users();
     $this->view->createdby = $users->checkSession();
     if ($this->view->createdby == 0) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $this->view->adm = new App_Model_Adm();
     $this->view->dayendobject = new Maintenance_Model_Dayend();
 }
Exemplo n.º 17
0
 public function init()
 {
     $this->view->pageTitle = 'Settings';
     $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');
     }
 }
Exemplo n.º 18
0
 public function accessRights($resource, $role, $action)
 {
     $identity = Zend_Auth::getInstance()->getIdentity();
     $resmodel = new App_Model_Users();
     $this->resourceid = $resmodel->getResource($resource);
     $this->roleid = $resmodel->getRole($role);
     $db = Zend_Db_Table::getDefaultAdapter();
     $access = $db->fetchOne("SELECT \n                                    a.activity_id as activity_id\n                                    FROM \n                                    ob_grantactivites a,\n                                    ob_subactivity b\n                                    where a.submodule_id='" . $this->resourceid . "' and \n                                    a.grant_id='" . $this->roleid . "' and \n                                    a.activity_id = b.activity_id and\n                                    b.activity_description = '" . $action . "'");
     if ($access['activity_id']) {
         $accessid = 1;
         return $accessid;
     } else {
         $accessid = 0;
         return $accessid;
     }
 }
Exemplo n.º 19
0
 function init()
 {
     $this->view->pageTitle = "Summary of MFI";
     $this->view->type = "generalFields";
     $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');
     }
     $this->view->adm = new App_Model_Adm();
 }
Exemplo n.º 20
0
 public function init()
 {
     //it is create session and implement ACL concept...
     $this->view->pageTitle = $this->view->translate('Health');
     $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'];
     $storage = new Zend_Auth_Storage_Session();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $this->view->adm = new App_Model_Adm();
     $this->view->familycommon = new Familycommonview_Model_familycommonview();
 }
Exemplo n.º 21
0
 public function init()
 {
     $this->view->pageTitle = 'Month end';
     $this->view->adm = new App_Model_Adm();
     $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();
     $this->view->dateconvector = new App_Model_dateConvertor();
     $data = $storage->read();
     if (!$data) {
         $this->_redirect('index/login');
     }
     $this->view->monthmodle = new Monthend_Model_Transaction();
 }
Exemplo n.º 22
0
 function init()
 {
     $this->view->pageTitle = "Individual / Group Savings ledger";
     $this->view->tilte = "Reports";
     $this->view->type = "generalFields";
     $this->view->dateconvert = new App_Model_dateConvertor();
     $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');
     }
 }
Exemplo n.º 23
0
 public function init()
 {
     $this->view->pageTitle = 'Holiday';
     $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
     }
 }
Exemplo n.º 24
0
 public function init()
 {
     $this->view->title = "Reports";
     $this->view->pageTitle = "Loans ledger";
     $this->view->type = "generalFields";
     $this->view->loanModel = new Loanledger_Model_loandetails();
     $this->view->cl = new App_Model_Users();
     $this->view->adm = new App_Model_Adm();
     $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');
     }
 }
Exemplo n.º 25
0
 public function init()
 {
     //to change language
     $this->view->pageTitle = $this->view->translate("Funder");
     $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');
     }
     //         if (($this->view->globalvalue[0]['id'] == 0)) {
     //         $this->_redirect('index/logout');
     //         }
     $this->view->adm = new App_Model_Adm();
 }
Exemplo n.º 26
0
 public function init()
 {
     $this->view->pageTitle = 'Community 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
     }
 }
Exemplo n.º 27
0
 public function editAction()
 {
     $request = $this->getRequest();
     $form = new Admin_Form_Users_Edit();
     $id = (int) $this->getRequest()->getParam('id');
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($request->getPost())) {
             $model = new App_Model_Users();
             $model->updateUser($form->getValues(), $id);
             $this->_helper->flashMessenger->addMessage('Edited');
             return $this->_redirect('/admin/users');
         }
     }
     if ($id > 0) {
         $news = new App_Model_Users();
         $ad = $news->fetchRow('id=' . $id);
         $form->populate($ad->toArray());
     }
     $this->view->form = $form;
 }
Exemplo n.º 28
0
 public function __construct()
 {
     /*
      * Need to implement these features .Roles,Resources and Access
      */
     /*
      *  Roles
      *
      */
     $db = Zend_Db_Table::getDefaultAdapter();
     $roles = $db->fetchAll("select grantname from ob_grant");
     foreach ($roles as $role) {
         $this->addRole(new Zend_Acl_Role($role['grantname']));
     }
     // Eg. admin, manager
     /*
      *  Resources
      *
      */
     $db = Zend_Db_Table::getDefaultAdapter();
     $resources = $db->fetchAll("select submodule_description from ob_submodule");
     foreach ($resources as $resources) {
         $this->add(new Zend_Acl_Resource($resources['submodule_description']));
     }
     // folder name management---->
     /*
      *  Access
      *
      */
     $rolenames = new App_Model_Users();
     $db = Zend_Db_Table::getDefaultAdapter();
     $access = $db->fetchAll("SELECT B.grant_id,\n \t\t                                 B.submodule_id,\n \t\t                                 C.activity_id\n \t\t                                 FROM\n \t\t                                 ob_grantactivites B,\n \t\t                                 ob_subactivity C\n \t\t                                 where\n \t\t                                 C.activity_id = B.activity_id");
     //edit,view,___,
     foreach ($access as $access) {
         if ($access["activity_id"]) {
             $this->allow($rolenames->getRoleName($access["grant_id"]), $rolenames->getResourceName($access["submodule_id"]), 1);
         } else {
             $this->deny($rolenames->getRoleName($access["grant_id"]), $rolenames->getResourceName($access["submodule_id"]), 0);
         }
     }
 }
Exemplo n.º 29
0
 public function init()
 {
     $this->view->pageTitle = 'Product';
     $users = new App_Model_Users();
     $this->view->createdby = $users->checkSession();
     if ($this->view->createdby == 0) {
         $this->_redirect('index/login');
         // once session get expired it will redirect to Login page
     }
     $this->view->adm = new App_Model_Adm();
     $dbobj = new Product_Model_Product();
     $productvalues = $dbobj->getAllProduct();
     $name = array('personal saving', 'fixed deposit', 'recurring deposit');
     $shortname = array('ps', 'fd', 'rd');
     $desc = array('for Personal savings', 'for fixed deposit', 'for recurring deposit');
     if (empty($productvalues)) {
         for ($i = 0; $i <= 2; $i++) {
             $dbobj->insertbaseProduct(array('id' => '', 'name' => $name[$i], 'shortname' => $shortname[$i], 'category_id' => '1', 'description' => $desc[$i], 'created_by' => $this->view->createdby, 'created_date' => date("Y-m-d")));
         }
     }
 }
Exemplo n.º 30
0
 function init()
 {
     $this->view->pageTitle = $this->view->translate('Loan Supplementary');
     $this->view->title = $this->view->translate('Reports');
     $this->view->type = "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
     }
 }