Passed
Push — master ( 49d752...4c7773 )
by Joe Nilson
03:19
created
controller/clientes_vehiculos.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
             if ($accion === 'agregar') {
69 69
                 if ($vehiculo->save()) {
70 70
                     $this->new_message('Vehiculo agregado exitosamente');
71
-                } else {
71
+                }else {
72 72
                     $this->new_error_msg('No se pudieron agregar los datos del vehiculo, revise la información e ".
73 73
                     "intentelo nuevamente.');
74 74
                 }
75 75
             } elseif ($accion === 'eliminar') {
76 76
                 if ($vehiculo->delete()) {
77 77
                     $this->new_message('Vehiculo eliminado exitosamente');
78
-                } else {
78
+                }else {
79 79
                     $this->new_error_msg('No se pudieron eliminar los datos del vehiculo, revise la información e ".
80 80
                     "intentelo nuevamente.');
81 81
                 }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         foreach ($extensiones as $ext) {
111 111
             $fsext0 = new fs_extension($ext);
112 112
             if (!$fsext0->save()) {
113
-                $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.');
113
+                $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.');
114 114
             }
115 115
         }
116 116
     }
Please login to merge, or discard this patch.
model/core/residentes_informacion.php 2 patches
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                 $lista[] = $item->info_adicional($item);
217 217
             }
218 218
             return $lista;
219
-        }else{
219
+        } else{
220 220
             return false;
221 221
         }
222 222
     }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         if($data){
236 236
             $item = new residentes_informacion($data[0]);
237 237
             return $item->info_adicional($item);
238
-        }else{
238
+        } else{
239 239
             return false;
240 240
         }
241 241
     }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $lista[] = $item->info_adicional($item);
258 258
             }
259 259
             return $lista;
260
-        }else{
260
+        } else{
261 261
             return false;
262 262
         }
263 263
     }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     public function exists() {
266 266
         if(!$this->get($this->codcliente)){
267 267
             return false;
268
-        }else{
268
+        } else{
269 269
             return $this->get($this->codcliente);
270 270
         }
271 271
     }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             "vehiculos = ".$this->intval($this->vehiculos)." ".
297 297
             "WHERE codcliente = ".$this->var2str($this->codcliente).";";
298 298
             return $this->db->exec($sql);
299
-        }else{
299
+        } else{
300 300
             $sql = "INSERT INTO ".$this->table_name." (codcliente, codigo, ocupantes, ocupantes5anos, ocupantes12anos, ocupantes18anos, ocupantes30anos, ocupantes50anos, ocupantes70anos, ocupantes71anos, informacion_discapacidad, propietario, profesion, ocupacion, ca_nombres, ca_apellidos, ca_telefono, ca_email, ca_propietario, ca_parentesco, ca_parentesco_obs, vehiculos) VALUES (".
301 301
             $this->var2str($this->codcliente).", ".
302 302
             $this->var2str($this->codigo).", ".
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
             $this->intval($this->vehiculos).");";
323 323
             if($this->db->exec($sql)){
324 324
                 return true;
325
-            }else{
325
+            } else{
326 326
                 return false;
327 327
             }
328 328
         }
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  * @author Joe Nilson <joenilson at gmail.com>
25 25
  * @version 1
26 26
  */
