@@ -33,6 +33,9 @@ discard block  | 
                                                    ||
| 33 | 33 | return $bloc_editable;  | 
                                                        
| 34 | 34 | }  | 
                                                        
| 35 | 35 | |
| 36 | + /**  | 
                                                        |
| 37 | + * @param integer $parent  | 
                                                        |
| 38 | + */  | 
                                                        |
| 36 | 39 |  		private function getOrdrePage($parent) { | 
                                                        
| 37 | 40 |  			if (($parent != "") || ($parent != 0)) { | 
                                                        
| 38 | 41 | $dbc = \core\App::getDb();  | 
                                                        
@@ -66,13 +69,13 @@ discard block  | 
                                                    ||
| 66 | 69 | }  | 
                                                        
| 67 | 70 | |
| 68 | 71 | /**  | 
                                                        
| 69 | - * @param $nom_table  | 
                                                        |
| 70 | - * @param $nom_id_table  | 
                                                        |
| 71 | - * @param $champ  | 
                                                        |
| 72 | + * @param string $nom_table  | 
                                                        |
| 73 | + * @param string $nom_id_table  | 
                                                        |
| 74 | + * @param string $champ  | 
                                                        |
| 72 | 75 | * @param $value  | 
                                                        
| 73 | - * @param $limit_char  | 
                                                        |
| 74 | - * @param $err_char  | 
                                                        |
| 75 | - * @param $err_egalite  | 
                                                        |
| 76 | + * @param integer $limit_char  | 
                                                        |
| 77 | + * @param string $err_char  | 
                                                        |
| 78 | + * @param string $err_egalite  | 
                                                        |
| 76 | 79 | * @param null $value_id_table  | 
                                                        
| 77 | 80 | * @return string  | 
                                                        
| 78 | 81 | * fonction qui permet de vérifier qu'il n'y ait pas d'erreur dans le champ spécifié ni de doublons  | 
                                                        
@@ -52,7 +52,9 @@ discard block  | 
                                                    ||
| 52 | 52 |  		private function getParentId($parent) { | 
                                                        
| 53 | 53 | $dbc = \core\App::getDb();  | 
                                                        
| 54 | 54 | |
| 55 | - if ($parent == "") return 0;  | 
                                                        |
| 55 | +			if ($parent == "") { | 
                                                        |
| 56 | + return 0;  | 
                                                        |
| 57 | + }  | 
                                                        |
| 56 | 58 | |
| 57 | 59 |  			$query = $dbc->select("ID_page")->from("page")->where("titre", " LIKE ", '"%'.$parent.'%"', "", true)->get(); | 
                                                        
| 58 | 60 | |
@@ -83,8 +85,7 @@ discard block  | 
                                                    ||
| 83 | 85 |  			if (strlen(utf8_decode($value)) > $limit_char) { | 
                                                        
| 84 | 86 | $this->erreur = true;  | 
                                                        
| 85 | 87 | return "<li>$err_char</li>";  | 
                                                        
| 86 | - }  | 
                                                        |
| 87 | -			else if ($dbc->rechercherEgalite($nom_table, $champ, $value, $nom_id_table, $value_id_table) == true) { | 
                                                        |
| 88 | +			} else if ($dbc->rechercherEgalite($nom_table, $champ, $value, $nom_id_table, $value_id_table) == true) { | 
                                                        |
| 88 | 89 | $this->erreur = true;  | 
                                                        
| 89 | 90 | return "<li>$err_egalite</li>";  | 
                                                        
| 90 | 91 | }  | 
                                                        
@@ -167,13 +168,11 @@ discard block  | 
                                                    ||
| 167 | 168 |  					if ($parent == "") { | 
                                                        
| 168 | 169 |  						$this->setAjoutLienNavigation("ID_page", $this->id_page, 1); | 
                                                        
| 169 | 170 | }  | 
                                                        
| 170 | - }  | 
                                                        |
| 171 | -				else { | 
                                                        |
| 171 | +				} else { | 
                                                        |
| 172 | 172 |  					FlashMessage::setFlash("Impossible de créer cette page, veuillez réeseyer dans un moment. Si le problème persiste contactez votre administrateur."); | 
                                                        
| 173 | 173 | $this->erreur = true;  | 
                                                        
| 174 | 174 | }  | 
                                                        
| 175 | - }  | 
                                                        |
| 176 | -			else { | 
                                                        |
| 175 | +			} else { | 
                                                        |
| 177 | 176 | $this->setErreurContenus($balise_title, $url, $meta_description, $titre_page, $parent, $err_balise_title, $err_url, $err_meta_description, $err_titre_page);  | 
                                                        
| 178 | 177 | $this->erreur = true;  | 
                                                        
| 179 | 178 | }  | 
                                                        
@@ -219,8 +218,7 @@ discard block  | 
                                                    ||
| 219 | 218 |  				if ($parent == "") { | 
                                                        
| 220 | 219 |  					$this->setAjoutLienNavigation("ID_page", $this->id_page, 1); | 
                                                        
| 221 | 220 | }  | 
                                                        
| 222 | - }  | 
                                                        |
| 223 | -			else { | 
                                                        |
| 221 | +			} else { | 
                                                        |
| 224 | 222 | $this->setErreurContenus($balise_title, $url, $titre_page, $parent, $err_balise_title, $err_url, $err_titre_page);  | 
                                                        
| 225 | 223 | $this->erreur = true;  | 
                                                        
| 226 | 224 | }  | 
                                                        
@@ -284,8 +282,7 @@ discard block  | 
                                                    ||
| 284 | 282 | ->set();  | 
                                                        
| 285 | 283 | |
| 286 | 284 |  					$this->setModifierLienNavigation("ID_page", $id_page, $this->getParentId($parent), $affiche); | 
                                                        
| 287 | - }  | 
                                                        |
| 288 | -				else { | 
                                                        |
| 285 | +				} else { | 
                                                        |
| 289 | 286 | $this->setErreurContenus($balise_title, $url, $meta_description, $titre_page, $parent, $err_balise_title, $err_url, $err_meta_description, $err_titre_page);  | 
                                                        
| 290 | 287 | }  | 
                                                        
| 291 | 288 | }  | 
                                                        
@@ -334,8 +331,7 @@ discard block  | 
                                                    ||
| 334 | 331 |  					FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); | 
                                                        
| 335 | 332 | $this->erreur = true;  | 
                                                        
| 336 | 333 | }  | 
                                                        
| 337 | - }  | 
                                                        |
| 338 | -			else { | 
                                                        |
| 334 | +			} else { | 
                                                        |
| 339 | 335 |  				FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); | 
                                                        
| 340 | 336 | $this->erreur = true;  | 
                                                        
| 341 | 337 | }  | 
                                                        
@@ -361,8 +357,7 @@ discard block  | 
                                                    ||
| 361 | 357 |  			if ($parent != "") { | 
                                                        
| 362 | 358 | $nav = new Navigation();  | 
                                                        
| 363 | 359 | $nav->setSupprimerLien($id, $id_page);  | 
                                                        
| 364 | - }  | 
                                                        |
| 365 | -			else if (($affiche == 1) && ($parent == "")) { | 
                                                        |
| 360 | +			} else if (($affiche == 1) && ($parent == "")) { | 
                                                        |
| 366 | 361 | $this->setAjoutLienNavigation($id, $id_page, $affiche);  | 
                                                        
| 367 | 362 | }  | 
                                                        
| 368 | 363 | }  | 
                                                        
@@ -368,7 +368,7 @@  | 
                                                    ||
| 368 | 368 | |
| 369 | 369 | /**  | 
                                                        
| 370 | 370 | * @param $nom_batiment_sql  | 
                                                        
| 371 | - * @param $niveau  | 
                                                        |
| 371 | + * @param integer $niveau  | 
                                                        |
| 372 | 372 | * @return array  | 
                                                        
| 373 | 373 | * recuperation des ressources nécéssaire pour construire le batiment  | 
                                                        
| 374 | 374 | */  | 
                                                        
@@ -46,7 +46,7 @@  | 
                                                    ||
| 46 | 46 | return $this->ressource_construire;  | 
                                                        
| 47 | 47 | }  | 
                                                        
