infos.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
  7. <meta name="description" content="" />
  8. <meta name="author" content="" />
  9. <title>Dashboard - SB Admin</title>
  10. <link href="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/style.min.css" rel="stylesheet" />
  11. <link href="css/styles.css" rel="stylesheet" />
  12. <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
  13. <?php include_once('api_functions.php'); ?>
  14. </head>
  15. <body class="sb-nav-fixed">
  16. <?php
  17. $hostname = "localhost";
  18. $username = "root";
  19. $password = "Bdtbdt17?";
  20. $port = "3306";
  21. $db = "intra";
  22. $dbconnect = mysqli_connect($hostname, $username, $password, $db, $port);
  23. // Vérifie si l'ID est présent dans l'URL
  24. if (isset($_GET['id'])) {
  25. $id = mysqli_real_escape_string($dbconnect, $_GET['id']);
  26. // Effectuez votre requête pour récupérer les informations du client avec l'ID donné
  27. $q = "SELECT * FROM client WHERE id = '$id'";
  28. $query = mysqli_query($dbconnect, $q) or die(mysqli_error($dbconnect));
  29. if ($row = mysqli_fetch_array($query)) {
  30. // Affichez les informations du client dans la page infos.php
  31. echo "<h1>Informations sur le client</h1>";
  32. echo "<h2><a href='prtg.php?id={$row['id']}'>PRTG</a></h2>";
  33. echo "<h2><a href='omada.php?id={$row['id']}'>Omada</a></h2>";
  34. echo "<p>ID: {$row['id']}</p>";
  35. echo "<p>Nom: {$row['name']}</p>";
  36. echo "<p>Type: " . mysqli_fetch_array($dbconnect->query('SELECT name FROM type WHERE id="' . $row['type'] . '"'))['0'] . "</p>";
  37. echo "<p>Localisation: {$row['localisation']}</p>";
  38. echo "<p>Département: {$row['departement']}</p>";
  39. } else {
  40. echo "<p>Client non trouvé.</p>";
  41. }
  42. } else {
  43. echo "<p>Paramètre ID manquant dans l'URL.</p>";
  44. }
  45. $dbconnect->close();
  46. ?>
  47. <a href="index.php">Retour</a>
  48. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
  49. <script src="js/scripts.js"></script>
  50. <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
  51. <script src="assets/demo/chart-area-demo.js"></script>
  52. <script src="assets/demo/chart-bar-demo.js"></script>
  53. <script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js" crossorigin="anonymous"></script>
  54. <script src="js/datatables-simple-demo.js"></script>
  55. </body>
  56. </html>