Ejemplo n.º 1
0
 /**
  * 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';
 }
Ejemplo n.º 2
0
 public function grabar()
 {
     $sql = "";
     $count = 0;
     if (!$this->_existe) {
         $this->cve_calendario = UtilDB::getSiguienteNumero("calendario_actividades", "cve_calendario");
         $sql = "INSERT INTO calendario_actividades VALUES({$this->cve_calendario}," . $this->cve_actividad->getCve_actividad() . ",'{$this->fecha_inicio}','{$this->fecha_fin}','{$this->lugar}'," . $this->cve_municipio->getCve_estado()->getCve_estado() . "," . $this->cve_municipio->getCve_municipio() . ",NULL,{$this->precio},{$this->cupo_maximo},'{$this->observaciones}',NOW(),{$this->activo})";
         $count = UtilDB::ejecutaSQL($sql);
         if ($count > 0) {
             $this->_existe = true;
         }
     } else {
         $sql = "UPDATE calendario_actividades SET ";
         $sql .= "cve_actividad = " . $this->cve_actividad->getCve_actividad() . ",";
         $sql .= "fecha_inicio = '{$this->fecha_inicio}',";
         $sql .= "fecha_fin = '{$this->fecha_fin}',";
         $sql .= "lugar = '{$this->lugar}',";
         $sql .= "cve_estado = " . $this->cve_municipio->getCve_estado()->getCve_estado() . ",";
         $sql .= "cve_municipio = " . $this->cve_municipio->getCve_municipio() . ",";
         //$sql.= "imagen_portada = '$this->imagen_portada',";
         $sql .= "precio = {$this->precio},";
         $sql .= "cupo_maximo = {$this->cupo_maximo},";
         $sql .= "observaciones = '{$this->observaciones}',";
         $sql .= "activo=" . ($this->activo ? "1" : "0");
         $sql .= " WHERE cve_calendario = {$this->cve_calendario}";
         $count = UtilDB::ejecutaSQL($sql);
     }
     return $count;
 }
 /**
  * {@inheritDoc}
  */
 public function getEspacialidadesById($id)
 {
     $sql = $this->getSqlById($id);
     $this->bd->execSql($sql);
     while ($row = $this->bd->proximo()) {
         $obj = new Municipio();
         $obj->setId($row->mun_id);
         $obj->setNome($row->nome);
         $obj->setGeoJson($row->geo_json);
         $this->addEspacialidade($obj);
     }
     return $this;
 }
