Blame view

html/Scripts/type_appareil.php 558 Bytes
c825216f   lwadbled   feat(main.php): R...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <?php
  	/* Recherche du type de l'appareil en fonction de son nom dans le fichier 'bdd.json' */
  	$Json = file_get_contents("bdd.json");
  	$my_array = json_decode($Json,true);
  	for($j=0;$j<count($my_array);$j++){
  		$name = $my_array[$j]['name'];
  		if(strpos($nom,$name)!=false or $nom==$name){
  			$type = $my_array[$j]['appareil'];
  		}
  	}
  	/* TODO : Modifier le probleme de l'appareil non connu de la page ? */
  	if($type==""){
  		echo "<script> alert('Appareil non reconnu') </script>";
  		echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.html\">";
  	}
  ?>