You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
<?php
|
|
|
|
require_once('../BDD/SqliteDb.php');
|
|
require_once('../controleur/Controleur.php');
|
|
|
|
|
|
$db = new SqliteDb('o');
|
|
|
|
|
|
if (empty($_GET['chapitre']) || empty($_GET['bdd']) || empty($_GET['numDemo']) || empty($_GET['description']) || empty($_GET['reponse']) ) {
|
|
echo '<strong>ERREUR : Veuillez remplir tous les champs </strong>';
|
|
}
|
|
|
|
else if(!is_numeric($_GET['chapitre']))
|
|
echo '<strong>ERREUR : une valeur non numérique à été détectée dans le champ \'Chapitre n° :\' </strong>';
|
|
else if(!is_numeric($_GET['numDemo']))
|
|
echo '<strong>ERREUR : une valeur non numérique à été détectée dans le champ \'Numéro de démonstration :\' </strong>';
|
|
|
|
|
|
else {
|
|
if(isset($_GET['modif'])){
|
|
$db->supprimerDemonstration($_GET['chapitre'], $_GET['numDemo']);
|
|
}
|
|
|
|
|
|
$isAdd = $db->ajouterDemonstration($_GET['bdd'],$_GET['chapitre'],$_GET['numDemo'],$_GET['description'], $_GET['reponse']);
|
|
if(!$isAdd){
|
|
echo '<strong>ERREUR : la combinaison (numéro de chapitre, numéro de démonstration) existe déjà dans la bdd</strong>';
|
|
}
|
|
else echo '<strong>AJOUT Démonstration avec succès</strong>';
|
|
|
|
|
|
|
|
|
|
}
|
|
//require_once('index.php');
|
|
//header("Location: ../index.php");
|
|
|