diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-06-30 10:05:02 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-06-30 10:05:02 +0200 |
commit | 71b503f07007346eda3d1da71d4a64f31f13d846 (patch) | |
tree | 3d1aaa880857eb05e7e9c1f2d75f309507dd9c07 /appli_3_alpha_old/include/je.inc.php | |
parent | 756f0fa75c7d8e18188dffdfbdd4416651dca9fe (diff) | |
download | 2007-AWOR-71b503f07007346eda3d1da71d4a64f31f13d846.tar.gz 2007-AWOR-71b503f07007346eda3d1da71d4a64f31f13d846.tar.bz2 2007-AWOR-71b503f07007346eda3d1da71d4a64f31f13d846.zip |
Prmère version alpha 2007-02-03+09:07:04 - 2007-02-06+12:19:50
Diffstat (limited to 'appli_3_alpha_old/include/je.inc.php')
-rw-r--r-- | appli_3_alpha_old/include/je.inc.php | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/appli_3_alpha_old/include/je.inc.php b/appli_3_alpha_old/include/je.inc.php new file mode 100644 index 0000000..cb80df0 --- /dev/null +++ b/appli_3_alpha_old/include/je.inc.php @@ -0,0 +1,99 @@ +<?php + function traiter_formulaire_valider_modif_personnes() + { + require_once ('include/connect.inc.php'); + $result = mysql_query("SELECT P.idP,P.courrielP FROM Appartenir A, Personne P WHERE P.idP = A.idP AND A.idL=".$_GET['idL']); + if (mysql_num_rows($result)>=0) + { + //Fabrication des trois tableaux + $tabOldPers = array(); + $tabOldPersMail = array(); + $tabNewPers = array(); + if (isset( $_GET['dataParticipants'] ) ) $tabNewPers = $_GET['dataParticipants']; + for($i=0;$i<mysql_num_rows($result);$i++) + { + $row = mysql_fetch_array($result); + $tabOldPers[$i] = $row[0]; + $tabOldPersMail[$i] = $row[1]; + } + //Boucle permettant de suprimer les élements identiques aux deux tableaux + $i = 0; + while ($i < count($tabOldPers)) + { + $exist=false; + for ($j=0;$j<count($tabNewPers);$j++) + { + echo $tabOldPers[$i] . "==<b>" . $tabNewPers[$j] . "</b>OU " . $tabOldPersMail[$i] . "==<b>" . $tabNewPers[$j] . "</b>->" ; + echo "<i>" . (($tabOldPers[$i] == $tabNewPers[$j]) or ($tabOldPersMail[$i] == $tabNewPers[$j])) . "</i><br/>"; + + if (($tabOldPers[$i] == $tabNewPers[$j]) or ($tabOldPersMail[$i] == $tabNewPers[$j])) + { + $exist = true; + print_r($tabNewPers); + $tabNewPers[$j]=NULL; + echo "<br/>"; + print_r($tabNewPers); + echo "<br/>"; + } + } + if ($exist) + { + /* + $tabOldPers[$i] = $tabOldPers[(count($tabOldPers)-1)];unset($tabOldPers[(count($tabOldPers)-1)]); + $tabOldPersMail[$i] = $tabOldPersMail[(count($tabOldPersMail)-1)];unset($tabOldPersMail[(count($tabOldPersMail)-1)]); + } + else + {i++;} + */ + $tabOldPers[$i]=NULL; + $tabOldPersMail[$i]=NULL; + } + $i++; + } + //Tableau permet de savoir qui doit etre supprimer et ajouter + echo "--TabOldPers--<br/>"; + print_r ($tabOldPers); + //for ($i=0;$i<(int)$sizeTabOldPers;$i++) echo "<br/> - " . $tabOldPers[$i]; + echo "<br/>--TabNewPers--<br/>"; + print_r ($tabNewPers); + //for ($i=0;$i<(int)$sizeTabNewPers;$i++) echo " - " . $tabNewPers[$i] ."<br/>"; + } + /* + for ($i=0;$i<count($_GET['dataParticipants']); $i++) + { + if (!stristr($_GET['dataParticipants'][$i],'@')===false) + { + echo "Nouvel inscrit : ".$_GET['dataParticipants'][$i]; + } + } + */ + } + + //Fonction qui affiche toutes les liste public ainsi que les liste privée possédées par idP + function generate_html_array_list ($idP) + { + + // Connexion à la base et sélection de la database + require_once ('include/connect.inc.php'); + $result = mysql_query("SELECT idL,libelleL,estPrivee FROM Liste WHERE idP_Createur=$idP OR estPrivee='non' ORDER BY estPrivee"); + echo "<table>\n<tr>\n<th>Type</th>\n<th>Libellé</th>\n</tr>\n"; + if (mysql_num_rows($result)>0) + { + + for($i=0;$i<mysql_num_rows($result);$i++) + { + $row = mysql_fetch_array($result); + echo "<tr>\n<td>"; + if ($row['estPrivee'] == 'oui') echo 'Privée' ; else echo 'Public'; + echo "</td>\n<td>"; + echo "<a href=\"#\" onclick=\"loadid('poppersonne.php?idL=".$row['idL']."&idP_orga=$idP','poppersonne',true);popon('poppersonne')\" \>"; + echo $row['libelleL']; + echo "</a>\n"; + echo "</td>\n</tr>\n"; + } + + } + echo "</table>\n"; + + } +?>
\ No newline at end of file |