Esempio n. 1
0
 public function getAdminSettings()
 {
     $table = $this->getDbTable();
     $select = $table->select();
     $select->from($table, array('id', 'rejected_type_1_name', 'rejected_type_2_name', 'tiempo_ac_capital', 'tiempo_ac_interior', 'tiempo_ac_sistema', 'gastos_denuncia', 'gastos_rechazo', 'gastos_general', 'gastos_interior', 'impuesto_al_cheque', 'crm_operation_notify_span', 'mail_informes'));
     $select->where('status = ?', true);
     $select->where('id = 1');
     $row = $table->fetchRow($select);
     $entry = null;
     if ($row) {
         $entry = new Gyuser_Model_Admin();
         $entry->setId($row->id);
         //$entry->setRejected_type_1_cost($row->rejected_type_1_cost);
         $entry->setRejected_type_1_name($row->rejected_type_1_name);
         //$entry->setRejected_type_2_cost($row->rejected_type_2_cost);
         $entry->setRejected_type_2_name($row->rejected_type_2_name);
         $entry->setTiempo_ac_capital($row->tiempo_ac_capital);
         $entry->setTiempo_ac_interior($row->tiempo_ac_interior);
         $entry->setTiempo_ac_sistema($row->tiempo_ac_sistema);
         $entry->setGastos_denuncia($row->gastos_denuncia);
         $entry->setGastos_rechazo($row->gastos_rechazo);
         $entry->setGastos_general($row->gastos_general);
         $entry->setGastos_interior($row->gastos_interior);
         $entry->setImpuesto_al_cheque($row->impuesto_al_cheque);
         $entry->setCrm_operation_notify_span($row->crm_operation_notify_span);
         $entry->setMail_informes($row->mail_informes);
     }
     return $entry;
 }
Esempio n. 2
0
 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;
     }
 }