Code Duplication    Length = 3-5 lines in 6 locations

core/admin/Admin.php 2 locations

@@ 22-26 (lines=5) @@
19
20
			//on récupere le lvl de l'admin
21
			$query = $dbc->select("acces_admin")->from("identite")->where("ID_identite", "=", $id_identite)->get();
22
			if ((is_array($query)) && (count($query) > 0)) {
23
				foreach ($query as $obj) {
24
					$this->acces_admin = $obj->acces_admin;
25
				}
26
			}
27
28
			//si on ne passe pas dans le foreach -> on est pas admin donc on deco le compte
29
			if ((!isset($this->acces_admin)) || ($this->acces_admin != 1)) {
@@ 101-105 (lines=5) @@
98
99
			$query = $dbc->select("admin")->from("notification")->get();
100
101
			if ((is_array($query)) && (count($query) > 0)) {
102
				foreach ($query as $obj) {
103
					return $obj->admin;
104
				}
105
			}
106
		}
107
		//-------------------------- FIN GETTER ----------------------------------------------------------------------------//
108

core/admin/contenus/GestionContenus.php 2 locations

@@ 26-30 (lines=5) @@
23
				$ordre = 1;
24
25
				$query = $dbc->select("ordre")->from("page")->orderBy("ordre", "DESC")->limit(0, 1)->get();
26
				if ((is_array($query)) && (count($query) > 0)) {
27
					foreach ($query as $obj) {
28
						$ordre = $obj->ordre;
29
					}
30
				}
31
32
				return $ordre;
33
			}
@@ 43-47 (lines=5) @@
40
41
			$query = $dbc->select("ID_page")->from("page")->where("titre", " LIKE ", '"%'.$parent.'%"', "", true)->get();
42
43
			if ((is_array($query)) && (count($query) == 1)) {
44
				foreach ($query as $obj) {
45
					return $obj->ID_page;
46
				}
47
			}
48
49
			return 0;
50
		}

core/auth/Connexion.php 1 location

@@ 179-181 (lines=3) @@
176
		public static function getlastConnexion($id_identite) {
177
			$dbc = App::getDb();
178
			$query = $dbc->select("last_change_mdp")->from("identite")->where("ID_identite", "=", $id_identite)->get();
179
			if ((is_array($query)) && (count($query) > 0)) {
180
				foreach ($query as $obj) return $obj->last_change_mdp;
181
			}
182
		}
183
184
		/**

core/modules/GestionModule.php 1 location

@@ 117-121 (lines=5) @@
114
115
			$query = $dbc->select("ID_module")->from("module")->where("url", "=", $url)->get();
116
117
			if ((is_array($query)) && (count($query) > 0)) {
118
				foreach ($query as $obj) {
119
					return $obj->ID_module;
120
				}
121
			}
122
		}
123
124