27
-class residentes_informacion extends \fs_model{
27
+class residentes_informacion extends \fs_model {
28 28
     /**
29 29
      * Codigo del cliente
30 30
      * @var string
@@ -142,60 +142,60 @@  discard block
 block discarded – undo
142 142
     {
143 143
         parent::__construct('residentes_informacion', 'plugins/residentes');
144 144
         if ($t) {
145
-            $this->codcliente=$t['codcliente'];
146
-            $this->codigo=$t['codigo'];
147
-            $this->ocupantes=$t['ocupantes'];
148
-            $this->ocupantes5anos=$t['ocupantes5anos'];
149
-            $this->ocupantes12anos=$t['ocupantes12anos'];
150
-            $this->ocupantes18anos=$t['ocupantes18anos'];
151
-            $this->ocupantes30anos=$t['ocupantes30anos'];
152
-            $this->ocupantes50anos=$t['ocupantes50anos'];
153
-            $this->ocupantes70anos=$t['ocupantes70anos'];
154
-            $this->ocupantes71anos=$t['ocupantes71anos'];
155
-            $this->informacion_discapacidad=$t['informacion_discapacidad'];
156
-            $this->propietario=$this->str2bool($t['propietario']);
157
-            $this->profesion=$t['profesion'];
158
-            $this->ocupacion=$t['ocupacion'];
159
-            $this->ca_nombres=$t['ca_nombres'];
160
-            $this->ca_apellidos=$t['ca_apellidos'];
161
-            $this->ca_telefono=$t['ca_telefono'];
162
-            $this->ca_email=$t['ca_email'];
163
-            $this->ca_propietario=$this->str2bool($t['ca_propietario']);
164
-            $this->ca_parentesco=$t['ca_parentesco'];
165
-            $this->ca_parentesco_obs=$t['ca_parentesco_obs'];
166
-            $this->vehiculos=$t['vehiculos'];
167
-        } else {
168
-            $this->codcliente=NULL;
169
-            $this->codigo=NULL;
170
-            $this->ocupantes=NULL;
171
-            $this->ocupantes5anos=NULL;
172
-            $this->ocupantes12anos=NULL;
173
-            $this->ocupantes18anos=NULL;
174
-            $this->ocupantes30anos=NULL;
175
-            $this->ocupantes50anos=NULL;
176
-            $this->ocupantes70anos=NULL;
177
-            $this->ocupantes71anos=NULL;
178
-            $this->informacion_discapacidad=NULL;
179
-            $this->propietario='FALSE';
180
-            $this->profesion=NULL;
181
-            $this->ocupacion=NULL;
182
-            $this->ca_nombres=NULL;
183
-            $this->ca_apellidos=NULL;
184
-            $this->ca_telefono=NULL;
185
-            $this->ca_email=NULL;
186
-            $this->ca_propietario='FALSE';
187
-            $this->ca_parentesco=NULL;
188
-            $this->ca_parentesco_obs='';
189
-            $this->vehiculos=0;
145
+            $this->codcliente = $t['codcliente'];
146
+            $this->codigo = $t['codigo'];
147
+            $this->ocupantes = $t['ocupantes'];
148
+            $this->ocupantes5anos = $t['ocupantes5anos'];
149
+            $this->ocupantes12anos = $t['ocupantes12anos'];
150
+            $this->ocupantes18anos = $t['ocupantes18anos'];
151
+            $this->ocupantes30anos = $t['ocupantes30anos'];
152
+            $this->ocupantes50anos = $t['ocupantes50anos'];
153
+            $this->ocupantes70anos = $t['ocupantes70anos'];
154
+            $this->ocupantes71anos = $t['ocupantes71anos'];
155
+            $this->informacion_discapacidad = $t['informacion_discapacidad'];
156
+            $this->propietario = $this->str2bool($t['propietario']);
157
+            $this->profesion = $t['profesion'];
158
+            $this->ocupacion = $t['ocupacion'];
159
+            $this->ca_nombres = $t['ca_nombres'];
160
+            $this->ca_apellidos = $t['ca_apellidos'];
161
+            $this->ca_telefono = $t['ca_telefono'];
162
+            $this->ca_email = $t['ca_email'];
163
+            $this->ca_propietario = $this->str2bool($t['ca_propietario']);
164
+            $this->ca_parentesco = $t['ca_parentesco'];
165
+            $this->ca_parentesco_obs = $t['ca_parentesco_obs'];
166
+            $this->vehiculos = $t['vehiculos'];
167
+        }else {
168
+            $this->codcliente = NULL;
169
+            $this->codigo = NULL;
170
+            $this->ocupantes = NULL;
171
+            $this->ocupantes5anos = NULL;
172
+            $this->ocupantes12anos = NULL;
173
+            $this->ocupantes18anos = NULL;
174
+            $this->ocupantes30anos = NULL;
175
+            $this->ocupantes50anos = NULL;
176
+            $this->ocupantes70anos = NULL;
177
+            $this->ocupantes71anos = NULL;
178
+            $this->informacion_discapacidad = NULL;
179
+            $this->propietario = 'FALSE';
180
+            $this->profesion = NULL;
181
+            $this->ocupacion = NULL;
182
+            $this->ca_nombres = NULL;
183
+            $this->ca_apellidos = NULL;
184
+            $this->ca_telefono = NULL;
185
+            $this->ca_email = NULL;
186
+            $this->ca_propietario = 'FALSE';
187
+            $this->ca_parentesco = NULL;
188
+            $this->ca_parentesco_obs = '';
189
+            $this->vehiculos = 0;
190 190
         }
191 191
         $this->cliente = new cliente();
192 192
     }
193 193
 
194
-    public function install(){
194
+    public function install() {
195 195
         return "";
196 196
     }
197 197
 
198
-    public function info_adicional($i){
198
+    public function info_adicional($i) {
199 199
         $data = $this->cliente->get($i->codcliente);
200 200
         $i->nombre = $data->nombre;
201 201
         $i->telefono1 = $data->telefono1;
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
         return $i;
206 206
     }
207 207
 
208
-    public function all(){
208
+    public function all() {
209 209
         $sql = "SELECT * FROM ".$this->table_name." ORDER BY codcliente";
210 210
         $data = $this->db->select($sql);
211
-        if($data){
211
+        if ($data) {
212 212
             $lista = array();
213
-            foreach($data as $d){
213
+            foreach ($data as $d) {
214 214
                 $item = new residentes_informacion($d);
215 215
                 $lista[] = $item->info_adicional($item);
216 216
             }
217 217
             return $lista;
218
-        }else{
218
+        }else {
219 219
             return false;
220 220
         }
221 221
     }
@@ -227,14 +227,14 @@  discard block
 block discarded – undo
227 227
      * @param integer $padre_tipo
228 228
      * @return \FacturaScripts\model\residentes_informacion|boolean
229 229
      */
230
-    public function get($codcliente){
230
+    public function get($codcliente) {
231 231
         $sql = "SELECT * FROM ".$this->table_name.
232 232
                 " WHERE codcliente = ".$this->var2str($codcliente).";";
233 233
         $data = $this->db->select($sql);
234
-        if($data){
234
+        if ($data) {
235 235
             $item = new residentes_informacion($data[0]);
236 236
             return $item->info_adicional($item);
237
-        }else{
237
+        }else {
238 238
             return false;
239 239
         }
240 240
     }
@@ -245,32 +245,32 @@  discard block
 block discarded – undo
245 245
      * @param string $value
246 246
      * @return boolean|\FacturaScripts\model\residentes_informacion
247 247
      */
248
-    public function get_by_field($field,$value){
249
-        $query = (is_string($value))?$this->var2str($value):$this->intval($value);
248
+    public function get_by_field($field, $value) {
249
+        $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value);
250 250
         $sql = "SELECT * FROM ".$this->table_name." WHERE ".strtoupper(trim($field))." = ".$query.";";
251 251
         $data = $this->db->select($sql);
252
-        if($data){
252
+        if ($data) {
253 253
             $lista = array();
254
-            foreach($data as $d){
254
+            foreach ($data as $d) {
255 255
                 $item = new residentes_informacion($d);
256 256
                 $lista[] = $item->info_adicional($item);
257 257
             }
258 258
             return $lista;
259
-        }else{
259
+        }else {
260 260
             return false;
261 261
         }
262 262
     }
263 263
 
264 264
     public function exists() {
265
-        if(!$this->get($this->codcliente)){
265
+        if (!$this->get($this->codcliente)) {
266 266
             return false;
267
-        }else{
267
+        }else {
268 268
             return $this->get($this->codcliente);
269 269
         }
270 270
     }
271 271
 
272 272
     public function save() {
273
-        if($this->exists()){
273
+        if ($this->exists()) {
274 274
             $sql = "UPDATE ".$this->table_name." SET ".
275 275
             "codigo = ".$this->var2str($this->codigo).", ".
276 276
             "ocupantes = ".$this->intval($this->ocupantes).", ".
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             "vehiculos = ".$this->intval($this->vehiculos)." ".
296 296
             "WHERE codcliente = ".$this->var2str($this->codcliente).";";
297 297
             return $this->db->exec($sql);
298
-        }else{
298
+        }else {
299 299
             $sql = "INSERT INTO ".$this->table_name." (codcliente, codigo, ocupantes, ocupantes5anos, ocupantes12anos, ocupantes18anos, ocupantes30anos, ocupantes50anos, ocupantes70anos, ocupantes71anos, informacion_discapacidad, propietario, profesion, ocupacion, ca_nombres, ca_apellidos, ca_telefono, ca_email, ca_propietario, ca_parentesco, ca_parentesco_obs, vehiculos) VALUES (".
300 300
             $this->var2str($this->codcliente).", ".
301 301
             $this->var2str($this->codigo).", ".
@@ -319,9 +319,9 @@  discard block
 block discarded – undo
319 319
             $this->var2str($this->ca_parentesco).", ".
320 320
             $this->var2str($this->ca_parentesco_obs).", ".
321 321
             $this->intval($this->vehiculos).");";
322
-            if($this->db->exec($sql)){
322
+            if ($this->db->exec($sql)) {
323 323
                 return true;
324
-            }else{
324
+            }else {
325 325
                 return false;
326 326
             }
327 327
         }
@@ -335,14 +335,14 @@  discard block
 block discarded – undo
335 335
         $clilist = array();
336 336
         $query = mb_strtolower($this->no_html($busqueda), 'UTF8');
337 337
 
338
-        $consulta = "SELECT * FROM " . $this->table_name . " WHERE ";
338
+        $consulta = "SELECT * FROM ".$this->table_name." WHERE ";
339 339
         if (is_numeric($query)) {
340
-            $consulta .= "(ca_telefono LIKE '%" . $query . "%' OR codigo LIKE '%" . $query . "%')";
341
-        } else {
340
+            $consulta .= "(ca_telefono LIKE '%".$query."%' OR codigo LIKE '%".$query."%')";
341
+        }else {
342 342
             $buscar = str_replace(' ', '%', $query);
343
-            $consulta .= "(lower(ca_nombres) LIKE '%" . $buscar . "%' OR lower(ca_apellidos) LIKE '%" . $buscar . "%'"
344
-                    . " OR lower(ocupacion) LIKE '%" . $buscar . "%' OR lower(profesion) LIKE '%" . $buscar . "%'"
345
-                    . " OR lower(ca_email) LIKE '%" . $buscar . "%')";
343
+            $consulta .= "(lower(ca_nombres) LIKE '%".$buscar."%' OR lower(ca_apellidos) LIKE '%".$buscar."%'"
344
+                    . " OR lower(ocupacion) LIKE '%".$buscar."%' OR lower(profesion) LIKE '%".$buscar."%'"
345
+                    . " OR lower(ca_email) LIKE '%".$buscar."%')";
346 346
         }
347 347
         $consulta .= " ORDER BY codcliente ASC";
348 348
 
Please login to merge, or discard this patch.
extras/residentes_controller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             " AND ".
140 140
             $this->empresa->var2str(\date('Y-m-d', strtotime($this->hasta)));
141 141
         }
142
-        $tipo_pagada = ($pagada)?'TRUE':'FALSE';
142
+        $tipo_pagada = ($pagada) ? 'TRUE' : 'FALSE';
143 143
         $sql = "SELECT f.idfactura, f.numero2, f.vencimiento, lf.referencia, lf.descripcion, f.fecha, lf.pvpsindto, ".
144 144
             "lf.dtopor, lf.pvptotal".
145 145
             " FROM facturascli as f left join lineasfacturascli as lf ON (f.idfactura = lf.idfactura)".
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         foreach ($data as $l) {
153 153
             $linea = (object) $l;
154 154
             $linea->f_pago = $linea->fecha;
155
-            $linea->dias_atraso = ($pagada)?0:$this->diasAtraso($linea->vencimiento, \date('d-m-Y'));
155
+            $linea->dias_atraso = ($pagada) ? 0 : $this->diasAtraso($linea->vencimiento, \date('d-m-Y'));
156 156
             $linea->abono = 0;
157 157
             if (in_array('tesoreria', $GLOBALS['plugins'], true)) {
158 158
                 //TO-DO Restar recibos de pagos realizados
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
         $cliente = $cli->get($codcliente);
184 184
         if ($iddireccion !== '') {
185 185
             foreach ($cliente->get_direcciones() as $dir) {
186
-                if ($dir->id === (int)$iddireccion) {
186
+                if ($dir->id === (int) $iddireccion) {
187 187
                     $dir->direccion = $nueva_direccion;
188 188
                     $dir->save();
189 189
                     break;
190 190
                 }
191 191
             }
192 192
             return $iddireccion;
193
-        } else {
193
+        }else {
194 194
             $dir = new direccion_cliente();
195 195
             $dir->direccion = $nueva_direccion;
196 196
             $dir->codcliente = $codcliente;
Please login to merge, or discard this patch.
extras/residentes_pdf.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -71,81 +71,81 @@  discard block
 block discarded – undo
71 71
                     if (imagepng(imagecreatefromstring(file_get_contents($this->logo)), FS_MYDOCS
72 72
                         . 'images/logo.png')) {
73 73
                         $this->pdf->addPngFromFile(
74
-                            FS_MYDOCS . 'images/logo.png',
74
+                            FS_MYDOCS.'images/logo.png',
75 75
                             self::LOGO_X,
76 76
                             self::LOGO_Y,
77 77
                             $tamanyo[0],
78 78
                             $tamanyo[1]
79 79
                         );
80
-                    } else {
80
+                    }else {
81 81
                         $this->pdf->addJpegFromFile($this->logo, self::LOGO_X, self::LOGO_Y, $tamanyo[0], $tamanyo[1]);
82 82
                     }
83
-                } else {
83
+                }else {
84 84
                     $this->pdf->addJpegFromFile($this->logo, self::LOGO_X, self::LOGO_Y, $tamanyo[0], $tamanyo[1]);
85 85
                 }
86 86
 
87 87
                 $this->pdf->ez['rightMargin'] = 40;
88 88
                 $this->pdf->ezText(
89
-                    "<b>" . fs_fix_html($empresa->nombre) . "</b>",
89
+                    "<b>".fs_fix_html($empresa->nombre)."</b>",
90 90
                     12,
91 91
                     array('justification' => 'right')
92 92
                 );
93
-                $this->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'right'));
93
+                $this->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'right'));
94 94
 
95
-                $direccion = $empresa->direccion . "\n";
95
+                $direccion = $empresa->direccion."\n";
96 96
                 if ($empresa->apartado) {
97
-                    $direccion .= ucfirst(FS_APARTADO) . ': ' . $empresa->apartado . ' - ';
97
+                    $direccion .= ucfirst(FS_APARTADO).': '.$empresa->apartado.' - ';
98 98
                 }
99 99
 
100 100
                 if ($empresa->codpostal) {
101
-                    $direccion .= 'CP: ' . $empresa->codpostal . ' - ';
101
+                    $direccion .= 'CP: '.$empresa->codpostal.' - ';
102 102
                 }
103 103
 
104 104
                 if ($empresa->ciudad) {
105
-                    $direccion .= $empresa->ciudad . ' - ';
105
+                    $direccion .= $empresa->ciudad.' - ';
106 106
                 }
107 107
 
108 108
                 if ($empresa->provincia) {
109
-                    $direccion .= '(' . $empresa->provincia . ')';
109
+                    $direccion .= '('.$empresa->provincia.')';
110 110
                 }
111 111
 
112 112
                 if ($empresa->telefono) {
113
-                    $direccion .= "\nTeléfono: " . $empresa->telefono;
113
+                    $direccion .= "\nTeléfono: ".$empresa->telefono;
114 114
                 }
115 115
 
116
-                $this->pdf->ezText(fs_fix_html($direccion) . "\n", 8, array('justification' => 'right'));
116
+                $this->pdf->ezText(fs_fix_html($direccion)."\n", 8, array('justification' => 'right'));
117 117
                 $this->set_y(self::LOGO_Y + 10);
118
-            } else {
118
+            }else {
119 119
                 die('ERROR: no se encuentra la función imagecreatefromstring(). '
120 120
                     . 'Y por tanto no se puede usar el logotipo en los documentos.');
121 121
             }
122
-        } else {
122
+        }else {
123 123
             $this->pdf->ezText(
124
-                "<b>" . fs_fix_html($empresa->nombre) . "</b>",
124
+                "<b>".fs_fix_html($empresa->nombre)."</b>",
125 125
                 12,
126 126
                 array('justification' => 'center')
127 127
             );
128
-            $this->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'center'));
128
+            $this->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'center'));
129 129
 
130 130
             $direccion = $empresa->direccion;
131 131
             if ($empresa->apartado) {
132
-                $direccion .= ' - ' . ucfirst(FS_APARTADO) . ': ' . $empresa->apartado;
132
+                $direccion .= ' - '.ucfirst(FS_APARTADO).': '.$empresa->apartado;
133 133
             }
134 134
 
135 135
             if ($empresa->codpostal) {
136
-                $direccion .= ' - CP: ' . $empresa->codpostal;
136
+                $direccion .= ' - CP: '.$empresa->codpostal;
137 137
             }
138 138
 
139 139
             if ($empresa->ciudad) {
140
-                $direccion .= ' - ' . $empresa->ciudad;
140
+                $direccion .= ' - '.$empresa->ciudad;
141 141
             }
142 142
 
143 143
             if ($empresa->provincia) {
144
-                $direccion .= ' (' . $empresa->provincia . ')';
144
+                $direccion .= ' ('.$empresa->provincia.')';
145 145
             }
146 146
 
147 147
             if ($empresa->telefono) {
148
-                $direccion .= ' - Teléfono: ' . $empresa->telefono;
148
+                $direccion .= ' - Teléfono: '.$empresa->telefono;
149 149
             }
150 150
 
151 151
             $this->pdf->ezText(fs_fix_html($direccion), 8, array('justification' => 'center'));
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
         $pdf_doc->new_table();
167 167
         $pdf_doc->add_table_row(
168 168
             array(
169
-                'campo1' => "<b>" . $tipo_doc . "</b>",
169
+                'campo1' => "<b>".$tipo_doc."</b>",
170 170
                 'dato1' => '',
171
-                'campo2' => "<b>Fecha Impresión:</b> " . \date('d-m-Y H:i:s')
171
+                'campo2' => "<b>Fecha Impresión:</b> ".\date('d-m-Y H:i:s')
172 172
             )
173 173
         );
174 174
 
@@ -176,27 +176,27 @@  discard block
 block discarded – undo
176 176
             array(
177 177
                 'campo1' => "<b>Residente:</b>",
178 178
                 'dato1' => fs_fix_html($this->cliente_residente->nombre),
179
-                'campo2' => "<b>Tipo Residente:</b> " . $tipo_residente
179
+                'campo2' => "<b>Tipo Residente:</b> ".$tipo_residente
180 180
             )
181 181
         );
182 182
 
183 183
         $row = array(
184 184
             'campo1' => "<b>Inmueble:</b>",
185
-            'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo() .
186
-                ' - ' . $this->cliente_residente->inmueble->numero),
185
+            'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo().
186
+                ' - '.$this->cliente_residente->inmueble->numero),
187 187
             'campo2' => ''
188 188
         );
