public function indexAction() { try { $cMapper = new Gyuser_Model_ClientTypesDataMapper(); $cList = $cMapper->fetchAll(); $adminObj = new Gyuser_Model_Admin(); $adminObj->setId(1); $adminMapper = new Gyuser_Model_AdminDataMapper(); $adminObj = $adminMapper->find($adminObj); $userType = new Gyuser_Model_UserType(); $this->view->admin = $adminObj; $this->view->authDetail = $this->authDetail; } catch (Exception $e) { echo $e; } }
public function ChangeStatusAsPaidByTimeOverFlow() { //Initialize admin obj $adminMapper = new Gyuser_Model_AdminDataMapper(); $adminObj = new Gyuser_Model_Admin(); $adminObj->setId(1); $adminObj = $adminMapper->find($adminObj); $acreditation_hrs = $adminObj->getTiempo_ac_sistema(); $acreditation_days = round($acreditation_hrs / 24); $current_ac_date = mktime(0, 0, 0, date("m"), date("d") - $acreditation_days, date("Y")); $current_ac_date = date("Y-m-d", $current_ac_date); $currentDate = date("d/m/Y"); //$Tiempo_ac_capital = $adminObj->getTiempo_ac_capital(); //$Tiempo_ac_interior = $adminObj->getTiempo_ac_interior(); $table = $this->getDbTable(); $select = $table->select(); $select->setIntegrityCheck(false); $select->from(array('sls' => 'cheques'), array('id', 'client_id', 'operation_id', 'date', 'status', 'liquidacion_id', 'check_zip_code')); $select->joinLeft('operations', 'operations.id = sls.operation_id', array('client_id')); $select->where('sls.status = 1 OR sls.status = 4'); $select->where('operations.client_id IS NOT NULL'); //to avoid the checks that are not attached to an operation $select->where('sls.date <= ?', $current_ac_date); $resultSet = $table->fetchAll($select); foreach ($resultSet as $row) { if ($row->operation_id == 433) { $varTemp = true; } $this->setChequeStatusToPaid($row->id, $row->operation_id, $row->client_id); } }
public function adminAction() { try { $sessionNamespace = new Zend_Session_Namespace(); if ($sessionNamespace->loginAuth == true) { /* $cMapper = new Gyuser_Model_OtherCavesDataMapper(); $cObj = new Gyuser_Model_OtherCaves(); $cObj->setId(1); $cList = $cMapper->GetCaveById($cObj); $this->view->cList = $cList; $sMapper = new Gyuser_Model_SupplierOperationsDataMapper(); $sList = $sMapper->GetAllSuppliers(); */ $provMapper = new Gyuser_Model_ProvidersDataMapper(); $this->view->sList = $provMapper->getProviders(); $aMapper = new Gyuser_Model_AdminDataMapper(); $aObj = new Gyuser_Model_Admin(); $aObj->setId(1); $this->view->admin = $aMapper->find($aObj); $cMapper = new Gyuser_Model_ChequesDataMapper(); $cObj = new Gyuser_Model_Cheques(); $cObj->setStatus(1); $this->view->ctAmount = $cMapper->GetTotalAmountByStats($cObj); $cObj->setStatus(4); $this->view->cpAmount = $cMapper->GetTotalAmountByStats($cObj); } else { $this->_helper->redirector('login', 'index', 'gyuser'); } } catch (Exception $e) { echo $e; } }
public function GetAcreditacionHrsByOperationId(Gyuser_Model_Operations $obj) { $arc_hrs = 0; $table = $this->getDbTable(); $select = $table->select(); $select->setIntegrityCheck(false); $select->from(array('ops' => 'operations'), array('id', 'bank_account_id')); $select->joinInner(array('bks' => 'bank_accounts'), 'ops.bank_account_id = bks.id', array('location_capital')); $select->where('ops.id = ?', $obj->getId()); $row = $table->fetchRow($select); $location_capital = $row->location_capital; $adminMapper = new Gyuser_Model_AdminDataMapper(); $adminObj = new Gyuser_Model_Admin(); $adminObj->setId(1); $adminObj = $adminMapper->find($adminObj); if ($location_capital == 1) { $arc_hrs = $adminObj->getTiempo_ac_capital(); } else { if ($location_capital == 2) { $arc_hrs = $adminObj->getTiempo_ac_interior(); } } return $arc_hrs; }