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 delete(Gyuser_Model_Admin $obj) { try { $table = $this->getDbTable(); $set = array('status' => 0); $where = array('id = ?' => $obj->getId()); $result = $table->update($set, $where); return $result; } 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 gysaveajaxAction() { try { $request = $this->getRequest(); if ($this->getRequest()->isPost()) { $mapper = new Gyuser_Model_AdminDataMapper(); $Obj = new Gyuser_Model_Admin(); $Obj->setId($request->id); $Obj->setTiempo_ac_capital($request->tiempo_ac_capital); $Obj->setTiempo_ac_interior($request->tiempo_ac_interior); $Obj->setTiempo_ac_sistema($request->tiempo_ac_sistema); $Obj->setGastos_denuncia($request->gastos_denuncia); $Obj->setGastos_rechazo($request->gastos_rechazo); $Obj->setGastos_general($request->gastos_general); $Obj->setGastos_interior($request->gastos_interior); $Obj->setImpuesto_al_cheque($request->impuesto_al_cheque); $Obj->setCrm_operation_notify_span($request->crm_operation_notify_span); if ($request->id) { $Obj->setId($request->id); } $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $id = $mapper->save($Obj); if ($id) { echo $id; } else { echo "f"; } } } 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; }