@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->cantidad = floatval($t['cantidad']); |
| 47 | 47 | $this->codimpuesto = $t['codimpuesto']; |
| 48 | 48 | $this->importe = floatval($t['importe']); |
| 49 | - }else{ |
|
| 49 | + } else{ |
|
| 50 | 50 | $this->id = null; |
| 51 | 51 | $this->idprogramacion = null; |
| 52 | 52 | $this->referencia = ''; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | "WHERE id = ".$this->intval($this->id).";"; |
| 82 | 82 | $data = $this->db->exec($sql); |
| 83 | 83 | return $data; |
| 84 | - }else{ |
|
| 84 | + } else{ |
|
| 85 | 85 | $sql = "INSERT INTO ".$this->table_name. |
| 86 | 86 | " (idprogramacion, referencia, pvp, cantidad, codimpuesto, importe) VALUES (". |
| 87 | 87 | $this->intval($this->idprogramacion).", ". |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | if($this->db->exec($sql)){ |
| 95 | 95 | return true; |
| 96 | - }else{ |
|
| 96 | + } else{ |
|
| 97 | 97 | return false; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->codcliente = $t['codcliente']; |
| 45 | 45 | $this->idfactura = $t['idfactura']; |
| 46 | 46 | $this->procesado = $this->str2bool($t['procesado']); |
| 47 | - }else{ |
|
| 47 | + } else{ |
|
| 48 | 48 | $this->id = null; |
| 49 | 49 | $this->idprogramacion = null; |
| 50 | 50 | $this->id_edificacion = null; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->var2str($this->procesado).");"; |
| 88 | 88 | if($this->db->exec($sql)){ |
| 89 | 89 | return true; |
| 90 | - }else{ |
|
| 90 | + } else{ |
|
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->codigo = $t['codigo']; |
| 45 | 45 | $this->tipo = $t['tipo']; |
| 46 | 46 | $this->descripcion = $t['descripcion']; |
| 47 | - }else{ |
|
| 47 | + } else{ |
|
| 48 | 48 | $this->codigo = null; |
| 49 | 49 | $this->tipo = null; |
| 50 | 50 | $this->descripcion = null; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $lista[] = new residentes_ayudas($d); |
| 75 | 75 | } |
| 76 | 76 | return $lista; |
| 77 | - }else{ |
|
| 77 | + } else{ |
|
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $lista[] = new residentes_ayudas($d); |
| 89 | 89 | } |
| 90 | 90 | return $lista; |
| 91 | - }else{ |
|
| 91 | + } else{ |
|
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $data = $this->db->select($sql); |
| 99 | 99 | if($data){ |
| 100 | 100 | return new residentes_ayudas($data[0]); |
| 101 | - }else{ |
|
| 101 | + } else{ |
|
| 102 | 102 | return false; |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | public function exists() { |
| 107 | 107 | if(is_null($this->codigo)){ |
| 108 | 108 | return false; |
| 109 | - }else{ |
|
| 109 | + } else{ |
|
| 110 | 110 | return $this->get($this->codigo,$this->tipo); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -117,14 +117,14 @@ discard block |
||
| 117 | 117 | "descripcion = ".$this->var2str($this->descripcion)." ". |
| 118 | 118 | "WHERE codigo = ".$this->var2str($this->codigo)." AND tipo = ".$this->var2str($this->tipo).";"; |
| 119 | 119 | return $this->db->exec($sql); |
| 120 | - }else{ |
|
| 120 | + } else{ |
|
| 121 | 121 | $sql = "INSERT INTO ".$this->table_name." (codigo, tipo, descripcion) VALUES (". |
| 122 | 122 | $this->var2str($this->codigo).", ". |
| 123 | 123 | $this->var2str($this->tipo).", ". |
| 124 | 124 | $this->var2str($this->descripcion).");"; |
| 125 | 125 | if($this->db->exec($sql)){ |
| 126 | 126 | return $this->db->lastval(); |
| 127 | - }else{ |
|
| 127 | + } else{ |
|
| 128 | 128 | return false; |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -100,8 +100,9 @@ |
||
| 100 | 100 | { |
| 101 | 101 | if (\filter_input(INPUT_GET, 'id')) { |
| 102 | 102 | return $this->residente->url(); |
| 103 | - } else |
|
| 104 | - return parent::url(); |
|
| 103 | + } else { |
|
| 104 | + return parent::url(); |
|
| 105 | + } |
|
| 105 | 106 | } |
| 106 | 107 | |
| 107 | 108 | public function informacionResidente() |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -17,11 +17,9 @@ discard block |
||
| 17 | 17 | public function current_font($c){ |
| 18 | 18 | if($c=='family'){ |
| 19 | 19 | return $this->FontFamily; |
| 20 | - } |
|
| 21 | - elseif($c=='style'){ |
|
| 20 | + } elseif($c=='style'){ |
|
| 22 | 21 | return $this->FontStyle; |
| 23 | - } |
|
| 24 | - elseif($c=='size'){ |
|
| 22 | + } elseif($c=='size'){ |
|
| 25 | 23 | return $this->FontSizePt; |
| 26 | 24 | } |
| 27 | 25 | } |
@@ -29,8 +27,7 @@ discard block |
||
| 29 | 27 | public function get_color($c){ |
| 30 | 28 | if($c=='fill'){ |
| 31 | 29 | return $this->FillColor; |
| 32 | - } |
|
| 33 | - elseif($c=='text'){ |
|
| 30 | + } elseif($c=='text'){ |
|
| 34 | 31 | return $this->TextColor; |
| 35 | 32 | } |
| 36 | 33 | } |
@@ -42,11 +39,9 @@ discard block |
||
| 42 | 39 | public function get_margin($c){ |
| 43 | 40 | if($c=='l'){ |
| 44 | 41 | return $this->lMargin; |
| 45 | - } |
|
| 46 | - elseif($c=='r'){ |
|
| 42 | + } elseif($c=='r'){ |
|
| 47 | 43 | return $this->rMargin; |
| 48 | - } |
|
| 49 | - elseif($c=='t'){ |
|
| 44 | + } elseif($c=='t'){ |
|
| 50 | 45 | return $this->tMargin; |
| 51 | 46 | } |
| 52 | 47 | } |
@@ -84,8 +79,7 @@ discard block |
||
| 84 | 79 | break; |
| 85 | 80 | } |
| 86 | 81 | } |
| 87 | - } |
|
| 88 | - else{ |
|
| 82 | + } else{ |
|
| 89 | 83 | $a=false; |
| 90 | 84 | } |
| 91 | 85 | return $a; |
@@ -98,8 +92,7 @@ discard block |
||
| 98 | 92 | for($i=0; $i<3; $i++){ |
| 99 | 93 | if($n==6){ |
| 100 | 94 | $result[$i]=self::$hex[$str[2*$i]]*16+self::$hex[$str[2*$i+1]]; |
| 101 | - } |
|
| 102 | - else{ |
|
| 95 | + } else{ |
|
| 103 | 96 | $result[$i]=self::$hex[$str[$i]]*16+self::$hex[$str[$i]]; |
| 104 | 97 | } |
| 105 | 98 | } |
@@ -113,16 +106,14 @@ discard block |
||
| 113 | 106 | $array=array(); |
| 114 | 107 | if($this->is_hex($str)){ |
| 115 | 108 | $array=$this->hextodec($str); |
| 116 | - } |
|
| 117 | - elseif($this->is_rgb($str)){ |
|
| 109 | + } elseif($this->is_rgb($str)){ |
|
| 118 | 110 | $array=explode(',', trim($str, ',')); |
| 119 | 111 | for($i=0; $i<3; $i++){ |
| 120 | 112 | if(!isset($array[$i])){ |
| 121 | 113 | $array[$i]=0; |
| 122 | 114 | } |
| 123 | 115 | } |
| 124 | - } |
|
| 125 | - else{ |
|
| 116 | + } else{ |
|
| 126 | 117 | $array=array(null, null, null); |
| 127 | 118 | $i=0; |
| 128 | 119 | $tmp=explode(' ', $str); |
@@ -135,11 +126,9 @@ discard block |
||
| 135 | 126 | } |
| 136 | 127 | if($p=='T'){ |
| 137 | 128 | $this->SetTextColor($array[0],$array[1],$array[2]); |
| 138 | - } |
|
| 139 | - elseif($p=='D'){ |
|
| 129 | + } elseif($p=='D'){ |
|
| 140 | 130 | $this->SetDrawColor($array[0],$array[1], $array[2]); |
| 141 | - } |
|
| 142 | - elseif($p=='F'){ |
|
| 131 | + } elseif($p=='F'){ |
|
| 143 | 132 | $this->SetFillColor($array[0],$array[1],$array[2]); |
| 144 | 133 | } |
| 145 | 134 | } |
@@ -164,30 +153,35 @@ discard block |
||
| 164 | 153 | ************************************************************************/ |
| 165 | 154 | |
| 166 | 155 | private function &FontData($family, $style, $size){ |
| 167 | - if($family=='') |
|
| 168 | - $family = $this->FontFamily; |
|
| 169 | - else |
|
| 170 | - $family = strtolower($family); |
|
| 156 | + if($family=='') { |
|
| 157 | + $family = $this->FontFamily; |
|
| 158 | + } else { |
|
| 159 | + $family = strtolower($family); |
|
| 160 | + } |
|
| 171 | 161 | $style = strtoupper($style); |
| 172 | 162 | if(strpos($style,'U')!==false){ |
| 173 | 163 | $this->underline = true; |
| 174 | 164 | $style = str_replace('U','',$style); |
| 175 | 165 | } |
| 176 | - if($style=='IB') |
|
| 177 | - $style = 'BI'; |
|
| 166 | + if($style=='IB') { |
|
| 167 | + $style = 'BI'; |
|
| 168 | + } |
|
| 178 | 169 | $fontkey = $family.$style; |
| 179 | 170 | if(!isset($this->fonts[$fontkey])){ |
| 180 | - if($family=='arial') |
|
| 181 | - $family = 'helvetica'; |
|
| 171 | + if($family=='arial') { |
|
| 172 | + $family = 'helvetica'; |
|
| 173 | + } |
|
| 182 | 174 | if(in_array($family,$this->CoreFonts)){ |
| 183 | - if($family=='symbol' || $family=='zapfdingbats') |
|
| 184 | - $style = ''; |
|
| 175 | + if($family=='symbol' || $family=='zapfdingbats') { |
|
| 176 | + $style = ''; |
|
| 177 | + } |
|
| 185 | 178 | $fontkey = $family.$style; |
| 186 | - if(!isset($this->fonts[$fontkey])) |
|
| 187 | - $this->AddFont($family,$style); |
|
| 179 | + if(!isset($this->fonts[$fontkey])) { |
|
| 180 | + $this->AddFont($family,$style); |
|
| 181 | + } |
|
| 182 | + } else { |
|
| 183 | + $this->Error('Undefined font: '.$family.' '.$style); |
|
| 188 | 184 | } |
| 189 | - else |
|
| 190 | - $this->Error('Undefined font: '.$family.' '.$style); |
|
| 191 | 185 | } |
| 192 | 186 | $result['FontSize'] = $size/$this->k; |
| 193 | 187 | $result['CurrentFont']=&$this->fonts[$fontkey]; |
@@ -242,8 +236,7 @@ discard block |
||
| 242 | 236 | $x-=($a+$sl); |
| 243 | 237 | $a=0; |
| 244 | 238 | $u=$p; |
| 245 | - } |
|
| 246 | - else{ |
|
| 239 | + } else{ |
|
| 247 | 240 | $x=$cw[$parced_str[$i]]*$cfty['font-size']; |
| 248 | 241 | $t=''; |
| 249 | 242 | $u=$i; |
@@ -330,8 +323,7 @@ discard block |
||
| 330 | 323 | if($line['width']!=0){ |
| 331 | 324 | if($align=='R'){ |
| 332 | 325 | $dx = $w-$line['width']/($this->k*1000); |
| 333 | - } |
|
| 334 | - elseif($align=='C'){ |
|
| 326 | + } elseif($align=='C'){ |
|
| 335 | 327 | $dx = ($w-$line['width']/($this->k*1000))/2; |
| 336 | 328 | } |
| 337 | 329 | if($align=='J'){ |
@@ -365,8 +357,7 @@ discard block |
||
| 365 | 357 | } |
| 366 | 358 | $xx+=$this->GetStringWidth($tt); |
| 367 | 359 | } |
| 368 | - } |
|
| 369 | - else{ |
|
| 360 | + } else{ |
|
| 370 | 361 | $this->Text($xx, $y, $txt); |
| 371 | 362 | if($line['style'][$tj]['href']){ |
| 372 | 363 | $yr=$this->y+0.5*($lh*$line['height']-$line['height']/$this->k); |
@@ -40,12 +40,10 @@ discard block |
||
| 40 | 40 | if(strpos($r[1], 'U')!==false){ |
| 41 | 41 | $style['font-style'].='U'; |
| 42 | 42 | } |
| 43 | - } |
|
| 44 | - elseif($r[1]){ |
|
| 43 | + } elseif($r[1]){ |
|
| 45 | 44 | if($r[0]=='href'){ |
| 46 | 45 | $style[$r[0]]=implode(':', array_slice($r,1)); |
| 47 | - } |
|
| 48 | - else{ |
|
| 46 | + } else{ |
|
| 49 | 47 | $style[$r[0]]=$r[1]; |
| 50 | 48 | } |
| 51 | 49 | } |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | $cs=$this->style_merge($cs, $this->get_style($open[$total[$i]])); |
| 119 | 117 | array_push($tmp, $cs); |
| 120 | 118 | $k=strpos($str, '>',$total[$i]+1)+1; |
| 121 | - } |
|
| 122 | - else{ |
|
| 119 | + } else{ |
|
| 123 | 120 | $k=$total[$i]+4; |
| 124 | 121 | array_pop($tmp); |
| 125 | 122 | $l=count($tmp)-1; |