/**
  * Método principal
  */
 public function index()
 {
     $pais = new Pais();
     $estado = new Estado();
     $municipio = new Municipio();
     if (Input::hasPost('empresa')) {
         if (DwSecurity::isValidKey(Input::post('empresa_id_key'), 'form_key')) {
             if (Empresa::setEmpresa('save', Input::post('empresa'))) {
                 DwMessage::valid('Los datos se han actualizado correctamente');
             } else {
                 DwMessage::get('error_form');
             }
         }
     }
     $empresa = new Empresa();
     if (!$empresa->getInformacionEmpresa()) {
         DwMessage::get('id_no_found');
         return DwRedirect::toRoute('module: dashboard', 'controller: index');
     }
     if (!APP_OFFICE) {
         $sucursal = new Sucursal();
         $this->sucursal = $sucursal->getInformacionSucursal(1);
         $this->ciudades = Load::model('params/ciudad')->getCiudadesToJson();
     }
     $this->empresa = $empresa;
     $this->pais = $pais->getListadoPais();
     $this->estado = $estado->getListadoEstado();
     $this->municipio = $municipio->getListadoMunicipio();
     $this->page_title = 'Información de la empresa';
 }
 /**
  * Método para verificar la conexión de la bd
  */
 public function test()
 {
     if (!Input::isAjax()) {
         DwMessage::error('Acceso incorrecto para la verificación del sistema.');
         return DwRedirect::toRoute('module: dashboard', 'controller: index');
     }
     if (!Input::hasPost('development') or !Input::hasPost('production')) {
         DwMessage::error('Oops!. No hemos recibido algún parámetro de configuración.');
     } else {
         if (Input::hasPost('development')) {
             Sistema::testConnection(Input::post('development'), 'development', true);
         }
         if (Input::hasPost('production')) {
             Sistema::testConnection(Input::post('production'), 'production', true);
         }
     }
     View::ajax();
 }