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.
42 lines
1.3 KiB
42 lines
1.3 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'])){
|
|
if ($_GET["type"] == 'fonction')
|
|
$db->supprimerFonction ($_GET['num'], $_GET['tp']);
|
|
else if ($_GET["type"] == 'requete')
|
|
$db->supprimerRequete($_GET['num'], $_GET['tp']);
|
|
}
|
|
|
|
|
|
$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");
|
|
|