<?php

$db = new Mypdo();
$managerMeth = new MethodeManager($db);
$managerChap = new ChapitreManager($db);
if (!isset($_SESSION['nomMethode'])) {
    if (isset($_GET['nomMethode'])) {
        $_SESSION['nomMethode'] = $_GET['nomMethode'];
    }
}
$_SESSION['numMethode'] = $managerMeth->getNumMethodeParNom($_SESSION['nomMethode']);
if (!empty($_POST["TailleCubeSelect"])) {
    $_SESSION["TailleCubeSelect"] = $_POST["TailleCubeSelect"];
} else {
    $_SESSION['TailleCubeSelect'] = $managerMeth->getCubTailleMethodeParNum($_SESSION['numMethode']);
}
$list = $managerChap->getAllChapitreParMethode($_SESSION['numMethode']);
$NbrChapitreParMethode = sizeof($list);
if (empty($_POST['titreChap']) && empty($_POST['descriptionChap'])) {
    ?>

<h1> ajout d'un chapitre pour la méthode : <?php 
    echo $_SESSION['nomMethode'];
    ?>
 </h1>

<p>
<?php 
    $descriptionMeth = $managerMeth->getDescriptionMethodeParNum($_SESSION['numMethode']);
    echo $descriptionMeth;
    ?>
<?php

$db = new Mypdo();
$managerMeth = new MethodeManager($db);
if (!isset($_SESSION['nomMethode'])) {
    if (isset($_GET['nomMethode'])) {
        $_SESSION['nomMethode'] = $_GET['nomMethode'];
    }
}
$_SESSION['numMethode'] = $managerMeth->getNumMethodeParNom($_SESSION['nomMethode']);
if (empty($_POST['commentaire'])) {
    ?>

<form method="post" action="#">
<fieldset>
  <legend>Commentaire pour la méthode : <?php 
    echo $_SESSION['nomMethode'];
    ?>
</legend>
  <p><label for="commentaire" >Commentaire : </label><textarea  id="commentaire" name="commentaire" rows="8" cols="40"></textarea></p>
  <input type="submit" value="Valider" id="Valider"/>
</fieldset>
</form>

<?php 
} else {
    $commentaire = addslashes($_POST['commentaire']);
    $managerMeth->updateCommentaireMethode($_SESSION['numMethode'], $commentaire);
    echo "Commentaire ajoutée";
    header('Refresh : 1 ; URL = index.php?page=12');
}
<?php

$bd = new Mypdo();
$managerMeth = new MethodeManager($bd);
$managerChap = new ChapitreManager($bd);
unset($_SESSION['nomMethode']);
unset($_SESSION['numMethode']);
$methodes = $managerMeth->getAllMethodeParUti($_SESSION['num']);
if (sizeof($methodes) == 0) {
    echo "Aucune méthodes enregistrées";
} else {
    ?>

<h1>Liste des m&eacutethodes enregistrées</h1>
<p> Actuellement <?php 
    echo sizeof($methodes);
    ?>
 methodes sont enregistrées  </p>
<table class="listeof">
	<tr class="listof">
		<th class="listof">Nom</th><th class="listof">Nombre de chapitres</th><th class="listof">Validité</th>
	</tr>
	<?php 
    foreach ($methodes as $methode) {
        $nbrChapitre = $managerChap->getAllChapitreParMethode($methode->getMet_num());
        $NBRChapitre = sizeof($nbrChapitre);
        ?>
		<tr>
			<td class="listof"><a href="index.php?page=19&nomMethode=<?php 
        echo $methode->getMet_nom();
        ?>
Exemplo n.º 4
0
<?php

$bd = new Mypdo();
$managerMeth = new MethodeManager($bd);
$managerChap = new ChapitreManager($bd);
unset($_SESSION['nomMethode']);
unset($_SESSION['numMethode']);
$methodes = $managerMeth->getAllMethodeNonValide();
?>

<h1>Liste des m&eacutethodes enregistrées</h1>
<p> Actuellement <?php 
echo sizeof($methodes);
?>
 methodes non validées  </p>
<table class="listeof">
	<tr class="listof">
		<th class="listof">Nom</th><th class="listof">Nombre de chapitres</th><th class="listof">Accepter</th><th class="listof">Commentaire</th><th class="listof">Refuser</th>
	</tr>
	<?php 
foreach ($methodes as $methode) {
    $nbrChapitre = $managerChap->getAllChapitreParMethode($methode->getMet_num());
    $NBRChapitre = sizeof($nbrChapitre);
    ?>
		<tr>
			<td class="listof"><a href="index.php?page=11&nomMethode=<?php 
    echo $methode->getMet_nom();
    ?>
"><?php 
    echo $methode->getMet_nom();
    ?>
Exemplo n.º 5
0
<?php

$db = new Mypdo();
$managerMeth = new MethodeManager($db);
$managerChap = new ChapitreManager($db);
$managerPiJo = new PieceJointeManager($db);
$managerLien = new LienManager($db);
$managerPart = new PartitionManager($db);
$managerListePartition = new ListePartitionManager($db);
$managerCont = new ContientManager($db);
$numMethode = $managerMeth->getNumMethodeParNom($_GET['nomMethode']);
$listChapitreParMethode = $managerChap->getAllChapitreParMethode($numMethode);
$managerLien->deleteLien($numMethode);
$managerPiJo->deletePiJo($numMethode);
foreach ($listChapitreParMethode as $Chapitre) {
    $numChapitre = $Chapitre->getCha_num();
    $listePartitionParChapitre = $managerCont->getAllPartitionParChapitre($numChapitre);
    foreach ($listePartitionParChapitre as $Partition) {
        $numPartition = $Partition->getPar_num();
        $managerListePartition->deleteListePartition($numPartition);
        $managerCont->deleteContient($numMethode);
        $managerPart->deletePartition($numPartition);
    }
    $managerChap->deleteChapitre($numChapitre);
}
$managerMeth->deleteMethode($numMethode);
echo '<br/><img src="image/valid.png" /> La méthode a bien été supprimée !';
header("Refresh: 2 ; URL = index.php?page=12");
Exemplo n.º 6
0
<?php

$bd = new Mypdo();
$managerMeth = new MethodeManager($bd);
$managerChap = new ChapitreManager($bd);
$methodes = $managerMeth->getAllMethode();
unset($_SESSION['nomMethode']);
unset($_SESSION['numMethode']);
?>

<h1>Liste des m&eacutethodes enregistrées</h1>
<p> Actuellement <?php 
echo sizeof($methodes);
?>
 methodes sont enregistrées  </p>
<table class="listeof">
	<tr class="listof">
		<th class="listof">Nom</th><th class="listof">Nombre de chapitres</th>
	</tr>
	<?php 
foreach ($methodes as $methode) {
    $nbrChapitre = $managerChap->getAllChapitreParMethode($methode->getMet_num());
    $NBRChapitre = sizeof($nbrChapitre);
    ?>
		<tr>
			<td class="listof"><a href="index.php?page=11&nomMethode=<?php 
    echo $methode->getMet_nom();
    ?>
"><?php 
    echo $methode->getMet_nom();
    ?>
Exemplo n.º 7
0
<?php 
$bd = new Mypdo();
$managerPer = new MethodeManager($bd);
$managerMeth = new MethodeManager($bd);
unset($_SESSION['nomMethode']);
unset($_SESSION['numMethode']);
?>

<h1>Ajouter une méthode</h1>
<?php 
if (empty($_POST['nomMethode']) && empty($_POST['description'])) {
    ?>

<form method="post" action="#">
<fieldset>
  <legend>Nouvelle m&eacutethode</legend>

  <p><label for="TailleCubeSelect" id="taille" class="labelMethode">Taille :</label>
    <select name="TailleCubeSelect" id="taille"></p><br />
        <?php 
    for ($i = 2; $i <= 7; $i++) {
        echo '<option value=' . $i . '>' . $i . 'x' . $i . 'x' . $i . ' </option>';
    }
    ?>
        </select>

  <p><label for="nomMethode" class="labelMethode">Nom de la méthode : </label><input type="text" id="nom" name="nomMethode" /></p>
  <p><label for="description" class="labelMethode">Description : </label><textarea  id="description" name="description" rows="8" cols="40"></textarea></p>

<?php

$bd = new Mypdo();
$managerMeth = new MethodeManager($bd);
$numMethode = $managerMeth->getNumMethodeParNom($_GET['nomMethode']);
$managerMeth->updateMethode(1, $numMethode);
header("Refresh: 0 ; URL = index.php?page=12");