Ejemplo n.º 4
0
 public function run()
 {
     $municipios = [['estado_id' => 1, 'nombre' => 'CE. BLVNO LIBERTADOR'], ['estado_id' => 2, 'nombre' => 'MP. ANACO'], ['estado_id' => 2, 'nombre' => 'MP. ARAGUA'], ['estado_id' => 2, 'nombre' => 'CE. BOLIVAR'], ['estado_id' => 2, 'nombre' => 'MP. BRUZUAL'], ['estado_id' => 2, 'nombre' => 'MP. CAJIGAL'], ['estado_id' => 2, 'nombre' => 'MP. FREITES'], ['estado_id' => 2, 'nombre' => 'MP. INDEPENDENCIA'], ['estado_id' => 2, 'nombre' => 'MP. LIBERTAD'], ['estado_id' => 2, 'nombre' => 'MP. MIRANDA'], ['estado_id' => 2, 'nombre' => 'MP. MONAGAS'], ['estado_id' => 2, 'nombre' => 'MP. PE#ALVER'], ['estado_id' => 2, 'nombre' => 'MP. SIMON RODRIGUEZ'], ['estado_id' => 2, 'nombre' => 'MP. SOTILLO'], ['estado_id' => 2, 'nombre' => 'MP. GUANIPA'], ['estado_id' => 2, 'nombre' => 'MP. GUANTA'], ['estado_id' => 2, 'nombre' => 'MP. PIRITU'], ['estado_id' => 2, 'nombre' => 'MP. L/DIEGO BAUTISTA'], ['estado_id' => 2, 'nombre' => 'MP. CARVAJAL'], ['estado_id' => 2, 'nombre' => 'MP. SANTA ANA'], ['estado_id' => 2, 'nombre' => 'MP. MC GREGOR'], ['estado_id' => 2, 'nombre' => 'MP.S JUAN CAPISTRANO'], ['estado_id' => 3, 'nombre' => 'MP. ACHAGUAS'], ['estado_id' => 3, 'nombre' => 'MP. MU#OZ'], ['estado_id' => 3, 'nombre' => 'MP. PAEZ'], ['estado_id' => 3, 'nombre' => 'MP. PEDRO CAMEJO'], ['estado_id' => 3, 'nombre' => 'MP. ROMULO GALLEGOS'], ['estado_id' => 3, 'nombre' => 'CE. SAN FERNANDO'], ['estado_id' => 3, 'nombre' => 'MP. BIRUACA'], ['estado_id' => 4, 'nombre' => 'CE. GIRARDOT'], ['estado_id' => 4, 'nombre' => 'MP. SANTIAGO MARI#O'], ['estado_id' => 4, 'nombre' => 'MP. JOSE FELIX RIVAS'], ['estado_id' => 4, 'nombre' => 'MP. SAN CASIMIRO'], ['estado_id' => 4, 'nombre' => 'MP. SAN SEBASTIAN'], ['estado_id' => 4, 'nombre' => 'MP. SUCRE'], ['estado_id' => 4, 'nombre' => 'MP. URDANETA'], ['estado_id' => 4, 'nombre' => 'MP. ZAMORA'], ['estado_id' => 4, 'nombre' => 'MP. LIBERTADOR'], ['estado_id' => 4, 'nombre' => 'MP. JOSE ANGEL LAMAS'], ['estado_id' => 4, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 4, 'nombre' => 'MP. SANTOS MICHELENA'], ['estado_id' => 4, 'nombre' => 'MP. MARIO B IRAGORRY'], ['estado_id' => 4, 'nombre' => 'MP. TOVAR'], ['estado_id' => 4, 'nombre' => 'MP. CAMATAGUA'], ['estado_id' => 4, 'nombre' => 'MP. JOSE R REVENGA'], ['estado_id' => 4, 'nombre' => 'MP.FRANCISCO LINARES'], ['estado_id' => 4, 'nombre' => 'MP.OCUMARE D L COSTA'], ['estado_id' => 5, 'nombre' => 'MP. ARISMENDI'], ['estado_id' => 5, 'nombre' => 'CE. BARINAS'], ['estado_id' => 5, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 5, 'nombre' => 'MP. EZEQUIEL ZAMORA'], ['estado_id' => 5, 'nombre' => 'MP. OBISPOS'], ['estado_id' => 5, 'nombre' => 'MP. PEDRAZA'], ['estado_id' => 5, 'nombre' => 'MP. ROJAS'], ['estado_id' => 5, 'nombre' => 'MP. SOSA'], ['estado_id' => 5, 'nombre' => 'MP. ALBERTO ARVELO T'], ['estado_id' => 5, 'nombre' => 'MP. A JOSE DE SUCRE'], ['estado_id' => 5, 'nombre' => 'MP. CRUZ PAREDES'], ['estado_id' => 5, 'nombre' => 'MP. ANDRES E. BLANCO'], ['estado_id' => 6, 'nombre' => 'MP. CARONI'], ['estado_id' => 6, 'nombre' => 'MP. CEDE#O'], ['estado_id' => 6, 'nombre' => 'CE. HERES'], ['estado_id' => 6, 'nombre' => 'MP. PIAR'], ['estado_id' => 6, 'nombre' => 'MP. ROSCIO'], ['estado_id' => 6, 'nombre' => 'MP. SUCRE'], ['estado_id' => 6, 'nombre' => 'MP. SIFONTES'], ['estado_id' => 6, 'nombre' => 'MP. BLVNO ANGOSTURA'], ['estado_id' => 6, 'nombre' => 'MP. GRAN SABANA'], ['estado_id' => 6, 'nombre' => 'MP. EL CALLAO'], ['estado_id' => 6, 'nombre' => 'MP.PADRE PEDRO CHIEN'], ['estado_id' => 7, 'nombre' => 'MP. BEJUMA'], ['estado_id' => 7, 'nombre' => 'MP. CARLOS ARVELO'], ['estado_id' => 7, 'nombre' => 'MP. DIEGO IBARRA'], ['estado_id' => 7, 'nombre' => 'MP. GUACARA'], ['estado_id' => 7, 'nombre' => 'MP. MONTALBAN'], ['estado_id' => 7, 'nombre' => 'MP. JUAN JOSE MORA'], ['estado_id' => 7, 'nombre' => 'MP. PUERTO CABELLO'], ['estado_id' => 7, 'nombre' => 'MP. SAN JOAQUIN'], ['estado_id' => 7, 'nombre' => 'CE. VALENCIA'], ['estado_id' => 7, 'nombre' => 'MP. MIRANDA'], ['estado_id' => 7, 'nombre' => 'MP. LOS GUAYOS'], ['estado_id' => 7, 'nombre' => 'MP. NAGUANAGUA'], ['estado_id' => 7, 'nombre' => 'MP. SAN DIEGO'], ['estado_id' => 7, 'nombre' => 'MP. LIBERTADOR'], ['estado_id' => 8, 'nombre' => 'MP. ANZOATEGUI'], ['estado_id' => 8, 'nombre' => 'MP. FALCON'], ['estado_id' => 8, 'nombre' => 'MP. GIRARDOT'], ['estado_id' => 8, 'nombre' => 'MP. PAO S J BAUTISTA'], ['estado_id' => 8, 'nombre' => 'MP. RICAURTE'], ['estado_id' => 8, 'nombre' => 'CE. EZEQUIEL ZAMORA'], ['estado_id' => 8, 'nombre' => 'MP. TINACO'], ['estado_id' => 8, 'nombre' => 'MP. LIMA BLANCO'], ['estado_id' => 8, 'nombre' => 'MP. ROMULO GALLEGOS'], ['estado_id' => 9, 'nombre' => 'MP. ACOSTA'], ['estado_id' => 9, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 9, 'nombre' => 'MP. BUCHIVACOA'], ['estado_id' => 9, 'nombre' => 'MP. CARIRUBANA'], ['estado_id' => 9, 'nombre' => 'MP. COLINA'], ['estado_id' => 9, 'nombre' => 'MP. DEMOCRACIA'], ['estado_id' => 9, 'nombre' => 'MP. FALCON'], ['estado_id' => 9, 'nombre' => 'MP. FEDERACION'], ['estado_id' => 9, 'nombre' => 'MP. MAUROA'], ['estado_id' => 9, 'nombre' => 'CE. MIRANDA'], ['estado_id' => 9, 'nombre' => 'MP. PETIT'], ['estado_id' => 9, 'nombre' => 'MP. SILVA'], ['estado_id' => 9, 'nombre' => 'MP. ZAMORA'], ['estado_id' => 9, 'nombre' => 'MP. DABAJURO'], ['estado_id' => 9, 'nombre' => 'MP. MONS. ITURRIZA'], ['estado_id' => 9, 'nombre' => 'MP. LOS TAQUES'], ['estado_id' => 9, 'nombre' => 'MP. PIRITU'], ['estado_id' => 9, 'nombre' => 'MP. UNION'], ['estado_id' => 9, 'nombre' => 'MP. SAN FRANCISCO'], ['estado_id' => 9, 'nombre' => 'MP. JACURA'], ['estado_id' => 9, 'nombre' => 'MP. CACIQUE MANAURE'], ['estado_id' => 9, 'nombre' => 'MP. PALMA SOLA'], ['estado_id' => 9, 'nombre' => 'MP. SUCRE'], ['estado_id' => 9, 'nombre' => 'MP. URUMACO'], ['estado_id' => 9, 'nombre' => 'MP. TOCOPERO'], ['estado_id' => 10, 'nombre' => 'MP. INFANTE'], ['estado_id' => 10, 'nombre' => 'MP. MELLADO'], ['estado_id' => 10, 'nombre' => 'MP. MIRANDA'], ['estado_id' => 10, 'nombre' => 'MP. MONAGAS'], ['estado_id' => 10, 'nombre' => 'MP. RIBAS'], ['estado_id' => 10, 'nombre' => 'CE. ROSCIO'], ['estado_id' => 10, 'nombre' => 'MP. ZARAZA'], ['estado_id' => 10, 'nombre' => 'MP. CAMAGUAN'], ['estado_id' => 10, 'nombre' => 'MP.S JOSE DE GUARIBE'], ['estado_id' => 10, 'nombre' => 'MP. LAS MERCEDES'], ['estado_id' => 10, 'nombre' => 'MP. EL SOCORRO'], ['estado_id' => 10, 'nombre' => 'MP. ORTIZ'], ['estado_id' => 10, 'nombre' => 'MP. S MARIA DE IPIRE'], ['estado_id' => 10, 'nombre' => 'MP. CHAGUARAMAS'], ['estado_id' => 10, 'nombre' => 'MP.SAN GERONIMO DE G'], ['estado_id' => 11, 'nombre' => 'MP. CRESPO'], ['estado_id' => 11, 'nombre' => 'CE. IRIBARREN'], ['estado_id' => 11, 'nombre' => 'MP. JIMENEZ'], ['estado_id' => 11, 'nombre' => 'MP. MORAN'], ['estado_id' => 11, 'nombre' => 'MP. PALAVECINO'], ['estado_id' => 11, 'nombre' => 'MP. TORRES'], ['estado_id' => 11, 'nombre' => 'MP. URDANETA'], ['estado_id' => 11, 'nombre' => 'MP. ANDRES E BLANCO'], ['estado_id' => 11, 'nombre' => 'MP. SIMON PLANAS'], ['estado_id' => 12, 'nombre' => 'MP. ALBERTO ADRIANI'], ['estado_id' => 12, 'nombre' => 'MP. ANDRES BELLO'], ['estado_id' => 12, 'nombre' => 'MP. ARZOBISPO CHACON'], ['estado_id' => 12, 'nombre' => 'MP. CAMPO ELIAS'], ['estado_id' => 12, 'nombre' => 'MP. GUARAQUE'], ['estado_id' => 12, 'nombre' => 'MP.JULIO CESAR SALAS'], ['estado_id' => 12, 'nombre' => 'MP. JUSTO BRICE#O'], ['estado_id' => 12, 'nombre' => 'CE. LIBERTADOR'], ['estado_id' => 12, 'nombre' => 'MP. SANTOS MARQUINA'], ['estado_id' => 12, 'nombre' => 'MP. MIRANDA'], ['estado_id' => 12, 'nombre' => 'MP. ANTONIO PINTO S.'], ['estado_id' => 12, 'nombre' => 'MP.OB. RAMOS DE LORA'], ['estado_id' => 12, 'nombre' => 'MP. CARACCIOLO PARRA'], ['estado_id' => 12, 'nombre' => 'MP.CARDENAL QUINTERO'], ['estado_id' => 12, 'nombre' => 'MP. PUEBLO LLANO'], ['estado_id' => 12, 'nombre' => 'MP. RANGEL'], ['estado_id' => 12, 'nombre' => 'MP. RIVAS DAVILA'], ['estado_id' => 12, 'nombre' => 'MP. SUCRE'], ['estado_id' => 12, 'nombre' => 'MP. TOVAR'], ['estado_id' => 12, 'nombre' => 'MP. TULIO F CORDERO'], ['estado_id' => 12, 'nombre' => 'MP. PADRE NOGUERA'], ['estado_id' => 12, 'nombre' => 'MP. ARICAGUA'], ['estado_id' => 12, 'nombre' => 'MP. ZEA'], ['estado_id' => 13, 'nombre' => 'MP. ACEVEDO'], ['estado_id' => 13, 'nombre' => 'MP. BRION'], ['estado_id' => 13, 'nombre' => 'CE. GUAICAIPURO'], ['estado_id' => 13, 'nombre' => 'MP. INDEPENDENCIA'], ['estado_id' => 13, 'nombre' => 'MP. LANDER'], ['estado_id' => 13, 'nombre' => 'MP. PAEZ'], ['estado_id' => 13, 'nombre' => 'MP. PAZ CASTILLO'], ['estado_id' => 13, 'nombre' => 'MP. PLAZA'], ['estado_id' => 13, 'nombre' => 'MP. SUCRE'], ['estado_id' => 13, 'nombre' => 'MP. URDANETA'], ['estado_id' => 13, 'nombre' => 'MP. ZAMORA'], ['estado_id' => 13, 'nombre' => 'MP. CRISTOBAL ROJAS'], ['estado_id' => 13, 'nombre' => 'MP. LOS SALIAS'], ['estado_id' => 13, 'nombre' => 'MP. ANDRES BELLO'], ['estado_id' => 13, 'nombre' => 'MP. SIMON BOLIVAR'], ['estado_id' => 13, 'nombre' => 'MP. BARUTA'], ['estado_id' => 13, 'nombre' => 'MP. CARRIZAL'], ['estado_id' => 13, 'nombre' => 'MP. CHACAO'], ['estado_id' => 13, 'nombre' => 'MP. EL HATILLO'], ['estado_id' => 13, 'nombre' => 'MP. BUROZ'], ['estado_id' => 13, 'nombre' => 'MP. PEDRO GUAL'], ['estado_id' => 14, 'nombre' => 'MP. ACOSTA'], ['estado_id' => 14, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 14, 'nombre' => 'MP. CARIPE'], ['estado_id' => 14, 'nombre' => 'MP. CEDE#O'], ['estado_id' => 14, 'nombre' => 'MP. EZEQUIEL ZAMORA'], ['estado_id' => 14, 'nombre' => 'MP. LIBERTADOR'], ['estado_id' => 14, 'nombre' => 'CE. MATURIN'], ['estado_id' => 14, 'nombre' => 'MP. PIAR'], ['estado_id' => 14, 'nombre' => 'MP. PUNCERES'], ['estado_id' => 14, 'nombre' => 'MP. SOTILLO'], ['estado_id' => 14, 'nombre' => 'MP. AGUASAY'], ['estado_id' => 14, 'nombre' => 'MP. SANTA BARBARA'], ['estado_id' => 14, 'nombre' => 'MP. URACOA'], ['estado_id' => 15, 'nombre' => 'CE. ARISMENDI'], ['estado_id' => 15, 'nombre' => 'MP. DIAZ'], ['estado_id' => 15, 'nombre' => 'MP. GOMEZ'], ['estado_id' => 15, 'nombre' => 'MP. MANEIRO'], ['estado_id' => 15, 'nombre' => 'MP. MARCANO'], ['estado_id' => 15, 'nombre' => 'MP. MARI#O'], ['estado_id' => 15, 'nombre' => 'MP.PENIN. DE MACANAO'], ['estado_id' => 15, 'nombre' => 'MP.VILLALBA(I.COCHE)'], ['estado_id' => 15, 'nombre' => 'MP. TUBORES'], ['estado_id' => 15, 'nombre' => 'MP.ANTOLIN DEL CAMPO'], ['estado_id' => 15, 'nombre' => 'MP. GARCIA'], ['estado_id' => 16, 'nombre' => 'MP. ARAURE'], ['estado_id' => 16, 'nombre' => 'MP. ESTELLER'], ['estado_id' => 16, 'nombre' => 'CE. GUANARE'], ['estado_id' => 16, 'nombre' => 'MP. GUANARITO'], ['estado_id' => 16, 'nombre' => 'MP. OSPINO'], ['estado_id' => 16, 'nombre' => 'MP. PAEZ'], ['estado_id' => 16, 'nombre' => 'MP. SUCRE'], ['estado_id' => 16, 'nombre' => 'MP. TUREN'], ['estado_id' => 16, 'nombre' => 'MP. M.JOSE V DE UNDA'], ['estado_id' => 16, 'nombre' => 'MP. AGUA BLANCA'], ['estado_id' => 16, 'nombre' => 'MP. PAPELON'], ['estado_id' => 16, 'nombre' => 'MP.GENARO BOCONOITO'], ['estado_id' => 16, 'nombre' => 'MP.S RAFAEL DE ONOTO'], ['estado_id' => 16, 'nombre' => 'MP. SANTA ROSALIA'], ['estado_id' => 17, 'nombre' => 'MP. ARISMENDI'], ['estado_id' => 17, 'nombre' => 'MP. BENITEZ'], ['estado_id' => 17, 'nombre' => 'MP. BERMUDEZ'], ['estado_id' => 17, 'nombre' => 'MP. CAJIGAL'], ['estado_id' => 17, 'nombre' => 'MP. MARI#O'], ['estado_id' => 17, 'nombre' => 'MP. MEJIA'], ['estado_id' => 17, 'nombre' => 'MP. MONTES'], ['estado_id' => 17, 'nombre' => 'MP. RIBERO'], ['estado_id' => 17, 'nombre' => 'CE. SUCRE'], ['estado_id' => 17, 'nombre' => 'MP. VALDEZ'], ['estado_id' => 17, 'nombre' => 'MP. ANDRES E BLANCO'], ['estado_id' => 17, 'nombre' => 'MP. LIBERTADOR'], ['estado_id' => 17, 'nombre' => 'MP. ANDRES MATA'], ['estado_id' => 17, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 17, 'nombre' => 'MP. CRUZ S ACOSTA'], ['estado_id' => 18, 'nombre' => 'MP. AYACUCHO'], ['estado_id' => 18, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 18, 'nombre' => 'MP. INDEPENDENCIA'], ['estado_id' => 18, 'nombre' => 'MP. CARDENAS'], ['estado_id' => 18, 'nombre' => 'MP. JAUREGUI'], ['estado_id' => 18, 'nombre' => 'MP. JUNIN'], ['estado_id' => 18, 'nombre' => 'MP. LOBATERA'], ['estado_id' => 18, 'nombre' => 'CE. SAN CRISTOBAL'], ['estado_id' => 18, 'nombre' => 'MP. URIBANTE'], ['estado_id' => 18, 'nombre' => 'MP. CORDOBA'], ['estado_id' => 18, 'nombre' => 'MP. GARCIA DE HEVIA'], ['estado_id' => 18, 'nombre' => 'MP. GUASIMOS'], ['estado_id' => 18, 'nombre' => 'MP. MICHELENA'], ['estado_id' => 18, 'nombre' => 'MP. LIBERTADOR'], ['estado_id' => 18, 'nombre' => 'MP. PANAMERICANO'], ['estado_id' => 18, 'nombre' => 'MP.PEDRO MARIA URE#A'], ['estado_id' => 18, 'nombre' => 'MP. SUCRE'], ['estado_id' => 18, 'nombre' => 'MP. ANDRES BELLO'], ['estado_id' => 18, 'nombre' => 'MP. FERNANDEZ FEO'], ['estado_id' => 18, 'nombre' => 'MP. LIBERTAD'], ['estado_id' => 18, 'nombre' => 'MP. SAMUEL MALDONADO'], ['estado_id' => 18, 'nombre' => 'MP. SEBORUCO'], ['estado_id' => 18, 'nombre' => 'MP. ANTONIO ROMULO C'], ['estado_id' => 18, 'nombre' => 'MP. FCO DE MIRANDA'], ['estado_id' => 18, 'nombre' => 'MP. JOSE MARIA VARGA'], ['estado_id' => 18, 'nombre' => 'MP. RAFAEL URDANETA'], ['estado_id' => 18, 'nombre' => 'MP. SIMON RODRIGUEZ'], ['estado_id' => 18, 'nombre' => 'MP. TORBES'], ['estado_id' => 18, 'nombre' => 'MP. SAN JUDAS TADEO'], ['estado_id' => 19, 'nombre' => 'MP. RAFAEL RANGEL'], ['estado_id' => 19, 'nombre' => 'MP. BOCONO'], ['estado_id' => 19, 'nombre' => 'MP. CARACHE'], ['estado_id' => 19, 'nombre' => 'MP. ESCUQUE'], ['estado_id' => 19, 'nombre' => 'CE. TRUJILLO'], ['estado_id' => 19, 'nombre' => 'MP. URDANETA'], ['estado_id' => 19, 'nombre' => 'MP. VALERA'], ['estado_id' => 19, 'nombre' => 'MP. CANDELARIA'], ['estado_id' => 19, 'nombre' => 'MP. MIRANDA'], ['estado_id' => 19, 'nombre' => 'MP. MONTE CARMELO'], ['estado_id' => 19, 'nombre' => 'MP. MOTATAN'], ['estado_id' => 19, 'nombre' => 'MP. PAMPAN'], ['estado_id' => 19, 'nombre' => 'MP.S RAFAEL CARVAJAL'], ['estado_id' => 19, 'nombre' => 'MP. SUCRE'], ['estado_id' => 19, 'nombre' => 'MP. ANDRES BELLO'], ['estado_id' => 19, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 19, 'nombre' => 'MP. JOSE F M CA#IZAL'], ['estado_id' => 19, 'nombre' => 'MP. JUAN V CAMPO ELI'], ['estado_id' => 19, 'nombre' => 'MP. LA CEIBA'], ['estado_id' => 19, 'nombre' => 'MP. PAMPANITO'], ['estado_id' => 20, 'nombre' => 'MP. BOLIVAR'], ['estado_id' => 20, 'nombre' => 'MP. BRUZUAL'], ['estado_id' => 20, 'nombre' => 'MP. NIRGUA'], ['estado_id' => 20, 'nombre' => 'CE. SAN FELIPE'], ['estado_id' => 20, 'nombre' => 'MP. SUCRE'], ['estado_id' => 20, 'nombre' => 'MP. URACHICHE'], ['estado_id' => 20, 'nombre' => 'MP. PE#A'], ['estado_id' => 20, 'nombre' => 'MP.JOSE ANTONIO PAEZ'], ['estado_id' => 20, 'nombre' => 'MP. LA TRINIDAD'], ['estado_id' => 20, 'nombre' => 'MP. COCOROTE'], ['estado_id' => 20, 'nombre' => 'MP. INDEPENDENCIA'], ['estado_id' => 20, 'nombre' => 'MP. ARISTIDES BASTID'], ['estado_id' => 20, 'nombre' => 'MP. MANUEL MONGE'], ['estado_id' => 20, 'nombre' => 'MP. VEROES'], ['estado_id' => 21, 'nombre' => 'MP. BARALT'], ['estado_id' => 21, 'nombre' => 'MP. SANTA RITA'], ['estado_id' => 21, 'nombre' => 'MP. COLON'], ['estado_id' => 21, 'nombre' => 'MP. MARA'], ['estado_id' => 21, 'nombre' => 'CE. MARACAIBO'], ['estado_id' => 21, 'nombre' => 'MP. MIRANDA'], ['estado_id' => 21, 'nombre' => 'MP.IDJ BLVNO GUAJIRA'], ['estado_id' => 21, 'nombre' => 'MP. MACHIQUES DE P'], ['estado_id' => 21, 'nombre' => 'MP. SUCRE'], ['estado_id' => 21, 'nombre' => 'MP. LA CA#ADA DE U.'], ['estado_id' => 21, 'nombre' => 'MP. LAGUNILLAS'], ['estado_id' => 21, 'nombre' => 'MP. CATATUMBO'], ['estado_id' => 21, 'nombre' => 'MP.ROSARIO DE PERIJA'], ['estado_id' => 21, 'nombre' => 'MP. CABIMAS'], ['estado_id' => 21, 'nombre' => 'MP.VALMORE RODRIGUEZ'], ['estado_id' => 21, 'nombre' => 'MP. JESUS E LOSSADA'], ['estado_id' => 21, 'nombre' => 'MP. ALMIRANTE P'], ['estado_id' => 21, 'nombre' => 'MP. SAN FRANCISCO'], ['estado_id' => 21, 'nombre' => 'MP. JESUS M SEMPRUN'], ['estado_id' => 21, 'nombre' => 'MP. FRANCISCO J PULG'], ['estado_id' => 21, 'nombre' => 'MP. SIMON BOLIVAR'], ['estado_id' => 22, 'nombre' => 'CE. ATURES'], ['estado_id' => 22, 'nombre' => 'MP. ATABAPO'], ['estado_id' => 22, 'nombre' => 'MP. MAROA'], ['estado_id' => 22, 'nombre' => 'MP. RIO NEGRO'], ['estado_id' => 22, 'nombre' => 'MP. AUTANA'], ['estado_id' => 22, 'nombre' => 'MP. MANAPIARE'], ['estado_id' => 22, 'nombre' => 'MP. ALTO ORINOCO'], ['estado_id' => 23, 'nombre' => 'CE. TUCUPITA'], ['estado_id' => 23, 'nombre' => 'MP. PEDERNALES'], ['estado_id' => 23, 'nombre' => 'MP. ANTONIO DIAZ'], ['estado_id' => 23, 'nombre' => 'MP. CASACOIMA'], ['estado_id' => 24, 'nombre' => 'CE. VARGAS']];
     foreach ($municipios as $municipio) {
         Municipio::create($municipio);
     }
 }
