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.
175 lines
7.8 KiB
175 lines
7.8 KiB
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title></title>
|
|
<script src="css/jquery-3.5.1.js"></script>
|
|
<link rel="stylesheet" href="css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="css/VueDemonstration.css">
|
|
</head>
|
|
<?php
|
|
$tp_str = implode(",", array_keys($dVueDemonstrations));
|
|
//die($tp_str);
|
|
|
|
?>
|
|
<body>
|
|
<div id="content">
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
|
|
<div class="container">
|
|
<a class="navbar-brand js-scroll-trigger" href="#page-top">TP de Base De Données</a>
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarResponsive">
|
|
<ul class="navbar-nav ml-auto">
|
|
<?php foreach ($dVueDemonstrations as $tp => $question){ ?>
|
|
<li class="nav-item">
|
|
<a style = "text-transform:uppercase;" class="nav-link js-scroll-trigger" id="<?php echo $tp; ?>" onclick="changerSection('<?php echo $tp;?>','<?php echo $tp_str ;?>')" ><?php echo $tp; ?></a>
|
|
</li>
|
|
<?php }?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<!--<header class="bg-primary text-white">
|
|
<div class="container text-center">
|
|
<h1>Demonstrations</h1>
|
|
<p class="lead">TEST</p>
|
|
</div>
|
|
</header>-->
|
|
|
|
<?php foreach ($dVueDemonstrations as $tp => $questions){ ?>
|
|
|
|
<section id="<?php echo 'c'.$tp; ?>">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-8 mx-auto">
|
|
<h2 style = "text-transform:uppercase;"><?php echo $tp; ?></h2>
|
|
|
|
<form id="demoForm" method="get" >
|
|
<?php $i=0;
|
|
foreach ($questions as $q) {
|
|
?>
|
|
<?php $i++; echo $q->getNumQuestion() .'.'.$q->getQuestion(); $_SESSION['num']=array(); $_SESSION['num'][$i] =$q->getNumQuestion(); ?> <br/>
|
|
<textarea rows="5" cols="70" name="demo<?php echo $q->getNumQuestion(); ?>" id="demo<?php echo $q->getNumQuestion().$q->getNumTp(); ?>" >
|
|
<?php echo $q->getReponse(); ?>
|
|
</textarea>
|
|
<input class="monterDemonstration" type="button" value="Monter" onclick="MonterDemonstration(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>)" ></p>
|
|
<input class="supprimerDemonstration" type="button" value="Supprimer" onclick="SupprimerDemonstration(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" >
|
|
<input class="descendreDemonstration" type="button" value="Descendre" onclick="DescendreDemonstration(<?php echo sizeof($questions); ?>,<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>)" ></p>
|
|
|
|
<p><input class="submitDemoData" type="button" value="Exécuter" onclick="SubmitDemoData(<?php echo $q->getNumQuestion(); ?>,<?php echo $q->getNumTp(); ?>);" ></p>
|
|
|
|
<div id="results<?php echo $q->getNumQuestion().$q->getNumTp(); ?>">
|
|
<!-- les résultats s'affichent içi -->
|
|
</div><br/>
|
|
<?php $i++; } //fin foreach ?>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section> <?php } ?>
|
|
<!-- <form method="get" id="frm-reset">
|
|
<input type="submit" name="action" id="regenererDemo" value="Reintiliser les demonstrations" /><br/>
|
|
</form>-->
|
|
|
|
<form method="get" >
|
|
<input id="btn-ajout" type="submit" name="action" value="Ajouter une demonstration" />
|
|
</form>
|
|
|
|
<form method="get" role="form">
|
|
<input type="submit" name="action" id="afficher-demo" value="Afficher les demonstrations" style='display:none'>
|
|
<input id="inp-ret" type="submit" name="action" value="Retour au menu principal" >
|
|
</form>
|
|
<div id="erreur">
|
|
|
|
</div>
|
|
<script>
|
|
|
|
|
|
function SubmitDemoData(numQuestion,numChapitre) {
|
|
//document.write($('#demo'+numQuestion).val());
|
|
var txt = $('#demo'+numQuestion+numChapitre).val() ;
|
|
$.get("Traitement/AffichageDemo.php", { textbox: txt},
|
|
function(data) {
|
|
$('#results'+numQuestion+numChapitre).html(data);
|
|
//$('#demoForm')[0].reset();
|
|
});
|
|
}
|
|
|
|
function MonterDemonstration(numDemo, numChapitre) {
|
|
if(numDemo > 1){
|
|
$.get("Traitement/OrdreDemo.php", { numDemo : numDemo, numChapitre : numChapitre },
|
|
function(data) {
|
|
|
|
//$('#questionsForm')[0].reset();
|
|
//$('#erreur').html(data);
|
|
$("#afficher-demo").trigger("click");
|
|
//window.location.replace("index.php");
|
|
});
|
|
}
|
|
}
|
|
function DescendreDemonstration(nbQuestions,numQuestion, numTp) {
|
|
//alert(nbQuestions);
|
|
|
|
var des = 1;
|
|
if(numQuestion < nbQuestions){
|
|
$.get("Traitement/OrdreDemo.php", { des : des , numDemo : numQuestion, numChapitre : numTp },
|
|
function(data) {
|
|
|
|
//$('#questionsForm')[0].reset();
|
|
$("#afficher-demo").trigger("click");
|
|
//window.location.replace("index.php");
|
|
});
|
|
}
|
|
}
|
|
|
|
function SupprimerDemonstration(numDemo,numChapitre) {
|
|
var type = "demo";
|
|
$.get("Traitement/Suppression.php", { numChapitre : numChapitre, numDemo : numDemo,type : type},
|
|
function(data) {
|
|
//$('#results'+numDemo+numChapitre).html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
$("#afficher-demo").trigger("click");
|
|
});
|
|
|
|
}
|
|
|
|
function changerSection(tp,keys){
|
|
|
|
tpk = keys.split(",");
|
|
tpk.forEach(function(entry) {
|
|
$("#c"+entry).hide();
|
|
console.log(entry);
|
|
});
|
|
$("#c"+tp).show();
|
|
|
|
}
|
|
|
|
function ModifierQuestion(numQuestion, numTp) {
|
|
|
|
$.get("Traitement/Modification.php", { numQuestion : numQuestion, numTp : numTp },
|
|
function(data) {
|
|
$('#vuep').empty();
|
|
$('#vuep').html(data);
|
|
//$('#questionsForm')[0].reset();
|
|
//location.reload();
|
|
});
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
</div>
|
|
<!-- Footer -->
|
|
<footer class="py-5 bg-dark">
|
|
<div class="container">
|
|
<p class="m-0 text-center text-white">IUT Clermont-Ferrand 2020</p>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|