<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="w3.css">
<title>Eleve Non Inscrit</title>
 
</head>
<style>
body {width:90%;}
</style>
<body>

<div class="w3-card-4">
<?php
include 'header.php';

include '_serveur.php';

$sql = 'SELECT * FROM users left JOIN devices on users.id=devices.userID where users.type=1';

   if(!(mysqli_query($link, $sql))){
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
echo '<div class="w3-container">';
$j=1;
$req=mysqli_query($link, $sql);
echo "Date:  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".date('d/m/Y');
while ($data = mysqli_fetch_array($req)) {
// on affiche les résultats
$username=$data[1];
$firstName=$data[2];
$lastName=$data[3];
$pass=$data[4];
$ipcell=$data[7];
$cell=$data[9];
if($ipcell!="") $ipcell="Inscrit";
echo '<div class="w3-container w3-left-align">';
if($j==1) {echo '<table width="90%" border=1 cellspacing=0>';
echo "<tr bgcolor='#BDDCFD'><td width='5%'>Nom Utilisateur</td><td width='5%' >Prénom</td>
<td width='5%'>Nom</td><td width='5%'>Passe</td><td width='70%'>Ip Cell</td><td width='5%'>Genre</td></tr>";

}
echo "<tr><td>".$username."</td><td>".$firstName."</td>
<td >".$lastName."</td><td >".$pass."</td><td>".$ipcell."</td><td>".$cell."</td></tr>";

$j=$j+1;

}
?>


</body>
</html>