189 189
 
190 190
         if (!$this->cliente_residente) {
191 191
             /// nada
192 192
         } elseif ($this->cliente_residente->telefono1) {
193
-            $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono1;
193
+            $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono1;
194 194
             if ($this->cliente_residente->telefono2) {
195
-                $row['campo2'] .= "\n" . $this->cliente_residente->telefono2;
195
+                $row['campo2'] .= "\n".$this->cliente_residente->telefono2;
196 196
                 $lppag -= 2;
197 197
             }
198 198
         } elseif ($this->cliente_residente->telefono2) {
199
-            $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono2;
199
+            $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono2;
200 200
         }
201 201
         $pdf_doc->add_table_row($row);
202 202
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         [$table_header, $array_cols] = $this->generar_pdf_lineas_tablas($tipo);
245 245
         $pdf_doc->add_table_header($table_header);
246 246
 
247
-        for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ( $linea_actual < count($items)));) {
247
+        for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ($linea_actual < count($items)));) {
248 248
             $fila = $this->generar_pdf_lineas_fila($tipo, $items, $linea_actual);
249 249
             $pdf_doc->add_table_row($fila);
250 250
             $linea_actual++;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             );
287 287
         }
288 288
 
289
-        return array($table_header,$array_cols);
289
+        return array($table_header, $array_cols);
290 290
     }
