Пример #1
0
<?php

include_once 'connect.php';
switch ($_GET["action"]) {
    case "getAllUsers":
        selectAllUsers($_GET);
        break;
    case "getColisIfUser":
        selectColisByUser($_GET);
        break;
    default:
        break;
}
function selectAllUsers()
{
    global $conn;
    $list = array();
    $sql = "SELECT * FROM personnes";
    $result = $conn->query($sql);
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_row()) {
            $list[] = $row;
            //echo $row,'<br>';
        }
        echo json_encode($list);
    }
}
function selectColisByUser($data)
{
    global $conn;
    $list = array();
Пример #2
0
<?php

include_once '../lib/toolKit.php';
include_once 'connect.php';
switch ($_GET["table"]) {
    case "score":
        selectScore($_GET);
        break;
    case "personne":
        selectPersonne($_GET);
        break;
    case "AllUsers":
        selectAllUsers();
        break;
    case "AllScores":
        selectAllScores();
        break;
    case "AllDocuments":
        selectDocuments();
        break;
    case "document":
        selectOneDocument($_GET);
        break;
    default:
        break;
}
function selectAllScores()
{
    global $conn;
    $list = array();
    $sql = "SELECT * FROM scores";
Пример #3
0
 <head>
     <title>Utilisateurs</title>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <link rel="stylesheet" type="text/css" href="style.css">
 </head>
 <body>
     <h1>Utilisateurs dans la base de données</h1>
     <div>
     <?php 
 if (isset($_GET['idToDelete'])) {
     $idToDelete = $_REQUEST['idToDelete'];
     deleteUser($idToDelete);
 }
 if (!isset($_GET['id'])) {
     buildTable(selectAllUsers());
 } else {
     $id = $_REQUEST['id'];
     buildTableOneUser(selectOneUser($id));
 }
 ?>
     </div>
     <br />
     <?php 
 echo $stateConnection;
 ?>
     <br /><br />
     <a href="index.php">Index</a> -
     <a href="login.php">Login</a> -
     <a href="utilisateurs.php">Utilisateurs</a> -
     <a href="choisirSport.php">Chosir un sport</a>