Ejemplo n.º 5
0
 public function getImportEmpresas()
 {
     $oldEmpresas = DB::connection("mysql_old")->table("empresas")->get();
     foreach ($oldEmpresas as $empresa) {
         $empresa = json_decode(json_encode($empresa), true);
         $provincia = Provincia::where("NOMBRE", "LIKE", "%{$empresa['provincia']}%")->select("id")->first();
         $municipio = Municipio::where("NOMBRE", "LIKE", "%{$empresa['localidad']}%")->select("id")->first();
         $formacion_empresa = DB::connection("mysql_old")->table("formacion_empresa")->where("empresas_id", $empresa["id"])->first();
         $proveedor_empresa = DB::connection("mysql_old")->table("proveedor_empresa")->where("empresas_id", $empresa["id"])->first();
         $proveedor_empresa = json_decode(json_encode($proveedor_empresa), true);
         $formacion_empresa = json_decode(json_encode($formacion_empresa), true);
         if ($proveedor_empresa) {
             if (!$proveedor_empresa["sist_calidad"] || $proveedor_empresa["sist_calidad"] == "N") {
                 $proveedor_empresa["sist_calidad"] = 0;
             } else {
                 $proveedor_empresa["sist_calidad"] = 1;
             }
             $proveedor_empresa["decision"] = ucwords($proveedor_empresa["decision"]);
         }
         $newEmpresa = array("cif" => $empresa["nif"], "razon_social" => $empresa["razon_social"], "direccion" => $empresa["direccion"], "telefono" => $empresa["telefono"], "fax" => $empresa["fax"], "representante" => $empresa["contacto"], "provincia_id" => $provincia["id"], "municipio_id" => $municipio["id"], "cod_postal" => $empresa["cp"], "email" => $empresa["email"], "observaciones" => $empresa["observaciones"], "contacto_formacion" => $formacion_empresa["persona_contacto_formacion"], "email_proveedor" => $formacion_empresa["email_contacto_formacion"], "eval_referencia" => $proveedor_empresa["referencia"], "eval_capacidad_suministro" => $proveedor_empresa["cap_suministro"], "eval_certificado_calidad" => $proveedor_empresa["sist_calidad"], "eval_condiciones_economicas" => $proveedor_empresa["cond_economicas"], "eval_plazo_entrega" => $proveedor_empresa["plazo_entrega"], "eval_decision" => $proveedor_empresa["decision"], "eval_fecha_evaluacion" => $proveedor_empresa["fecha_eval"], "old_id" => $empresa["id"]);
         try {
             (new Empresa())->fill($newEmpresa)->save();
         } catch (\Illuminate\Database\QueryException $e) {
         }
     }
 }