291 291
 
292 292
     public function generar_pdf_lineas_fila($tipo, $items, $linea_actual)
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                 true,
304 304
                 FS_NF0
305 305
             ),
306
-            'descuento' => $residentes_controller->show_numero($items[$linea_actual]->dtopor) . " %",
306
+            'descuento' => $residentes_controller->show_numero($items[$linea_actual]->dtopor)." %",
307 307
             'total' => $residentes_controller->show_precio(
308 308
                 $items[$linea_actual]->pvptotal,
309 309
                 $residentes_controller->empresa->coddivisa,
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                 }
341 341
                 $aux = explode("\n", $lin->descripcion);
342 342
                 if (count($aux) > 1) {
343
-                    $linea_size += 0.5 * ( count($aux) - 1);
343
+                    $linea_size += 0.5 * (count($aux) - 1);
344 344
                 }
345 345
                 if ($linea_size > 1) {
346 346
                     $lppag2 -= $linea_size - 1;
Please login to merge, or discard this patch.
controller/informe_residentes.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         }
108 108
 
109 109
         if ($this->codigo_edificacion) {
110
-            $this->where_code = " AND r.codigo like '" . $this->codigo_edificacion . "%' ";
110
+            $this->where_code = " AND r.codigo like '".$this->codigo_edificacion."%' ";
111 111
         }
