From c93c261a461c9a2359bdcd75f7136fcb05237106 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sat, 30 Jun 2018 10:48:12 +0200 Subject: Version alpha_old4 2007-02-22+15:45:00 - 2007-03-07+17:08:39 --- appli_3_alpha_old/include/je.inc.php | 60 ++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 12 deletions(-) (limited to 'appli_3_alpha_old/include/je.inc.php') diff --git a/appli_3_alpha_old/include/je.inc.php b/appli_3_alpha_old/include/je.inc.php index 08861d5..e902a1a 100644 --- a/appli_3_alpha_old/include/je.inc.php +++ b/appli_3_alpha_old/include/je.inc.php @@ -3,15 +3,51 @@ require_once ('include/connect.inc.php'); function traiter_formulaire_valider_modif_personnes() { - - $result = mysql_query("SELECT P.idP,P.courrielP FROM Appartenir A, Personne P WHERE P.idP = A.idP AND A.idL=".$_GET['idL']); + //Vérification a faire pour savoir si c'est bien le propriétaire ?!! $_SESSION['session_idP'] + $tabParticipant = array(); + if (isset($_GET['dataParticipants'])) $tabParticipant = $_GET['dataParticipants']; + $idL=-1; + if (!isset($_GET['idL']) && isset($_GET['listname'])) + { + if (isset($_GET['isPrivate'])) $isPrivate = 'oui'; else $isPrivate = 'non'; + $idL = list_new($_GET['listname'],$_GET['idP'],$isPrivate); + } + else {$idL = $_GET['idL'];} + + if ($idL != -1) list_modif($idL,$tabParticipant); + } + + function traiter_formulaire_delete_list() + { + //Vérification a faire pour savoir si c'est bien le propriétaire ?!! $_SESSION['session_idP'] + if (isset($_GET['idL'])) list_delete($_GET['idL']); + } + + function list_delete($idL) + { + $result = mysql_query("DELETE FROM Appartenir WHERE idL=$idL;"); + $result = mysql_query("DELETE FROM Liste WHERE idL=$idL;"); + } + + function list_new($listname,$idP,$isPrivate) + { + $result = mysql_query("INSERT INTO Liste (libelleL,estPrivee,idP_Createur) VALUES ('$listname','$isPrivate',$idP)") or die (mysql_error()); + if (mysql_affected_rows() > 0) + { + return (mysql_insert_id()); + } + } + + function list_modif($idL,$tabParticipant) + { + $result = mysql_query("SELECT P.idP,P.courrielP FROM Appartenir A, Personne P WHERE P.idP = A.idP AND A.idL=$idL") or die (mysql_error()); if (mysql_num_rows($result)>=0) { //Fabrication des trois tableaux $tabOldPers = array(); $tabOldPersMail = array(); $tabNewPers = array(); - if (isset( $_GET['dataParticipants'] ) ) $tabNewPers = $_GET['dataParticipants']; + if (!empty($tabParticipant)) $tabNewPers = $tabParticipant; for($i=0;$i\n\nType\nLibellé\n\n"; + $result = mysql_query("SELECT idL,libelleL,estPrivee,idP_Createur FROM Liste WHERE idP_Createur=$idP OR estPrivee='non' ORDER BY estPrivee,libelleL"); + echo "\n\n\n\n\n\n"; if (mysql_num_rows($result)>0) { @@ -124,12 +159,13 @@ require_once ('include/connect.inc.php'); { $row = mysql_fetch_array($result); echo "\n\n" ; else echo "\n"; + if ($row['estPrivee'] == 'oui') echo "\n\n\n"; + echo "\n"; + echo "\n"; } } -- cgit v1.2.3
SupprimerTypeLibellé
"; - if ($row['estPrivee'] == 'oui') echo 'Privée' ; else echo 'Public'; + if ($row['estPrivee'] == 'oui' || $row['idP_Createur']==$idP) echo "\"SupprimerestPrivée" ; else echo "Public"; echo ""; - echo ""; + echo ""; echo $row['libelleL']; - echo "\n"; - echo "