@@ -75,10 +75,10 @@ discard block |
||
| 75 | 75 | $inq->fecha_ocupacion = null; |
| 76 | 76 | if ($inq->save()) { |
| 77 | 77 | $this->new_message('Inquilino removido correctamente.'); |
| 78 | - } else { |
|
| 78 | + }else { |
|
| 79 | 79 | $this->new_error_msg('Error al remover el inquilino.'); |
| 80 | 80 | } |
| 81 | - } else { |
|
| 81 | + }else { |
|
| 82 | 82 | $this->new_error_msg('Inquilino no encontrado.'); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -188,22 +188,22 @@ discard block |
||
| 188 | 188 | public function buscar_residentes($param) |
| 189 | 189 | { |
| 190 | 190 | if (is_numeric($param)) { |
| 191 | - $where = "(r.codcliente LIKE '%" . $param . "%'" |
|
| 192 | - . " OR c.cifnif LIKE '%" . $param . "%'" |
|
| 193 | - . " OR c.telefono1 LIKE '" . $param . "%'" |
|
| 194 | - . " OR c.telefono2 LIKE '" . $param . "%'" |
|
| 195 | - . " OR ca_telefono LIKE '" . $param . "%'" |
|
| 196 | - . " OR r.observaciones LIKE '%" . $param . "%')"; |
|
| 197 | - } else { |
|
| 191 | + $where = "(r.codcliente LIKE '%".$param."%'" |
|
| 192 | + . " OR c.cifnif LIKE '%".$param."%'" |
|
| 193 | + . " OR c.telefono1 LIKE '".$param."%'" |
|
| 194 | + . " OR c.telefono2 LIKE '".$param."%'" |
|
| 195 | + . " OR ca_telefono LIKE '".$param."%'" |
|
| 196 | + . " OR r.observaciones LIKE '%".$param."%')"; |
|
| 197 | + }else { |
|
| 198 | 198 | $buscar = str_replace(' ', '%', $param); |
| 199 | - $where = "(lower(nombre) LIKE '%" . $buscar . "%'" |
|
| 200 | - . " OR lower(razonsocial) LIKE '%" . $buscar . "%'" |
|
| 201 | - . " OR lower(ca_apellidos) LIKE '%" . $buscar . "%'" |
|
| 202 | - . " OR lower(ca_nombres) LIKE '%" . $buscar . "%'" |
|
| 203 | - . " OR lower(cifnif) LIKE '%" . $buscar . "%'" |
|
| 204 | - . " OR lower(observaciones) LIKE '%" . $buscar . "%'" |
|
| 205 | - . " OR lower(ca_email) LIKE '%" . $buscar . "%'" |
|
| 206 | - . " OR lower(email) LIKE '%" . $buscar . "%')"; |
|
| 199 | + $where = "(lower(nombre) LIKE '%".$buscar."%'" |
|
| 200 | + . " OR lower(razonsocial) LIKE '%".$buscar."%'" |
|
| 201 | + . " OR lower(ca_apellidos) LIKE '%".$buscar."%'" |
|
| 202 | + . " OR lower(ca_nombres) LIKE '%".$buscar."%'" |
|
| 203 | + . " OR lower(cifnif) LIKE '%".$buscar."%'" |
|
| 204 | + . " OR lower(observaciones) LIKE '%".$buscar."%'" |
|
| 205 | + . " OR lower(ca_email) LIKE '%".$buscar."%'" |
|
| 206 | + . " OR lower(email) LIKE '%".$buscar."%')"; |
|
| 207 | 207 | } |
| 208 | 208 | return $where; |
| 209 | 209 | } |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | public function buscar_inmuebles($param) |
| 212 | 212 | { |
| 213 | 213 | if (is_numeric($param)) { |
| 214 | - $where = " r.codigo LIKE '%" . $param . "%'" |
|
| 215 | - . " OR r.numero LIKE '%" . $param . "%'" |
|
| 216 | - . " OR CONCAT(r.codigo, r.numero) LIKE '%" . $param . "%'"; |
|
| 217 | - } else { |
|
| 214 | + $where = " r.codigo LIKE '%".$param."%'" |
|
| 215 | + . " OR r.numero LIKE '%".$param."%'" |
|
| 216 | + . " OR CONCAT(r.codigo, r.numero) LIKE '%".$param."%'"; |
|
| 217 | + }else { |
|
| 218 | 218 | $buscar = str_replace(' ', '%', $param); |
| 219 | - $where = " lower(r.codigo) LIKE '%" . $buscar . "%'" |
|
| 220 | - . " OR lower(r.numero) LIKE '%" . $buscar . "%'" |
|
| 221 | - . " OR CONCAT(lower(r.codigo), r.numero) LIKE '%" . $param . "%'"; |
|
| 219 | + $where = " lower(r.codigo) LIKE '%".$buscar."%'" |
|
| 220 | + . " OR lower(r.numero) LIKE '%".$buscar."%'" |
|
| 221 | + . " OR CONCAT(lower(r.codigo), r.numero) LIKE '%".$param."%'"; |
|
| 222 | 222 | } |
| 223 | 223 | return $where; |
| 224 | 224 | } |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | public function buscar_vehiculos($param) |
| 227 | 227 | { |
| 228 | 228 | if (is_numeric($param)) { |
| 229 | - $where = "(r.codcliente LIKE '%" . $param . "%'" |
|
| 230 | - . " OR vehiculo_placa LIKE '%" . $param . "%'" |
|
| 231 | - . " OR CAST(idvehiculo AS CHAR) LIKE '" . $param . "%'" |
|
| 232 | - . " OR telefono2 LIKE '" . $param . "%'" |
|
| 233 | - . " OR observaciones LIKE '%" . $param . "%')"; |
|
| 234 | - } else { |
|
| 229 | + $where = "(r.codcliente LIKE '%".$param."%'" |
|
| 230 | + . " OR vehiculo_placa LIKE '%".$param."%'" |
|
| 231 | + . " OR CAST(idvehiculo AS CHAR) LIKE '".$param."%'" |
|
| 232 | + . " OR telefono2 LIKE '".$param."%'" |
|
| 233 | + . " OR observaciones LIKE '%".$param."%')"; |
|
| 234 | + }else { |
|
| 235 | 235 | $buscar = str_replace(' ', '%', $param); |
| 236 | - $where = "(lower(vehiculo_marca) LIKE '%" . $buscar . "%'" |
|
| 237 | - . " OR lower(vehiculo_modelo) LIKE '%" . $buscar . "%'" |
|
| 238 | - . " OR lower(vehiculo_color) LIKE '%" . $buscar . "%'" |
|
| 239 | - . " OR lower(vehiculo_placa) LIKE '%" . $buscar . "%'" |
|
| 240 | - . " OR lower(vehiculo_tipo) LIKE '%" . $buscar . "%'" |
|
| 241 | - . " OR lower(codigo_tarjeta) LIKE '%" . $buscar . "%')"; |
|
| 236 | + $where = "(lower(vehiculo_marca) LIKE '%".$buscar."%'" |
|
| 237 | + . " OR lower(vehiculo_modelo) LIKE '%".$buscar."%'" |
|
| 238 | + . " OR lower(vehiculo_color) LIKE '%".$buscar."%'" |
|
| 239 | + . " OR lower(vehiculo_placa) LIKE '%".$buscar."%'" |
|
| 240 | + . " OR lower(vehiculo_tipo) LIKE '%".$buscar."%'" |
|
| 241 | + . " OR lower(codigo_tarjeta) LIKE '%".$buscar."%')"; |
|
| 242 | 242 | } |
| 243 | 243 | return $where; |
| 244 | 244 | } |
@@ -257,13 +257,13 @@ discard block |
||
| 257 | 257 | $inmueble->ocupado = true; |
| 258 | 258 | $inmueble->codcliente = $codcliente; |
| 259 | 259 | $inmueble->iddireccion = $this->actualizar_direccion_residente($codcliente, $iddireccion, $nueva_direccion); |
| 260 | - $inmueble->fecha_ocupacion = ($fecha_ocupacion)?\date('Y-m-d', strtotime($fecha_ocupacion)):null; |
|
| 260 | + $inmueble->fecha_ocupacion = ($fecha_ocupacion) ?\date('Y-m-d', strtotime($fecha_ocupacion)) : null; |
|
| 261 | 261 | $inmueble->fecha_disponibilidad = ($fecha_disponibilidad) |
| 262 | 262 | ?\date('Y-m-d', strtotime($fecha_disponibilidad)) |
| 263 | 263 | :null; |
| 264 | 264 | if ($inmueble->save()) { |
| 265 | 265 | $this->new_message('Residente agregado exitosamente.'); |
| 266 | - } else { |
|
| 266 | + }else { |
|
| 267 | 267 | $this->new_error_msg('No se pudo agregar al residente confirme el nombre '. |
| 268 | 268 | 'del residente y las fechs de ocupación y disponibilidad'); |
| 269 | 269 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $inmueble->fecha_disponibilidad = ''; |
| 276 | 276 | if ($inmueble->save()) { |
| 277 | 277 | $this->new_message('Residente removido exitosamente.'); |
| 278 | - } else { |
|
| 278 | + }else { |
|
| 279 | 279 | $this->new_error_msg('No se pudo remover al residente'); |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | 'nombre' => $cli->nombre, |
| 311 | 311 | 'asignado' => true); |
| 312 | 312 | } |
| 313 | - } else { |
|
| 313 | + }else { |
|
| 314 | 314 | $json[$cli->codcliente] = array('value' => $cli->nombre, |
| 315 | 315 | 'data' => $cli->codcliente, |
| 316 | 316 | 'nombre' => $cli->nombre, |
@@ -367,13 +367,13 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | public function paginas() |
| 369 | 369 | { |
| 370 | - $url = $this->url() . "&query=" . $this->query |
|
| 371 | - . "&query_r=" . $this->query_r |
|
| 372 | - . "&query_v=" . $this->query_v |
|
| 373 | - . "&query_i=" . $this->query_i |
|
| 374 | - . "&orden=" . $this->order |
|
| 375 | - . "&deudores=" . $this->deudores |
|
| 376 | - . "&disponibles=" . $this->disponibles; |
|
| 370 | + $url = $this->url()."&query=".$this->query |
|
| 371 | + . "&query_r=".$this->query_r |
|
| 372 | + . "&query_v=".$this->query_v |
|
| 373 | + . "&query_i=".$this->query_i |
|
| 374 | + . "&orden=".$this->order |
|
| 375 | + . "&deudores=".$this->deudores |
|
| 376 | + . "&disponibles=".$this->disponibles; |
|
| 377 | 377 | |
| 378 | 378 | $paginas = array(); |
| 379 | 379 | $i = 0; |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | /// añadimos todas la página |
| 384 | 384 | while ($num < $this->total_resultados) { |
| 385 | 385 | $paginas[$i] = array( |
| 386 | - 'url' => $url . "&offset=" . ($i * FS_ITEM_LIMIT), |
|
| 386 | + 'url' => $url."&offset=".($i * FS_ITEM_LIMIT), |
|
| 387 | 387 | 'num' => $i + 1, |
| 388 | 388 | 'actual' => ($num === $this->offset) |
| 389 | 389 | ); |
@@ -398,20 +398,20 @@ discard block |
||
| 398 | 398 | |
| 399 | 399 | /// ahora descartamos |
| 400 | 400 | foreach ($paginas as $j => $value) { |
| 401 | - $enmedio = (int)($i / 2); |
|
| 401 | + $enmedio = (int) ($i / 2); |
|
| 402 | 402 | |
| 403 | 403 | /** |
| 404 | 404 | * descartamos todo excepto la primera, la última, la de enmedio, |
| 405 | 405 | * la actual, las 5 anteriores y las 5 siguientes |
| 406 | 406 | */ |
| 407 | - if (($j>1 && $j<$actual-5 && $j !== $enmedio) || ($j > $actual + 5 && $j < $i - 1 && $j !== $enmedio)) { |
|
| 407 | + if (($j > 1 && $j < $actual - 5 && $j !== $enmedio) || ($j > $actual + 5 && $j < $i - 1 && $j !== $enmedio)) { |
|
| 408 | 408 | unset($paginas[$j]); |
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | if (count($paginas) > 1) { |
| 413 | 413 | return $paginas; |
| 414 | - } else { |
|
| 414 | + }else { |
|
| 415 | 415 | return array(); |
| 416 | 416 | } |
| 417 | 417 | } |
@@ -103,31 +103,31 @@ discard block |
||
| 103 | 103 | $ca_parentesco_obs = $this->clean_text(\filter_input(INPUT_POST, 'ca_parentesco_obs')); |
| 104 | 104 | $vehiculos = \filter_input(INPUT_POST, 'vehiculos'); |
| 105 | 105 | $cliinfo = new residentes_informacion(); |
| 106 | - $cliinfo->codcliente=$codcliente; |
|
| 107 | - $cliinfo->codigo=$codigo; |
|
| 108 | - $cliinfo->ocupantes=$ocupantes; |
|
| 109 | - $cliinfo->ocupantes5anos=$ocupantes5anos; |
|
| 110 | - $cliinfo->ocupantes12anos=$ocupantes12anos; |
|
| 111 | - $cliinfo->ocupantes18anos=$ocupantes18anos; |
|
| 112 | - $cliinfo->ocupantes30anos=$ocupantes30anos; |
|
| 113 | - $cliinfo->ocupantes50anos=$ocupantes50anos; |
|
| 114 | - $cliinfo->ocupantes70anos=$ocupantes70anos; |
|
| 115 | - $cliinfo->ocupantes71anos=$ocupantes71anos; |
|
| 116 | - $cliinfo->informacion_discapacidad= $informacion_discapacidad; |
|
| 117 | - $cliinfo->propietario= (bool)$propietario; |
|
| 118 | - $cliinfo->profesion= $profesion; |
|
| 119 | - $cliinfo->ocupacion= $ocupacion; |
|
| 120 | - $cliinfo->ca_nombres= $ca_nombres; |
|
| 121 | - $cliinfo->ca_apellidos= $ca_apellidos; |
|
| 122 | - $cliinfo->ca_telefono= $ca_telefono; |
|
| 123 | - $cliinfo->ca_email= $ca_email; |
|
| 124 | - $cliinfo->ca_propietario= (bool)$ca_propietario; |
|
| 125 | - $cliinfo->ca_parentesco= $ca_parentesco; |
|
| 126 | - $cliinfo->ca_parentesco_obs= $ca_parentesco_obs; |
|
| 127 | - $cliinfo->vehiculos= $vehiculos; |
|
| 106 | + $cliinfo->codcliente = $codcliente; |
|
| 107 | + $cliinfo->codigo = $codigo; |
|
| 108 | + $cliinfo->ocupantes = $ocupantes; |
|
| 109 | + $cliinfo->ocupantes5anos = $ocupantes5anos; |
|
| 110 | + $cliinfo->ocupantes12anos = $ocupantes12anos; |
|
| 111 | + $cliinfo->ocupantes18anos = $ocupantes18anos; |
|
| 112 | + $cliinfo->ocupantes30anos = $ocupantes30anos; |
|
| 113 | + $cliinfo->ocupantes50anos = $ocupantes50anos; |
|
| 114 | + $cliinfo->ocupantes70anos = $ocupantes70anos; |
|
| 115 | + $cliinfo->ocupantes71anos = $ocupantes71anos; |
|
| 116 | + $cliinfo->informacion_discapacidad = $informacion_discapacidad; |
|
| 117 | + $cliinfo->propietario = (bool) $propietario; |
|
| 118 | + $cliinfo->profesion = $profesion; |
|
| 119 | + $cliinfo->ocupacion = $ocupacion; |
|
| 120 | + $cliinfo->ca_nombres = $ca_nombres; |
|
| 121 | + $cliinfo->ca_apellidos = $ca_apellidos; |
|
| 122 | + $cliinfo->ca_telefono = $ca_telefono; |
|
| 123 | + $cliinfo->ca_email = $ca_email; |
|
| 124 | + $cliinfo->ca_propietario = (bool) $ca_propietario; |
|
| 125 | + $cliinfo->ca_parentesco = $ca_parentesco; |
|
| 126 | + $cliinfo->ca_parentesco_obs = $ca_parentesco_obs; |
|
| 127 | + $cliinfo->vehiculos = $vehiculos; |
|
| 128 | 128 | if ($cliinfo->save()) { |
| 129 | 129 | $this->new_message('¡Información actualizada correctamente!'); |
| 130 | - } else { |
|
| 130 | + }else { |
|
| 131 | 131 | $this->new_error_msg('Ocurrió un error al actualizar la información por favor revise los ". |
| 132 | 132 | "datos ingresados e intente nuevamente.'); |
| 133 | 133 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | foreach ($extensiones as $ext) { |
| 163 | 163 | $fsext0 = new fs_extension($ext); |
| 164 | 164 | if (!$fsext0->save()) { |
| 165 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
| 165 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if (isset($i['deudas'])) { |
| 57 | 57 | $this->deudas = floatval($i['deudas']); |
| 58 | 58 | } |
| 59 | - } else { |
|
| 59 | + }else { |
|
| 60 | 60 | $this->id = null; |
| 61 | 61 | $this->codcliente = null; |
| 62 | 62 | $this->fechaalta = Date('d-m-Y'); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | return '-'; |
| 90 | 90 | } elseif (strlen($this->observaciones) < 60) { |
| 91 | 91 | return $this->observaciones; |
| 92 | - } else { |
|
| 93 | - return substr($this->observaciones, 0, 60) . '...'; |
|
| 92 | + }else { |
|
| 93 | + return substr($this->observaciones, 0, 60).'...'; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -99,16 +99,16 @@ discard block |
||
| 99 | 99 | $data = $this->db->select("SELECT * FROM residentes WHERE id = ".$this->var2str($id).";"); |
| 100 | 100 | if ($data) { |
| 101 | 101 | return new residente($data[0]); |
| 102 | - } else { |
|
| 102 | + }else { |
|
| 103 | 103 | return false; |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | public function exists() |
| 108 | 108 | { |
| 109 | - if(is_null($this->id)) { |
|
| 109 | + if (is_null($this->id)) { |
|
| 110 | 110 | return false; |
| 111 | - } else { |
|
| 111 | + }else { |
|
| 112 | 112 | return $this->db->select("SELECT * FROM residentes WHERE id = ".$this->var2str($this->id).";"); |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | deudas = ".$this->var2str($this->deudas)." WHERE id = ".$this->var2str($this->id).";"; |
| 126 | 126 | |
| 127 | 127 | return $this->db->exec($sql); |
| 128 | - } else { |
|
| 128 | + }else { |
|
| 129 | 129 | $sql = "INSERT INTO residentes (codcliente,nombre,fechaalta,piso,bloque,mensualidad,agua,gas,". |
| 130 | - "observaciones,fechaagua,fechagas,deudas) " . "VALUES (".$this->var2str($this->codcliente).",". |
|
| 130 | + "observaciones,fechaagua,fechagas,deudas) "."VALUES (".$this->var2str($this->codcliente).",". |
|
| 131 | 131 | $this->var2str($this->nombre).",".$this->var2str($this->fechaalta)."," |
| 132 | 132 | .$this->var2str($this->piso).",".$this->var2str($this->bloque).",".$this->var2str($this->mensualidad)."," |
| 133 | 133 | .$this->var2str($this->agua).",".$this->var2str($this->gas).",".$this->var2str($this->observaciones)."," |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | if ($this->db->exec($sql)) { |
| 137 | 137 | $this->id = $this->db->lastval(); |
| 138 | 138 | return true; |
| 139 | - } else { |
|
| 139 | + }else { |
|
| 140 | 140 | return false; |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @author Joe Nilson <joenilson at gmail.com> |
| 24 | 24 | */ |
| 25 | -class residentes_edificaciones_tipo extends \fs_model{ |
|
| 25 | +class residentes_edificaciones_tipo extends \fs_model { |
|
| 26 | 26 | /** |
| 27 | 27 | * El Id del tipo de edificacion |
| 28 | 28 | * @var integer serial |
@@ -39,19 +39,19 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public $padre; |
| 41 | 41 | public function __construct($t = FALSE) { |
| 42 | - parent::__construct('residentes_edificaciones_tipo','plugins/residentes'); |
|
| 43 | - if($t){ |
|
| 42 | + parent::__construct('residentes_edificaciones_tipo', 'plugins/residentes'); |
|
| 43 | + if ($t) { |
|
| 44 | 44 | $this->id = $t['id']; |
| 45 | 45 | $this->descripcion = $t['descripcion']; |
| 46 | 46 | $this->padre = $t['padre']; |
| 47 | - }else{ |
|
| 47 | + }else { |
|
| 48 | 48 | $this->id = null; |
| 49 | 49 | $this->descripcion = null; |
| 50 | 50 | $this->padre = null; |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function install(){ |
|
| 54 | + public function install() { |
|
| 55 | 55 | return "insert into residentes_edificaciones_tipo (descripcion) VALUES ('Bloque');"; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | $lista[] = new residentes_edificaciones_tipo($d); |
| 66 | 66 | } |
| 67 | 67 | return $lista; |
| 68 | - } else { |
|
| 68 | + }else { |
|
| 69 | 69 | return false; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function get($id){ |
|
| 73 | + public function get($id) { |
|
| 74 | 74 | $sql = "SELECT * FROM ".$this->table_name." WHERE id = ".$this->intval($id).";"; |
| 75 | 75 | $data = $this->db->select($sql); |
| 76 | - if($data){ |
|
| 76 | + if ($data) { |
|
| 77 | 77 | return new residentes_edificaciones_tipo($data[0]); |
| 78 | - }else{ |
|
| 78 | + }else { |
|
| 79 | 79 | return false; |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -86,43 +86,43 @@ discard block |
||
| 86 | 86 | * @param type $value string or integer |
| 87 | 87 | * @return boolean|\FacturaScripts\model\residentes_edificaciones_tipo |
| 88 | 88 | */ |
| 89 | - public function get_by_field($field,$value){ |
|
| 90 | - $query = (is_string($value))?$this->var2str($value):$this->intval($value); |
|
| 89 | + public function get_by_field($field, $value) { |
|
| 90 | + $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value); |
|
| 91 | 91 | $sql = "SELECT * FROM ".$this->table_name." WHERE ".strtoupper(trim($field))." = ".$query.";"; |
| 92 | 92 | $data = $this->db->select($sql); |
| 93 | - if($data){ |
|
| 93 | + if ($data) { |
|
| 94 | 94 | $lista = array(); |
| 95 | - foreach($data as $d){ |
|
| 96 | - $lista[] = new residentes_edificaciones_tipo($d); |
|
| 95 | + foreach ($data as $d) { |
|
| 96 | + $lista[] = new residentes_edificaciones_tipo($d); |
|
| 97 | 97 | } |
| 98 | 98 | return $lista; |
| 99 | - }else{ |
|
| 99 | + }else { |
|
| 100 | 100 | return false; |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | public function exists() { |
| 105 | - if(is_null($this->id)){ |
|
| 105 | + if (is_null($this->id)) { |
|
| 106 | 106 | return false; |
| 107 | - }else{ |
|
| 107 | + }else { |
|
| 108 | 108 | return $this->get($this->id); |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | public function save() { |
| 113 | - if($this->exists()){ |
|
| 113 | + if ($this->exists()) { |
|
| 114 | 114 | $sql = "UPDATE ".$this->table_name." SET ". |
| 115 | 115 | "descripcion = ".$this->var2str($this->descripcion).", ". |
| 116 | 116 | "padre = ".$this->intval($this->padre)." ". |
| 117 | 117 | "WHERE id = ".$this->intval($this->id).";"; |
| 118 | 118 | return $this->db->exec($sql); |
| 119 | - }else{ |
|
| 119 | + }else { |
|
| 120 | 120 | $sql = "INSERT INTO ".$this->table_name." (descripcion, padre) VALUES (". |
| 121 | 121 | $this->var2str($this->descripcion).", ". |
| 122 | 122 | $this->intval($this->padre).");"; |
| 123 | - if($this->db->exec($sql)){ |
|
| 123 | + if ($this->db->exec($sql)) { |
|
| 124 | 124 | return $this->db->lastval(); |
| 125 | - }else{ |
|
| 125 | + }else { |
|
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -132,24 +132,24 @@ discard block |
||
| 132 | 132 | return $this->db->exec($sql); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - public function jerarquia(){ |
|
| 135 | + public function jerarquia() { |
|
| 136 | 136 | $lista = $this->all(); |
| 137 | - return ($lista)?$this->estructura($lista):null; |
|
| 137 | + return ($lista) ? $this->estructura($lista) : null; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - public function estructura($lista, $raiz = 0){ |
|
| 140 | + public function estructura($lista, $raiz = 0) { |
|
| 141 | 141 | $estructura = array(); |
| 142 | - foreach($lista as $key=>$item){ |
|
| 143 | - if($item->padre == $raiz){ |
|
| 142 | + foreach ($lista as $key=>$item) { |
|
| 143 | + if ($item->padre == $raiz) { |
|
| 144 | 144 | unset($lista[$key]); |
| 145 | - $estructura[]=array( |
|
| 145 | + $estructura[] = array( |
|
| 146 | 146 | 'id'=>$item->id, |
| 147 | 147 | 'text'=>$item->descripcion, |
| 148 | 148 | 'padre'=>$item->padre, |
| 149 | - 'nodes'=>$this->estructura($lista,$item->id) |
|
| 149 | + 'nodes'=>$this->estructura($lista, $item->id) |
|
| 150 | 150 | ); |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | - return empty($estructura)?null:$estructura; |
|
| 153 | + return empty($estructura) ?null:$estructura; |
|
| 154 | 154 | } |
| 155 | 155 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->id = $t['id']; |
| 45 | 45 | $this->descripcion = $t['descripcion']; |
| 46 | 46 | $this->padre = $t['padre']; |
| 47 | - }else{ |
|
| 47 | + } else{ |
|
| 48 | 48 | $this->id = null; |
| 49 | 49 | $this->descripcion = null; |
| 50 | 50 | $this->padre = null; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $data = $this->db->select($sql); |
| 76 | 76 | if($data){ |
| 77 | 77 | return new residentes_edificaciones_tipo($data[0]); |
| 78 | - }else{ |
|
| 78 | + } else{ |
|
| 79 | 79 | return false; |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $lista[] = new residentes_edificaciones_tipo($d); |
| 97 | 97 | } |
| 98 | 98 | return $lista; |
| 99 | - }else{ |
|
| 99 | + } else{ |
|
| 100 | 100 | return false; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | public function exists() { |
| 105 | 105 | if(is_null($this->id)){ |
| 106 | 106 | return false; |
| 107 | - }else{ |
|
| 107 | + } else{ |
|
| 108 | 108 | return $this->get($this->id); |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -116,13 +116,13 @@ discard block |
||
| 116 | 116 | "padre = ".$this->intval($this->padre)." ". |
| 117 | 117 | "WHERE id = ".$this->intval($this->id).";"; |
| 118 | 118 | return $this->db->exec($sql); |
| 119 | - }else{ |
|
| 119 | + } else{ |
|
| 120 | 120 | $sql = "INSERT INTO ".$this->table_name." (descripcion, padre) VALUES (". |
| 121 | 121 | $this->var2str($this->descripcion).", ". |
| 122 | 122 | $this->intval($this->padre).");"; |
| 123 | 123 | if($this->db->exec($sql)){ |
| 124 | 124 | return $this->db->lastval(); |
| 125 | - }else{ |
|
| 125 | + } else{ |
|
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @author Joe Nilson <joenilson at gmail.com> |
| 23 | 23 | */ |
| 24 | -class residentes_edificaciones_mapa extends \fs_model{ |
|
| 24 | +class residentes_edificaciones_mapa extends \fs_model { |
|
| 25 | 25 | /** |
| 26 | 26 | * ID correlativo de cada linea |
| 27 | 27 | * @var integer |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->numero = $t['numero']; |
| 72 | 72 | $this->padre_tipo = $t['padre_tipo']; |
| 73 | 73 | $this->padre_id = $t['padre_id']; |
| 74 | - } else { |
|
| 74 | + }else { |
|
| 75 | 75 | $this->id = null; |
| 76 | 76 | $this->id_tipo = null; |
| 77 | 77 | $this->codigo_edificacion = null; |
@@ -82,21 +82,21 @@ discard block |
||
| 82 | 82 | $this->edificaciones_tipo = new \residentes_edificaciones_tipo(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - public function install(){ |
|
| 85 | + public function install() { |
|
| 86 | 86 | return ""; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - public function all(){ |
|
| 89 | + public function all() { |
|
| 90 | 90 | $sql = "SELECT * FROM ".$this->table_name." ORDER BY id_tipo,codigo_edificacion"; |
| 91 | 91 | $data = $this->db->select($sql); |
| 92 | - if($data){ |
|
| 92 | + if ($data) { |
|
| 93 | 93 | $lista = array(); |
| 94 | - foreach($data as $d){ |
|
| 94 | + foreach ($data as $d) { |
|
| 95 | 95 | $item = new residentes_edificaciones_mapa($d); |
| 96 | 96 | $lista[] = $item; |
| 97 | 97 | } |
| 98 | 98 | return $lista; |
| 99 | - }else{ |
|
| 99 | + }else { |
|
| 100 | 100 | return false; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -108,29 +108,29 @@ discard block |
||
| 108 | 108 | * @param type $padre_tipo integer |
| 109 | 109 | * @return \FacturaScripts\model\residentes_edificaciones_mapa|boolean |
| 110 | 110 | */ |
| 111 | - public function get($id){ |
|
| 111 | + public function get($id) { |
|
| 112 | 112 | $sql = "SELECT * FROM ".$this->table_name. |
| 113 | 113 | " WHERE id = ".$this->intval($id).";"; |
| 114 | 114 | $data = $this->db->select($sql); |
| 115 | - if($data){ |
|
| 115 | + if ($data) { |
|
| 116 | 116 | $item = new residentes_edificaciones_mapa($data[0]); |
| 117 | 117 | $item->desc_id = $this->edificaciones_tipo->get($item->id_tipo)->descripcion; |
| 118 | 118 | return $item; |
| 119 | - }else{ |
|
| 119 | + }else { |
|
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - public function getEstructura(){ |
|
| 124 | + public function getEstructura() { |
|
| 125 | 125 | $sql = "SELECT * FROM ".$this->table_name." WHERE codigo_edificacion = ".$this->var2str($this->codigo_edificacion)." AND ". |
| 126 | 126 | " codigo_padre = ".$this->var2str($this->codigo_padre)." AND id_tipo = ".$this->intval($this->id_tipo)." AND ". |
| 127 | 127 | " padre_tipo = ".$this->intval($this->padre_tipo)." AND padre_id = ".$this->intval($this->padre_id).";"; |
| 128 | 128 | $data = $this->db->select($sql); |
| 129 | - if($data){ |
|
| 129 | + if ($data) { |
|
| 130 | 130 | $item = new residentes_edificaciones_mapa($data[0]); |
| 131 | 131 | $item->desc_id = $this->edificaciones_tipo->get($item->id_tipo)->descripcion; |
| 132 | 132 | return $item; |
| 133 | - }else{ |
|
| 133 | + }else { |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -141,34 +141,34 @@ discard block |
||
| 141 | 141 | * @param type $value string |
| 142 | 142 | * @return boolean|\FacturaScripts\model\residentes_edificaciones_mapa |
| 143 | 143 | */ |
| 144 | - public function get_by_field($field,$value){ |
|
| 145 | - $query = (is_string($value))?$this->var2str($value):$this->intval($value); |
|
| 144 | + public function get_by_field($field, $value) { |
|
| 145 | + $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value); |
|
| 146 | 146 | $sql = "SELECT rem.*, ret.descripcion FROM ".$this->table_name." as rem, residentes_edificaciones_tipo as ret ". |
| 147 | 147 | " WHERE ".strtoupper(trim($field))." = ".$query." AND rem.id_tipo = ret.id order by codigo_edificacion ASC;"; |
| 148 | 148 | $data = $this->db->select($sql); |
| 149 | - if($data){ |
|
| 149 | + if ($data) { |
|
| 150 | 150 | $lista = array(); |
| 151 | - foreach($data as $d){ |
|
| 151 | + foreach ($data as $d) { |
|
| 152 | 152 | $item = new residentes_edificaciones_mapa($d); |
| 153 | 153 | $item->desc_id = $d['descripcion']; |
| 154 | 154 | $lista[] = $item; |
| 155 | 155 | } |
| 156 | 156 | return $lista; |
| 157 | - }else{ |
|
| 157 | + }else { |
|
| 158 | 158 | return false; |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | public function exists() { |
| 163 | - if(!$this->getEstructura()){ |
|
| 163 | + if (!$this->getEstructura()) { |
|
| 164 | 164 | return false; |
| 165 | - }else{ |
|
| 165 | + }else { |
|
| 166 | 166 | return $this->getEstructura(); |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | public function save() { |
| 171 | - if($this->exists()){ |
|
| 171 | + if ($this->exists()) { |
|
| 172 | 172 | $sql = "UPDATE ".$this->table_name." SET ". |
| 173 | 173 | " codigo_edificacion = ".$this->var2str($this->codigo_edificacion).", ". |
| 174 | 174 | " codigo_padre = ".$this->var2str($this->codigo_padre).", ". |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | " padre_id = ".$this->intval($this->padre_id)." ". |
| 179 | 179 | "WHERE id = ".$this->intval($this->id).";"; |
| 180 | 180 | return $this->db->exec($sql); |
| 181 | - }else{ |
|
| 181 | + }else { |
|
| 182 | 182 | $sql = "INSERT INTO ".$this->table_name." (id_tipo, codigo_edificacion, codigo_padre, numero, padre_tipo, padre_id) VALUES (". |
| 183 | 183 | $this->intval($this->id_tipo).", ". |
| 184 | 184 | $this->var2str($this->codigo_edificacion).", ". |
@@ -186,9 +186,9 @@ discard block |
||
| 186 | 186 | $this->var2str($this->numero).", ". |
| 187 | 187 | $this->intval($this->padre_tipo).", ". |
| 188 | 188 | $this->intval($this->padre_id).");"; |
| 189 | - if($this->db->exec($sql)){ |
|
| 189 | + if ($this->db->exec($sql)) { |
|
| 190 | 190 | return true; |
| 191 | - }else{ |
|
| 191 | + }else { |
|
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -200,11 +200,11 @@ discard block |
||
| 200 | 200 | return $this->db->exec($sql); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - private function pertenencia($d){ |
|
| 203 | + private function pertenencia($d) { |
|
| 204 | 204 | $codigo_interno = $d->codigo_interno; |
| 205 | 205 | $piezas = \json_decode($codigo_interno); |
| 206 | 206 | $lista = array(); |
| 207 | - foreach($piezas as $id=>$data){ |
|
| 207 | + foreach ($piezas as $id=>$data) { |
|
| 208 | 208 | $pertenencia = new \stdClass(); |
| 209 | 209 | $pertenencia->id = $id; |
| 210 | 210 | $pertenencia->desc_id = $this->edificaciones_tipo->get($id)->descripcion; |
@@ -215,47 +215,47 @@ discard block |
||
| 215 | 215 | return $lista; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - public function buscar_ubicacion_inmueble($id,$linea){ |
|
| 219 | - $inicio_busqueda = ($linea==0)?"{\"":"{%\""; |
|
| 218 | + public function buscar_ubicacion_inmueble($id, $linea) { |
|
| 219 | + $inicio_busqueda = ($linea == 0) ? "{\"" : "{%\""; |
|
| 220 | 220 | $sql = "SELECT * FROM ".$this->table_name." WHERE codigo_interno LIKE '".$inicio_busqueda.$id."\":%}' ORDER BY codigo;"; |
| 221 | 221 | $data = $this->db->select($sql); |
| 222 | - if($data){ |
|
| 222 | + if ($data) { |
|
| 223 | 223 | $lista = array(); |
| 224 | - foreach($data as $d){ |
|
| 224 | + foreach ($data as $d) { |
|
| 225 | 225 | $l = new residentes_edificaciones_mapa($d); |
| 226 | 226 | $lista[] = $this->pertenencia($l); |
| 227 | 227 | } |
| 228 | 228 | return $lista; |
| 229 | - }else{ |
|
| 229 | + }else { |
|
| 230 | 230 | return false; |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - public function buscar_cantidad_inmuebles($id,$linea){ |
|
| 235 | - $inicio_busqueda = ($linea==0)?"{\"":"{%\""; |
|
| 234 | + public function buscar_cantidad_inmuebles($id, $linea) { |
|
| 235 | + $inicio_busqueda = ($linea == 0) ? "{\"" : "{%\""; |
|
| 236 | 236 | $sql = "SELECT DISTINCT codigo FROM ".$this->table_name." WHERE codigo_interno LIKE '".$inicio_busqueda.$id."\":%}' ORDER BY codigo;"; |
| 237 | 237 | $data = $this->db->select($sql); |
| 238 | - if($data){ |
|
| 238 | + if ($data) { |
|
| 239 | 239 | $lista = array(); |
| 240 | - foreach($data as $d){ |
|
| 240 | + foreach ($data as $d) { |
|
| 241 | 241 | $l = $this->get_by_field('codigo', $d['codigo']); |
| 242 | 242 | $lista[] = $l; |
| 243 | 243 | } |
| 244 | 244 | return $lista; |
| 245 | - }else{ |
|
| 245 | + }else { |
|
| 246 | 246 | return false; |
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - public function generar_mapa(){ |
|
| 250 | + public function generar_mapa() { |
|
| 251 | 251 | $mapa = array(); |
| 252 | 252 | $linea = 0; |
| 253 | - foreach($this->edificaciones_tipo->all() as $data){ |
|
| 254 | - if($linea==1){ |
|
| 253 | + foreach ($this->edificaciones_tipo->all() as $data) { |
|
| 254 | + if ($linea == 1) { |
|
| 255 | 255 | break; |
| 256 | 256 | } |
| 257 | - $items = $this->buscar_cantidad_inmuebles($data->id,$data->padre); |
|
| 258 | - foreach($items as $inmueble){ |
|
| 257 | + $items = $this->buscar_cantidad_inmuebles($data->id, $data->padre); |
|
| 258 | + foreach ($items as $inmueble) { |
|
| 259 | 259 | $mapa[$data->id][] = $inmueble; |
| 260 | 260 | } |
| 261 | 261 | $linea++; |
@@ -263,12 +263,12 @@ discard block |
||
| 263 | 263 | return $mapa; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | - public function tiene_hijos(){ |
|
| 266 | + public function tiene_hijos() { |
|
| 267 | 267 | $sql = "SELECT count(*) as cantidad FROM ".$this->table_name." WHERE padre_id = ".$this->intval($this->id).";"; |
| 268 | 268 | $data = $this->db->select($sql); |
| 269 | - if($data){ |
|
| 269 | + if ($data) { |
|
| 270 | 270 | return $data[0]['cantidad']; |
| 271 | - }else{ |
|
| 271 | + }else { |
|
| 272 | 272 | return false; |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $lista[] = $item; |
| 97 | 97 | } |
| 98 | 98 | return $lista; |
| 99 | - }else{ |
|
| 99 | + } else{ |
|
| 100 | 100 | return false; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $item = new residentes_edificaciones_mapa($data[0]); |
| 117 | 117 | $item->desc_id = $this->edificaciones_tipo->get($item->id_tipo)->descripcion; |
| 118 | 118 | return $item; |
| 119 | - }else{ |
|
| 119 | + } else{ |
|
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $item = new residentes_edificaciones_mapa($data[0]); |
| 131 | 131 | $item->desc_id = $this->edificaciones_tipo->get($item->id_tipo)->descripcion; |
| 132 | 132 | return $item; |
| 133 | - }else{ |
|
| 133 | + } else{ |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $lista[] = $item; |
| 155 | 155 | } |
| 156 | 156 | return $lista; |
| 157 | - }else{ |
|
| 157 | + } else{ |
|
| 158 | 158 | return false; |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | public function exists() { |
| 163 | 163 | if(!$this->getEstructura()){ |
| 164 | 164 | return false; |
| 165 | - }else{ |
|
| 165 | + } else{ |
|
| 166 | 166 | return $this->getEstructura(); |
| 167 | 167 | } |
| 168 | 168 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | " padre_id = ".$this->intval($this->padre_id)." ". |
| 179 | 179 | "WHERE id = ".$this->intval($this->id).";"; |
| 180 | 180 | return $this->db->exec($sql); |
| 181 | - }else{ |
|
| 181 | + } else{ |
|
| 182 | 182 | $sql = "INSERT INTO ".$this->table_name." (id_tipo, codigo_edificacion, codigo_padre, numero, padre_tipo, padre_id) VALUES (". |
| 183 | 183 | $this->intval($this->id_tipo).", ". |
| 184 | 184 | $this->var2str($this->codigo_edificacion).", ". |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $this->intval($this->padre_id).");"; |
| 189 | 189 | if($this->db->exec($sql)){ |
| 190 | 190 | return true; |
| 191 | - }else{ |
|
| 191 | + } else{ |
|
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $lista[] = $this->pertenencia($l); |
| 227 | 227 | } |
| 228 | 228 | return $lista; |
| 229 | - }else{ |
|
| 229 | + } else{ |
|
| 230 | 230 | return false; |
| 231 | 231 | } |
| 232 | 232 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $lista[] = $l; |
| 243 | 243 | } |
| 244 | 244 | return $lista; |
| 245 | - }else{ |
|
| 245 | + } else{ |
|
| 246 | 246 | return false; |
| 247 | 247 | } |
| 248 | 248 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $data = $this->db->select($sql); |
| 269 | 269 | if($data){ |
| 270 | 270 | return $data[0]['cantidad']; |
| 271 | - }else{ |
|
| 271 | + } else{ |
|
| 272 | 272 | return false; |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -192,8 +192,8 @@ |
||
| 192 | 192 | public function all_ocupados() |
| 193 | 193 | { |
| 194 | 194 | $sql = "SELECT re.*, c.nombre FROM ".$this->table_name." as re, clientes as c ". |
| 195 | - " WHERE ocupado = TRUE and re.codcliente != '' and re.codcliente = c.codcliente ". |
|
| 196 | - " ORDER BY re.codigo_interno, re.numero"; |
|
| 195 | + " WHERE ocupado = TRUE and re.codcliente != '' and re.codcliente = c.codcliente ". |
|
| 196 | + " ORDER BY re.codigo_interno, re.numero"; |
|
| 197 | 197 | $data = $this->db->select($sql); |
| 198 | 198 | return $this->listaInfo($data); |
| 199 | 199 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * @author Joe Nilson <joenilson at gmail.com> |
| 23 | 23 | */ |
| 24 | -class residentes_edificaciones extends \fs_model{ |
|
| 24 | +class residentes_edificaciones extends \fs_model { |
|
| 25 | 25 | /** |
| 26 | 26 | * El Id de la de edificacion |
| 27 | 27 | * @var integer serial |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | public $cliente_info; |
| 96 | 96 | public $cliente_vehiculo; |
| 97 | 97 | public function __construct($t = FALSE) { |
| 98 | - parent::__construct('residentes_edificaciones','plugins/residentes'); |
|
| 99 | - if($t){ |
|
| 98 | + parent::__construct('residentes_edificaciones', 'plugins/residentes'); |
|
| 99 | + if ($t) { |
|
| 100 | 100 | $this->id = $t['id']; |
| 101 | 101 | $this->iddireccion = $t['iddireccion']; |
| 102 | 102 | $this->id_edificacion = $t['id_edificacion']; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $this->ocupado = $this->str2bool($t['ocupado']); |
| 110 | 110 | $this->fecha_ocupacion = $t['fecha_ocupacion']; |
| 111 | 111 | $this->fecha_disponibilidad = $t['fecha_disponibilidad']; |
| 112 | - }else{ |
|
| 112 | + }else { |
|
| 113 | 113 | $this->id = null; |
| 114 | 114 | $this->iddireccion = 0; |
| 115 | 115 | $this->id_edificacion = null; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | { |
| 148 | 148 | if (!is_null($this->id)) { |
| 149 | 149 | return FS_PATH.'index.php?page=ver_residente&id='.$this->id; |
| 150 | - } else { |
|
| 150 | + }else { |
|
| 151 | 151 | return FS_PATH.'index.php?page=residentes'; |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $lista[] = $item; |
| 178 | 178 | } |
| 179 | 179 | return $lista; |
| 180 | - } else { |
|
| 180 | + }else { |
|
| 181 | 181 | return false; |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -198,15 +198,15 @@ discard block |
||
| 198 | 198 | return $this->listaInfo($data); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - public function get($id){ |
|
| 201 | + public function get($id) { |
|
| 202 | 202 | $sql = "SELECT * FROM ".$this->table_name." WHERE id = ".$this->intval($id).";"; |
| 203 | 203 | $data = $this->db->select($sql); |
| 204 | - if($data){ |
|
| 204 | + if ($data) { |
|
| 205 | 205 | $item = new residentes_edificaciones($data[0]); |
| 206 | 206 | $item->pertenencia = $this->pertenencia($item); |
| 207 | 207 | $this->info($item); |
| 208 | 208 | return $item; |
| 209 | - }else{ |
|
| 209 | + }else { |
|
| 210 | 210 | return false; |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | * @param type $value string |
| 218 | 218 | * @return boolean|\FacturaScripts\model\residentes_edificaciones |
| 219 | 219 | */ |
| 220 | - public function get_by_field($field,$value){ |
|
| 221 | - $query = (is_string($value))?$this->var2str($value):$this->intval($value); |
|
| 220 | + public function get_by_field($field, $value) { |
|
| 221 | + $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value); |
|
| 222 | 222 | $sql = "SELECT * FROM ".$this->table_name." WHERE ".strtoupper(trim($field))." = ".$query. |
| 223 | 223 | " ORDER BY codigo_interno,numero;"; |
| 224 | 224 | $data = $this->db->select($sql); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | { |
| 230 | 230 | if (is_null($this->id)) { |
| 231 | 231 | return false; |
| 232 | - } else { |
|
| 232 | + }else { |
|
| 233 | 233 | return $this->get($this->id); |
| 234 | 234 | } |
| 235 | 235 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | "ocupado = ".$this->var2str($this->ocupado)." ". |
| 252 | 252 | "WHERE id = ".$this->intval($this->id).";"; |
| 253 | 253 | return $this->db->exec($sql); |
| 254 | - } else { |
|
| 254 | + }else { |
|
| 255 | 255 | $sql = "INSERT INTO ".$this->table_name." (id_edificacion, iddireccion, codigo, codigo_interno, numero, ubicacion, coordenadas,codcliente, ocupado, fecha_ocupacion, fecha_disponibilidad) VALUES (". |
| 256 | 256 | $this->intval($this->id_edificacion).", ". |
| 257 | 257 | $this->intval($this->iddireccion).", ". |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $this->var2str($this->fecha_disponibilidad).");"; |
| 267 | 267 | if ($this->db->exec($sql)) { |
| 268 | 268 | return $this->db->lastval(); |
| 269 | - } else { |
|
| 269 | + }else { |
|
| 270 | 270 | return false; |
| 271 | 271 | } |
| 272 | 272 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | public function buscar_ubicacion_inmueble($id, $linea) |
| 310 | 310 | { |
| 311 | - $inicio_busqueda = ($linea===0)?"{\"":"{%\""; |
|
| 311 | + $inicio_busqueda = ($linea === 0) ? "{\"" : "{%\""; |
|
| 312 | 312 | $sql = "SELECT * FROM ".$this->table_name." WHERE codigo_interno LIKE '". |
| 313 | 313 | $inicio_busqueda.$id."\":%}' ORDER BY codigo;"; |
| 314 | 314 | $data = $this->db->select($sql); |
@@ -319,14 +319,14 @@ discard block |
||
| 319 | 319 | $lista[] = $this->pertenencia($l); |
| 320 | 320 | } |
| 321 | 321 | return $lista; |
| 322 | - } else { |
|
| 322 | + }else { |
|
| 323 | 323 | return false; |
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - public function buscar_cantidad_inmuebles($id,$linea) |
|
| 327 | + public function buscar_cantidad_inmuebles($id, $linea) |
|
| 328 | 328 | { |
| 329 | - $inicio_busqueda = ($linea===0)?"{\"":"{%\""; |
|
| 329 | + $inicio_busqueda = ($linea === 0) ? "{\"" : "{%\""; |
|
| 330 | 330 | $sql = "SELECT DISTINCT codigo FROM ".$this->table_name." WHERE codigo_interno LIKE '". |
| 331 | 331 | $inicio_busqueda.$id."\":%}' ORDER BY codigo;"; |
| 332 | 332 | $data = $this->db->select($sql); |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | $lista[] = $l; |
| 338 | 338 | } |
| 339 | 339 | return $lista; |
| 340 | - } else { |
|
| 340 | + }else { |
|
| 341 | 341 | return false; |
| 342 | 342 | } |
| 343 | 343 | } |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | $data = $this->db->select($sql); |
| 350 | 350 | if ($data) { |
| 351 | 351 | return $data[0]['cantidad']; |
| 352 | - } else { |
|
| 352 | + }else { |
|
| 353 | 353 | return false; |
| 354 | 354 | } |
| 355 | 355 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $mapa = array(); |
| 361 | 361 | $linea = 0; |
| 362 | 362 | foreach ($edificaciones_tipo->all() as $data) { |
| 363 | - if ($linea===1) { |
|
| 363 | + if ($linea === 1) { |
|
| 364 | 364 | break; |
| 365 | 365 | } |
| 366 | 366 | $items = $this->buscar_cantidad_inmuebles($data->id, $data->padre); |
@@ -376,19 +376,19 @@ discard block |
||
| 376 | 376 | { |
| 377 | 377 | $sql = "SELECT * FROM ".$this->table_name." WHERE "; |
| 378 | 378 | $OR = ""; |
| 379 | - if ($type=='inmueble') { |
|
| 380 | - $sql.=" numero LIKE '%".strtoupper($query)."%' "; |
|
| 381 | - $sql.=" OR codigo LIKE '%".strtoupper($query)."%' "; |
|
| 382 | - } else { |
|
| 379 | + if ($type == 'inmueble') { |
|
| 380 | + $sql .= " numero LIKE '%".strtoupper($query)."%' "; |
|
| 381 | + $sql .= " OR codigo LIKE '%".strtoupper($query)."%' "; |
|
| 382 | + }else { |
|
| 383 | 383 | if (is_int($query)) { |
| 384 | - $sql.=" id_edificacion LIKE '%".$query."%' "; |
|
| 385 | - $sql.=" id LIKE '%".$query."%' "; |
|
| 384 | + $sql .= " id_edificacion LIKE '%".$query."%' "; |
|
| 385 | + $sql .= " id LIKE '%".$query."%' "; |
|
| 386 | 386 | $OR = "OR"; |
| 387 | 387 | } |
| 388 | - $sql.=" $OR numero LIKE '%".strtoupper($query)."%' "; |
|
| 389 | - $sql.=" OR codigo LIKE '%".strtoupper($query)."%' "; |
|
| 388 | + $sql .= " $OR numero LIKE '%".strtoupper($query)."%' "; |
|
| 389 | + $sql .= " OR codigo LIKE '%".strtoupper($query)."%' "; |
|
| 390 | 390 | } |
| 391 | - $sql.=" ORDER BY codigo,numero"; |
|
| 391 | + $sql .= " ORDER BY codigo,numero"; |
|
| 392 | 392 | $data = $this->db->select($sql); |
| 393 | 393 | $lista = array(); |
| 394 | 394 | if ($data) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $this->ocupado = $this->str2bool($t['ocupado']); |
| 110 | 110 | $this->fecha_ocupacion = $t['fecha_ocupacion']; |
| 111 | 111 | $this->fecha_disponibilidad = $t['fecha_disponibilidad']; |
| 112 | - }else{ |
|
| 112 | + } else{ |
|
| 113 | 113 | $this->id = null; |
| 114 | 114 | $this->iddireccion = 0; |
| 115 | 115 | $this->id_edificacion = null; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $item->pertenencia = $this->pertenencia($item); |
| 207 | 207 | $this->info($item); |
| 208 | 208 | return $item; |
| 209 | - }else{ |
|
| 209 | + } else{ |
|
| 210 | 210 | return false; |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | public function crear_documento($tipo_documento) |
| 80 | 80 | { |
| 81 | - $this->archivo = \date('dmYhis') . '.pdf'; |
|
| 81 | + $this->archivo = \date('dmYhis').'.pdf'; |
|
| 82 | 82 | switch ($tipo_documento) { |
| 83 | 83 | case 'informacion_cobros': |
| 84 | 84 | $this->documento = new residentes_pdf('letter', 'portrait'); |
| 85 | - $this->documento->pdf->addInfo('Title', 'Pagos Residente ' . |
|
| 85 | + $this->documento->pdf->addInfo('Title', 'Pagos Residente '. |
|
| 86 | 86 | $this->cliente_residente->codcliente); |
| 87 | - $this->documento->pdf->addInfo('Subject', 'Pagos del Residente ' . |
|
| 87 | + $this->documento->pdf->addInfo('Subject', 'Pagos del Residente '. |
|
| 88 | 88 | $this->cliente_residente->codcliente); |
| 89 | 89 | $this->documento->pdf->addInfo('Author', $this->empresa->nombre); |
| 90 | 90 | $this->documento->pdf->ezSetMargins(10, 10, 10, 10); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | public function crearFacturaDetallada() |
| 135 | 135 | { |
| 136 | 136 | $customerInfo = (array) $this->cliente_residente; |
| 137 | - $customerInfo['direccion'] = trim($this->cliente_residente->inmueble->codigo_externo()) . ' numero ' |
|
| 137 | + $customerInfo['direccion'] = trim($this->cliente_residente->inmueble->codigo_externo()).' numero ' |
|
| 138 | 138 | . $this->cliente_residente->inmueble->numero; |
| 139 | 139 | $datosFactura = $this->datosFactura(); |
| 140 | 140 | $datosEmpresa = (array) $this->empresa; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $this->documento->set_y(80); |
| 197 | 197 | if ($this->empresa->pie_factura) { |
| 198 | - $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> ' . |
|
| 198 | + $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> '. |
|
| 199 | 199 | $this->user->get_agente_fullname()), 0); |
| 200 | 200 | $this->documento->pdf->addText( |
| 201 | 201 | 10, |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | if ($this->filter_request('info_accion') == 'enviar') { |
| 209 | - $this->documento->save('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 210 | - } else { |
|
| 211 | - $this->documento->show('documento_cobros_' . \date('dmYhis') . '.pdf'); |
|
| 209 | + $this->documento->save('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 210 | + }else { |
|
| 211 | + $this->documento->show('documento_cobros_'.\date('dmYhis').'.pdf'); |
|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | $this->documento->set_y(80); |
| 258 | 258 | if ($this->empresa->pie_factura) { |
| 259 | - $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> ' . |
|
| 259 | + $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> '. |
|
| 260 | 260 | $this->user->get_agente_fullname()), 0); |
| 261 | 261 | $this->documento->pdf->addText( |
| 262 | 262 | 10, |
@@ -267,9 +267,9 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | if ($this->filter_request('info_accion') == 'enviar') { |
| 270 | - $this->documento->save('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 271 | - } else { |
|
| 272 | - $this->documento->show('documento_cobros_' . \date('dmYhis') . '.pdf'); |
|
| 270 | + $this->documento->save('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 271 | + }else { |
|
| 272 | + $this->documento->show('documento_cobros_'.\date('dmYhis').'.pdf'); |
|
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | $this->crear_documento($tipo_documento); |
| 279 | 279 | $tipo_doc = $this->generar_tipo_doc($tipo_documento); |
| 280 | - if (file_exists('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo)) { |
|
| 280 | + if (file_exists('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo)) { |
|
| 281 | 281 | $mail = $this->empresa->new_mail(); |
| 282 | 282 | $mail->FromName = $this->user->get_agente_fullname(); |
| 283 | 283 | |
@@ -289,22 +289,22 @@ discard block |
||
| 289 | 289 | if ($_POST['email_copia']) { |
| 290 | 290 | if (isset($_POST['cco'])) { |
| 291 | 291 | $mail->addBCC($_POST['email_copia'], $this->cliente_residente->nombre); |
| 292 | - } else { |
|
| 292 | + }else { |
|
| 293 | 293 | $mail->addCC($_POST['email_copia'], $this->cliente_residente->nombre); |
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | - $mail->Subject = $this->empresa->nombre . ': ' . $tipo_doc; |
|
| 297 | + $mail->Subject = $this->empresa->nombre.': '.$tipo_doc; |
|
| 298 | 298 | |
| 299 | 299 | if ($this->is_html($_POST['mensaje'])) { |
| 300 | 300 | $mail->AltBody = strip_tags($_POST['mensaje']); |
| 301 | 301 | $mail->msgHTML($_POST['mensaje']); |
| 302 | 302 | $mail->isHTML(true); |
| 303 | - } else { |
|
| 303 | + }else { |
|
| 304 | 304 | $mail->Body = $_POST['mensaje']; |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - $mail->addAttachment('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 307 | + $mail->addAttachment('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 308 | 308 | if (is_uploaded_file($_FILES['adjunto']['tmp_name'])) { |
| 309 | 309 | $mail->addAttachment($_FILES['adjunto']['tmp_name'], $_FILES['adjunto']['name']); |
| 310 | 310 | } |
@@ -312,12 +312,12 @@ discard block |
||
| 312 | 312 | if ($this->empresa->mail_connect($mail) && $mail->send()) { |
| 313 | 313 | $this->new_message('Mensaje enviado correctamente.'); |
| 314 | 314 | $this->empresa->save_mail($mail); |
| 315 | - } else { |
|
| 316 | - $this->new_error_msg("Error al enviar el email: " . $mail->ErrorInfo); |
|
| 315 | + }else { |
|
| 316 | + $this->new_error_msg("Error al enviar el email: ".$mail->ErrorInfo); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | - unlink('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 320 | - } else { |
|
| 319 | + unlink('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 320 | + }else { |
|
| 321 | 321 | $this->new_error_msg('Imposible generar el PDF.'); |
| 322 | 322 | } |
| 323 | 323 | } |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | $pdf_doc->new_table(); |
| 337 | 337 | $pdf_doc->add_table_row( |
| 338 | 338 | array( |
| 339 | - 'campo1' => "<b>" . $tipo_doc . "</b>", |
|
| 339 | + 'campo1' => "<b>".$tipo_doc."</b>", |
|
| 340 | 340 | 'dato1' => '', |
| 341 | - 'campo2' => "<b>Fecha Impresión:</b> " . \date('d-m-Y H:i:s') |
|
| 341 | + 'campo2' => "<b>Fecha Impresión:</b> ".\date('d-m-Y H:i:s') |
|
| 342 | 342 | ) |
| 343 | 343 | ); |
| 344 | 344 | |
@@ -346,27 +346,27 @@ discard block |
||
| 346 | 346 | array( |
| 347 | 347 | 'campo1' => "<b>Residente:</b>", |
| 348 | 348 | 'dato1' => fs_fix_html($this->cliente_residente->nombre), |
| 349 | - 'campo2' => "<b>Tipo Residente:</b> " . $tipo_residente |
|
| 349 | + 'campo2' => "<b>Tipo Residente:</b> ".$tipo_residente |
|
| 350 | 350 | ) |
| 351 | 351 | ); |
| 352 | 352 | |
| 353 | 353 | $row = array( |
| 354 | 354 | 'campo1' => "<b>Inmueble:</b>", |
| 355 | - 'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo() . |
|
| 356 | - ' - ' . $this->cliente_residente->inmueble->numero), |
|
| 355 | + 'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo(). |
|
| 356 | + ' - '.$this->cliente_residente->inmueble->numero), |
|
| 357 | 357 | 'campo2' => '' |
| 358 | 358 | ); |
| 359 | 359 | |
| 360 | 360 | if (!$this->cliente_residente) { |
| 361 | 361 | /// nada |
| 362 | 362 | } elseif ($this->cliente_residente->telefono1) { |
| 363 | - $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono1; |
|
| 363 | + $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono1; |
|
| 364 | 364 | if ($this->cliente_residente->telefono2) { |
| 365 | - $row['campo2'] .= "\n" . $this->cliente_residente->telefono2; |
|
| 365 | + $row['campo2'] .= "\n".$this->cliente_residente->telefono2; |
|
| 366 | 366 | $lppag -= 2; |
| 367 | 367 | } |
| 368 | 368 | } elseif ($this->cliente_residente->telefono2) { |
| 369 | - $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono2; |
|
| 369 | + $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono2; |
|
| 370 | 370 | } |
| 371 | 371 | $pdf_doc->add_table_row($row); |
| 372 | 372 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | [$table_header, $array_cols] = $this->generar_pdf_lineas_tablas($tipo); |
| 415 | 415 | $pdf_doc->add_table_header($table_header); |
| 416 | 416 | |
| 417 | - for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ( $linea_actual < count($items)));) { |
|
| 417 | + for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ($linea_actual < count($items)));) { |
|
| 418 | 418 | $fila = $this->generar_pdf_lineas_fila($tipo, $items, $linea_actual); |
| 419 | 419 | $pdf_doc->add_table_row($fila); |
| 420 | 420 | $linea_actual++; |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | ); |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - return array($table_header,$array_cols); |
|
| 459 | + return array($table_header, $array_cols); |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | public function generar_pdf_lineas_fila($tipo, $items, $linea_actual) |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | 'fecha' => $items[$linea_actual]->fecha, |
| 468 | 468 | 'vencimiento' => $items[$linea_actual]->vencimiento, |
| 469 | 469 | 'importe' => $this->show_precio($items[$linea_actual]->pvpsindto, $this->empresa->coddivisa, true, FS_NF0), |
| 470 | - 'descuento' => $this->show_numero($items[$linea_actual]->dtopor) . " %", |
|
| 470 | + 'descuento' => $this->show_numero($items[$linea_actual]->dtopor)." %", |
|
| 471 | 471 | 'total' => $this->show_precio($items[$linea_actual]->pvptotal, $this->empresa->coddivisa, true, FS_NF0), |
| 472 | 472 | 'atraso' => $items[$linea_actual]->dias_atraso |
| 473 | 473 | ); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | } |
| 495 | 495 | $aux = explode("\n", $lin->descripcion); |
| 496 | 496 | if (count($aux) > 1) { |
| 497 | - $linea_size += 0.5 * ( count($aux) - 1); |
|
| 497 | + $linea_size += 0.5 * (count($aux) - 1); |
|
| 498 | 498 | } |
| 499 | 499 | if ($linea_size > 1) { |
| 500 | 500 | $lppag2 -= $linea_size - 1; |
@@ -522,83 +522,83 @@ discard block |
||
| 522 | 522 | if (imagepng(imagecreatefromstring(file_get_contents($pdf_doc->logo)), FS_MYDOCS |
| 523 | 523 | . 'images/logo.png')) { |
| 524 | 524 | $pdf_doc->pdf->addPngFromFile( |
| 525 | - FS_MYDOCS . 'images/logo.png', |
|
| 525 | + FS_MYDOCS.'images/logo.png', |
|
| 526 | 526 | $pdf_doc_LOGO_X, |
| 527 | 527 | $pdf_doc_LOGO_Y, |
| 528 | 528 | $tamanyo[0], |
| 529 | 529 | $tamanyo[1] |
| 530 | 530 | ); |
| 531 | - } else { |
|
| 531 | + }else { |
|
| 532 | 532 | $pdf_doc->pdf->addJpegFromFile($pdf_doc->logo, $pdf_doc_LOGO_X, $pdf_doc_LOGO_Y, $tamanyo[0], $tamanyo[1]); |
| 533 | 533 | } |
| 534 | - } else { |
|
| 534 | + }else { |
|
| 535 | 535 | $pdf_doc->pdf->addJpegFromFile($pdf_doc->logo, $pdf_doc_LOGO_X, $pdf_doc_LOGO_Y, $tamanyo[0], $tamanyo[1]); |
| 536 | 536 | } |
| 537 | 537 | $pdf_doc->set_y(400); |
| 538 | 538 | $pdf_doc->pdf->ez['leftMargin'] = 120; |
| 539 | 539 | $pdf_doc->pdf->ezText( |
| 540 | - "<b>" . fs_fix_html($empresa->nombre) . "</b>", |
|
| 540 | + "<b>".fs_fix_html($empresa->nombre)."</b>", |
|
| 541 | 541 | 12, |
| 542 | 542 | array('justification' => 'left') |
| 543 | 543 | ); |
| 544 | - $pdf_doc->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'left')); |
|
| 544 | + $pdf_doc->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'left')); |
|
| 545 | 545 | |
| 546 | - $direccion = $empresa->direccion . "\n"; |
|
| 546 | + $direccion = $empresa->direccion."\n"; |
|
| 547 | 547 | if ($empresa->apartado) { |
| 548 | - $direccion .= ucfirst(FS_APARTADO) . ': ' . $empresa->apartado . ' - '; |
|
| 548 | + $direccion .= ucfirst(FS_APARTADO).': '.$empresa->apartado.' - '; |
|
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | if ($empresa->codpostal) { |
| 552 | - $direccion .= 'CP: ' . $empresa->codpostal . ' - '; |
|
| 552 | + $direccion .= 'CP: '.$empresa->codpostal.' - '; |
|
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | if ($empresa->ciudad) { |
| 556 | - $direccion .= $empresa->ciudad . ' - '; |
|
| 556 | + $direccion .= $empresa->ciudad.' - '; |
|
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | if ($empresa->provincia) { |
| 560 | - $direccion .= '(' . $empresa->provincia . ')'; |
|
| 560 | + $direccion .= '('.$empresa->provincia.')'; |
|
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | if ($empresa->telefono) { |
| 564 | - $direccion .= "\nTeléfono: " . $empresa->telefono . ' - '.$pdf_doc_LOGO_X."/".$pdf_doc_LOGO_Y; |
|
| 564 | + $direccion .= "\nTeléfono: ".$empresa->telefono.' - '.$pdf_doc_LOGO_X."/".$pdf_doc_LOGO_Y; |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | - $pdf_doc->pdf->ezText(fs_fix_html($direccion) . "\n", 8, array('justification' => 'left')); |
|
| 567 | + $pdf_doc->pdf->ezText(fs_fix_html($direccion)."\n", 8, array('justification' => 'left')); |
|
| 568 | 568 | $pdf_doc->set_y($pdf_doc_LOGO_Y); |
| 569 | 569 | |
| 570 | 570 | $pdf_doc->pdf->ez['leftMargin'] = 10; |
| 571 | - } else { |
|
| 571 | + }else { |
|
| 572 | 572 | die('ERROR: no se encuentra la función imagecreatefromstring(). ' |
| 573 | 573 | . 'Y por tanto no se puede usar el logotipo en los documentos.'); |
| 574 | 574 | } |
| 575 | - } else { |
|
| 575 | + }else { |
|
| 576 | 576 | $pdf_doc->pdf->ezText( |
| 577 | - "<b>" . fs_fix_html($empresa->nombre) . "</b>", |
|
| 577 | + "<b>".fs_fix_html($empresa->nombre)."</b>", |
|
| 578 | 578 | 12, |
| 579 | 579 | array('justification' => 'left') |
| 580 | 580 | ); |
| 581 | - $pdf_doc->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'left')); |
|
| 581 | + $pdf_doc->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'left')); |
|
| 582 | 582 | |
| 583 | 583 | $direccion = $empresa->direccion; |
| 584 | 584 | if ($empresa->apartado) { |
| 585 | - $direccion .= ' - ' . ucfirst(FS_APARTADO) . ': ' . $empresa->apartado; |
|
| 585 | + $direccion .= ' - '.ucfirst(FS_APARTADO).': '.$empresa->apartado; |
|
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | if ($empresa->codpostal) { |
| 589 | - $direccion .= ' - CP: ' . $empresa->codpostal; |
|
| 589 | + $direccion .= ' - CP: '.$empresa->codpostal; |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | if ($empresa->ciudad) { |
| 593 | - $direccion .= ' - ' . $empresa->ciudad; |
|
| 593 | + $direccion .= ' - '.$empresa->ciudad; |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | if ($empresa->provincia) { |
| 597 | - $direccion .= ' (' . $empresa->provincia . ')'; |
|
| 597 | + $direccion .= ' ('.$empresa->provincia.')'; |
|
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | if ($empresa->telefono) { |
| 601 | - $direccion .= ' - Teléfono: ' . $empresa->telefono; |
|
| 601 | + $direccion .= ' - Teléfono: '.$empresa->telefono; |
|
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | $pdf_doc->pdf->ezText(fs_fix_html($direccion), 8, array('justification' => 'left')); |
@@ -623,8 +623,8 @@ discard block |
||
| 623 | 623 | $pdf_doc->new_table(); |
| 624 | 624 | $pdf_doc->add_table_row( |
| 625 | 625 | array( |
| 626 | - 'campos' => "<b>" . ucfirst(FS_FACTURA) . ":</b>\n <b>".FS_NUMERO2.":</b>\n<b>Fecha:</b>\n<b>" . 'F. Pago' . ":</b>", |
|
| 627 | - 'factura' => $factura->codigo . "\n" . $factura->numero2 . "\n" . $factura->fecha . "\n" . $factura->codpago, |
|
| 626 | + 'campos' => "<b>".ucfirst(FS_FACTURA).":</b>\n <b>".FS_NUMERO2.":</b>\n<b>Fecha:</b>\n<b>".'F. Pago'.":</b>", |
|
| 627 | + 'factura' => $factura->codigo."\n".$factura->numero2."\n".$factura->fecha."\n".$factura->codpago, |
|
| 628 | 628 | ) |
| 629 | 629 | ); |
| 630 | 630 | $pdf_doc->save_table( |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | $pdf_doc->pdf->ez['leftMargin'] = 10; |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | - public function pdfFacturaDetalle(&$pdf_doc, &$empresa, &$lppag, &$linea_actual) |
|
| 646 | + public function pdfFacturaDetalle(&$pdf_doc, &$empresa, &$lppag, &$linea_actual) |
|
| 647 | 647 | { |
| 648 | 648 | $facturas = new factura_cliente(); |
| 649 | 649 | $clientes = new cliente(); |
@@ -662,10 +662,10 @@ discard block |
||
| 662 | 662 | |
| 663 | 663 | $pdf_doc->add_table_header($table_header); |
| 664 | 664 | |
| 665 | - for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ( $linea_actual < count($lineas)));) { |
|
| 665 | + for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ($linea_actual < count($lineas)));) { |
|
| 666 | 666 | $descripcion = fs_fix_html($lineas[$linea_actual]->descripcion); |
| 667 | 667 | if (!is_null($lineas[$linea_actual]->referencia) && $this->impresion['print_ref']) { |
| 668 | - $descripcion = '<b>' . $lineas[$linea_actual]->referencia . '</b> ' . $descripcion; |
|
| 668 | + $descripcion = '<b>'.$lineas[$linea_actual]->referencia.'</b> '.$descripcion; |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | /// ¿El articulo tiene trazabilidad? |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | 'descripcion' => $descripcion, |
| 678 | 678 | 'cantidad' => $this->show_numero($lineas[$linea_actual]->cantidad, 0), |
| 679 | 679 | 'pvp' => $this->show_precio($lineas[$linea_actual]->pvpunitario, $factura->coddivisa, true, FS_NF0_ART), |
| 680 | - 'dto' => $this->show_numero($due_lineas) . " %", |
|
| 680 | + 'dto' => $this->show_numero($due_lineas)." %", |
|
| 681 | 681 | 'importe' => $this->show_precio($lineas[$linea_actual]->pvptotal, $this->documento->coddivisa) |
| 682 | 682 | ); |
| 683 | 683 | |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | |
| 719 | 719 | /// ¿Última página? |
| 720 | 720 | if ($linea_actual == count($lineas) && $this->documento->observaciones != '') { |
| 721 | - $pdf_doc->pdf->ezText("\n" . fs_fix_html($this->documento->observaciones), 9); |
|
| 721 | + $pdf_doc->pdf->ezText("\n".fs_fix_html($this->documento->observaciones), 9); |
|
| 722 | 722 | } |
| 723 | 723 | } |
| 724 | 724 | |
@@ -737,8 +737,8 @@ discard block |
||
| 737 | 737 | { |
| 738 | 738 | $this->existe_tesoreria(); |
| 739 | 739 | $this->cliente_residente = false; |
| 740 | - if (!file_exists('tmp/' . FS_TMP_NAME . 'enviar') && |
|
| 741 | - !mkdir($concurrentDirectory = 'tmp/' . FS_TMP_NAME . 'enviar') && |
|
| 740 | + if (!file_exists('tmp/'.FS_TMP_NAME.'enviar') && |
|
| 741 | + !mkdir($concurrentDirectory = 'tmp/'.FS_TMP_NAME.'enviar') && |
|
| 742 | 742 | !is_dir($concurrentDirectory)) { |
| 743 | 743 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
| 744 | 744 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if ($this->codigo_edificacion) { |
| 111 | - $this->where_code = " AND r.codigo like '" . $this->codigo_edificacion . "%' "; |
|
| 111 | + $this->where_code = " AND r.codigo like '".$this->codigo_edificacion."%' "; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ($this->tipo === 'informacion') { |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | $this->offset = $this->confirmarValor($this->filter_request('offset'), 0); |
| 148 | 148 | $this->limit = $this->confirmarValor($this->filter_request('limit'), FS_ITEM_LIMIT); |
| 149 | 149 | $this->search = $this->confirmarValor($this->filter_request('search'), false); |
| 150 | - $this->sort = ($sort and $sort!='undefined')?$sort:'r.codigo, r.numero'; |
|
| 151 | - $this->order = ($order and $order!='undefined')?$order:'ASC'; |
|
| 150 | + $this->sort = ($sort and $sort != 'undefined') ? $sort : 'r.codigo, r.numero'; |
|
| 151 | + $this->order = ($order and $order != 'undefined') ? $order : 'ASC'; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | public function informacion_edificaciones() |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | //Verificamos los que están ocupados |
| 172 | - $this->inmuebles_libres = $inmuebles-$inmuebles_ocupados; |
|
| 172 | + $this->inmuebles_libres = $inmuebles - $inmuebles_ocupados; |
|
| 173 | 173 | $this->inmuebles_ocupados = $inmuebles_ocupados; |
| 174 | 174 | $this->total_vehiculos = $vehiculos; |
| 175 | 175 | $this->carpetasPlugin(); |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | public function generarArchivoExcel() |
| 180 | 180 | { |
| 181 | - $this->archivoXLSX = $this->exportDir . DIRECTORY_SEPARATOR . |
|
| 182 | - $this->archivo . "_" . $this->user->nick . ".xlsx"; |
|
| 183 | - $this->archivoXLSXPath = $this->publicPath . DIRECTORY_SEPARATOR . |
|
| 184 | - $this->archivo . "_" . $this->user->nick . ".xlsx"; |
|
| 181 | + $this->archivoXLSX = $this->exportDir.DIRECTORY_SEPARATOR. |
|
| 182 | + $this->archivo."_".$this->user->nick.".xlsx"; |
|
| 183 | + $this->archivoXLSXPath = $this->publicPath.DIRECTORY_SEPARATOR. |
|
| 184 | + $this->archivo."_".$this->user->nick.".xlsx"; |
|
| 185 | 185 | if (file_exists($this->archivoXLSX)) { |
| 186 | 186 | unlink($this->archivoXLSX); |
| 187 | 187 | } |
@@ -261,10 +261,10 @@ discard block |
||
| 261 | 261 | public function datosInformacion() |
| 262 | 262 | { |
| 263 | 263 | //Cantidad de Edificaciones |
| 264 | - $sql_edificaciones = "SELECT ret.id,ret.descripcion, count(rme.id) as total " . |
|
| 265 | - "FROM residentes_edificaciones_tipo as ret " . |
|
| 266 | - " join residentes_mapa_edificaciones as rme on (rme.id_tipo = ret.id) " . |
|
| 267 | - " group by ret.id,ret.descripcion " . |
|
| 264 | + $sql_edificaciones = "SELECT ret.id,ret.descripcion, count(rme.id) as total ". |
|
| 265 | + "FROM residentes_edificaciones_tipo as ret ". |
|
| 266 | + " join residentes_mapa_edificaciones as rme on (rme.id_tipo = ret.id) ". |
|
| 267 | + " group by ret.id,ret.descripcion ". |
|
| 268 | 268 | " order by ret.padre;"; |
| 269 | 269 | $data_edificaciones = $this->db->select($sql_edificaciones); |
| 270 | 270 | //cantidad de Inmuebles |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | echo json_encode($data, JSON_THROW_ON_ERROR); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - public function lista_residentes ($todo = false) |
|
| 310 | + public function lista_residentes($todo = false) |
|
| 311 | 311 | { |
| 312 | 312 | $sql = " select r.codcliente, c.nombre, c.cifnif, c.telefono1, c.email, codigo, numero, fecha_ocupacion ". |
| 313 | 313 | " from residentes_edificaciones as r, clientes as c ". |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | " order by ".$this->sort." ".$this->order; |
| 316 | 316 | if ($todo) { |
| 317 | 317 | $data = $this->db->select($sql); |
| 318 | - } else { |
|
| 318 | + }else { |
|
| 319 | 319 | $data = $this->db->select_limit($sql, $this->limit, $this->offset); |
| 320 | 320 | } |
| 321 | 321 | $sql_cantidad = "select count(r.id) as total from residentes_edificaciones as r ". |
@@ -337,13 +337,13 @@ discard block |
||
| 337 | 337 | " order by ".$this->sort." ".$this->order; |
| 338 | 338 | if ($todo) { |
| 339 | 339 | $data = $this->db->select($sql); |
| 340 | - } else { |
|
| 340 | + }else { |
|
| 341 | 341 | $data = $this->db->select_limit($sql, $this->limit, $this->offset); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | $sql_cantidad = "select count(r.id) as total from residentes_edificaciones as r"; |
| 345 | 345 | if ($this->where_code) { |
| 346 | - $sql_cantidad.=" WHERE r.codigo!='' ".$this->where_code; |
|
| 346 | + $sql_cantidad .= " WHERE r.codigo!='' ".$this->where_code; |
|
| 347 | 347 | } |
| 348 | 348 | $data_cantidad = $this->db->select($sql_cantidad); |
| 349 | 349 | return array($data, $data_cantidad[0]['total']); |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | " order by ".$this->sort." ".$this->order; |
| 366 | 366 | if ($todo) { |
| 367 | 367 | $data = $this->db->select($sql); |
| 368 | - } else { |
|
| 368 | + }else { |
|
| 369 | 369 | $data = $this->db->select_limit($sql, $this->limit, $this->offset); |
| 370 | 370 | } |
| 371 | 371 | |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | public function crearXLSX(&$writer, $hoja_nombre, $header, $headerText, $data) |
| 448 | 448 | { |
| 449 | - $style_header = array('border'=>'left,right,top,bottom','font'=>'Arial','font-size'=>10,'font-style'=>'bold'); |
|
| 449 | + $style_header = array('border'=>'left,right,top,bottom', 'font'=>'Arial', 'font-size'=>10, 'font-style'=>'bold'); |
|
| 450 | 450 | $writer->writeSheetRow($hoja_nombre, $headerText, $style_header); |
| 451 | 451 | $writer->writeSheetHeader($hoja_nombre, $header, true); |
| 452 | 452 | $this->agregarDatosXLSX($writer, $hoja_nombre, $data, $headerText); |
@@ -478,9 +478,9 @@ discard block |
||
| 478 | 478 | public function carpetasPlugin() |
| 479 | 479 | { |
| 480 | 480 | $basepath = dirname(__DIR__, 3); |
| 481 | - $this->documentosDir = $basepath . DIRECTORY_SEPARATOR . FS_MYDOCS . 'documentos'; |
|
| 482 | - $this->exportDir = $this->documentosDir . DIRECTORY_SEPARATOR . "informes_residentes"; |
|
| 483 | - $this->publicPath = FS_PATH . FS_MYDOCS . 'documentos' . DIRECTORY_SEPARATOR . 'informes_residentes'; |
|
| 481 | + $this->documentosDir = $basepath.DIRECTORY_SEPARATOR.FS_MYDOCS.'documentos'; |
|
| 482 | + $this->exportDir = $this->documentosDir.DIRECTORY_SEPARATOR."informes_residentes"; |
|
| 483 | + $this->publicPath = FS_PATH.FS_MYDOCS.'documentos'.DIRECTORY_SEPARATOR.'informes_residentes'; |
|
| 484 | 484 | if (!is_dir($this->documentosDir)) { |
| 485 | 485 | if (!mkdir($concurrentDirectory = $this->documentosDir) && !is_dir($concurrentDirectory)) { |
| 486 | 486 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
@@ -497,8 +497,8 @@ discard block |
||
| 497 | 497 | public function url() |
| 498 | 498 | { |
| 499 | 499 | if (isset($_REQUEST['inmueble'])) { |
| 500 | - return 'index.php?page=informe_residentes&inmueble=' . $_REQUEST['inmueble']; |
|
| 501 | - } else { |
|
| 500 | + return 'index.php?page=informe_residentes&inmueble='.$_REQUEST['inmueble']; |
|
| 501 | + }else { |
|
| 502 | 502 | return parent::url(); |
| 503 | 503 | } |
| 504 | 504 | } |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | 'page_from' => __CLASS__, |
| 516 | 516 | 'page_to' => __CLASS__, |
| 517 | 517 | 'type' => 'head', |
| 518 | - 'text' => '<script src="' . FS_PATH . |
|
| 518 | + 'text' => '<script src="'.FS_PATH. |
|
| 519 | 519 | 'plugins/residentes/view/js/1/bootstrap-table.min.js" type="text/javascript"></script>', |
| 520 | 520 | 'params' => '' |
| 521 | 521 | ), |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | 'page_from' => __CLASS__, |
| 525 | 525 | 'page_to' => __CLASS__, |
| 526 | 526 | 'type' => 'head', |
| 527 | - 'text' => '<script src="' . FS_PATH . |
|
| 527 | + 'text' => '<script src="'.FS_PATH. |
|
| 528 | 528 | 'plugins/residentes/view/js/1/bootstrap-table-locale-all.min.js" type="text/javascript"></script>', |
| 529 | 529 | 'params' => '' |
| 530 | 530 | ), |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | 'page_from' => __CLASS__, |
| 534 | 534 | 'page_to' => __CLASS__, |
| 535 | 535 | 'type' => 'head', |
| 536 | - 'text' => '<script src="' . FS_PATH . |
|
| 536 | + 'text' => '<script src="'.FS_PATH. |
|
| 537 | 537 | 'plugins/residentes/view/js/plugins/bootstrap-table-filter.min.js" type="text/javascript"></script>', |
| 538 | 538 | 'params' => '' |
| 539 | 539 | ), |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | 'page_from' => __CLASS__, |
| 543 | 543 | 'page_to' => __CLASS__, |
| 544 | 544 | 'type' => 'head', |
| 545 | - 'text' => '<script src="' . FS_PATH . |
|
| 545 | + 'text' => '<script src="'.FS_PATH. |
|
| 546 | 546 | 'plugins/residentes/view/js/plugins/bootstrap-table-toolbar.min.js" type="text/javascript"></script>', |
| 547 | 547 | 'params' => '' |
| 548 | 548 | ), |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | 'page_from' => __CLASS__, |
| 552 | 552 | 'page_to' => __CLASS__, |
| 553 | 553 | 'type' => 'head', |
| 554 | - 'text' => '<script src="' . FS_PATH . |
|
| 554 | + 'text' => '<script src="'.FS_PATH. |
|
| 555 | 555 | 'plugins/residentes/view/js/plugins/bootstrap-table-mobile.min.js" type="text/javascript"></script>', |
| 556 | 556 | 'params' => '' |
| 557 | 557 | ), |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | 'page_from' => __CLASS__, |
| 561 | 561 | 'page_to' => __CLASS__, |
| 562 | 562 | 'type' => 'head', |
| 563 | - 'text' => '<script src="' . FS_PATH . 'view/js/chart.bundle.min.js" type="text/javascript"></script>', |
|
| 563 | + 'text' => '<script src="'.FS_PATH.'view/js/chart.bundle.min.js" type="text/javascript"></script>', |
|
| 564 | 564 | 'params' => '' |
| 565 | 565 | ), |
| 566 | 566 | array( |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | 'page_from' => __CLASS__, |
| 569 | 569 | 'page_to' => __CLASS__, |
| 570 | 570 | 'type' => 'head', |
| 571 | - 'text' => '<link rel="stylesheet" type="text/css" media="screen" href="' . FS_PATH . |
|
| 571 | + 'text' => '<link rel="stylesheet" type="text/css" media="screen" href="'.FS_PATH. |
|
| 572 | 572 | 'plugins/residentes/view/css/bootstrap-table.min.css"/>', |
| 573 | 573 | 'params' => '' |
| 574 | 574 | ), |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | foreach ($extensiones as $ext) { |
| 578 | 578 | $fsext0 = new fs_extension($ext); |
| 579 | 579 | if (!$fsext0->save()) { |
| 580 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
| 580 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
| 581 | 581 | } |
| 582 | 582 | } |
| 583 | 583 | } |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | 'page_to' => __CLASS__, |
| 127 | 127 | 'type' => 'head', |
| 128 | 128 | 'text' => '<script src="' . |
| 129 | - FS_PATH . |
|
| 129 | + FS_PATH . |
|
| 130 | 130 | 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" ' . |
| 131 | 131 | 'type="text/javascript"></script>', |
| 132 | 132 | 'params' => '' |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if ($logo) { |
| 59 | 59 | $type = pathinfo($logo, PATHINFO_EXTENSION); |
| 60 | 60 | $data = file_get_contents($logo); |
| 61 | - $this->factura_logo_uri = 'data:image/' . $type . ';base64,' . base64_encode($data); |
|
| 61 | + $this->factura_logo_uri = 'data:image/'.$type.';base64,'.base64_encode($data); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if ($this->id) { |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | $fac = new factura_cliente(); |
| 72 | 72 | $this->factura = $fac->get($this->id); |
| 73 | 73 | //Agregamos la cantidad de lineas multiplicadas por 4 |
| 74 | - $this->sizeFactura+= count($this->factura->get_lineas())*8; |
|
| 74 | + $this->sizeFactura += count($this->factura->get_lineas()) * 8; |
|
| 75 | 75 | //Agregamos la linea de separación del total |
| 76 | - $this->sizeFactura+=4; |
|
| 76 | + $this->sizeFactura += 4; |
|
| 77 | 77 | //Agregamos las 3 lineas de Neto, FS_IVA y Total |
| 78 | - $this->sizeFactura+=12; |
|
| 78 | + $this->sizeFactura += 12; |
|
| 79 | 79 | //Agregamos un espacio de 4 lineas aprox |
| 80 | - $this->sizeFactura+=20; |
|
| 80 | + $this->sizeFactura += 20; |
|
| 81 | 81 | $cli = new cliente(); |
| 82 | 82 | $this->cliente = $cli->get($this->factura->codcliente); |
| 83 | 83 | $facturas = $fac->all_from_cliente($this->factura->codcliente); |
@@ -89,12 +89,12 @@ discard block |
||
| 89 | 89 | 'fecha'=>$f->fecha, |
| 90 | 90 | 'monto'=>$f->total |
| 91 | 91 | ); |
| 92 | - $this->sizeFactura+=4; |
|
| 92 | + $this->sizeFactura += 4; |
|
| 93 | 93 | $this->total_facturas_pendientes += $f->total; |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | - $this->sizeFactura+=20; |
|
| 97 | + $this->sizeFactura += 20; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | public function url() |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | 'page_from' => __CLASS__, |
| 121 | 121 | 'page_to' => __CLASS__, |
| 122 | 122 | 'type' => 'head', |
| 123 | - 'text' => '<script src="' . |
|
| 124 | - FS_PATH . |
|
| 123 | + 'text' => '<script src="'. |
|
| 124 | + FS_PATH. |
|
| 125 | 125 | 'plugins/residentes/view/js/jspdf.min.js" type="text/javascript"></script>', |
| 126 | 126 | 'params' => '' |
| 127 | 127 | ), |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | 'page_from' => __CLASS__, |
| 131 | 131 | 'page_to' => __CLASS__, |
| 132 | 132 | 'type' => 'head', |
| 133 | - 'text' => '<script src="' . |
|
| 134 | - FS_PATH . |
|
| 135 | - 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" ' . |
|
| 133 | + 'text' => '<script src="'. |
|
| 134 | + FS_PATH. |
|
| 135 | + 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" '. |
|
| 136 | 136 | 'type="text/javascript"></script>', |
| 137 | 137 | 'params' => '' |
| 138 | 138 | ), |