112 112
 
113 113
         if ($this->tipo === 'informacion') {
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
         $this->offset = $this->confirmarValor($this->filter_request('offset'), 0);
147 147
         $this->limit = $this->confirmarValor($this->filter_request('limit'), FS_ITEM_LIMIT);
148 148
         $this->search = $this->confirmarValor($this->filter_request('search'), false);
149
-        $this->sort = ($sort and $sort!='undefined')?$sort:'r.codigo, r.numero';
150
-        $this->order = ($order and $order!='undefined')?$order:'ASC';
149
+        $this->sort = ($sort and $sort != 'undefined') ? $sort : 'r.codigo, r.numero';
150
+        $this->order = ($order and $order != 'undefined') ? $order : 'ASC';
151 151
     }
152 152
 
153 153
     public function informacion_edificaciones()
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             $this->resultado[] = $l;
168 168
         }
169 169
         //Verificamos los que están ocupados
170
-        $this->inmuebles_libres = $inmuebles-$inmuebles_ocupados;
170
+        $this->inmuebles_libres = $inmuebles - $inmuebles_ocupados;
171 171
         $this->inmuebles_ocupados = $inmuebles_ocupados;
172 172
         $this->total_vehiculos = $vehiculos;
173 173
         $this->carpetasPlugin();