| 48 | 48 |  		public function getInfoBatiment(){ | 
                                                        
| 49 | - return $this->info_batiment;  | 
                                                        |
| 49 | + return $this->info_batiment;  | 
                                                        |
| 50 | 50 | }  | 
                                                        
| 51 | 51 | |
| 52 | 52 |  		public function getNomBatimentConstruction() { | 
                                                        
@@ -46,10 +46,10 @@ discard block  | 
                                                    ||
| 46 | 46 |  		public function getRessourceConstruire() { | 
                                                        
| 47 | 47 | return $this->ressource_construire;  | 
                                                        
| 48 | 48 | }  | 
                                                        
| 49 | -		public function getInfoBatiment(){ | 
                                                        |
| 49 | +		public function getInfoBatiment() { | 
                                                        |
| 50 | 50 | return $this->info_batiment;  | 
                                                        
| 51 | 51 | }  | 
                                                        
| 52 | -		public function getInfoBatimentNext(){ | 
                                                        |
| 52 | +		public function getInfoBatimentNext() { | 
                                                        |
| 53 | 53 | return $this->info_batiment_next;  | 
                                                        
| 54 | 54 | }  | 
                                                        
| 55 | 55 | |
@@ -81,7 +81,7 @@ discard block  | 
                                                    ||
| 81 | 81 |  			if ((is_array($query)) && (count($query) > 0)) { | 
                                                        
| 82 | 82 |  				foreach ($query as $obj) { | 
                                                        
| 83 | 83 |  					if ($obj->construction == 1) { | 
                                                        
| 84 | - return $obj->niveau-1;  | 
                                                        |
| 84 | + return $obj->niveau - 1;  | 
                                                        |
| 85 | 85 | }  | 
                                                        
| 86 | 86 | |
| 87 | 87 | return $obj->niveau;  | 
                                                        
@@ -149,7 +149,7 @@ discard block  | 
                                                    ||
| 149 | 149 |  			if ($niveau > 0) { | 
                                                        
| 150 | 150 |  				$query = $dbc1->select("stockage")->from("entrepot")->where("ID_entrepot", "=", $niveau)->get(); | 
                                                        
| 151 | 151 | |
| 152 | -				if ((is_array($query)) && (count($query) > 0)){ | 
                                                        |
| 152 | +				if ((is_array($query)) && (count($query) > 0)) { | 
                                                        |
| 153 | 153 |  					foreach ($query as $obj) { | 
                                                        
| 154 | 154 | return $obj->stockage;  | 
                                                        
| 155 | 155 | }  | 
                                                        
@@ -190,7 +190,7 @@ discard block  | 
                                                    ||
| 190 | 190 | $this->niveau_batiment = $this->niveau_batiment + 1;  | 
                                                        
| 191 | 191 | }  | 
                                                        
| 192 | 192 | $niveau_batiment_base = $this->niveau_batiment;  | 
                                                        
| 193 | - $max_level = $this->getInfoUpgradeBatiment();  | 
                                                        |
| 193 | + $max_level = $this->getInfoUpgradeBatiment();  | 
                                                        |
| 194 | 194 | }  | 
                                                        
| 195 | 195 |  			else { | 
                                                        
| 196 | 196 | //on test voir si le bat est au niveau max et si il peut avoir un addon  | 
                                                        
@@ -264,12 +264,12 @@ discard block  | 
                                                    ||
| 264 | 264 | $id_batiment = $obj->ID_batiment;  | 
                                                        
| 265 | 265 | }  | 
                                                        
| 266 | 266 | |
| 267 | -				if ($this->date_fin_construction-$today <= 0) { | 
                                                        |
| 267 | +				if ($this->date_fin_construction - $today <= 0) { | 
                                                        |
| 268 | 268 | $this->setTerminerConstruction($id_batiment);  | 
                                                        
| 269 | 269 | }  | 
                                                        
| 270 | 270 |  				else { | 
                                                        
| 271 | 271 | Bataille::setValues([  | 
                                                        
| 272 | - "date_fin_construction" => $this->date_fin_construction-$today,  | 
                                                        |
| 272 | + "date_fin_construction" => $this->date_fin_construction - $today,  | 
                                                        |
| 273 | 273 | "nom_batiment_construction" => $this->nom_batiment_construction  | 
                                                        
| 274 | 274 | ]);  | 
                                                        
| 275 | 275 | }  | 
                                                        
@@ -318,7 +318,7 @@ discard block  | 
                                                    ||
| 318 | 318 | //et compare la liste des batiments qu'il faut pour construire le batiment  | 
                                                        
| 319 | 319 | //a ceux qui sont deja construit dans la base  | 
                                                        
| 320 | 320 | //si tous les batments qu'il faut son batis on autorise la construction du batiment  | 
                                                        
| 321 | -			for ($i=0 ; $i<$c_all_batiment ; $i++) { | 
                                                        |
| 321 | +			for ($i = 0; $i < $c_all_batiment; $i++) { | 
                                                        |
| 322 | 322 |  				if (!in_array($all_batiment[$i], $batiment_construit)) { | 
                                                        
| 323 | 323 |  					$query = $dbc1->select("pour_construire") | 
                                                        
| 324 | 324 |  						->select("temps_construction") | 
                                                        
@@ -358,7 +358,7 @@ discard block  | 
                                                    ||
| 358 | 358 |  					else if (count($pour_construire) > 1) { | 
                                                        
| 359 | 359 | $ok_construction = false;  | 
                                                        
| 360 | 360 | //test si tous les batiments sont construits et on le niveau nécéssaire  | 
                                                        
| 361 | -						for ($j=0 ; $j<count($pour_construire) ; $j++) { | 
                                                        |
| 361 | +						for ($j = 0; $j < count($pour_construire); $j++) { | 
                                                        |
| 362 | 362 |  							if (in_array($pour_construire[$j][1], $batiment_construit)) { | 
                                                        
| 363 | 363 |  								if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { | 
                                                        
| 364 | 364 | $ok_construction = true;  | 
                                                        
@@ -402,7 +402,7 @@ discard block  | 
                                                    ||
| 402 | 402 |  		private function getRessourceConstruireBatiment($nom_batiment_sql, $niveau) { | 
                                                        
| 403 | 403 | $dbc1 = Bataille::getDb();  | 
                                                        
| 404 | 404 | |
| 405 | - $niveau = $niveau+1;  | 
                                                        |
| 405 | + $niveau = $niveau + 1;  | 
                                                        |
| 406 | 406 | |
| 407 | 407 |  			$query = $dbc1->select("ressource_construire")->from($nom_batiment_sql)->where("ID_".$nom_batiment_sql, "=", $niveau)->get(); | 
                                                        
| 408 | 408 | |
@@ -435,7 +435,7 @@ discard block  | 
                                                    ||
| 435 | 435 | */  | 
                                                        
| 436 | 436 |  		private function getTestBatimentConstruction($nom_batiment) { | 
                                                        
| 437 | 437 |  			if (ChaineCaractere::FindInString($nom_batiment, " en construction") == true) { | 
                                                        
| 438 | -				return [substr($nom_batiment, 0, (0-strlen(" en construction"))), true]; | 
                                                        |
| 438 | +				return [substr($nom_batiment, 0, (0 - strlen(" en construction"))), true]; | 
                                                        |
| 439 | 439 | }  | 
                                                        
| 440 | 440 | |
| 441 | 441 | return [$nom_batiment, false];  | 
                                                        
@@ -450,7 +450,7 @@ discard block  | 
                                                    ||
| 450 | 450 | $dbc1 = Bataille::getDb();  | 
                                                        
| 451 | 451 | |
| 452 | 452 | //récupération du temps et des ressources pour construire  | 
                                                        
| 453 | -			$query = $dbc1->select()->from($this->nom_batiment_sql)->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1)->get(); | 
                                                        |
| 453 | +			$query = $dbc1->select()->from($this->nom_batiment_sql)->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment + 1)->get(); | 
                                                        |
| 454 | 454 | |
| 455 | 455 | //si on a quelque chose cela veut dire qu'on est pas encore au lvl max du batiment  | 
                                                        
| 456 | 456 |  			if ((is_array($query)) && (count($query) > 0)) { | 
                                                        
@@ -471,7 +471,7 @@ discard block  | 
                                                    ||
| 471 | 471 |  						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment) | 
                                                        
| 472 | 472 | ->get();  | 
                                                        
| 473 | 473 | |
| 474 | -					if ((is_array($query)) && (count($query) > 0)){ | 
                                                        |
| 474 | +					if ((is_array($query)) && (count($query) > 0)) { | 
                                                        |
| 475 | 475 |  						foreach ($query as $obj) { | 
                                                        
| 476 | 476 | $this->info_batiment = $xml->$nom_batiment_sql->phrase.$obj->$champ;  | 
                                                        
| 477 | 477 | }  | 
                                                        
@@ -480,10 +480,10 @@ discard block  | 
                                                    ||
| 480 | 480 | //récupération de la phrase pour le niveau suivant  | 
                                                        
| 481 | 481 | $query = $dbc1->select($xml->$nom_batiment_sql->champ)  | 
                                                        
| 482 | 482 | ->from($this->nom_batiment_sql)  | 
                                                        
| 483 | -						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) | 
                                                        |
| 483 | +						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment + 1) | 
                                                        |
| 484 | 484 | ->get();  | 
                                                        
| 485 | 485 | |
| 486 | -					if ((is_array($query)) && (count($query) > 0)){ | 
                                                        |
| 486 | +					if ((is_array($query)) && (count($query) > 0)) { | 
                                                        |
| 487 | 487 |  						foreach ($query as $obj) { | 
                                                        
| 488 | 488 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ;  | 
                                                        
| 489 | 489 | }  | 
                                                        
@@ -552,7 +552,7 @@ discard block  | 
                                                    ||
| 552 | 552 |  					$query = $dbc1->select("ressource_construire") | 
                                                        
| 553 | 553 |  						->select("temps_construction") | 
                                                        
| 554 | 554 | ->from($this->nom_batiment_sql)  | 
                                                        
| 555 | -						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1) | 
                                                        |
| 555 | +						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment + 1) | 
                                                        |
| 556 | 556 | ->get();  | 
                                                        
| 557 | 557 | |
| 558 | 558 |  					foreach ($query as $obj) { | 
                                                        
@@ -562,7 +562,7 @@ discard block  | 
                                                    ||
| 562 | 562 | |
| 563 | 563 | //on insere la construction dans la table batiment si new batiment  | 
                                                        
| 564 | 564 |  					if ($un_batiment == 0) { | 
                                                        
| 565 | -						$dbc->insert("niveau", $this->niveau_batiment+1) | 
                                                        |
| 565 | +						$dbc->insert("niveau", $this->niveau_batiment + 1) | 
                                                        |
| 566 | 566 |  							->insert("emplacement", $emplacement) | 
                                                        
| 567 | 567 |  							->insert("nom_batiment", $nom_batiment) | 
                                                        
| 568 | 568 |  							->insert("nom_batiment_sql", $this->nom_batiment_sql) | 
                                                        
@@ -574,7 +574,7 @@ discard block  | 
                                                    ||
| 574 | 574 | $this->id_batiment = $dbc->lastInsertId();  | 
                                                        
| 575 | 575 | }  | 
                                                        
| 576 | 576 |  					else { | 
                                                        
| 577 | -						$dbc->update("niveau", $this->niveau_batiment+1) | 
                                                        |
| 577 | +						$dbc->update("niveau", $this->niveau_batiment + 1) | 
                                                        |
| 578 | 578 |  							->update("construction", 1) | 
                                                        
| 579 | 579 |  							->from("_bataille_batiment") | 
                                                        
| 580 | 580 |  							->where("ID_batiment", "=", $this->id_batiment, "AND") | 
                                                        
@@ -589,7 +589,7 @@ discard block  | 
                                                    ||
| 589 | 589 | $today = $today->getTimestamp();  | 
                                                        
| 590 | 590 | |
| 591 | 591 | //date de la fin de la construction en seconde  | 
                                                        
| 592 | - $fin_construction = $today+$temps_construction;  | 
                                                        |
| 592 | + $fin_construction = $today + $temps_construction;  | 
                                                        |
| 593 | 593 | |
| 594 | 594 |  					$dbc->insert("date_fin", $fin_construction) | 
                                                        
| 595 | 595 |  						->insert("emplacement_construction", $emplacement) | 
                                                        
@@ -3,7 +3,6 @@  | 
                                                    ||
| 3 | 3 | use core\App;  | 
                                                        
| 4 | 4 | use core\functions\ChaineCaractere;  | 
                                                        
| 5 | 5 | use core\HTML\flashmessage\FlashMessage;  | 
                                                        
| 6 | - use Nette\Utils\DateTime;  | 
                                                        |
| 7 | 6 | |
| 8 | 7 |  	class Batiment { | 
                                                        
| 9 | 8 | //pour quand on recup un batiment  | 
                                                        
@@ -91,8 +91,7 @@ discard block  | 
                                                    ||
| 91 | 91 | |
| 92 | 92 | return $obj->niveau;  | 
                                                        
| 93 | 93 | }  | 
                                                        
| 94 | - }  | 
                                                        |
| 95 | -			else { | 
                                                        |
| 94 | +			} else { | 
                                                        |
| 96 | 95 | return 0;  | 
                                                        
| 97 | 96 | }  | 
                                                        
| 98 | 97 | }  | 
                                                        
@@ -109,10 +108,18 @@ discard block  | 
                                                    ||
| 109 | 108 | $id_base = Bataille::getIdBase();  | 
                                                        
| 110 | 109 | }  | 
                                                        
| 111 | 110 | |
| 112 | - if ($ressource == "eau") $nom_batiment = "centrale_eau";  | 
                                                        |
| 113 | - if ($ressource == "electricite") $nom_batiment = "centrale_electrique";  | 
                                                        |
| 114 | - if ($ressource == "fuel") $nom_batiment = "station_pompage_fuel";  | 
                                                        |
| 115 | - if ($ressource == "fer") $nom_batiment = "station_forage";  | 
                                                        |
| 111 | +			if ($ressource == "eau") { | 
                                                        |
| 112 | + $nom_batiment = "centrale_eau";  | 
                                                        |
| 113 | + }  | 
                                                        |
| 114 | +			if ($ressource == "electricite") { | 
                                                        |
| 115 | + $nom_batiment = "centrale_electrique";  | 
                                                        |
| 116 | + }  | 
                                                        |
| 117 | +			if ($ressource == "fuel") { | 
                                                        |
| 118 | + $nom_batiment = "station_pompage_fuel";  | 
                                                        |
| 119 | + }  | 
                                                        |
| 120 | +			if ($ressource == "fer") { | 
                                                        |
| 121 | + $nom_batiment = "station_forage";  | 
                                                        |
| 122 | + }  | 
                                                        |
| 116 | 123 | |
| 117 | 124 | $niveau = $this->getNiveauBatiment($nom_batiment, $id_base);  | 
                                                        
| 118 | 125 | |
@@ -126,8 +133,7 @@ discard block  | 
                                                    ||
| 126 | 133 | |
| 127 | 134 | return $prod;  | 
                                                        
| 128 | 135 | }  | 
                                                        
| 129 | - }  | 
                                                        |
| 130 | -			else { | 
                                                        |
| 136 | +			} else { | 
                                                        |
| 131 | 137 | return 20;  | 
                                                        
| 132 | 138 | }  | 
                                                        
| 133 | 139 | }  | 
                                                        
@@ -153,8 +159,7 @@ discard block  | 
                                                    ||
| 153 | 159 | return $obj->stockage;  | 
                                                        
| 154 | 160 | }  | 
                                                        
| 155 | 161 | }  | 
                                                        
| 156 | - }  | 
                                                        |
| 157 | -			else { | 
                                                        |
| 162 | +			} else { | 
                                                        |
| 158 | 163 | return 1000;  | 
                                                        
| 159 | 164 | }  | 
                                                        
| 160 | 165 | }  | 
                                                        
@@ -190,8 +195,7 @@ discard block  | 
                                                    ||
| 190 | 195 | }  | 
                                                        
| 191 | 196 | $niveau_batiment_base = $this->niveau_batiment;  | 
                                                        
| 192 | 197 | $max_level = $this->getInfoUpgradeBatiment();  | 
                                                        
| 193 | - }  | 
                                                        |
| 194 | -			else { | 
                                                        |
| 198 | +			} else { | 
                                                        |
| 195 | 199 | $max_level = 0;  | 
                                                        
| 196 | 200 | }  | 
                                                        
| 197 | 201 | |
@@ -244,8 +248,7 @@ discard block  | 
                                                    ||
| 244 | 248 | |
| 245 | 249 |  				if ($this->date_fin_construction-$today <= 0) { | 
                                                        
| 246 | 250 | $this->setTerminerConstruction($id_batiment);  | 
                                                        
| 247 | - }  | 
                                                        |
| 248 | -				else { | 
                                                        |
| 251 | +				} else { | 
                                                        |
| 249 | 252 | Bataille::setValues([  | 
                                                        
| 250 | 253 | "date_fin_construction" => $this->date_fin_construction-$today,  | 
                                                        
| 251 | 254 | "nom_batiment_construction" => $this->nom_batiment_construction  | 
                                                        
@@ -308,8 +311,7 @@ discard block  | 
                                                    ||
| 308 | 311 |  						foreach ($query as $obj) { | 
                                                        
| 309 | 312 |  							if ($obj->pour_construire != null) { | 
                                                        
| 310 | 313 | $pour_construire = unserialize($obj->pour_construire);  | 
                                                        
| 311 | - }  | 
                                                        |
| 312 | -							else { | 
                                                        |
| 314 | +							} else { | 
                                                        |
| 313 | 315 | $pour_construire = [];  | 
                                                        
| 314 | 316 | }  | 
                                                        
| 315 | 317 | |
@@ -332,21 +334,18 @@ discard block  | 
                                                    ||
| 332 | 334 | ];  | 
                                                        
| 333 | 335 | }  | 
                                                        
| 334 | 336 | }  | 
                                                        
| 335 | - }  | 
                                                        |
| 336 | -					else if (count($pour_construire) > 1) { | 
                                                        |
| 337 | +					} else if (count($pour_construire) > 1) { | 
                                                        |
| 337 | 338 | $ok_construction = false;  | 
                                                        
| 338 | 339 | //test si tous les batiments sont construits et on le niveau nécéssaire  | 
                                                        
| 339 | 340 |  						for ($j=0 ; $j<count($pour_construire) ; $j++) { | 
                                                        
| 340 | 341 |  							if (in_array($pour_construire[$j][1], $batiment_construit)) { | 
                                                        
| 341 | 342 |  								if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) { | 
                                                        
| 342 | 343 | $ok_construction = true;  | 
                                                        
| 343 | - }  | 
                                                        |
| 344 | -								else { | 
                                                        |
| 344 | +								} else { | 
                                                        |
| 345 | 345 | $ok_construction = false;  | 
                                                        
| 346 | 346 | break;  | 
                                                        
| 347 | 347 | }  | 
                                                        
| 348 | - }  | 
                                                        |
| 349 | -							else { | 
                                                        |
| 348 | +							} else { | 
                                                        |
| 350 | 349 | $ok_construction = false;  | 
                                                        
| 351 | 350 | break;  | 
                                                        
| 352 | 351 | }  | 
                                                        
@@ -363,8 +362,7 @@ discard block  | 
                                                    ||
| 363 | 362 | "temps_construction" => $temps_construction  | 
                                                        
| 364 | 363 | ];  | 
                                                        
| 365 | 364 | }  | 
                                                        
| 366 | - }  | 
                                                        |
| 367 | -					else { | 
                                                        |
| 365 | +					} else { | 
                                                        |
| 368 | 366 | $ressource = $this->getRessourceConstruireBatiment($all_batiment[$i], 0);  | 
                                                        
| 369 | 367 | |
| 370 | 368 | $batiment_construire[] = [  | 
                                                        
@@ -473,8 +471,7 @@ discard block  | 
                                                    ||
| 473 | 471 | $this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ;  | 
                                                        
| 474 | 472 | }  | 
                                                        
| 475 | 473 | }  | 
                                                        
| 476 | - }  | 
                                                        |
| 477 | -				else { | 
                                                        |
| 474 | +				} else { | 
                                                        |
| 478 | 475 | $this->info_batiment = "";  | 
                                                        
| 479 | 476 | $this->info_batiment_next = "";  | 
                                                        
| 480 | 477 | }  | 
                                                        
@@ -519,8 +516,7 @@ discard block  | 
                                                    ||
| 519 | 516 | $ressource = $this->getRessourceConstruireBatiment($nom_batiment_sql, 0);  | 
                                                        
| 520 | 517 | $this->nom_batiment_sql = $nom_batiment_sql;  | 
                                                        
| 521 | 518 | $this->niveau_batiment = 0;  | 
                                                        
| 522 | - }  | 
                                                        |
| 523 | -				else { | 
                                                        |
| 519 | +				} else { | 
                                                        |
| 524 | 520 | //si c'est le lvl 0 de l'addon  | 
                                                        
| 525 | 521 |  					if ($this->niveau_batiment == 0) { | 
                                                        
| 526 | 522 | $un_batiment = 0;  | 
                                                        
@@ -531,8 +527,7 @@ discard block  | 
                                                    ||
| 531 | 527 | //si pas assez de ressource  | 
                                                        
| 532 | 528 |  				if (in_array("rouge", $ressource[0])) { | 
                                                        
| 533 | 529 |  					FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment"); | 
                                                        
| 534 | - }  | 
                                                        |
| 535 | -				else { | 
                                                        |
| 530 | +				} else { | 
                                                        |
| 536 | 531 | //recuperation du temps de construction  | 
                                                        
| 537 | 532 |  					$query = $dbc1->select("ressource_construire") | 
                                                        
| 538 | 533 |  						->select("temps_construction") | 
                                                        
@@ -557,8 +552,7 @@ discard block  | 
                                                    ||
| 557 | 552 | ->set();  | 
                                                        
| 558 | 553 | |
| 559 | 554 | $this->id_batiment = $dbc->lastInsertId();  | 
                                                        
| 560 | - }  | 
                                                        |
| 561 | -					else { | 
                                                        |
| 555 | +					} else { | 
                                                        |
| 562 | 556 |  						$dbc->update("niveau", $this->niveau_batiment+1) | 
                                                        
| 563 | 557 |  							->update("construction", 1) | 
                                                        
| 564 | 558 |  							->from("_bataille_batiment") | 
                                                        
@@ -585,8 +579,7 @@ discard block  | 
                                                    ||
| 585 | 579 | //on retire les ressources de la base  | 
                                                        
| 586 | 580 | Bataille::getRessource()->setUpdateRessource($ressource_construction[2], $ressource_construction[3], $ressource_construction[0], $ressource_construction[1], 0, "-");  | 
                                                        
| 587 | 581 | }  | 
                                                        
| 588 | - }  | 
                                                        |
| 589 | -			else { | 
                                                        |
| 582 | +			} else { | 
                                                        |
| 590 | 583 |  				FlashMessage::setFlash("Un batiment est déjà en construction, vous ne pouvez pas en construire un autre !"); | 
                                                        
| 591 | 584 | }  | 
                                                        
| 592 | 585 | }  | 
                                                        
@@ -1,5 +1,7 @@ discard block  | 
                                                    ||
| 1 | 1 | <?php  | 
                                                        
| 2 | - if (!isset($page_root)) $page_root = "index.php";  | 
                                                        |
| 2 | +	if (!isset($page_root)) { | 
                                                        |
| 3 | + $page_root = "index.php";  | 
                                                        |
| 4 | + }  | 
                                                        |
| 3 | 5 | |
| 4 | 6 | //-------------------------- CONSTANTE POUR LES ROUTES ----------------------------------------------------------------------------//  | 
                                                        
| 5 | 7 | //definit le chemin vers la racine du projet (depuis racine serveur web  | 
                                                        
@@ -46,15 +48,13 @@ discard block  | 
                                                    ||
| 46 | 48 |  		if (($ini["installation"] == 1) && ($page_root != "installation.php")) { | 
                                                        
| 47 | 49 |  			header("location:".WEBROOT."installation-ribs"); | 
                                                        
| 48 | 50 | }  | 
                                                        
| 49 | - }  | 
                                                        |