Ejemplo n.º 6
0
 function getMunicipioDepartamento(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $id = $request->getAttribute("id");
     $data = Municipio::select("municipio.*", "departamento.nombre as departamento")->join('departamento', 'departamento.id', '=', 'municipio.idDepartamento')->where("municipio.id", "=", $id)->first();
     $response->getBody()->write($data);
     return $response;
 }
Ejemplo n.º 7
0
 public static function municipios()
 {
     $municipios = Municipio::ms();
     foreach ($municipios as $municipio) {
         $return[utf8_encode($municipio->cidade)] = utf8_encode($municipio->cidade);
     }
     return $return;
 }
Ejemplo n.º 8
0
 public function verDatos($id)
 {
     $profesor = ProfesoresModel::find($id);
     $estado = Estado::find($profesor->ciudad);
     $municipio = Municipio::where('idMunicipio', '=', $profesor->delegacion)->where('idEstado', '=', $profesor->ciudad)->first();
     $colonia = Colonia::where('idMunicipio', '=', $profesor->delegacion)->where('idEstado', '=', $profesor->ciudad)->where('idColonia', '=', $profesor->colonia)->first();
     //$municipio=AlumnosModel::find($id)->municipio;
     return View::make('profesores/misDatos', array('profesor' => $profesor))->with('municipio', $municipio->municipio)->with('colonia', $colonia->colonia)->with('estado', $estado->estado);
 }
Ejemplo n.º 9
0
 public function verDatos($id)
 {
     $alumno = AlumnosModel::find($id);
     $estado = Estado::find($alumno->estadoAlumno);
     $municipio = Municipio::where('idMunicipio', '=', $alumno->delegacionAlumno)->where('idEstado', '=', $alumno->estadoAlumno)->first();
     $colonia = Colonia::where('idMunicipio', '=', $alumno->delegacionAlumno)->where('idEstado', '=', $alumno->estadoAlumno)->where('idColonia', '=', $alumno->coloniaAlumno)->first();
     //$municipio=AlumnosModel::find($id)->municipio;
     return View::make('alumnos/misDatos', array('alumno' => $alumno))->with('municipio', $municipio->municipio)->with('colonia', $colonia->colonia)->with('estado', $estado->estado);
 }
Ejemplo n.º 10
0
 /**
  * Método para agregar
  */
 public function agregar()
 {
     $pais = new Pais();
     $estado = new Estado();
     $municipio = new Municipio();
     //$empresa = Session::get('empresa', 'config');
     $empresa = 1;
     if (Input::hasPost('sucursal')) {
         if (Sucursal::setSucursal('create', Input::post('sucursal'), array('empresa_id' => $empresa))) {
             DwMessage::valid('La sucursal se ha registrado correctamente!');
             return DwRedirect::toAction('listar');
         }
     }
     $this->pais = $pais->getListadoPais();
     $this->estado = $estado->getListadoEstado();
     $this->municipio = $municipio->getListadoMunicipio();
     $this->page_title = 'Agregar sucursal';
 }
Ejemplo n.º 11
0
 public function getFichaDemandante($id)
 {
     $data = Demandante::find($id);
     $provincias = new Provincia();
     $municipios = new Municipio();
     $estudios = Estudio::all();
     $titulos = Titulacion::all();
     $estudiosArr = null;
     foreach ($estudios as $estudio) {
         $estudiosArr[$estudio->id] = $estudio->nombre;
     }
     $titulosArr = array();
     foreach ($titulos as $titulo) {
         $titulosArr[$titulo->id] = $titulo->nombre;
     }
     $id_est = $data->usuarios->estudios->max('id');
     $titulosReg = $data->usuarios->titulaciones;
     $titulosArrReg = array();
     foreach ($titulosReg as $titulo) {
         $titulosArrReg[] = $titulo->id;
     }
     $carnetsP = array();
     foreach ($data->funciones()->where('grupo_id', '=', 2)->get() as $value) {
         $carnetsP[] = $value->id;
     }
     $idiomas = array();
     foreach ($data->funciones()->where('grupo_id', '=', 4)->get() as $value) {
         $idiomas[] = $value->id;
     }
     $informatica = array();
     foreach ($data->funciones()->where('grupo_id', '=', 5)->get() as $value) {
         $informatica[] = $value->id;
     }
     $funcionesUser = $data->usuarios->funciones;
     $funcionesArrReg = array();
     foreach ($funcionesUser as $funcion) {
         $funcionesArrReg[] = $funcion->funcion_id;
     }
     $trabajosUser = $data->usuarios->trabajos;
     $areas = AreasEmpleo::vector();
     $subareas = SubareaEmpleo::subareas($data->areaEmpleo_id);
     return View::make('demandante/ficha', array('data' => $data, 'areas' => $areas, 'subareas' => $subareas, 'trabajosUser' => $trabajosUser, 'informatica' => $informatica, 'funcionesUser' => $funcionesArrReg, 'idiomas' => $idiomas, 'carnetsP' => $carnetsP, 'titulosReg' => $titulosArrReg, 'titulos' => $titulosArr, 'estudios' => $estudiosArr, 'id_estudio' => $id_est, 'provincias' => $provincias->arraySelect(), 'municipios' => $municipios->municipiosProvincia($data->usuarios->provincia_id)));
 }
Ejemplo n.º 12
0
 public static function getCombo($idMunicipio = "", array $condiciones = [])
 {
     $municipio = Municipio::find((int) $idMunicipio);
     $retorno = array('' => 'Seleccione.');
     if (is_object($municipio)) {
         $municipios = $municipio->parroquias;
         foreach ($municipios as $registro) {
             $retorno[$registro->id] = $registro->nombre;
         }
     } else {
         $retorno = array('' => 'Seleccione primero un municipio');
     }
     return $retorno;
 }
Ejemplo n.º 13
0
 public function getFichaDocente($id)
 {
     $data = Docente::find($id);
     $provincias = new Provincia();
     $municipios = new Municipio();
     $estudios = Estudio::all();
     $titulos = Titulacion::all();
     $estudiosArr = null;
     foreach ($estudios as $estudio) {
         $estudiosArr[$estudio->id] = $estudio->nombre;
     }
     $titulosArr = array();
     foreach ($titulos as $titulo) {
         $titulosArr[$titulo->id] = $titulo->nombre;
     }
     $usuario = Usuario::find($data->id_usuario);
     $id_est = $usuario->estudios->max('id');
     $titulosReg = $usuario->titulaciones;
     $titulosArrReg = array();
     foreach ($titulosReg as $titulo) {
         $titulosArrReg[] = $titulo->id;
     }
     return View::make('docente/ficha', array('data' => $data, 'titulosReg' => $titulosArrReg, 'titulos' => $titulosArr, 'estudios' => $estudiosArr, 'id_estudio' => $id_est, 'provincias' => $provincias->arraySelect(), 'municipios' => $municipios->municipiosProvincia($data->provincia_id)));
 }