@@ -176,10 +176,10 @@  discard block
 block discarded – undo
176 176
 
177 177
     public function generarArchivoExcel()
178 178
     {
179
-        $this->archivoXLSX = $this->exportDir . DIRECTORY_SEPARATOR .
180
-                            $this->archivo . "_" . $this->user->nick . ".xlsx";
181
-        $this->archivoXLSXPath = $this->publicPath . DIRECTORY_SEPARATOR .
182
-                            $this->archivo . "_" . $this->user->nick . ".xlsx";
179
+        $this->archivoXLSX = $this->exportDir.DIRECTORY_SEPARATOR.
180
+                            $this->archivo."_".$this->user->nick.".xlsx";
181
+        $this->archivoXLSXPath = $this->publicPath.DIRECTORY_SEPARATOR.
182
+                            $this->archivo."_".$this->user->nick.".xlsx";
183 183
         if (file_exists($this->archivoXLSX)) {
184 184
             unlink($this->archivoXLSX);
185 185
         }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
     public function crearXLSX(&$writer, $hoja_nombre, $header, $headerText, $data)
366 366
     {
367
-        $style_header = array('border'=>'left,right,top,bottom','font'=>'Arial','font-size'=>10,'font-style'=>'bold');
367
+        $style_header = array('border'=>'left,right,top,bottom', 'font'=>'Arial', 'font-size'=>10, 'font-style'=>'bold');
368 368
         $writer->writeSheetRow($hoja_nombre, $headerText, $style_header);
369 369
         $writer->writeSheetHeader($hoja_nombre, $header, true);
370 370
         $this->agregarDatosXLSX($writer, $hoja_nombre, $data, $headerText);
@@ -396,9 +396,9 @@  discard block
 block discarded – undo
396 396
     public function carpetasPlugin()
397 397
     {
398 398
         $basepath = dirname(__DIR__, 3);
399
-        $this->documentosDir = $basepath . DIRECTORY_SEPARATOR . FS_MYDOCS . 'documentos';
400
-        $this->exportDir = $this->documentosDir . DIRECTORY_SEPARATOR . "informes_residentes";
401
-        $this->publicPath = FS_PATH . FS_MYDOCS . 'documentos' . DIRECTORY_SEPARATOR . 'informes_residentes';
399
+        $this->documentosDir = $basepath.DIRECTORY_SEPARATOR.FS_MYDOCS.'documentos';
400
+        $this->exportDir = $this->documentosDir.DIRECTORY_SEPARATOR."informes_residentes";
401
+        $this->publicPath = FS_PATH.FS_MYDOCS.'documentos'.DIRECTORY_SEPARATOR.'informes_residentes';
402 402
         if (!is_dir($this->documentosDir)) {
403 403
             if (!mkdir($concurrentDirectory = $this->documentosDir) && !is_dir($concurrentDirectory)) {
404 404
                 throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     public function url()
416 416
     {
417 417
         if (isset($_REQUEST['inmueble'])) {
418
-            return 'index.php?page=informe_residentes&inmueble=' . $_REQUEST['inmueble'];
418
+            return 'index.php?page=informe_residentes&inmueble='.$_REQUEST['inmueble'];
419 419
         }
420 420
 
421 421
         return parent::url();
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                 'page_from' => __CLASS__,
435 435
                 'page_to' => __CLASS__,
436 436
                 'type' => 'head',
437
-                'text' => '<script src="' . FS_PATH .
437
+                'text' => '<script src="'.FS_PATH.
438 438
                                 'plugins/residentes/view/js/1/bootstrap-table.min.js" type="text/javascript"></script>',
439 439
                 'params' => ''
440 440
             ),
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                 'page_from' => __CLASS__,
444 444
                 'page_to' => __CLASS__,
445 445
                 'type' => 'head',
446
-                'text' => '<script src="' . FS_PATH .
446
+                'text' => '<script src="'.FS_PATH.
447 447
                     'plugins/residentes/view/js/1/bootstrap-table-locale-all.min.js" type="text/javascript"></script>',
448 448
                 'params' => ''
449 449
             ),
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                 'page_from' => __CLASS__,
453 453
                 'page_to' => __CLASS__,
454 454
                 'type' => 'head',
455
-                'text' => '<script src="' . FS_PATH .
455
+                'text' => '<script src="'.FS_PATH.
456 456
                 'plugins/residentes/view/js/plugins/bootstrap-table-filter.min.js" type="text/javascript"></script>',
457 457
                 'params' => ''
458 458
             ),
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 'page_from' => __CLASS__,
462 462
                 'page_to' => __CLASS__,
463 463
                 'type' => 'head',
464
-                'text' => '<script src="' . FS_PATH .
464
+                'text' => '<script src="'.FS_PATH.
465 465
                 'plugins/residentes/view/js/plugins/bootstrap-table-toolbar.min.js" type="text/javascript"></script>',
466 466
                 'params' => ''
467 467
             ),
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
                 'page_from' => __CLASS__,
471 471
                 'page_to' => __CLASS__,
472 472
                 'type' => 'head',
473
-                'text' => '<script src="' . FS_PATH .
473
+                'text' => '<script src="'.FS_PATH.
474 474
                 'plugins/residentes/view/js/plugins/bootstrap-table-mobile.min.js" type="text/javascript"></script>',
475 475
                 'params' => ''
476 476
             ),
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
                 'page_from' => __CLASS__,
480 480
                 'page_to' => __CLASS__,
481 481
                 'type' => 'head',
482
-                'text' => '<script src="' . FS_PATH . 'view/js/chart.bundle.min.js" type="text/javascript"></script>',
482
+                'text' => '<script src="'.FS_PATH.'view/js/chart.bundle.min.js" type="text/javascript"></script>',
483 483
                 'params' => ''
484 484
             ),