| 50 | -	else { | 
                                                        |
| 51 | +	} else { | 
                                                        |
| 51 | 52 |  		header("location:".WEBROOT."installation"); | 
                                                        
| 52 | 53 | }  | 
                                                        
| 53 | 54 | |
| 54 | 55 |  	if ($ini["developpment"] == 1) { | 
                                                        
| 55 | 56 | $tab = "dev";  | 
                                                        
| 56 | - }  | 
                                                        |
| 57 | -	else { | 
                                                        |
| 57 | +	} else { | 
                                                        |
| 58 | 58 | $tab = "prod";  | 
                                                        
| 59 | 59 | }  | 
                                                        
| 60 | 60 | |
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | |
| 25 | 25 | //-------------------------- GETTER ----------------------------------------------------------------------------//  | 
                                                        
| 26 | 26 |  		public static function getValues() { | 
                                                        
| 27 | - return ["bataille" => self::$values];  | 
                                                        |
| 27 | + return ["bataille" => self::$values];  | 
                                                        |
| 28 | 28 | }  | 
                                                        
| 29 | 29 | |
| 30 | 30 | //initilisation of all classes of battle  | 
                                                        
@@ -197,7 +197,7 @@ discard block  | 
                                                    ||
| 197 | 197 |  		public static function getTestAssezRessourceBase($nom_ressource, $ressource) { | 
                                                        
| 198 | 198 | $f = "get".ucfirst($nom_ressource);  | 
                                                        
| 199 | 199 | |
| 200 | -			if ($ressource >  Bataille::getRessource()->$f()) { | 
                                                        |
| 200 | +			if ($ressource > Bataille::getRessource()->$f()) { | 
                                                        |
| 201 | 201 |  				/*echo("$nom_ressource $ressource ".Bataille::getRessource()->getEau()." ---");*/ | 
                                                        
| 202 | 202 | return [  | 
                                                        
| 203 | 203 | "ressource" => $ressource,  | 
                                                        
@@ -224,10 +224,10 @@ discard block  | 
                                                    ||
| 224 | 224 | |
| 225 | 225 | //calcul des distances séparant les deux bases en x et y  | 
                                                        
| 226 | 226 | //cette dstance sera multipliée par 15 sur x et y puis ajoutée pour avoir le temps du trajte en seconde  | 
                                                        
| 227 | - $calc_x = abs($base_joueur['posx']-$base_autre['posx']);  | 
                                                        |
| 228 | - $calc_y = abs($base_joueur['posy']-$base_autre['posy']);  | 
                                                        |
| 227 | + $calc_x = abs($base_joueur['posx'] - $base_autre['posx']);  | 
                                                        |
| 228 | + $calc_y = abs($base_joueur['posy'] - $base_autre['posy']);  | 
                                                        |
| 229 | 229 | |
| 230 | - $temps_voyage = (($calc_x*70)+($calc_y*70))/$vitesse;  | 
                                                        |
| 230 | + $temps_voyage = (($calc_x * 70) + ($calc_y * 70)) / $vitesse;  | 
                                                        |
| 231 | 231 | |
| 232 | 232 | return $temps_voyage;  | 
                                                        
| 233 | 233 | }  | 
                                                        
@@ -124,7 +124,9 @@ discard block  | 
                                                    ||
| 124 | 124 | ->get();  | 
                                                        
| 125 | 125 | |
| 126 | 126 |  			if ((is_array($query)) && (count($query) == 1)) { | 
                                                        
| 127 | - foreach ($query as $obj) return $obj->ID_base;  | 
                                                        |
| 127 | +				foreach ($query as $obj) { | 
                                                        |
| 128 | + return $obj->ID_base;  | 
                                                        |
| 129 | + }  | 
                                                        |
| 128 | 130 | }  | 
                                                        
| 129 | 131 | }  | 
                                                        
| 130 | 132 | |
@@ -169,8 +171,7 @@ discard block  | 
                                                    ||
| 169 | 171 | |
| 170 | 172 |  			if ($id_base === null) { | 
                                                        
| 171 | 173 |  				$query = $dbc->select()->from("_bataille_last_connexion")->where("ID_identite", "=", self::getIdIdentite())->get(); | 
                                                        
| 172 | - }  | 
                                                        |
| 173 | -			else { | 
                                                        |
| 174 | +			} else { | 
                                                        |
| 174 | 175 |  				$query = $dbc->select("_bataille_last_connexion.last_connexion")->from("_bataille_base") | 
                                                        
| 175 | 176 |  					->from("_bataille_last_connexion") | 
                                                        
| 176 | 177 |  					->from("identite") | 
                                                        
@@ -272,7 +273,9 @@ discard block  | 
                                                    ||
| 272 | 273 | ->get();  | 
                                                        
| 273 | 274 | |
| 274 | 275 |  			if ((is_array($query)) && (count($query) == 1)) { | 
                                                        
| 275 | - foreach ($query as $obj) return $obj->ID_base;  | 
                                                        |
| 276 | +				foreach ($query as $obj) { | 
                                                        |
| 277 | + return $obj->ID_base;  | 
                                                        |
| 278 | + }  | 
                                                        |
| 276 | 279 | }  | 
                                                        
| 277 | 280 | |
| 278 | 281 | return 0;  | 
                                                        
@@ -288,7 +291,9 @@ discard block  | 
                                                    ||
| 288 | 291 |  			$query = $dbc->select("nombre_joueur")->from("_bataille_nombre_joueur")->where("ID_nombre_joueur", "=", 1)->get(); | 
                                                        
| 289 | 292 | |
| 290 | 293 |  			if ((is_array($query)) && (count($query) == 1)) { | 
                                                        
| 291 | - foreach ($query as $obj) return $obj->nombre_joueur;  | 
                                                        |
| 294 | +				foreach ($query as $obj) { | 
                                                        |
| 295 | + return $obj->nombre_joueur;  | 
                                                        |
| 296 | + }  | 
                                                        |
| 292 | 297 | }  | 
                                                        
| 293 | 298 | |
| 294 | 299 | return 0;  | 
                                                        
@@ -306,7 +311,9 @@ discard block  | 
                                                    ||
| 306 | 311 |  			$query = $dbc->select($param)->from("configuration")->where("ID_configuration", "=", 1)->get(); | 
                                                        
| 307 | 312 | |
| 308 | 313 |  			if ((is_array($query)) && (count($query) == 1)) { | 
                                                        
| 309 | - foreach ($query as $obj) return $obj->$param;  | 
                                                        |
| 314 | +				foreach ($query as $obj) { | 
                                                        |
| 315 | + return $obj->$param;  | 
                                                        |
| 316 | + }  | 
                                                        |
| 310 | 317 | }  | 
                                                        
| 311 | 318 | }  | 
                                                        
| 312 | 319 | //-------------------------- END GETTER ----------------------------------------------------------------------------//  | 
                                                        
@@ -322,11 +329,12 @@ discard block  | 
                                                    ||
| 322 | 329 | |
| 323 | 330 |  			if ($id_base === null) { | 
                                                        
| 324 | 331 | $id_identite = self::getIdIdentite();  | 
                                                        
| 325 | - }  | 
                                                        |
| 326 | -			else { | 
                                                        |
| 332 | +			} else { | 
                                                        |
| 327 | 333 |  				$query = $dbc->select("ID_identite")->from("_bataille_base")->where("ID_base", "=", $id_base)->get(); | 
                                                        
| 328 | 334 | |
| 329 | - foreach ($query as $obj) $id_identite = $obj->ID_identite;  | 
                                                        |
| 335 | +				foreach ($query as $obj) { | 
                                                        |
| 336 | + $id_identite = $obj->ID_identite;  | 
                                                        |
| 337 | + }  | 
                                                        |
| 330 | 338 | }  | 
                                                        
| 331 | 339 | |
| 332 | 340 |  			$dbc->update("last_connexion", date("Y-m-d H:i:s")) | 
                                                        
@@ -161,7 +161,7 @@ discard block  | 
                                                    ||
| 161 | 161 | |
| 162 | 162 | /**  | 
                                                        
| 163 | 163 | * @param null $id_base -> sert si definit a recuperer l'id identite de la abse en question  | 
                                                        
| 164 | - * @return mixed  | 
                                                        |
| 164 | + * @return string|null  | 
                                                        |
| 165 | 165 | * recupere la date de la derniere connexion  | 
                                                        
| 166 | 166 | */  | 
                                                        
| 167 | 167 |  		public static function getLastConnexion($id_base = null) { | 
                                                        
@@ -188,7 +188,7 @@ discard block  | 
                                                    ||
| 188 | 188 | }  | 
                                                        
| 189 | 189 | |
| 190 | 190 | /**  | 
                                                        
| 191 | - * @param $nom_ressource  | 
                                                        |
| 191 | + * @param string $nom_ressource  | 
                                                        |
| 192 | 192 | * @param $ressource  | 
                                                        
| 193 | 193 | * @return array  | 
                                                        
| 194 | 194 | * fonction qui permet de renvyer la couleur rouge si pas assez de ressource pour construire le batiment  | 
                                                        
@@ -213,7 +213,7 @@ discard block  | 
                                                    ||
| 213 | 213 | |
| 214 | 214 | /**  | 
                                                        
| 215 | 215 | * @param $id_base  | 
                                                        
| 216 | - * @param null $vitesse = vitesse de l'unité en question  | 
                                                        |
| 216 | + * @param integer $vitesse = vitesse de l'unité en question  | 
                                                        |
| 217 | 217 | * @return number  | 
                                                        
| 218 | 218 | * fonction qui renvoi le temps de trajet entre la base du joueur et une autre base en secondes  | 
                                                        
| 219 | 219 | */  | 
                                                        
@@ -295,8 +295,8 @@ discard block  | 
                                                    ||
| 295 | 295 | }  | 
                                                        
| 296 | 296 | |
| 297 | 297 | /**  | 
                                                        
| 298 | - * @param $param  | 
                                                        |
| 299 | - * @return mixed  | 
                                                        |
| 298 | + * @param string $param  | 
                                                        |
| 299 | + * @return integer  | 
                                                        |
| 300 | 300 | * fonction qui sert à récupérer un parametre spécifique pour un batiment  | 
                                                        
| 301 | 301 | * par exemple la vitesse d'un marchand ou le nombred'emplacment de la base  | 
                                                        
| 302 | 302 | */  | 
                                                        
@@ -15,7 +15,7 @@  | 
                                                    ||
| 15 | 15 | |
| 16 | 16 | //-------------------------- GETTER ----------------------------------------------------------------------------//  | 
                                                        
| 17 | 17 |  		public function getBatiments(){ | 
                                                        
| 18 | - return $this->batiments;  | 
                                                        |
| 18 | + return $this->batiments;  | 
                                                        |
| 19 | 19 | }  | 
                                                        
| 20 | 20 | |
| 21 | 21 | /**  | 
                                                        
@@ -14,7 +14,7 @@ discard block  | 
                                                    ||
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | //-------------------------- GETTER ----------------------------------------------------------------------------//  | 
                                                        
| 17 | -		public function getBatiments(){ | 
                                                        |
| 17 | +		public function getBatiments() { | 
                                                        |
| 18 | 18 | return $this->batiments;  | 
                                                        
| 19 | 19 | }  | 
                                                        
| 20 | 20 | |
@@ -66,7 +66,7 @@ discard block  | 
                                                    ||
| 66 | 66 | |
| 67 | 67 | $nombre_emplacement = Bataille::getNombreEmplacementBase();  | 
                                                        
| 68 | 68 | |
| 69 | -			for ($i=1 ; $i<($nombre_emplacement+1) ; $i++) { | 
                                                        |
| 69 | +			for ($i = 1; $i < ($nombre_emplacement + 1); $i++) { | 
                                                        |
| 70 | 70 |  				$query = $dbc->select()->from("_bataille_batiment")->where("ID_base", "=", Bataille::getIdBase(), "AND") | 
                                                        
| 71 | 71 |  					->where("emplacement", "=", $i) | 
                                                        
| 72 | 72 |  					->orderBy("emplacement") | 
                                                        
@@ -81,8 +81,7 @@ discard block  | 
                                                    ||
| 81 | 81 | "niveau" => $obj->niveau,  | 
                                                        
| 82 | 82 | "emplacement" => $i  | 
                                                        
| 83 | 83 | ];  | 
                                                        
| 84 | - }  | 
                                                        |
| 85 | -						else { | 
                                                        |
| 84 | +						} else { | 
                                                        |
| 86 | 85 | $batiments[] = [  | 
                                                        
| 87 | 86 | "nom_batiment" => $obj->nom_batiment,  | 
                                                        
| 88 | 87 | "nom_batiment_sql" => $obj->nom_batiment_sql,  | 
                                                        
@@ -91,8 +90,7 @@ discard block  | 
                                                    ||
| 91 | 90 | ];  | 
                                                        
| 92 | 91 | }  | 
                                                        
| 93 | 92 | }  | 
                                                        
| 94 | - }  | 
                                                        |
| 95 | -				else { | 
                                                        |
| 93 | +				} else { | 
                                                        |
| 96 | 94 | $batiments[] = [  | 
                                                        
| 97 | 95 | "nom_batiment" => "A construire",  | 
                                                        
| 98 | 96 | "nom_batiment_sql" => "a_construire",  | 
                                                        
@@ -76,10 +76,10 @@ discard block  | 
                                                    ||
| 76 | 76 | return $this->message;  | 
                                                        
| 77 | 77 | }  | 
                                                        
| 78 | 78 |  		public function getDateMessage(){ | 
                                                        
| 79 | - return $this->date_message;  | 
                                                        |
| 79 | + return $this->date_message;  | 
                                                        |
| 80 | 80 | }  | 
                                                        
| 81 | 81 |  		public function getUrl(){ | 
                                                        
| 82 | - return $this->url;  | 
                                                        |
| 82 | + return $this->url;  | 
                                                        |
| 83 | 83 | }  | 
                                                        
| 84 | 84 |  		public function getIdExpediteur() { | 
                                                        
| 85 | 85 | return $this->id_expediteur;  | 
                                                        
@@ -94,7 +94,7 @@ discard block  | 
                                                    ||
| 94 | 94 | return $this->pseudo_receveur;  | 
                                                        
| 95 | 95 | }  | 
                                                        
| 96 | 96 |  		public function getValues(){ | 
                                                        
| 97 | - return ["messagerie" => $this->values];  | 
                                                        |
| 97 | + return ["messagerie" => $this->values];  | 
                                                        |
| 98 | 98 | }  | 
                                                        
| 99 | 99 | |
| 100 | 100 | /**  | 
                                                        
@@ -76,10 +76,10 @@ discard block  | 
                                                    ||
| 76 | 76 |  		public function getMessage() { | 
                                                        
| 77 | 77 | return $this->message;  | 
                                                        
| 78 | 78 | }  | 
                                                        
| 79 | -		public function getDateMessage(){ | 
                                                        |
| 79 | +		public function getDateMessage() { | 
                                                        |
| 80 | 80 | return $this->date_message;  | 
                                                        
| 81 | 81 | }  | 
                                                        
| 82 | -		public function getUrl(){ | 
                                                        |
| 82 | +		public function getUrl() { | 
                                                        |
| 83 | 83 | return $this->url;  | 
                                                        
| 84 | 84 | }  | 
                                                        
| 85 | 85 |  		public function getIdExpediteur() { | 
                                                        
@@ -94,7 +94,7 @@ discard block  | 
                                                    ||
| 94 | 94 |  		public function getPseudoReceveur() { | 
                                                        
| 95 | 95 | return $this->pseudo_receveur;  | 
                                                        
| 96 | 96 | }  | 
                                                        
| 97 | -		public function getValues(){ | 
                                                        |
| 97 | +		public function getValues() { | 
                                                        |
| 98 | 98 | return ["messagerie" => $this->values];  | 
                                                        
| 99 | 99 | }  | 
                                                        
| 100 | 100 | |
@@ -291,7 +291,7 @@ discard block  | 
                                                    ||
| 291 | 291 |  				$destinataires = explode(",", $destinataire); | 
                                                        
| 292 | 292 | $c = count($destinataires);  | 
                                                        
| 293 | 293 | |
| 294 | -				for ($i=0 ; $i<$c ; $i++) { | 
                                                        |
| 294 | +				for ($i = 0; $i < $c; $i++) { | 
                                                        |
| 295 | 295 |  					if ($this->getIdIdentiteExist($destinataires[$i]) !== false) { | 
                                                        
| 296 | 296 | $destinataires[] = $this->getIdIdentiteExist($destinataires[$i]);  | 
                                                        
| 297 | 297 | }  | 
                                                        
@@ -33,11 +33,9 @@ discard block  | 
                                                    ||
| 33 | 33 |  			if ($type_boite !== null) { | 
                                                        
| 34 | 34 |  				if ($type_boite == "boite réception") { | 
                                                        
| 35 | 35 | $this->getBoiteReception();  | 
                                                        
| 36 | - }  | 
                                                        |
| 37 | -				else if ($type_boite == "messages envoyés") { | 
                                                        |
| 36 | +				} else if ($type_boite == "messages envoyés") { | 
                                                        |
| 38 | 37 | $this->getMessagesEnvoyes();  | 
                                                        
| 39 | - }  | 
                                                        |
| 40 | -				else if ($type_boite == "messages supprimés") { | 
                                                        |
| 38 | +				} else if ($type_boite == "messages supprimés") { | 
                                                        |
| 41 | 39 | $this->getMessageSupprimes();  | 
                                                        
| 42 | 40 | }  | 
                                                        
| 43 | 41 | |
@@ -240,8 +238,7 @@ discard block  | 
                                                    ||
| 240 | 238 | "supprimer" => $obj->supprimer  | 
                                                        
| 241 | 239 | ];  | 
                                                        
| 242 | 240 | }  | 
                                                        
| 243 | - }  | 
                                                        |
| 244 | -			else { | 
                                                        |
| 241 | +			} else { | 
                                                        |
| 245 | 242 | return false;  | 
                                                        
| 246 | 243 | }  | 
                                                        
| 247 | 244 | }  | 
                                                        
@@ -294,17 +291,14 @@ discard block  | 
                                                    ||
| 294 | 291 |  				for ($i=0 ; $i<$c ; $i++) { | 
                                                        
| 295 | 292 |  					if ($this->getIdIdentiteExist($destinataires[$i]) !== false) { | 
                                                        
| 296 | 293 | $destinataires[] = $this->getIdIdentiteExist($destinataires[$i]);  | 
                                                        
| 297 | - }  | 
                                                        |
| 298 | -					else { | 
                                                        |
| 294 | +					} else { | 
                                                        |
| 299 | 295 | return false;  | 
                                                        
| 300 | 296 | }  | 
                                                        
| 301 | 297 | }  | 
                                                        
| 302 | - }  | 
                                                        |
| 303 | -			else { | 
                                                        |
| 298 | +			} else { | 
                                                        |
| 304 | 299 |  				if ($this->getIdIdentiteExist($destinataire) !== false) { | 
                                                        
| 305 | 300 | $destinataires[] = $this->getIdIdentiteExist($destinataire);  | 
                                                        
| 306 | - }  | 
                                                        |
| 307 | -				else { | 
                                                        |
| 301 | +				} else { | 
                                                        |
| 308 | 302 | return false;  | 
                                                        
| 309 | 303 | }  | 
                                                        
| 310 | 304 | }  | 
                                                        
@@ -35,8 +35,7 @@ discard block  | 
                                                    ||
| 35 | 35 |  	if (isset($_GET['page'])) { | 
                                                        
| 36 | 36 | $titre_page = "Administration du site";  | 
                                                        
| 37 | 37 | $description_page = "Administration du site";  | 
                                                        
| 38 | - }  | 
                                                        |
| 39 | -	else { | 
                                                        |
| 38 | +	} else { | 
                                                        |
| 40 | 39 | $titre_page = "Administration du site";  | 
                                                        
| 41 | 40 | $description_page = "Administration du site";  | 
                                                        
| 42 | 41 | }  | 
                                                        
@@ -66,25 +65,21 @@ discard block  | 
                                                    ||
| 66 | 65 | //si c'est un controleur de base on va cerhcer dans core/admin  | 
                                                        
| 67 | 66 |  			if ($core !== false) { | 
                                                        
| 68 | 67 | require_once(ROOT.$lien.".php");  | 
                                                        
| 69 | - }  | 
                                                        |
| 70 | -			else if ($module !== false) { | 
                                                        |
| 68 | +			} else if ($module !== false) { | 
                                                        |
| 71 | 69 |  				$explode = explode("/", $lien, 3); | 
                                                        
| 72 | 70 | |
| 73 | 71 | require_once(ROOT.$explode[0]."/".$explode[1]."/admin/controller/".$explode[2].".php");  | 
                                                        
| 74 | - }  | 
                                                        |
| 75 | -			else { | 
                                                        |
| 72 | +			} else { | 
                                                        |
| 76 | 73 |  				require_once("admin/controller/".$lien.".php"); | 
                                                        
| 77 | 74 | }  | 
                                                        
| 78 | 75 | }  | 
                                                        
| 79 | 76 | //pour la page de login  | 
                                                        
| 80 | 77 |  		else if ($page == "login") { | 
                                                        
| 81 | 78 |  			require("admin/views/template/login_admin.php"); | 
                                                        
| 82 | - }  | 
                                                        |
| 83 | -		else { | 
                                                        |
| 79 | +		} else { | 
                                                        |
| 84 | 80 |  			if (!isset($_SESSION["idlogin".CLEF_SITE])) { | 
                                                        
| 85 | 81 | Connexion::setObgConnecte(WEBROOT."administrator/login");  | 
                                                        
| 86 | - }  | 
                                                        |
| 87 | -			else { | 
                                                        |
| 82 | +			} else { | 
                                                        |
| 88 | 83 |  				if (\core\functions\ChaineCaractere::FindInString($page, "modules/") == true) { | 
                                                        
| 89 | 84 | //utilisé pour initialiser les modules  | 
                                                        
| 90 | 85 | $page_module = $page;  | 
                                                        
@@ -99,8 +94,7 @@ discard block  | 
                                                    ||
| 99 | 94 |  				if (($droit_acces->getDroitAccesPage("gestion-comptes/index") == false) && ($page == "gestion-comptes")) { | 
                                                        
| 100 | 95 |  					FlashMessage::setFlash("L'accès à cette page n'est pas activé, veuillez contacter votre administrateur pour y avoir accès"); | 
                                                        
| 101 | 96 |  					header("location:".WEBROOT."administrator"); | 
                                                        
| 102 | - }  | 
                                                        |
| 103 | -				else if (($droit_acces->getDroitAccesPage("gestion-droits-acces/index") == false) && ($page == "gestion-droits-acces")) { | 
                                                        |
| 97 | +				} else if (($droit_acces->getDroitAccesPage("gestion-droits-acces/index") == false) && ($page == "gestion-droits-acces")) { | 
                                                        |
| 104 | 98 |  					FlashMessage::setFlash("L'accès à cette page n'est pas activé, veuillez contacter votre administrateur pour y avoir accès"); | 
                                                        
| 105 | 99 |  					header("location:".WEBROOT."administrator"); | 
                                                        
| 106 | 100 | }  | 
                                                        
@@ -108,8 +102,7 @@ discard block  | 
                                                    ||
| 108 | 102 |  				if (($droit_acces->getDroitAccesPage($page) == false) && (!isset($page_module))) { | 
                                                        
| 109 | 103 |  					FlashMessage::setFlash("Vous n'avez pas les droits pour accéder à cette page, contacter votre gérant pour y avoir accès"); | 
                                                        
| 110 | 104 |  					header("location:".WEBROOT."administrator"); | 
                                                        
| 111 | - }  | 
                                                        |
| 112 | -				else { | 
                                                        |
| 105 | +				} else { | 
                                                        |
| 113 | 106 | $cache = new \core\Cache($page, 1);  | 
                                                        
| 114 | 107 | $admin = new Admin($_SESSION["idlogin".CLEF_SITE]);  | 
                                                        
| 115 | 108 | |
@@ -121,14 +114,12 @@ discard block  | 
                                                    ||
| 121 | 114 | }  | 
                                                        
| 122 | 115 | }  | 
                                                        
| 123 | 116 | }  | 
                                                        
| 124 | - }  | 
                                                        |
| 125 | -	else { | 
                                                        |
| 117 | +	} else { | 
                                                        |
| 126 | 118 | Connexion::setObgConnecte(WEBROOT."administrator/login");  | 
                                                        
| 127 | 119 | |
| 128 | 120 |  		if (!isset($_SESSION["idlogin".CLEF_SITE])) { | 
                                                        
| 129 | 121 | Connexion::setObgConnecte(WEBROOT."administrator/login");  | 
                                                        
| 130 | - }  | 
                                                        |
| 131 | -		else { | 
                                                        |
| 122 | +		} else { | 
                                                        |
| 132 | 123 | $page = "index";  | 
                                                        
| 133 | 124 | $admin = new Admin($_SESSION["idlogin".CLEF_SITE]);  | 
                                                        
| 134 | 125 | require(ROOT."admin/controller/initialise_all.php");  | 
                                                        
@@ -35,8 +35,7 @@ discard block  | 
                                                    ||
| 35 | 35 |  		if ((isset($_GET['page'])) && ($_GET['page'] != null)) { | 
                                                        
| 36 | 36 | $page = $_GET['page'];  | 
                                                        
| 37 | 37 | $contenu->getHeadPage(0, $page);  | 
                                                        
| 38 | - }  | 
                                                        |
| 39 | -		else { | 
                                                        |
| 38 | +		} else { | 
                                                        |
| 40 | 39 | $contenu->getHeadPage(1);  | 
                                                        
| 41 | 40 | }  | 
                                                        
| 42 | 41 | |
@@ -70,17 +69,14 @@ discard block  | 
                                                    ||
| 70 | 69 | //si c'est un controleur de base on va cerhcer dans core/admin  | 
                                                        
| 71 | 70 |  			if ($core !== false) { | 
                                                        
| 72 | 71 | require_once(ROOT.$lien.".php");  | 
                                                        
| 73 | - }  | 
                                                        |
| 74 | -			else if ($module !== false) { | 
                                                        |
| 72 | +			} else if ($module !== false) { | 
                                                        |
| 75 | 73 |  				$explode = explode("/", $lien, 3); | 
                                                        
| 76 | 74 | |
| 77 | 75 | require_once(ROOT.$explode[0]."/".$explode[1]."/app/controller/".$explode[2].".php");  | 
                                                        
| 78 | - }  | 
                                                        |
| 79 | -			else { | 
                                                        |
| 76 | +			} else { | 
                                                        |
| 80 | 77 |  				require_once("app/controller/".$lien.".php"); | 
                                                        
| 81 | 78 | }  | 
                                                        
| 82 | - }  | 
                                                        |
| 83 | -		else { | 
                                                        |
| 79 | +		} else { | 
                                                        |
| 84 | 80 | $cache = new \core\Cache($page);  | 
                                                        
| 85 | 81 | |
| 86 | 82 | $router_module = new RouterModule();  | 
                                                        
@@ -98,8 +94,7 @@ discard block  | 
                                                    ||
| 98 | 94 |  				echo("<pre>"); | 
                                                        
| 99 | 95 | print_r($arr);  | 
                                                        
| 100 | 96 |  				echo("</pre>"); | 
                                                        
| 101 | - }  | 
                                                        |
| 102 | -			else { | 
                                                        |
| 97 | +			} else { | 
                                                        |
| 103 | 98 | $contenu->getContenuPage();  | 
                                                        
| 104 | 99 | $contenu_page = $contenu->getContenu();  | 
                                                        
| 105 | 100 | |
@@ -122,8 +117,7 @@ discard block  | 
                                                    ||
| 122 | 117 | }  | 
                                                        
| 123 | 118 | $cache->setEnd();  | 
                                                        
| 124 | 119 | }  | 
                                                        
| 125 | - }  | 
                                                        |
| 126 | -	else { | 
                                                        |
| 120 | +	} else { | 
                                                        |
| 127 | 121 | $contenu->getContenuPage();  | 
                                                        
| 128 | 122 | $contenu_page = $contenu->getContenu();  | 
                                                        
| 129 | 123 | |
@@ -9,7 +9,7 @@ discard block  | 
                                                    ||
| 9 | 9 | <link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>reset_css/reset.css">  | 
                                                        
| 10 | 10 | <link rel="stylesheet" type="text/css" href="<?=WEBROOT?>admin/views/template/css/style.css">  | 
                                                        
| 11 | 11 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>  | 
                                                        
| 12 | - <?php require_once(ROOT."admin/views/template/js/menu.php");?>  | 
                                                        |
| 12 | + <?php require_once(ROOT."admin/views/template/js/menu.php"); ?>  | 
                                                        |
| 13 | 13 | |
| 14 | 14 | <!-- Les librairies utlisées -->  | 
                                                        
| 15 | 15 | <link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>popup/css/style.css">  | 
                                                        
@@ -19,7 +19,7 @@ discard block  | 
                                                    ||
| 19 | 19 | </head>  | 
                                                        
| 20 | 20 | <?=\core\HTML\flashmessage\FlashMessage::getFlash(); ?>  | 
                                                        
| 21 | 21 | <body>  | 
                                                        
| 22 | - <nav class="menu <?php if (($_SESSION["menu_plie".CLEF_SITE] == "deplie") || (!isset($_SESSION["menu_plie".CLEF_SITE]))):?>active<?php endif;?>">  | 
                                                        |
| 22 | + <nav class="menu <?php if (($_SESSION["menu_plie".CLEF_SITE] == "deplie") || (!isset($_SESSION["menu_plie".CLEF_SITE]))):?>active<?php endif; ?>">  | 
                                                        |
| 23 | 23 | <div class="titre">  | 
                                                        
| 24 | 24 | <h1>Ribs V2.3.5.6</h1>  | 
                                                        
| 25 | 25 | <i class="fa fa-bars"></i>  | 
                                                        
@@ -41,14 +41,14 @@ discard block  | 
                                                    ||
| 41 | 41 | <a href="<?=ADMWEBROOT?>notifications"><i class="fa fa-bell <?php if ($admin->getNotification() == 1):?> animated infinite swing<?php endif; ?>"></i></a>  | 
                                                        
| 42 | 42 | </div>  | 
                                                        
| 43 | 43 | </div>  | 
                                                        
| 44 | - <?php endif;?>  | 
                                                        |
| 44 | + <?php endif; ?>  | 
                                                        |
| 45 | 45 |  							<?php if (($droit_acces->getSuperAdmin() == 1) || ($droit_acces->getDroitAccesPage("configuration/mon-compte"))):?> | 
                                                        
| 46 | 46 | <div class="colonne">  | 
                                                        
| 47 | 47 | <div class="config">  | 
                                                        
| 48 | 48 | <a href="<?=ADMWEBROOT?>configuration/index"><i class="fa fa-gear"></i></a>  | 
                                                        
| 49 | 49 | </div>  | 
                                                        
| 50 | 50 | </div>  | 
                                                        
| 51 | - <?php endif;?>  | 
                                                        |
| 51 | + <?php endif; ?>  | 
                                                        |
| 52 | 52 | <div class="colonne">  | 
                                                        
| 53 | 53 | <div class="logout">  | 
                                                        
| 54 | 54 | <a href="<?=WEBROOT?>administrator/controller/core/auth/connexion/logout"><i class="fa fa-sign-out animated activate swing infinite"></i></a>  | 
                                                        
@@ -67,7 +67,7 @@ discard block  | 
                                                    ||
| 67 | 67 | <ul>  | 
                                                        
| 68 | 68 |  								<?php if ($droit_acces->getDroitAccesAction("CREATION COMPTE ADMIN")):?> | 
                                                        
| 69 | 69 | <li><i class="fa fa-user"></i><a href="<?=ADMWEBROOT?>gestion-comptes/creer-utilisateur">Créer un utilisateur</a></li>  | 
                                                        
| 70 | - <?php endif;?>  | 
                                                        |
| 70 | + <?php endif; ?>  | 
                                                        |
| 71 | 71 | </ul>  | 
                                                        
| 72 | 72 | </li>  | 
                                                        
| 73 | 73 | <?php endif; ?>  |