diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-06-30 11:29:21 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2018-06-30 11:29:21 +0200 |
commit | 4f0df31cc153855d099e4c06228a6cf1bf51eeca (patch) | |
tree | 0c93c6b44d7b7025935d822d4209172ef0eef2b8 /beta_old1/app/include | |
parent | 19cdd5e2fde57d53f05570cd50f5ffd223182566 (diff) | |
download | 2007-AWOR-4f0df31cc153855d099e4c06228a6cf1bf51eeca.tar.gz 2007-AWOR-4f0df31cc153855d099e4c06228a6cf1bf51eeca.tar.bz2 2007-AWOR-4f0df31cc153855d099e4c06228a6cf1bf51eeca.zip |
Version beta_old1 (sans la doc) 2007-02-22+15:00 - 2007-03-11+16:41:00
Diffstat (limited to 'beta_old1/app/include')
-rw-r--r-- | beta_old1/app/include/ical.inc.php | 4 | ||||
-rw-r--r-- | beta_old1/app/include/je.inc.php | 26 | ||||
-rw-r--r-- | beta_old1/app/include/ju.inc.php | 37 | ||||
-rw-r--r-- | beta_old1/app/include/ludo/config.inc.php | 3 | ||||
-rw-r--r-- | beta_old1/app/include/ludo/div_create_or_modif.php | 9 | ||||
-rw-r--r-- | beta_old1/app/include/ludo/fonctions.inc.php | 57 | ||||
-rw-r--r-- | beta_old1/app/include/ludo/html_elements.inc.php | 20 | ||||
-rw-r--r-- | beta_old1/app/include/ludo/mail_textarea.php | 2 | ||||
-rw-r--r-- | beta_old1/app/include/ludo/majDispo.php | 18 |
9 files changed, 106 insertions, 70 deletions
diff --git a/beta_old1/app/include/ical.inc.php b/beta_old1/app/include/ical.inc.php index e79570b..0d858e3 100644 --- a/beta_old1/app/include/ical.inc.php +++ b/beta_old1/app/include/ical.inc.php @@ -11,7 +11,7 @@ define("ERR_ICAL_SQL_ERROR", -2); { require_once('connect.inc.php'); $query = 'SELECT DISTINCT R.idR,R.objetR,P.courrielP,UNIX_TIMESTAMP(C.dateHeure),C.duree,R.lieuR,R.ordreJourR,L.idL' - . ' FROM Liste L,Reunion R,Appartenir A,Creneau C,Personne P' + . ' FROM AWOR_Liste L,AWOR_Reunion R,AWOR_Appartenir A,AWOR_Creneau C,AWOR_Personne P' . " WHERE ((A.idP = $idP AND A.idL = L.idL) OR R.idP_Orga = $idP)" . ' AND R.idL = L.idL AND C.idC = R.idC_Fixe AND P.idP = R.idP_Orga' . ' AND C.dateHeure > NOW() '; @@ -41,7 +41,7 @@ define("ERR_ICAL_SQL_ERROR", -2); $iCal_content .= "LOCATION:$lieuR\r\n"; $iCal_content .= "DESCRIPTION:$ordreJourR\r\n"; - $query = 'SELECT P.courrielP FROM Appartenir A,Personne P' . " WHERE A.idP=P.idP AND A.idL='$idL'"; + $query = 'SELECT P.courrielP FROM AWOR_Appartenir A,AWOR_Personne P' . " WHERE A.idP=P.idP AND A.idL='$idL'"; if ( ! $result = mysql_query($query) ) { // Cas d'erreur diff --git a/beta_old1/app/include/je.inc.php b/beta_old1/app/include/je.inc.php index 3c87753..dcbb75e 100644 --- a/beta_old1/app/include/je.inc.php +++ b/beta_old1/app/include/je.inc.php @@ -25,13 +25,13 @@ require_once ('include/connect.inc.php'); function list_delete($idL) { - $result = mysql_query("DELETE FROM Appartenir WHERE idL=$idL;"); - $result = mysql_query("DELETE FROM Liste WHERE idL=$idL;"); + $result = mysql_query("DELETE FROM AWOR_Appartenir WHERE idL=$idL;"); + $result = mysql_query("DELETE FROM AWOR_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()); + $result = mysql_query("INSERT INTO AWOR_Liste (libelleL,estPrivee,idP_Createur) VALUES ('$listname','$isPrivate',$idP)") or die (mysql_error()); if (mysql_affected_rows() > 0) { return (mysql_insert_id()); @@ -41,7 +41,7 @@ require_once ('include/connect.inc.php'); 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()); + $result = mysql_query("SELECT P.idP,P.courrielP FROM AWOR_Appartenir A, AWOR_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 @@ -111,7 +111,7 @@ require_once ('include/connect.inc.php'); { foreach ($tabPers as $pers) { - $result=mysql_query("INSERT INTO Appartenir (idP,idL) VALUES ($pers,$idL);"); + $result=mysql_query("INSERT INTO AWOR_Appartenir (idP,idL) VALUES ($pers,$idL);"); } } @@ -121,7 +121,7 @@ require_once ('include/connect.inc.php'); foreach ($tabPers as $pers) { - $result = mysql_query("DELETE FROM Appartenir WHERE idP=$pers AND idL=$idL;"); + $result = mysql_query("DELETE FROM AWOR_Appartenir WHERE idP=$pers AND idL=$idL;"); } } @@ -131,7 +131,7 @@ require_once ('include/connect.inc.php'); // ou Insert une personne et retourne son identifiant function new_pers ($persMail) { - $result = mysql_query("SELECT idP,courrielP FROM Personne WHERE courrielP = '$persMail'"); + $result = mysql_query("SELECT idP,courrielP FROM AWOR_Personne WHERE courrielP = '$persMail'"); if (mysql_num_rows($result)>0) { $row = mysql_fetch_array($result); @@ -139,7 +139,7 @@ require_once ('include/connect.inc.php'); } else { - $result = mysql_query("INSERT INTO Personne (courrielP,loginP,nomP) VALUES ('$persMail','$persMail','$persMail')"); + $result = mysql_query("INSERT INTO AWOR_Personne (courrielP,loginP,nomP) VALUES ('$persMail','$persMail','$persMail')"); return (mysql_insert_id()); } @@ -151,7 +151,7 @@ require_once ('include/connect.inc.php'); //Fonction qui affiche toutes les liste public ainsi que les liste privée possédées par idP function generate_html_array_list ($idP) { - $result = mysql_query("SELECT idL,libelleL,estPrivee,idP_Createur FROM Liste WHERE idP_Createur=$idP OR estPrivee='non' ORDER BY estPrivee,libelleL"); + $result = mysql_query("SELECT idL,libelleL,estPrivee,idP_Createur FROM AWOR_Liste WHERE idP_Createur=$idP OR estPrivee='non' ORDER BY estPrivee,libelleL"); echo "<table>\n<tr>\n<th>Supprimer</th>\n<th>Type</th>\n<th>Libellé</th>\n</tr>\n"; if (mysql_num_rows($result)>0) { @@ -181,11 +181,11 @@ require_once ('include/connect.inc.php'); require_once ('include/connect.inc.php'); if (isset($_GET['idR'])) { - $query="UPDATE Repondre SET commentaireReponse ='".$_GET['txtCommentaire']."' WHERE idR=".$_GET['idR']." AND idP=".$_SESSION['session_idP']; + $query="UPDATE AWOR_Repondre SET commentaireReponse ='".$_GET['txtCommentaire']."' WHERE idR=".$_GET['idR']." AND idP=".$_SESSION['session_idP']; $result = @mysql_query($query); if ( ! $result || ( mysql_affected_rows() !== 1 ) ) { - $query="INSERT INTO Repondre(idR,idP,commentaireReponse) VALUES (".$_GET['idR'].", ".$_SESSION['session_idP'].", '".$_GET['txtCommentaire']."')"; + $query="INSERT INTO AWOR_Repondre(idR,idP,commentaireReponse) VALUES (".$_GET['idR'].", ".$_SESSION['session_idP'].", '".$_GET['txtCommentaire']."')"; $result = mysql_query($query); if ( ! $result || ( mysql_affected_rows() !== 1 )) @@ -199,7 +199,7 @@ require_once ('include/connect.inc.php'); } else { - $query="DELETE FROM Repondre WHERE idR=".$_GET['idR']." AND idP=".$_SESSION['session_idP']; + $query="DELETE FROM AWOR_Repondre WHERE idR=".$_GET['idR']." AND idP=".$_SESSION['session_idP']; $result = mysql_query($query); } } @@ -215,7 +215,7 @@ require_once ('include/connect.inc.php'); echo "<th>Commentaires <a href=\"#\" onclick=\"loadid('popcommentaire.php?idR=".$idR."&idP=".$idP."','popcommentaire',true);popon('popcommentaire');\">(Editer votre commentaire)</a></th>"; echo '</tr>'; echo '</thead>'; - $requete = "SELECT P.nomP,P.prenomP,P.courrielP,R.commentaireReponse FROM Repondre R,Personne P WHERE P.idP = R.idP AND R.idR = '".$idR."'"; + $requete = "SELECT P.nomP,P.prenomP,P.courrielP,R.commentaireReponse FROM AWOR_Repondre R,AWOR_Personne P WHERE P.idP = R.idP AND R.idR = '".$idR."'"; //echo "DEBUG : requete : $requete\n"; $resultat = mysql_query($requete); if($resultat != false) diff --git a/beta_old1/app/include/ju.inc.php b/beta_old1/app/include/ju.inc.php index 49f0322..75fb4ee 100644 --- a/beta_old1/app/include/ju.inc.php +++ b/beta_old1/app/include/ju.inc.php @@ -3,6 +3,9 @@ function traiter_formulaire_popfichier() { require("include/ludo/config.inc.php"); $file = "fichier"; + if ( isset($CONFIG['UPLOAD']['relative_path']) ) { $basepath=$CONFIG['UPLOAD']['relative_path']; } else { $basepath='fichiers/';} + $basepath=$_SERVER['DOCUMENT_ROOT'].'/'.$basepath; + if(isset($_FILES[$file])) { if($_FILES[$file]["error"] == 0) @@ -12,12 +15,13 @@ function traiter_formulaire_popfichier() $ext = array_pop($ext); if(is_numeric(array_search(strtolower($ext), $CONFIG["UPLOAD"]["accepted_files"]))) { - if(!file_exists($_SERVER['DOCUMENT_ROOT']."/fichiers/"."r".$_GET["idR"]."_".$_FILES[$file]["name"])) + $filepath=$basepath."r".$_GET["idR"]."_".$_FILES[$file]["name"]; + if(!file_exists($filepath)) { - if(move_uploaded_file($_FILES[$file]["tmp_name"], $_SERVER['DOCUMENT_ROOT']."/fichiers/"."r".$_GET["idR"]."_".$_FILES[$file]["name"])) + if(move_uploaded_file($_FILES[$file]["tmp_name"], $filepath)) { - if(isset($debug)) echo "DEBUG :".$_SERVER['DOCUMENT_ROOT']."/fichiers/\n"; - $requete = "INSERT INTO Fichier(nomFic, idR) VALUES ('"."r".$_GET["idR"]."_".$_FILES[$file]["name"]."', '".$_GET["idR"]."')"; + if(isset($debug)) echo "DEBUG : basepath==$basepath\n"; + $requete = "INSERT INTO AWOR_Fichier(nomFic, idR) VALUES ('"."r".$_GET["idR"]."_".$_FILES[$file]["name"]."', '".$_GET["idR"]."')"; if(mysql_query($requete) == false) { if(isset($debug)) echo "DEBUG : ".mysql_error()."<br/>\n"; @@ -44,7 +48,7 @@ function traiter_formulaire_popfichier() { switch($_FILES[$file]["error"]) { - case 1 : return "Erreur : Le fichier a une taille trop importante."; break; + case 1 : case 2 : return "Erreur : Le fichier a une taille trop importante."; break; case 3 : return "Erreur : Le fichier n'a pas ete envoye en entier."; break; case 4 : return "Erreur : Aucun fichier recu."; break; @@ -61,7 +65,10 @@ function traiter_formulaire_popfichier() function generate_html_reunion_fichiers($idR) { - $requete = "SELECT * FROM Fichier WHERE idR = '".$idR."'"; + require("include/ludo/config.inc.php"); + if ( isset($CONFIG['UPLOAD']['relative_path']) ) { $basepath='/'.$CONFIG['UPLOAD']['relative_path']; } else { $basepath='/fichiers/';} + + $requete = "SELECT * FROM AWOR_Fichier WHERE idR = '".$idR."'"; $resultat = mysql_query($requete); if($resultat != false) { @@ -75,7 +82,7 @@ function generate_html_reunion_fichiers($idR) { while($fichier = mysql_fetch_array($resultat)) { - echo "<tr><td><a href=\"../fichiers/".$fichier["nomFic"]."\" target=\"_blank\" >".$fichier["nomFic"]."</a></td></tr>\n"; + echo '<tr><td><a href="' . $basepath . $fichier["nomFic"].'" target="_blank" >'.$fichier["nomFic"]."</a></td></tr>\n"; } } else @@ -129,8 +136,8 @@ function traiter_formulaire_valider_creneau() if(isset($debug)) echo $listeCreneau; //On recupere les creneaux ne faisant plus partie de la novuelle liste des creneaux - $requete = "SELECT * FROM Creneau WHERE idR='".$_REQUEST["idR"]."' AND idC NOT IN ".$listeCreneau; - echo $requete; + $requete = "SELECT * FROM AWOR_Creneau WHERE idR='".$_REQUEST["idR"]."' AND idC NOT IN ".$listeCreneau; + //echo "DEBUG : $requete"; if($resultat = mysql_query($requete)) { while($ligne = mysql_fetch_array($resultat)) @@ -143,7 +150,7 @@ function traiter_formulaire_valider_creneau() function traiter_formulaire_maj_profil() { - $requete = "UPDATE Personne SET courrielP = '".$_POST["courrielP"]."', loginP = '".$_POST["loginP"]."', nomP = '".$_POST["nomP"]."', prenomP = '".$_POST["prenomP"]."', methodeAuth = '".$_POST["methodeAuth"]."' WHERE idP = '".$_SESSION['session_idP']."'"; + $requete = "UPDATE AWOR_Personne SET courrielP = '".$_POST["courrielP"]."', loginP = '".$_POST["loginP"]."', nomP = '".$_POST["nomP"]."', prenomP = '".$_POST["prenomP"]."', methodeAuth = '".$_POST["methodeAuth"]."' WHERE idP = '".$_SESSION['session_idP']."'"; if(mysql_query($requete) == false) return "Une erreur MySQL est survenu : ".mysql_error(); $_SESSION['session_prenomP'] = $_POST["prenomP"]; $_SESSION['session_nomP'] = $_POST["nomP"]; @@ -157,14 +164,14 @@ function ajouterCreneau($idR, $heureD, $minD, $heureA, $minA, $jourA, $moisA, $a $duree = $dateA - $dateD; $dateD = date("Y-m-d G:i:s", $dateD); $duree = $duree / 60; - $requete = "INSERT INTO Creneau (dateHeure, duree, idR) VALUES ('".$dateD."', '".$duree."', '".$idR."')"; + $requete = "INSERT INTO AWOR_Creneau (dateHeure, duree, idR) VALUES ('".$dateD."', '".$duree."', '".$idR."')"; if(isset($debug)) echo $requete."<br/>"; if(mysql_query($requete)) { return mysql_insert_id(); } else { return false; } } function ajouterCreneau2($idR, $dateHeure, $duree) { - $requete = "INSERT INTO Creneau (dateHeure, duree, idR) VALUES ('".$dateHeure."', '".$duree."', '".$idR."')"; + $requete = "INSERT INTO AWOR_Creneau (dateHeure, duree, idR) VALUES ('".$dateHeure."', '".$duree."', '".$idR."')"; if(mysql_query($requete)) { return mysql_insert_id(); @@ -177,9 +184,9 @@ function ajouterCreneau2($idR, $dateHeure, $duree) function supprimerCreneau($idC) { - if(mysql_query("DELETE FROM Creneau WHERE idC='".$idC."'")) + if(mysql_query("DELETE FROM AWOR_Creneau WHERE idC='".$idC."'")) { - if(mysql_query("DELETE FROM Choisir WHERE idC='".$idC."'")) + if(mysql_query("DELETE FROM AWOR_Choisir WHERE idC='".$idC."'")) { return true; } @@ -201,7 +208,7 @@ function creneauExiste($idR, $heureD, $minD, $heureA, $minA, $jourA, $moisA, $an $duree = $dateA - $dateD; $dateD = date("Y-m-d G:i:s", $dateD); $duree = $duree / 60; - $requete = "SELECT * FROM Creneau WHERE idR='".$idR."' AND dateHeure='".$dateD."' AND duree=".$duree.""; + $requete = "SELECT * FROM AWOR_Creneau WHERE idR='".$idR."' AND dateHeure='".$dateD."' AND duree=".$duree.""; if($result = mysql_query($requete)) { if(mysql_num_rows($result) > 0) diff --git a/beta_old1/app/include/ludo/config.inc.php b/beta_old1/app/include/ludo/config.inc.php index 51d6d73..6d6504b 100644 --- a/beta_old1/app/include/ludo/config.inc.php +++ b/beta_old1/app/include/ludo/config.inc.php @@ -67,7 +67,8 @@ $CONFIG = array 'accepted_files' => array ( 'jpg', 'jpeg', 'gif', 'png', 'svg', 'pdf', 'ps', 'txt', 'rtf', 'csv', 'doc', 'docx', 'ppt', 'xls', 'sxw','sxp','sxd', 'odt', 'odg', 'odp', 'avi', 'mpg', 'mpeg', 'rm', 'flv', 'mp3', 'mp4', 'ogg','htm','html','zip', 'rar', 'tar', 'gz', 'bz2', 'ace' - ) + ), + 'relative_path' => 'beta/upload_files/' ) ); ?> diff --git a/beta_old1/app/include/ludo/div_create_or_modif.php b/beta_old1/app/include/ludo/div_create_or_modif.php index 5849180..c386060 100644 --- a/beta_old1/app/include/ludo/div_create_or_modif.php +++ b/beta_old1/app/include/ludo/div_create_or_modif.php @@ -58,20 +58,13 @@ if ( isset ( $_GET['idR']) ) <td><strong>Etat :</strong></td> <td> <input name="isCancelled" type="checkbox">Annulée</input> - <?php - // TODO : refléter l'état de la BD pour l'annulation ! - ?> + <input name="isHidden" type="checkbox" checked="checked">Disponibilités masquées</input> </td> </tr> <tr> <!--<td> </td>--> <td colspan="2"> <input name="Valider" type="submit" value="Valider"></input> - <?php - // TODO : refléter l'état de la BD pour l'annulation ! - //~ echo '<a href="#confirmAnnulation" onclick="loadid(\'include/ludo/popConfirmAnnulR.php?idR='; - //~ echo $idR . "','popfixer',true);popon('popfixer');\">Annuler</a>"; - ?> </td> </tr> </tbody> diff --git a/beta_old1/app/include/ludo/fonctions.inc.php b/beta_old1/app/include/ludo/fonctions.inc.php index 7411000..74b7ca7 100644 --- a/beta_old1/app/include/ludo/fonctions.inc.php +++ b/beta_old1/app/include/ludo/fonctions.inc.php @@ -119,7 +119,7 @@ function generate_html_array_personnes_crenaux($idR) // Récupération des paramètres de la réunion... $montrerDispoR=$estAnnulee=$is_admin=$estFixee=false; $idP_orga=null; - $query="SELECT r.montrerDispoR, r.estAnnulee, r.idP_Orga, r.idC_Fixe, r.idL FROM Reunion r WHERE r.idR='$idR'"; + $query="SELECT r.montrerDispoR, r.estAnnulee, r.idP_Orga, r.idC_Fixe, r.idL FROM AWOR_Reunion r WHERE r.idR='$idR'"; $result = @mysql_query($query); if ( $result && ( mysql_num_rows($result) === 1 ) ) { @@ -160,7 +160,7 @@ function generate_html_array_personnes_crenaux($idR) echo ' </th>' . "\n"; // Remplissage des entêtes de colonnes (créneaux) - $query="SELECT idC, UNIX_TIMESTAMP(dateHeure), duree FROM Creneau WHERE idR='$idR' ORDER BY dateHeure ASC;"; + $query="SELECT idC, UNIX_TIMESTAMP(dateHeure), duree FROM AWOR_Creneau WHERE idR='$idR' ORDER BY dateHeure ASC;"; $creneaux=array(); $dispos=array(); if ( $result = @mysql_query($query) ) @@ -208,12 +208,12 @@ function generate_html_array_personnes_crenaux($idR) // Requette écrivant les disponibilités dans un tableau associatif en une seule fois if ( $montrerDispoR ) { - $query='SELECT ch.idC, ch.idP, ch.estDispo FROM Choisir ch, Creneau c, Personne p, Appartenir a, Reunion r WHERE ' + $query='SELECT ch.idC, ch.idP, ch.estDispo FROM AWOR_Choisir ch, AWOR_Creneau c, AWOR_Personne p, AWOR_Appartenir a, AWOR_Reunion r WHERE ' ."c.idR=$idR AND r.idR=$idR AND a.idL=r.idL AND p.idP=a.idP AND ch.idC = c.idC AND ch.idP = p.idP;"; } else { - $query='SELECT ch.idC, ch.idP, ch.estDispo FROM Choisir ch, Creneau c WHERE ' + $query='SELECT ch.idC, ch.idP, ch.estDispo FROM AWOR_Choisir ch, AWOR_Creneau c WHERE ' ."c.idR='$idR' AND ch.idC=c.idC AND ch.idP='$idP_Self';"; } //echo $query . "\n"; @@ -238,7 +238,7 @@ function generate_html_array_personnes_crenaux($idR) //print_r($dispos); - $query='SELECT p.idP, p.prenomP, p.nomP FROM Personne p, Appartenir a, Reunion r WHERE ' + $query='SELECT p.idP, p.prenomP, p.nomP FROM AWOR_Personne p, AWOR_Appartenir a, AWOR_Reunion r WHERE ' . "r.idR='$idR' AND a.idL=r.idL AND p.idP=a.idP ORDER BY p.nomP, p.prenomP;"; if ( $result = @mysql_query($query) ) @@ -338,7 +338,7 @@ function traiter_formulaire_fixer_creneau() $idR=addslashes($_GET['idR']); $idC=addslashes($_GET['idC']); - $query="UPDATE Reunion SET idC_Fixe=$idC WHERE idR=$idR;"; + $query="UPDATE AWOR_Reunion SET idC_Fixe=$idC WHERE idR=$idR;"; if ( ! mysql_query($query) || mysql_affected_rows() != 1 ) { $errmsg='Impossible de fixer la réunion : ' . mysql_generate_errmsg(); @@ -353,7 +353,7 @@ function traiter_formulaire_creer_reunion() $idP=$_SESSION['session_idP']; // Recherche d'une réunion vierge déjà existante - $query='SELECT idR FROM Reunion WHERE idP_Orga=' . "('$idP') AND objetR='Renseignez';"; + $query='SELECT idR FROM AWOR_Reunion WHERE idP_Orga=' . "('$idP') AND objetR='Renseignez';"; if ( ( $result = mysql_query($query) ) && (mysql_num_rows($result) > 0) ) { list($idR)=mysql_fetch_array($result); @@ -361,7 +361,7 @@ function traiter_formulaire_creer_reunion() else { // Création de la Réunion sauf si une réunion vierge existe déjà - $query='INSERT INTO Reunion(idP_Orga, objetR) VALUES' . "('$idP', 'Renseignez');"; + $query='INSERT INTO AWOR_Reunion(idP_Orga, objetR) VALUES' . "('$idP', 'Renseignez');"; if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) { // Cas d'erreur @@ -377,7 +377,7 @@ function traiter_formulaire_creer_reunion() return $errmsg; } - $query="UPDATE Reunion SET idL='$idL' WHERE idR='$idR'"; + $query="UPDATE AWOR_Reunion SET idL='$idL' WHERE idR='$idR'"; if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) { // Cas d'erreur @@ -405,8 +405,10 @@ function traiter_formulaire_modif_detail_reunion() $ordreJourR=addslashes($_POST['ordreJourR']); $remarquesR=addslashes($_POST['remarquesR']); $estAnnulee=( isset($_POST['isCancelled']) && ($_POST['isCancelled']==='on') )?'oui':'non'; + $montrerDispoR=( isset($_POST['isHidden']) && ($_POST['isHidden']==='on') )?'non':'oui'; - $query="UPDATE Reunion SET objetR='$objetR', lieuR='$lieuR', ordreJourR='$ordreJourR', remarquesR='$remarquesR', estAnnulee='$estAnnulee' WHERE idR='$idR'"; + $query="UPDATE AWOR_Reunion SET objetR='$objetR', lieuR='$lieuR', ordreJourR='$ordreJourR', " + ." remarquesR='$remarquesR', estAnnulee='$estAnnulee', montrerDispoR='$montrerDispoR' WHERE idR='$idR'"; if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) { // Cas d'erreur @@ -423,7 +425,7 @@ function traiter_formulaire_modif_detail_reunion() function generate_html_reunion_detail2($idR) { $query='SELECT r.objetR, r.ordreJourR, r.lieuR, r.remarquesR, r.montrerDispoR, r.estAnnulee, r.idP_Orga, r.idC_Fixe, p.nomP, p.prenomP' - . " FROM Reunion r, Personne p WHERE r.idR='$idR' AND p.idP=r.idP_Orga"; + . " FROM AWOR_Reunion r, AWOR_Personne p WHERE r.idR='$idR' AND p.idP=r.idP_Orga"; $result = @mysql_query($query); if ( ! $result || ( mysql_num_rows($result) !== 1 ) ) { @@ -512,4 +514,37 @@ function generate_html_reunion_detail2($idR) <?php } +function html_generate_MySQLTableSuppr($table, $key_name, $columns='*', $where_clause='') +{ + require_once('include/ludo/html_elements.inc.php'); + require_once('include/connect.inc.php'); + + if ( $where_clause !== '' ) { $where_clause="WHERE $where_clause"; } + $query = "SELECT $columns FROM $table $where_clause;"; + //~ echo "DEBUG : $query\n"; + if ( ! $result = @mysql_query($query) ) + { + return "Erreur de génération de la table $table\n"; + } + else + { + $row = mysql_fetch_assoc($result); + // Affichage des entêtes du tableau et du pied de tableau + echo '<form action="" method="post">' . "\n" . '<table summary="Affichage des objets de la table ' . $table . ' pour la purger">' . "\n<thead>\n<tr>\n"; + echo '<td colspan="' . ( count($row) + 1 ) . "\">$table</td>\n</tr>\n<tr>\n"; + echo "<td></td><td>" . implode("</td>\n<td>",array_keys($row)) . "</td>\n"; + echo "</tr>\n</thead>\n<tfoot><tr>\n"; + echo '<td><input name="action" value="delete_from_' . $table . '" type="hidden" /><input value="Supprimer" type="submit" /></td>'; + for ( $i=0; $i < count($row); $i++ ) { echo "<td></td>"; } + echo "</tr>\n</tfoot>\n<tbody>\n"; + + $num=0; + do + { if ( isset($row[$key_name]) ) { $num=$row[$key_name]; } else { $num=''; } + echo "<tr>\n<td><input name=\"${key_name}_${num}\" type=\"checkbox\" /></td>\n<td>" . implode("</td>\n<td>",$row) . "</td>\n</tr>\n"; + } while ( $row = mysql_fetch_assoc($result) ); + echo "</tbody>\n</table>\n</form>\n"; + } +} + ?> diff --git a/beta_old1/app/include/ludo/html_elements.inc.php b/beta_old1/app/include/ludo/html_elements.inc.php index 41fd812..b845f28 100644 --- a/beta_old1/app/include/ludo/html_elements.inc.php +++ b/beta_old1/app/include/ludo/html_elements.inc.php @@ -15,10 +15,10 @@ echo '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n" <meta name="author" content="Jérémie Dénoyer, Ludovic Pouzenc, Andriana Semouchtchak, Julien Sérè" /> <script type="text/javascript" src="script.js"></script> <?php - $cssfilemain=''; - if ( isset($_COOKIE['awor']['custom_css'] ) ) + //print_r($_COOKIE['aworcustom_css']); + if ( /*isset($_COOKIE['aworcustom_css'])*/ false ) { - $cssfilemain = $_COOKIE['awor']['custom_css']; + $cssfilemain = $_COOKIE['aworcustom_css']; } else { @@ -56,6 +56,7 @@ include 'config.inc.php'; <li><a href="listes.php">Listes</a></li> <li><a href="profil.php">Mon profil</a></li> <li><a href="ical.php">iCal</a></li> + <li><a href="apropos.php">A Propos</a></li> <?php if ( isset($_SESSION['session_loginP']) && (is_integer(array_search($_SESSION['session_loginP'],$CONFIG['SUPERUSERS'],true))) ) { echo ' <li><a href="admin.php">Administration</a></li>' . "\n"; } ?> @@ -75,7 +76,7 @@ function generate_html_div_help($help_file='') //if ( @fopen($help_file, 'r')!==false ) { echo '<div id="no_help">' . "\n<h2><a href=\"#css_standard\" onclick=\"setActiveStyleSheet('standard');\">?</a></h2>\n" . "</div>\n"; - echo '<div id="help">' . "\n<h2><a href=\"#css_nohelp\" onclick=\"setActiveStyleSheet('nohelp');\">Aide</a></h2>\n"; + echo '<div id="help">' . "\n"; readfile($help_file); echo "</div>\n"; } @@ -100,14 +101,15 @@ function generate_html_div_css_chooser() if ( ! is_array($CONFIG['CSS']['CHOOSER_LIST']) ) { return false; } - if ( isset($_COOKIE['awor']['custom_css'] ) ) { $css_selected=$_COOKIE['awor']['custom_css']; }else{$css_selected='';}; + if ( isset($_COOKIE['aworcustom_css'] ) ) { $css_selected=$_COOKIE['aworcustom_css']; }else{$css_selected='';}; echo '<div class="css_chooser">' . "\n"; + //print_r($_COOKIE); echo ' <select id="switcherCSS" onchange="switchCSS();">' . "\n"; foreach ( $CONFIG['CSS']['CHOOSER_LIST'] as $file => $name ) { - echo ' <option value="' . $file; - if ( $file == $css_selected ) { echo ' selected="selected'; } - echo '">' . $name . '</option>' . "\n"; + echo ' <option value="' . $file . '"'; + if ( $file == $css_selected ) { echo ' selected="selected"'; } + echo '>' . $name . '</option>' /*. "$DEBUG:file=$file, css_selected=$css_selected"*/ . "\n"; } echo ' </select>'. "\n"; echo '</div>'. "\n"; @@ -133,7 +135,7 @@ function generate_html_div_footer() </a> </li> <li class="right"> - <span class="discret">Application réalisée par Jérémie Dénoyer, Ludovic Pouzenc, Julien Séré et Andriana Semouchtchak</span> + <span class="discret">Application réalisée par Jérémie Dénoyer,<br /> Ludovic Pouzenc, Julien Séré et Andriana Semouchtchak</span> </li> </ul> </div> diff --git a/beta_old1/app/include/ludo/mail_textarea.php b/beta_old1/app/include/ludo/mail_textarea.php index cf4b6d7..87f4965 100644 --- a/beta_old1/app/include/ludo/mail_textarea.php +++ b/beta_old1/app/include/ludo/mail_textarea.php @@ -24,7 +24,7 @@ if ( isset($_GET['model']) ) { $model=$_GET['model']; } else { $model='empty'; } if (isset( $_GET['idR']) ) { $idR=addslashes($_GET['idR']); - $result = mysql_query("SELECT objetR, ordreJourR, lieuR, remarquesR FROM Reunion WHERE idR='$idR'"); + $result = mysql_query("SELECT objetR, ordreJourR, lieuR, remarquesR FROM AWOR_Reunion WHERE idR='$idR'"); if (mysql_num_rows($result)===1) { list($objetR, $ordreJourR, $lieuR, $remarquesR) = mysql_fetch_array($result); diff --git a/beta_old1/app/include/ludo/majDispo.php b/beta_old1/app/include/ludo/majDispo.php index ab7c200..3f79fec 100644 --- a/beta_old1/app/include/ludo/majDispo.php +++ b/beta_old1/app/include/ludo/majDispo.php @@ -1,4 +1,5 @@ <?php +require('../connect.inc.php'); require('session_verify.inc.php'); require('fonctions.inc.php'); @@ -20,22 +21,19 @@ else $estDispo=addslashes($_GET['estDispo']); $idP=$_SESSION['session_idP']; - - // TODO Traitement - -/* echo "DEBUG : query==UPDATE Choisir SET estDispo = '$estDispo' WHERE idC='$idC' AND idP='$idP'"; - $query="UPDATE Choisir SET estDispo = '$estDispo' WHERE idC='$idC' AND idP='$idP'"; + $query="UPDATE AWOR_Choisir SET estDispo = '$estDispo' WHERE idC='$idC' AND idP='$idP'"; $result = @mysql_query($query); - if ( ! $result || ( mysql_num_rows($result) !== 1 ) ) + if ( ! $result || ( mysql_affected_rows() !== 1 ) ) { - $query="INSERT INTO Choisir(idC,idP,estDispo) VALUES ('$idC', '$idP', '$estDispo')"; - $result = @mysql_query($query); - if ( ! $result || ( mysql_num_rows($result) !== 1 ) ) + $query="INSERT INTO AWOR_Choisir(idC,idP,estDispo) VALUES ('$idC', '$idP', '$estDispo')"; + //echo "DEBUG :$query"; + $result = mysql_query($query); + if ( ! $result || ( mysql_affected_rows() !== 1 ) ) { echo "Erreur BD\n"; return; } - } */ + } generate_html_dispo_case($idR, $idP, $idC, true, $estDispo, false); } ?>
\ No newline at end of file |