485 485
             array(
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
                 'page_from' => __CLASS__,
488 488
                 'page_to' => __CLASS__,
489 489
                 'type' => 'head',
490
-                'text' => '<link rel="stylesheet" type="text/css" media="screen" href="' . FS_PATH .
490
+                'text' => '<link rel="stylesheet" type="text/css" media="screen" href="'.FS_PATH.
491 491
                     'plugins/residentes/view/css/bootstrap-table.min.css"/>',
492 492
                 'params' => ''
493 493
             ),
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         foreach ($extensiones as $ext) {
497 497
             $fsext0 = new fs_extension($ext);
498 498
             if (!$fsext0->save()) {
499
-                $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.');
499
+                $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.');
500 500
             }
501 501
         }
502 502
     }
Please login to merge, or discard this patch.
model/core/residentes_edificaciones_mapa.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             $this->numero = $t['numero'];
74 74
             $this->padre_tipo = $t['padre_tipo'];
75 75
             $this->padre_id = $t['padre_id'];
76
-        } else {
76
+        }else {
77 77
             $this->id = null;
78 78
             $this->id_tipo = null;
79 79
             $this->codigo_edificacion = null;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 $lista[] = $item;
101 101
             }
102 102
             return $lista;
103
-        } else {
103
+        }else {
104 104
             return false;
105 105
         }
106 106
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             $item = new residentes_edificaciones_mapa($data[0]);
122 122
             $item->desc_id = $this->edificaciones_tipo->get($item->id_tipo)->descripcion;
123 123
             return $item;
124
-        } else {
124
+        }else {
125 125
             return false;
126 126
         }
127 127
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $item = new residentes_edificaciones_mapa($data[0]);
143 143
             $item->desc_id = $this->edificaciones_tipo->get($item->id_tipo)->descripcion;
144 144
             return $item;
145
-        } else {
145
+        }else {
146 146
             return false;
147 147
         }
148 148
     }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public function get_by_field($field, $value)
157 157
     {
158
-        $query = (is_string($value))?$this->var2str($value):$this->intval($value);
158
+        $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value);
159 159
         $sql = "SELECT rem.*, ret.descripcion FROM ".$this->table_name." as rem, residentes_edificaciones_tipo as ret ".
160 160
                 " WHERE ".strtoupper(trim($field))." = ".$query.
161 161
                 " AND rem.id_tipo = ret.id order by codigo_edificacion ASC;";
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $lista[] = $item;
169 169
             }
170 170
             return $lista;
171
-        } else {
171
+        }else {
172 172
             return false;
173 173
         }
174 174
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     {
178 178
         if (!$this->getEstructura()) {
179 179
             return false;
180
-        } else {
180
+        }else {
181 181
             return $this->getEstructura();
182 182
         }
183 183
     }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                     " padre_id = ".$this->intval($this->padre_id)." ".
195 195
                     "WHERE id = ".$this->intval($this->id).";";
196 196
             return $this->db->exec($sql);
197
-        } else {
197
+        }else {
198 198
             $sql = "INSERT INTO ".$this->table_name.
199 199
                     " (id_tipo, codigo_edificacion, codigo_padre, numero, padre_tipo, padre_id) VALUES (".
200 200
                     $this->intval($this->id_tipo).", ".
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                     $this->intval($this->padre_id).");";
206 206
             if ($this->db->exec($sql)) {
207 207
                 return true;
208
-            } else {
208
+            }else {
209 209
                 return false;
210 210
             }
211 211
         }
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
         return $lista;
238 238
     }
239 239
 
240
-    public function buscar_ubicacion_inmueble($id,$linea)
240
+    public function buscar_ubicacion_inmueble($id, $linea)
241 241
     {
242
-        $inicio_busqueda = ($linea===0)?"{\"":"{%\"";
242
+        $inicio_busqueda = ($linea === 0) ? "{\"" : "{%\"";
243 243
         $sql = "SELECT * FROM ".$this->table_name." WHERE codigo_interno LIKE '".
244 244
                 $inicio_busqueda.$id."\":%}' ORDER BY codigo;";
245 245
         $data = $this->db->select($sql);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 $lista[] = $this->pertenencia($l);
251 251
             }
252 252
             return $lista;
253
-        } else {
253
+        }else {
254 254
             return false;
255 255
         }
256 256
     }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function buscar_cantidad_inmuebles($id, $linea)
264 264
     {
265
-        $inicio_busqueda = ($linea===0)?"{\"":"{%\"";
265
+        $inicio_busqueda = ($linea === 0) ? "{\"" : "{%\"";
266 266
         $sql = "SELECT DISTINCT codigo FROM ".$this->table_name." WHERE codigo_interno LIKE '".
267 267
             $inicio_busqueda.$id."\":%}' ORDER BY codigo;";
268 268
         $data = $this->db->select($sql);
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                 $lista[] = $l;
274 274
             }