Ejemplo n.º 14
0
 public function __construct()
 {
     parent::__construct();
     // initializers for all the domain-specific core classes
     // they are here instead of the initializer in order to them to be able to access this controller instance from their static methods
     //
     Estado::init();
     Municipio::init();
     Parroquia::init();
     User::init();
     Log::init();
     // register this controller in the Log class
     // this is neccesary when working with multiples controllers (in non-standalone mode, for example)
     //
     Log::register_me($this);
     $this->load->database();
     $this->lang->load('db', 'spanish');
     $this->lang->load('form_validation', 'spanish');
 }
Ejemplo n.º 15
0

<h1>Escolha um município do Estado</h1>

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'municipio-pesquisa-form', 'htmlOptions' => array('class' => 'well'), 'type' => 'horizontal'));
?>

    <legend>Pesquisar concluintes do curso por Município</legend>
    
    <?php 
?>
    
    <?php 
$municipios = CHtml::listData(Municipio::model()->findAll(), 'id', 'nome');
echo $form->dropDownListRow($model, 'id', $municipios);
?>
<div class="form-actions">
    <?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'link', 'label' => 'Voltar', 'icon' => 'icon-chevron-left', 'url' => Yii::app()->baseUrl));
?>
    <?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'label' => 'Pesquisar', 'icon' => 'icon-search'));
?>
</div>    

<?php 
$this->endWidget();
Ejemplo n.º 16
0
$campusInscrito = $objinscrito[0]->getcampus();
$vetorCampusIncrito = $campus->SelectNomeCampus($conexao, $campusInscrito);
$nomeCampus = $vetorCampusIncrito->getNome();
// Obter Curso
$nomeCurso = new Curso();
$nomeCurso = $nomeCurso->SelectByPrimaryKey($conexao, $objinscrito[0]->getcurso());
$nomeCurso = $nomeCurso[0]->getnome();
// Obter Local Prova
$local_prova = new Localprova(null, null, null);
// Obter UF
$estado = new UnidadeFederativa(null, null);
$estadoId = $objinscrito[0]->getestado();
$vetorEstadoNome = $estado->SelectNomeUnidadeFederativa($conexao, $estadoId);
$estadoNome = $vetorEstadoNome[0]->getNome();
// Obter Município
$municipio = new Municipio(null, null, null);
$municipioId = $objinscrito[0]->getcidade();
$vetorMunicipioNome = $municipio->SelectNomeMunicipio($conexao, $municipioId);
$municipioNome = $vetorMunicipioNome->getNome();
//if (isset($_POST['id']) && !empty($_POST['id'])) {
//	$id = addslashes($_POST['id']);
//	$objinscrito = $inscrito->SelectById($conexao, $id);
//} else if(isset($_POST['cpf']) && !empty($_POST['cpf'])) {
//	$cpf = addslashes($_POST['cpf']);
//	$objinscrito = $inscrito->SelectByCpf($conexao, $cpf);
//}
//
//if (empty($objinscrito[0])) {
//	$_SESSION['flashMensagem'] = 'CPF n&atilde;o encontrado na nossa base de dados.';
//	header("Location:" . $_SERVER['HTTP_REFERER']);
//	exit;
 function crearDatosSigesp()
 {
     $objPais = new Pais();
     $objEstado = new Estado();
     $objMunicipio = new Municipio();
     $objParroquia = new Parroquia();
     $objMoneda = new Moneda();
     $objModalidad = new ModalClausula();
     $objClasificador = new ClasificadorRd();
     $objBancoSigecof = new BancoSigecof();
     //Insertar pais por defecto
     $objPais->codpai = '---';
     $objPais->despai = '---seleccione---';
     $objPais->incluir();
     //Insertar estado por defecto
     $objEstado->codpai = '---';
     $objEstado->codest = '---';
     $objEstado->desest = '---seleccione---';
     $objEstado->incluir();
     //Insertar municipio por defecto
     $objMunicipio->codpai = '---';
     $objMunicipio->codest = '---';
     $objMunicipio->codmun = '---';
     $objMunicipio->denmun = '---seleccione---';
     $objMunicipio->incluir();
     //Insertar parroquia por defecto
     $objParroquia->codpai = '---';
     $objParroquia->codest = '---';
     $objParroquia->codmun = '---';
     $objParroquia->codpar = '---';
     $objParroquia->denpar = '---seleccione---';
     $objParroquia->incluir();
     //Insertar moneda por defecto
     $objMoneda->codmon = '---';
     $objMoneda->denmon = '----seleccione----';
     $objMoneda->imamon = '------';
     $objMoneda->codpai = '---';
     $objMoneda->tascam = 0;
     $objMoneda->estmonpri = 0;
     $objMoneda->incluir();
     //insertar modalidad de cláusula por defecto
     $objModalidad->codemp = '0001';
     $objModalidad->codtipmod = '--';
     $objModalidad->denmodcla = '---seleccione---';
     $objModalidad->incluir();
     //Insertar clasificador de recepción de documentos por defecto
     $objClasificador->codcla = '--';
     $objClasificador->dencla = '---seleccione---';
     $objClasificador->sc_cuenta = '';
     $objClasificador->incluir();
     //Insertar banco sigecof por defecto
     $objBancoSigecof->codbansig = '---';
     $objBancoSigecof->denbansig = '---seleccione---';
     $objBancoSigecof->incluir();
     unset($objPais);
     unset($objEstado);
     unset($objMunicipio);
     unset($objParroquia);
     unset($objMoneda);
     unset($objModalidad);
     unset($objClasificador);
     unset($objBancoSigecof);
 }
Ejemplo n.º 18
0
 }
 if ($coddepe == 999) {
     $carp_codi = substr($dependencia, 0, 2);
     $carp_per = 1;
     $radi_usua_actu = 1;
 }
 if (!$radi_usua_actu) {
     $radi_usua_actu == 1;
 }
 if ($radi_usua_actu_padre and $radi_depe_actu_padre) {
     $radi_usua_actu = "{$radi_usua_actu_padre}";
     $coddepe = "{$radi_depe_actu_padre}";
 }
 // Buscamos Nivel de Usuario Destino
 error_reporting(7);
 $tmp_mun = new Municipio($db);
 $tmp_mun->municipio_codigo($codep_us1, $muni_us1);
 $rad = new Radicacion($db);
 $rad->radiTipoDeri = $tpRadicado;
 $rad->radiCuentai = "'" . trim($cuentai) . "'";
 $rad->eespCodi = $documento_us3;
 $rad->mrecCodi = $med;
 // "dd/mm/aaaa"
 $fecha_gen_doc_YMD = substr($fecha_gen_doc, 6, 4) . "-" . substr($fecha_gen_doc, 3, 2) . "-" . substr($fecha_gen_doc, 0, 2);
 $rad->radiFechOfic = $fecha_gen_doc_YMD;
 if (!$radicadopadre) {
     $radicadopadre = null;
 }
 $rad->radiNumeDeri = trim($radicadopadre);
 $rad->radiPais = $tmp_mun->get_pais_codi();
 $rad->descAnex = $ane;
