<?php include 'dbfunction.php'; include 'phpToHtml.php'; $sports = getSports(); if (isset($_SESSION['stateSession'])) { $stateConnection = $_SESSION["stateSession"]; } if (isset($_REQUEST['sendSports'])) { $idUser = $_SESSION['idUser']; $sport1 = $_POST['sport1']; $sport2 = $_POST['sport2']; $sport3 = $_POST['sport3']; $sport4 = $_POST['sport4']; $result = insertSports($idUser, $sport1, $sport2, $sport3, $sport4); if ($result == true) { echo "Merci d'avoir choisi vos sports."; } else { echo "Vous ne pouvez pas choisir deux fois le même sport"; } } if ($stateConnection == "connected") { ?> <html> <head> <title>Formulaire</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>
</div> <div class="row"> <?php if (isset($_SESSION['loggedin'])) { ?> <div class="col-xs-6 col-md-4"> <div class="panel panel-primary"> <div class="panel-heading"> <h4>Your Favorites</h4> </div> <?php buildFavorites(getFavorites($_SESSION['username'])); ?> </div> </div> <?php } ?> <div class="col-xs-12 col-md-8"> <div class="panel panel-primary"> <div class="panel-heading"> <h4>Sports</h4> </div> <?php getSports(); ?> </div> </div> </div> <?php include_once "{$_SERVER['DOCUMENT_ROOT']}/phase5/inc/footer.php";
<?php require './db.php'; require './UserFunctions.php'; //session_start(); $sport = getSports(); /* if ($_REQUEST['IDClasse'] === NULL) { header('Location: users.php'); exit; } */ ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Journée sportive</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="css.css" rel="stylesheet" type="text/css" /> </head> <body> <header><h1>Veuillez choisir un sport pour la journée sportive</h1></header> <section> <form action="db.php" method="post"> <div> <label for="Sport">Sport 1:</label> <select name="sport1">