diff options
Diffstat (limited to 'beta_old1/app/include/ludo')
-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 |
6 files changed, 69 insertions, 40 deletions
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 |