Ejemplo n.º 19
0
            $dpto_tmp2 = $muni_tmp2[1];
            $muni_tmp2 = $muni_tmp2[2];
            break;
        case 2:
            $idcont2 = $tmp_idcont;
            $idpais2 = $tmp_idpais;
            $dpto_tmp2 = $muni_tmp2[0];
            $muni_tmp2 = $muni_tmp2[1];
            break;
    }
    unset($tmp_mun);
    unset($tmp_idcont);
    unset($tmp_idpais);
}
if (!is_null($muni_us3)) {
    $tmp_mun = new Municipio($conexion);
    $tmp_mun->municipio_codigo($codep_us3, $muni_us3);
    $tmp_idcont = $tmp_mun->get_cont_codi();
    $tmp_idpais = $tmp_mun->get_pais_codi();
    $muni_tmp3 = explode("-", $muni_us3);
    switch (count($muni_tmp3)) {
        case 4:
            $idcont3 = $muni_tmp3[0];
            $idpais3 = $muni_tmp3[1];
            $dpto_tmp3 = $muni_tmp3[2];
            $muni_tmp3 = $muni_tmp3[3];
            break;
        case 3:
            $idcont3 = $tmp_idcont;
            $idpais3 = $muni_tmp3[0];
            $dpto_tmp3 = $muni_tmp3[1];
Ejemplo n.º 20
0
<?php

error_reporting(E_ALL);
date_default_timezone_set('America/Bogota');
require_once "modulos/module.LeerArchivos.php";
require_once "modulos/module.ManejoFechas.php";
require_once "clases/class.Session.php";
require_once "clases/class.rped.php";
require_once "clases/class.Menu.php";
require_once "clases/class.Entidad.php";
require_once "clases/class.Municipio.php";
require_once "clases/class.Errores.php";
$objRPED = new rped();
$objEntidad = new Entidad();
$objMunicipio = new Municipio();
$objMenu = new Menu();
$objErrores = new Errores();
$sesion = new sesion();
$usuario = $sesion->get("usuario");
if (isset($_GET['menu'])) {
    $id = $objMenu->getMenu($_GET['menu']);
}
$list_enti = $objEntidad->getEntidades();
$ListEnt = $objEntidad->getListEnt($sesion->get("idUsuario"));
// Obtener Entidad por ID
if (isset($_GET['CodEPS'])) {
    $Ent = $objEntidad->getEntidadId($_GET['CodEPS']);
}
$list_mun = $objMunicipio->getMunicipios();
// Funcion Para Exportar
$regEnt = $objRPED->getRegByEnt();
Ejemplo n.º 21
0
//Rutas de los catalogos
Route::get('catalogo/{cat}', 'CatalogoController@getCatalogo');
Route::post('catalogo/create', 'CatalogoController@create');
Route::post('getElementos/{cat}', 'CatalogoController@_getElementos');
Route::delete('catalogo/destroy/{id}', 'CatalogoController@destroy');
Route::put('catalogo/update/{id}', 'CatalogoController@update');
//Ruta para consultar todos los paises
Route::get('paises', function () {
    return Pais::all()->toJson();
});
//Ruta en la cual retornamos los estados relaccionados con el id del pais
Route::POST('estados', function () {
    return Estado::where('pais_id', '=', Input::get('pais'))->get();
});
Route::POST('municipios', function () {
    return Municipio::where('estado_id', '=', Input::get('estado'))->get();
});
Route::get('productos/estado/{id}', 'ProductoController@estado');
//Ruta para registrar pedido
Route::POST('productos/nuevopedido/{id}', 'ProductoController@nuevopedido');
Route::POST('productos/pedidoexistente/{id}', 'ProductoController@pedidoexistente');
//Editar domicilio
Route::get('productos/editar/{uddom}', 'ProductoController@editar');
//Actualizar domiclio
Route::post('productos/actualizar', 'ProductoController@actualizar');
//Verificar teléfonos
Route::post('productos/getVerificarTel', 'ProductoController@getVerificarTel');
//Detalle del pedido
Route::get('productos/datosdelpedido/{iddom}', 'ProductoController@datosdelpedido');
//	Listar pedidos del cliente
Route::POST('productos/listarpedidos', 'ProductoController@listarpedidos');
Ejemplo n.º 22
0
    echo '<option value="">* Selecione</option>';
    echo $obj->getComboSiteAreaAbaItem($_REQUEST['site_area_aba_id']);
} elseif ($_REQUEST['query'] == 14) {
    /**
     * PREENCHE COMBO MUNICIPIO
     */
    require_once '../../models/municipio.php';
    $obj = new Municipio();
    echo '<option value="">* Selecione</option>';
    echo $obj->getComboMunicipioPais('', $_REQUEST['pais_id']);
} elseif ($_REQUEST['query'] == 15) {
    require_once '../../models/municipio.php';
    require_once '../../models/estado.php';
    require_once '../../models/regiao.php';
    require_once '../../models/pais.php';
    $municipio = new Municipio();
    $estado = new Estado();
    $regiao = new Regiao();
    $pais = new Pais();
    $objMunicipio = $municipio->getMunicipio(null, $_REQUEST['nome']);
    $objEstado = $estado->getEstado(null, $_REQUEST['sigla']);
    $objRegiao = $regiao->getRegiao($objEstado['regiao_id']);
    echo $estado->getComboEstado2($objEstado['id']);
    echo '|*|';
    echo $municipio->getComboMunicipio($objMunicipio['id'], $objEstado['id']);
    echo '|*|';
    echo $regiao->getComboRegiao($objEstado['regiao_id'], $objRegiao['pais_id']);
    echo '|*|';
    echo $pais->getComboPais($objRegiao['pais_id']);
} elseif ($_REQUEST['query'] == 16) {
    require_once '../../models/pessoa.php';
 public function printaMunicipios($id)
 {
     $variosMuni = Municipio::model()->findAllByAttributes(array('regional_id' => $id));
     $result = '';
     foreach ($variosMuni as $mun) {
         if (Cursista::model()->exists('municipio_id = :municipio_id', array('municipio_id' => $mun->id))) {
             $modelo = $mun;
             $result .= $mun->nome . '<br />';
         }
     }
     if (empty($modelo)) {
         $result = 'Não existem municípios concluintes ainda.';
     }
     return $result;
 }
Ejemplo n.º 24
0
 /** 
 * Retorna un array con los datos del remitente de un radicado, este vector contiene los indices 'nombre','direccion','deptoNombre','muniNombre','deptoCodi','muniCodi'; antes de invocar esta funcion, se debe llamar a  radicado_codigo()
 * @return   array
 */
 function getDatosRemitente()
 {
     //almacena el query
     $q = "select *  from sgd_dir_drecciones where radi_nume_radi =" . $this->radi_nume_radi;
     $rs = $this->cursor->query($q);
     //Agregada por Johnny debido a solicitud de usuarios
     $direccion = $rs->fields['SGD_DIR_DIRECCION'];
     $deptoCodi = $rs->fields['DPTO_CODI'];
     $muniCodi = $rs->fields['MUNI_CODI'];
     $paisCodi = $rs->fields['ID_PAIS'];
     $contCodi = $rs->fields['ID_CONT'];
     //Agregada por Johnny debido a solicitud de usuarios
     $nombre = $rs->fields['SGD_DIR_NOMREMDES'];
     $dep = new Departamento($this->cursor);
     $mun = new Municipio($this->cursor);
     $dep->departamento_codigo($paisCodi . '-' . $deptoCodi);
     $mun->municipio_codigo($paisCodi . '-' . $deptoCodi, $paisCodi . '-' . $deptoCodi . '-' . $muniCodi);
     //Si se hallaron datos del remitente
     if ($dep) {
         $vecDatos["nombre"] = $nombre;
         $vecDatos["direccion"] = $direccion;
         $vecDatos["deptoNombre"] = $dep->get_dpto_nomb();
         $vecDatos["muniNombre"] = $mun->get_muni_nomb();
         $vecDatos["contCodi"] = $contCodi;
         $vecDatos["paisCodi"] = $paisCodi;
         $vecDatos["deptoCodi"] = $deptoCodi;
         $vecDatos["muniCodi"] = $muniCodi;
     }
     return $vecDatos;
 }
Ejemplo n.º 25
0
 static function init()
 {
     self::$ci = Mainapp::get_instance();
 }
Ejemplo n.º 26
0
 public function getMunicipios($id)
 {
     $municipios = \Municipio::getCombo($id);
     return \Response::json($municipios);
 }
Ejemplo n.º 27
0
 function combinar_csv($dependencia, $codusuario, $usua_doc, $usua_nomb, $depe_codi_territorial, $codiTRD, $TipoRad)
 {
     $odt = new OpenDocText();
     $b = new CLASS_GEN();
     //Var que contiene el arreglo de radicados genrados a partir de la masiva
     $arrRadicados = array();
     //echo "<hr> TipoRas es $TipoRad <hr>";
     //Instancia de la dependencia
     $objDependecia = new Dependencia($this->conexion);
     $objDependecia->Dependencia_codigo($dependencia);
     //Almacena la secuencia de radicacion para esta dependencia
     $secRadicacion = "secr_tp" . $TipoRad . "_" . $objDependecia->getSecRadicTipDepe($dependencia, $TipoRad);
     //	$this->conexion->conn->debug = true;
     $archivo = $this->arcFinal;
     $archivo = trim(substr($archivo, strpos($archivo, $this->carpetaBodega) + strlen($this->carpetaBodega), strlen($archivo) - strpos($archivo, $this->carpetaBodega) + strlen($this->carpetaBodega)));
     // INICIALIZA EL PDF
     $this->pdf = new Cezpdf("LETTER", "landscape");
     $objHist = new Historico($this->conexion);
     $year = date("Y");
     $day = date("d");
     $month = date("m");
     // orientaci�n izquierda
     $orientCentro = array("left" => 0);
     // justificaci�n centrada
     $justCentro = array("justification" => "center");
     $estilo1 = array("justification" => "left", "leading" => 8);
     $estilo2 = array("left" => 0, "leading" => 12);
     $estilo3 = array("left" => 0, "leading" => 15);
     $this->pdf->ezSetCmMargins(1, 1, 3, 2);
     //top,botton,left,right
     /* Se establece la fuente que se utilizara para el texto. */
     $this->pdf->selectFont($this->ruta_raiz . "/include/pdf/fonts/Times-Roman.afm");
     $this->pdf->ezText("LISTADO DE RADICACION MASIVA\n", 15, $justCentro);
     $this->pdf->ezText("Dependencia: {$dependencia} \n", 12, $estilo2);
     $this->pdf->ezText("Usuario Responsable: {$usua_nomb} \n", 12, $estilo2);
     $this->pdf->ezText("Fecha: {$day}-{$month}-{$day} \n", 12, $estilo2);
     $this->pdf->ezText($txtformat, 12, $estilo2);
     $data = array();
     $columna = array();
     $contador = 0;
     require_once $this->ruta_raiz . "/class_control/class_control.php";
     $this->btt = new CONTROL_ORFEO($this->conexion);
     echo "<table border=0 width 80% cellpadding='0' cellspacing='5' class='borde_tab' >";
     echo "<tr><td class='titulos4'>Registro</td><td class='titulos4'>Radicado</td><td class='titulos4' >Nombre</td><td class='titulos4'>Direccion</td><td class='titulos4'>Depto</td><td class='titulos4'>Municipio</td><td class='titulos4'>Expediente</td></tr>";
     //Referencia el archivo a abrir
     $ruta = $this->ruta_raiz . "/" . $this->carpetaBodega . "/masiva/" . $this->archivo_insumo;
     clearstatcache();
     unlink($ruta);
     $fp = fopen($ruta, 'wb');
     if ($fp) {
         fputs($fp, "plantilla={$this->arcPlantilla}" . "\n");
         fputs($fp, "csv={$this->arcCSV}" . "\n");
         fputs($fp, "archFinal={$this->arcFinal}" . "\n");
         fputs($fp, "archTmp={$this->arcTmp}" . "\n");
         // Comentariada por HLP. Cambiar , por ;
         fputs($fp, implode(",", $this->encabezado[0]) . ",*RAD_S*,*F_RAD_S*,*F_HOY*" . "\n");
         //fputs ($fp,implode( ";", $this->encabezado[0]).";*RAD_S*;*F_RAD_S*"."\n");
         //Recorre el arrego de los datos
         for ($ii = 0; $ii < count($this->datos); $ii++) {
             $i = 0;
             $numeroExpediente = "";
             // Aqui se accede a la clase class_control para actualizar expedientes.
             $ruta_raiz = $this->ruta_raiz;
             // Por cada etiqueta de los campos del encabezado del CSV efect�a un reemplazo
             foreach ($this->encabezado[0] as $campos_d) {
                 if (strlen(trim($this->datos[$ii][$i])) < 1) {
                     $this->datos[$ii][$i] = "";
                 }
                 $dato_r = str_replace("'", "''", trim($this->datos[$ii][$i]));
                 $texto_tmp = str_replace($campos_d, $dato_r, $texto_tmp);
                 if ($campos_d == "*TIPO*") {
                     $tip_doc = $dato_r;
                 }
                 if ($campos_d == "*NOMBRE*") {
                     $nombre = $dato_r;
                 }
                 if ($campos_d == "*DOCUMENTO*") {
                     $doc_us1 = $dato_r;
                 }
                 if ($campos_d == "*NOMBRE*") {
                     $nombre_us1 = $dato_r;
                 }
                 if ($campos_d == "*PRIM_APEL*") {
                     $prim_apell_us1 = $dato_r;
                 }
                 if ($campos_d == "*SEG_APEL*") {
                     $seg_apell_us1 = $dato_r;
                 }
                 if ($campos_d == "*DIGNATARIO*") {
                     $otro_us1 = $dato_r;
                 }
                 if ($campos_d == "*CARGO*") {
                     $cargo_us1 = $dato_r;
                 }
                 if ($campos_d == "*DIR*") {
                     $direccion_us1 = $dato_r;
                 }
                 if ($campos_d == "*TELEFONO*") {
                     $telefono_us1 = $dato_r;
                 }
                 if ($campos_d == "*MUNI*") {
                     $muni_codi = $dato_r;
                 }
                 if ($campos_d == "*DEPTO*") {
                     $dpto_codi = $dato_r;
                 }
                 if ($campos_d == "*ASUNTO*") {
                     $asu = $dato_r;
                 }
                 if ($campos_d == "*ID*") {
                     $sgd_esp_codigo = $dato_r;
                 }
                 if ($campos_d == "*DESC_ANEXOS*") {
                     $desc_anexos = $dato_r;
                 }
                 if ($campos_d == "*MUNI_NOMBRE*") {
                     $muni_nombre = $dato_r;
                 }
                 if ($campos_d == "*DEPTO_NOMBRE*") {
                     $dpto_nombre = $dato_r;
                 }
                 if ($campos_d == "*PAIS_NOMBRE*") {
                     $pais = $dato_r;
                 }
                 if ($campos_d == "*TIPO_DOC*") {
                     $tdoc = trim($dato_r);
                 }
                 if ($campos_d == "*NUM_EXPEDIENTE*") {
                     $numeroExpediente = trim($dato_r);
                 }
                 if ($campos_d == "*ESP_CODIGO*") {
                     $codigoESP = $dato_r;
                     if ($codigoESP == "") {
                         $codigoESP = null;
                     }
                 }
                 if ($campos_d == "*RAD_ANEXO*") {
                     $radicadopadre = $dato_r;
                     $tipoanexo = 0;
                     if ($radicadopadre == "") {
                         $radicadopadre = "";
                         $tipoanexo = "";
                     }
                 } else {
                     $radicadopadre = "";
                 }
                 $tipo_anexo = "0";
                 $cuentai = "";
                 $documento_us3 = "";
                 $med = "";
                 $fec = "";
                 $ane = "";
                 //$pais="COLOMBIA";
                 $carp_codi = "12";
                 $i++;
             }
             $tip_rem = "1";
             // Si no se especifico el tipo de documento
             if (!$tdoc) {
                 $tdoc = 0;
             }
             //			$this->validarLugar();
             $pais_codi = $this->arrCodPais[$pais . $dpto_nombre . $muni_nombre];
             if ($pais_codi == '') {
                 $pais_codi = '170';
             }
             $dpto_codi = $pais_codi . "-" . $this->arrCodDepto[$dpto_nombre];
             $muni_codi = $dpto_codi . "-" . $this->arrCodMuni[$dpto_nombre . $muni_nombre];
             $tmp_objMuni = new Municipio($this->conexion);
             //Creamos esto para traer el codigo del continente y transmitirlo
             $tmp_objMuni->municipio_codigo($dpto_codi, $muni_codi);
             //por las diferentes tablas.
             $cont_codi = $tmp_objMuni->get_cont_codi();
             $muni_codi = $cont_codi . "-" . $muni_codi;
             //Se agregan las dos variables siguientes, para corregir el error que se estaba presentando en la radicación masiva
             $codigo_depto = $this->arrCodDepto[$dpto_nombre];
             $codigo_muni = $this->arrCodMuni[$dpto_nombre . $muni_nombre];
             //Fin Variables agregadas
             $muni_us1 = $muni_codi;
             $codep_us1 = $dpto_codi;
             $nombre_us = "{$nombre_us1} {$prim_apell_us1} {$seg_apell_us1}";
             unset($tmp_objMuni);
             $documento_us3 = $codigoESP;
             if (!$documento_us3) {
                 $documento_us3 = null;
             }
             //Si se trata de una combinacion de correspondencia definitiva
             if ($this->definitivo == "si") {
                 // Segun el tipo de remitente se graba en la tabla respectiva.
                 // 0 - ESP 1 - OTRA EMPRESA  2 - PERSONA NATURAL
                 $nurad = $this->btt->radicar_salida_masiva($tipoanexo, $cuentai, $documento_us3, $med, $fec, $radicadopadre, $codusuario, $tip_doc, $ane, $pais, $asu, $dependencia, $tip_rem, $usua_doc, $this->tipoDocto, $muni_codi, $archivo, $usua_doc, $depe_codi_territorial, $secRadicacion, $numeroExpediente, $TipoRad);
                 //include_once("$this->ruta_raiz/include/tx/Expediente.php");
                 //$this->objExp = new Expediente($this->conexion);
                 if (strlen($numeroExpediente) >= 10) {
                     $this->objExp = new Expediente($this->conexion);
                     $resultadoExp = $this->objExp->insertar_expediente($numeroExpediente, $nurad, $dependencia, $codusuario, $usua_doc);
                     $observa = "Por Rad. Masiva.";
                     if ($this->codProceso) {
                         $radicados[] = $nurad;
                         $tipoTx = 50;
                         $objFlujo = new Flujo($this->conexion, $this->codProceso, $usua_doc);
                         $expEstadoActual = $objFlujo->actualNodoExpediente($numeroExpediente);
                         $objFlujo->cambioNodoExpediente($numeroExpediente, $nurad, $this->codFlujo, $this->codArista, 1, $observa, $this->codProceso);
                     }
                 }
                 $nombre_us1 = trim($nombre_us1);
                 $direccion_us1 = trim($direccion_us1);
                 if ($tip_doc == 2) {
                     $codigo_us = $this->btt->grabar_usuario($doc_us1, $nombre_us1, $direccion_us1, $prim_apell_us1, $seg_apell_us1, $telefono_us1, $mail_us1, $muni_us1);
                     $tipo_emp_us1 = 0;
                     $documento_us1 = $codigo_us;
                 }
                 if ($tip_doc == 1) {
                     $codigo_oem = $this->btt->grabar_oem($doc_us1, $nombre_us1, $direccion_us1, $prim_apell_us1, $seg_apell_us1, $telefono_us1, $mail_us1, $muni_us1);
                     $tipo_emp_us1 = 2;
                     $documento_us1 = $codigo_oem;
                 }
                 if ($tip_doc == 0) {
                     $sgd_esp_codigo = $this->arregloEsp[$nombre_us1];
                     $tipo_emp_us1 = 1;
                     $documento_us1 = $sgd_esp_codigo;
                 }
                 $documento_us2 = "";
                 $documento_us3 = "";
                 $mail_us1;
                 $cc_documento_us1 = "documento";
                 $grbNombresUs1 = trim($nombre_us1) . " " . trim($prim_apel_us1) . " " . trim($seg_apel_us1);
                 $conexion =& $this->conexion;
                 include "{$ruta_raiz}/radicacion/grb_direcciones.php";
                 // En esta parte registra el envio en la tabla SGD_RENV_REGENVIO
                 if (!$this->codigo_envio) {
                     $isql = "select max(SGD_RENV_CODIGO) as MAX FROM SGD_RENV_REGENVIO";
                     $rs = $this->conexion->query($isql);
                     if (!$rs->EOF) {
                         $nextval = $rs->fields['MAX'];
                     }
                     $nextval++;
                     $this->codigo_envio = $nextval;
                     $this->radi_nume_grupo = $nurad;
                     $radi_nume_grupo = $this->radi_nume_grupo;
                 } else {
                     $nextval = $this->codigo_envio;
                 }
                 $dep_radicado = substr($verrad_sal, 4, 3);
                 $carp_codi = substr($dep_radicado, 0, 2);
                 $dir_tipo = 1;
                 $nombre_us = substr(trim($nombre_us), 0, 49);
                 $direccion_us1 = substr(trim($direccion_us1), 0, 29);
                 if (!$muni_nomb) {
                     $muni_nomb = $muni_tmp1;
                 }
                 if (!$valor_unit) {
                     $valor_unit = 0;
                 }
                 //
                 $isql = "INSERT INTO SGD_RENV_REGENVIO (USUA_DOC, SGD_RENV_CODIGO, SGD_FENV_CODIGO, SGD_RENV_FECH,\n\t\t\t\t\t\tRADI_NUME_SAL, SGD_RENV_DESTINO, SGD_RENV_TELEFONO, SGD_RENV_MAIL, SGD_RENV_PESO, SGD_RENV_VALOR,\n\t\t\t\t\t\tSGD_RENV_CERTIFICADO, SGD_RENV_ESTADO, SGD_RENV_NOMBRE, SGD_DIR_CODIGO, DEPE_CODI, SGD_DIR_TIPO,\n\t\t\t\t\t\tRADI_NUME_GRUPO, SGD_RENV_PLANILLA, SGD_RENV_DIR, SGD_RENV_PAIS, SGD_RENV_DEPTO, SGD_RENV_MPIO,\n\t\t\t\t\t\tSGD_RENV_TIPO, SGD_RENV_OBSERVA,SGD_DEPE_GENERA)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t({$usua_doc}, {$nextval}, 101, " . $this->btt->sqlFechaHoy . ", {$nurad}, '{$muni_nomb}', '{$telefono_us1}', '{$mail}','',\n\t\t\t\t\t\t'{$valor_unit}', 0, 1, '{$nombre_us}', NULL, {$dependencia}, '{$dir_tipo}', " . $this->radi_nume_grupo . ", '00',\n\t\t\t\t\t\t'{$direccion_us1}', '{$pais}','{$dpto_nombre}', '{$muni_nombre}', 1, 'Masiva grupo " . $this->radi_nume_grupo . "',\n\t\t\t\t\t\t{$dependencia}) ";
                 $rs = $this->conexion->conn->Execute($isql);
                 if (!$rs) {
                     $this->conexion->conn->RollbackTrans();
                     die("<span class='etextomenu'>No se ha podido insertar la informaci&oacute;n en SGD_RENV_REGENVIO.");
                 }
                 /*
                  * Registro de la clasificacion TRD
                  */
                 $isql = "INSERT INTO SGD_RDF_RETDOCF(USUA_DOC, SGD_MRD_CODIGO, SGD_RDF_FECH, RADI_NUME_RADI, DEPE_CODI, USUA_CODI)\n\t\t\t\t\t\tVALUES({$usua_doc}, {$codiTRD}," . $this->btt->sqlFechaHoy . ", {$nurad}, '{$dependencia}', {$codusuario} )";
                 $rs = $this->conexion->query($isql);
                 if (!$rs) {
                     $this->conexion->conn->RollbackTrans();
                     die("<span class='etextomenu'>No se ha podido insertar la informaci&ocute;n en SGD_RENV_REGENVIO");
                 }
             } else {
                 $sec = $ii;
                 $sec = str_pad($sec, 5, "X", STR_PAD_LEFT);
                 $nurad = date("Y") . $dependencia . $sec . "1X";
             }
             // Comentariada por HLP. Cambiar , por ;
             fputs($fp, implode(",", $this->datos[$ii]) . ",{$nurad}," . date("d/m/Y") . "," . str_ireplace(",", " ", $b->traducefecha(date("m/d/Y"))) . " \n");
             //fputs ($fp,implode( ";", $this->datos[$ii]).";$nurad;".date("d/m/Y")."\n");
             $contador = $ii + 1;
             echo "<tr><td class='listado2'>{$contador}</td><td class='listado2' >{$nurad}</td>\n\t\t    \t <td class='listado2'>" . unhtmlspecialchars($nombre_us) . "</td><td class='listado2'>" . unhtmlspecialchars($direccion_us1) . "</td>\n\t\t     \t<td class='listado2' >{$dpto_nombre}</td><td class='listado2'>{$muni_nombre}</td>\n\t\t     \t<td class='listado2'>{$numeroExpediente}</td></tr>";
             if (connection_status() != 0) {
                 echo "<h1>Error de conexión</h1>";
                 $objError = new CombinaError(NO_DEFINIDO);
                 echo $objError->getMessage();
                 die;
             }
             $nombPdf = iconv($odt->codificacion($nombre_us), 'ISO-8859-1', $nombre_us);
             $dirPdf = iconv($odt->codificacion($direccion_us1), 'ISO-8859-1', $direccion_us1);
             $dptoPdf = iconv($odt->codificacion($dpto_nombre), 'ISO-8859-1', $dpto_nombre);
             $muniPdf = iconv($odt->codificacion($muni_nombre), 'ISO-8859-1', $muni_nombre);
             $data = array_merge($data, array(array('#' => $contador, 'Radicado' => $nurad, 'Nombre' => $nombPdf, 'Direccion' => $dirPdf, 'Departamento' => $dptoPdf, 'Municipio' => $muniPdf)));
             $arrRadicados[] = $nurad;
         }
         fclose($fp);
         echo "</table>";
         echo "<span class='info'>N&uacute;mero de registros {$contador}</span>";
         $this->pdf->ezTable($data);
         $this->pdf->ezText("\n", 15, $justCentro);
         $this->pdf->ezText("Total Registros {$contador} \n", 15, $justCentro);
         $pdfcode = $this->pdf->ezOutput();
         $fp = fopen($this->arcPDF, 'wb');
         fwrite($fp, $pdfcode);
         fclose($fp);
         if ($this->definitivo == "si") {
             $objHist->insertarHistorico($arrRadicados, $dependencia, $codusuario, $dependencia, $codusuario, "Radicado insertado del grupo de masiva {$radi_nume_grupo}", 30);
         }
         $this->resulComb = $data;
     } else {
         exit("No se pudo crear el archivo {$this->archivo_insumo}");
     }
 }
Ejemplo n.º 28
0
 public function getMunicipios($id_provincia)
 {
     $municipios = new Municipio();
     return $municipios->municipiosProvincia($id_provincia);
 }
Ejemplo n.º 29
0
require_once "{$ruta_raiz}/include/db/ConnectionHandler.php";
$db = new ConnectionHandler($ruta_raiz);
$error = 0;
if ($db) {
    include_once $ruta_raiz . "/radicacion/crea_combos_universales.php";
    $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);
    //$db->conn->debug=true;
    if (isset($_POST['btn_accion'])) {
        $record = array();
        $record['NUIR'] = $_POST['txt_nuir'];
        $record['NOMBRE_DE_LA_EMPRESA'] = mb_strtoupper(trim($_POST['txt_name']), ini_get('default_charset'));
        $record['NIT_DE_LA_EMPRESA'] = mb_strtoupper(trim($_POST['txt_nit']), ini_get('default_charset'));
        $record['SIGLA_DE_LA_EMPRESA'] = $_POST['txt_sigla'];
        $record['DIRECCION'] = $_POST['txt_dir'];
        include_once "{$ruta_raiz}/class_control/Municipio.php";
        $tmp_mun = new Municipio($db);
        $tmp_mun->municipio_codigo($_POST['codep_us1'], $_POST['muni_us1']);
        $record['ID_CONT'] = $tmp_mun->get_cont_codi();
        $record['ID_PAIS'] = $tmp_mun->get_pais_codi();
        $record['CODIGO_DEL_DEPARTAMENTO'] = $tmp_mun->dpto_codi;
        $record['CODIGO_DEL_MUNICIPIO'] = $tmp_mun->muni_codi;
        $record['TELEFONO_1'] = $_POST['txt_tel1'];
        isset($_POST['txt_tel2']) ? $record['TELEFONO_2'] = $_POST['txt_tel2'] : ($record['TELEFONO_2'] = null);
        $record['EMAIL'] = $_POST['txt_mail'];
        $_POST['Slc_act'] == "S" ? $record['ACTIVA'] = 1 : ($record['ACTIVA'] = 0);
        $record['ARE_ESP_SECUE'] = 8;
        $record['NOMBRE_REP_LEGAL'] = mb_strtoupper(trim($_POST['txt_namer']), ini_get('default_charset'));
        if ($_POST['btn_accion'] == 'Agregar') {
            $record['IDENTIFICADOR_EMPRESA'] = $db->conn->nextId("SEC_BODEGA_EMPRESAS");
        }
        if ($_POST['btn_accion'] == 'Modificar') {
Ejemplo n.º 30
0
/**
 * Se usa para generar usuarios nuevos debe de estar en el bloque de funcionalidades del administrador. 
 */
Route::get('usuarios/nuevo', array('uses' => 'UsuariosController@nuevoUsuario'));
/*
 * Guarda los datos del usuario nuevo, perfil, password y clave. 
 */
Route::post('usuarios/guardarUsuario', array('uses' => 'UsuariosController@crearUsuario'));
/*
 * Obtener municipios se utiliza para rellenar los controles select en los formularios de registro
 * de alumnos y profesores. 
 */
Route::get('obtenerMunicipios', function () {
    $estado = Input::get('option');
    $municipios[0] = 'Selecciona tu Delegación o Municipio';
    foreach (Municipio::where('idEstado', $estado)->orderBy('municipio', 'asc')->get() as $mun) {
        $municipios[$mun->idMunicipio] = $mun->municipio;
    }
    return Response::json($municipios);
});
Route::get('obtenerColonias', function () {
    $estado = Input::get('estado');
    $municipio = Input::get('municipio');
    //$coloniaDatos=DB::table('tblAsentamientos')->where('codigo',$codigo)->lists('asentamiento');
    $colonias[0] = 'Selecciona tu Colonia';
    foreach (Colonia::where('idEstado', $estado)->where('idMunicipio', $municipio)->orderBy('colonia', 'asc')->get() as $col) {
        $colonias[$col->idColonia] = $col->colonia;
    }
    return Response::json($colonias);
    //return Response::eloquent($coloniaDatos->get(['id','asentamiento']));
});