275 275
             return $lista;
276
-        } else {
276
+        }else {
277 277
             return false;
278 278
         }
279 279
     }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         $mapa = array();
284 284
         $linea = 0;
285 285
         foreach ($this->edificaciones_tipo->all() as $data) {
286
-            if ($linea===1) {
286
+            if ($linea === 1) {
287 287
                 break;
288 288
             }
289 289
             $items = $this->buscar_cantidad_inmuebles($data->id, $data->padre);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         $data = $this->db->select($sql);
302 302
         if ($data) {
303 303
             return $data[0]['cantidad'];
304
-        } else {
304
+        }else {
305 305
             return false;
306 306
         }
307 307
     }
Please login to merge, or discard this patch.
controller/mapa_edificaciones.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         $accion_p = \filter_input(INPUT_POST, 'accion');
51 51
         $accion_g = \filter_input(INPUT_GET, 'accion');
52
-        $accion = ($accion_p)?:$accion_g;
52
+        $accion = ($accion_p) ?: $accion_g;
53 53
         if ($accion === 'agregar_base') {
54 54
             $this->agregar($this->padre);
55 55
         } elseif ($accion === 'agregar_hijo') {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             if ($estructura->tiene_hijos()) {
63 63
                 $this->new_error_msg('Esta estructura tiene edificaciones internas, '.
64 64
                                 'primero debe eliminarlas para eliminar esta.');
65
-            } else {
65
+            }else {
66 66
                 try {
67 67
                     $estructura->delete();
68 68
                     $this->new_message('Edificación eliminada correctamente.');
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $inicio = \filter_input(INPUT_POST, 'inicio');
97 97
         $final_p = \filter_input(INPUT_POST, 'final');
98
-        $final=(!empty($final_p))?$final_p:$inicio;
98
+        $final = (!empty($final_p)) ? $final_p : $inicio;
99 99
         $inmuebles = 0;
100 100
         $error = 0;
101 101
         $linea = 0;
102 102
         if ($inicio === $final) {
103 103
             $this->edificacion($inicio, $inmuebles, $error, $objeto);
104 104
             $linea++;
105
-        } else {
105
+        }else {
106 106
             foreach (range($inicio, $final) as $item) {
107 107
                 $this->edificacion($item, $inmuebles, $error, $objeto);
108 108
                 $linea++;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $id = \filter_input(INPUT_POST, 'id');
120 120
         $codigo_padre = \filter_input(INPUT_POST, 'codigo_padre');
121 121
         $padre_id = \filter_input(INPUT_POST, 'padre_id');
122
-        $item = (is_int($i))?str_pad($i, 3, "0", STR_PAD_LEFT):$i;
122
+        $item = (is_int($i)) ?str_pad($i, 3, "0", STR_PAD_LEFT) : $i;
123 123
         $punto = new residentes_edificaciones_mapa();
124 124
         $punto->id = $id;
125 125
         $punto->id_tipo = $objeto->id;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $punto->numero = '';
131 131
         if ($punto->save()) {
132 132
             $inmuebles++;
133
-        } else {
133
+        }else {
134 134
             $error++;
135 135
         }
136 136
     }
Please login to merge, or discard this patch.
extras/residentesCronJobs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@
 block discarded – undo
110 110
             $jobDisponible->fecha_modificacion = \date('Y-m-d H:i:s');
111 111
             $jobDisponible->save();
112 112
             $this->startJob($jobDisponible);
113
-        } else {
113
+        }else {
114 114
             echo " ** No coincide la hora de proceso con la de ejecucion de cron se omite el proceso ".
115
-                $this->ahora . " " . $this->horaActual . " ** \n";
115
+                $this->ahora." ".$this->horaActual." ** \n";
116 116
             $this->log->new_advice(' ** No coincide la hora de proceso con la de ejecucion de cron se omite el proceso ** ');
117 117
         }
118 118
     }
Please login to merge, or discard this patch.
controller/documentos_residentes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $this->envio_masivo = !(($this->filter_request('envio_masivo') === 'false'));
60 60
         $this->tipo_accion = $tipo_documento;
61 61
         $this->verificarCantidadFacturas();
62
-        $this->archivo = $tipo_documento.'_'.\date('dmYhis') . '.pdf';
62
+        $this->archivo = $tipo_documento.'_'.\date('dmYhis').'.pdf';
63 63
         if ($this->cliente_residente && $info_accion) {
64 64
             switch ($info_accion) {
65 65
                 case 'imprimir':
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             unset($lista_facturas[0]);
126 126
             $this->contador_facturas = count($lista_facturas);
127 127
             $this->facturas = implode(',', $lista_facturas);
128
-        } else {
128
+        }else {
129 129
             $this->contador_facturas = 0;
130 130
             $this->facturas = '';
131 131
         }
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
         $this->envio_masivo = false;
230 230
         $this->existe_tesoreria();
231 231
         $this->cliente_residente = false;
232
-        if (!file_exists('tmp/' . FS_TMP_NAME . 'enviar') &&
233
-            !mkdir($concurrentDirectory = 'tmp/' . FS_TMP_NAME . 'enviar') &&
232
+        if (!file_exists('tmp/'.FS_TMP_NAME.'enviar') &&
233
+            !mkdir($concurrentDirectory = 'tmp/'.FS_TMP_NAME.'enviar') &&
234 234
             !is_dir($concurrentDirectory)) {
235 235
             throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
236 236
         }
Please login to merge, or discard this patch.