main
Thomas Chazot 2 years ago
parent 8daf5deb16
commit af88ff4f65

@ -83,10 +83,8 @@ else{
<?php <?php
if ($list->getPrivate()){ if ($list->getPrivate()){
?> ?>
<form method="POST" id="changePrivate" name="changePrivate">
<input type="checkbox" id="private" checked disabled readonly class="col col-3"></input> <input type="checkbox" id="private" checked disabled readonly class="col col-3"></input>
<input type="hidden" name="list" value="<?=$list->getId()?>"/></input>
</form>
<form method="POST" id="modifyList" name="modifyList" class="col col-4"> <form method="POST" id="modifyList" name="modifyList" class="col col-4">
<input type="submit" value="Modify"/> <input type="submit" value="Modify"/>

@ -2,9 +2,9 @@
$rep = __DIR__ . '/../'; $rep = __DIR__ . '/../';
$login="thchazot1"; $login="root";
$password="achanger"; $password="root";
$dsn="mysql:host=localhost;dbname=dbthchazot1"; // chemin vers bd (mysql:host=londres.uca.local;dbname=dblibreton => pour l'iut) $dsn="mysql:host=localhost;port=8888;dbname=bddDeQualite"; // chemin vers bd (mysql:host=londres.uca.local;dbname=dblibreton => pour l'iut)
//$dsn="mysql:host=localhost;port=8888;dbname=bddDeQualite"; //$dsn="mysql:host=localhost;port=8888;dbname=bddDeQualite";
/* /*
$login="thchazot1"; $login="thchazot1";

@ -28,12 +28,15 @@ class UserController {
case "accessModifyListPriv": case "accessModifyListPriv":
$mdlListe= new MdlListe(); $mdlListe= new MdlListe();
$liste=$mdlListe->findById($_POST['list']); $liste=$mdlListe->findById($_POST['list']);
$dataView=$liste; $dataView=$liste[0];
require($rep.$vues['modifyListPriv']); require($rep.$vues['modifyListPriv']);
break; break;
case "addPrivateList": case "addPrivateList":
$this->AddListPrivate($dVueEreur); $this->AddListPrivate($dVueEreur);
break; break;
case "modifyListPriv":
$this->ModifyListPriv($dVueEreur);
break;
case "viewPrivateList": case "viewPrivateList":
$this->PrivateList($dVueEreur); $this->PrivateList($dVueEreur);
@ -119,6 +122,28 @@ class UserController {
$control= new VisitorController(); $control= new VisitorController();
$dVueEreur = array(); $dVueEreur = array();
} }
function ModifyListPriv($dVueEreur){
global $rep,$vues,$dataView;
$list=$_POST['list'];
$name=$_POST['name'];
$model = new MdlListe();
if(!isset($_POST['private']))
{
$private = false;
} else {
$private = $_POST['private'];
}
$list=$model->findById($_POST['list']);
$model->update($list[0], $name, $private);
$_REQUEST['action']="accessListInfos";
$this->accessListInfos($dVueEreur);
$dVueEreur= array();
}
} }

Loading…
Cancel
Save