Ejemplo n.º 1
0
 public function postMunicipios()
 {
     $uf = ORGuf::find(Input::get('id'));
     $html = '';
     foreach ($uf->towns as $municipio) {
         $html .= "<option value='" . $municipio->id_municipio . "'>" . $municipio->name_municipio . "</option>";
     }
     return $html;
 }
Ejemplo n.º 2
0
 protected function valoresBoleto()
 {
     $this->add['nombre'] = $this->conta->nombre_completo;
     // Direccion de acuerdo al tipo de correspondencia
     if ($this->conta->tipo_correspondencia == 'c') {
         $this->add['estado'] = $this->conta->uf_com;
         $this->add['ciudad'] = $this->conta->municipio_com;
         $this->add['direccion'] = $this->conta->dir_com;
         $this->add['numero'] = $this->conta->numero_com;
         $this->add['complemento'] = $this->conta->complemento_com;
         $this->add['cep'] = $this->conta->cep_com;
         $this->add['barrio'] = $this->conta->bairro_com;
     } elseif ($this->conta->tipo_correspondencia == 'r') {
         $this->add['estado'] = $this->conta->uf_res;
         $this->add['ciudad'] = $this->conta->municipio_res;
         $this->add['direccion'] = $this->conta->dir_res;
         $this->add['numero'] = $this->conta->numero_res;
         $this->add['complemento'] = $this->conta->complemento_res;
         $this->add['cep'] = $this->conta->cep_res;
         $this->add['barrio'] = $this->conta->bairro_res;
     }
     // Instrucciones de boleto de acuerdo a la categoria
     if ($this->conta->categoria) {
         $rsCat = $this->conta->category;
         $this->categoria = $rsCat->nombre_categoria;
         $instruccionesCategoria = $rsCat->instruction;
         if ($instruccionesCategoria) {
             $this->linea2 = $instruccionesCategoria->linea_2;
             $this->linea3 = $instruccionesCategoria->linea_3;
             $this->linea4 = $instruccionesCategoria->linea_4;
         }
     }
     // Dados do Sacado asociado
     $cidade = ORGTowns::find($this->add['ciudad']);
     $cidade = $cidade ? $cidade->name_municipio : '';
     $estado = ORGuf::find($this->add['estado']);
     $estado = $estado ? $estado->name_uf : '';
     $this->boleto['sacado_nome'] = ucfirst($this->add['nombre']);
     $this->boleto['sacado_end1'] = $this->add['direccion'] . ' ' . ltrim($this->add['numero']) . " " . ltrim($this->add['complemento']);
     $this->boleto['sacado_end2'] = $this->add['cep'] . "&nbsp;&nbsp;&nbsp;&nbsp;" . ltrim($this->add['barrio']) . "&nbsp;&nbsp;&nbsp;&nbsp;" . ltrim($cidade) . "&nbsp;&nbsp;&nbsp;&nbsp;" . ltrim($estado);
 }