diff options
Diffstat (limited to 'appli_3_alpha_old/app/include/ludo')
6 files changed, 117 insertions, 70 deletions
diff --git a/appli_3_alpha_old/app/include/ludo/config.inc.php b/appli_3_alpha_old/app/include/ludo/config.inc.php index ea3d0ba..34a4956 100644 --- a/appli_3_alpha_old/app/include/ludo/config.inc.php +++ b/appli_3_alpha_old/app/include/ludo/config.inc.php @@ -60,6 +60,7 @@ $CONFIG = array ) ) ), + 'SUPERUSERS' => array ('jeremie.denoyer', 'lpouzenc'), 'UPLOAD' => array ( 'accepted_files' => array diff --git a/appli_3_alpha_old/app/include/ludo/div_create_or_modif.php b/appli_3_alpha_old/app/include/ludo/div_create_or_modif.php index e6c3f8e..5849180 100644 --- a/appli_3_alpha_old/app/include/ludo/div_create_or_modif.php +++ b/appli_3_alpha_old/app/include/ludo/div_create_or_modif.php @@ -17,6 +17,10 @@ if ( isset ( $_GET['idR']) ) } ?> <form action="" method="post"> + <input name="action" type="hidden" value="modif_detail_reunion" /> +<?php + echo ' <input name="idR" type="hidden" value="' . $idR . '" />' +?> <table class="detail_reunion" summary="Détail de la réunion que vous avez sélectionnée"> <thead> <tr> @@ -32,13 +36,6 @@ if ( isset ( $_GET['idR']) ) <input name="objetR" type="text" size="40" <?php if ($isModif) { echo 'value="' . $objetR .'"'; } ?>></input> </td> </tr> -<!-- <tr> - <td><strong>Organisateur :</strong></td> - <td> - <?php// echo "$prenomP $nomP\n"; ?> - </td> - </tr> ---> <tr> <td><strong>Lieu :</strong></td> <td> @@ -79,8 +76,4 @@ if ( isset ( $_GET['idR']) ) </tr> </tbody> </table> - <input name="action" type="hidden" value="modif_detail_reunion" /> -<?php - echo ' <input name="idR" type="hidden" value="' . $idR . '" />' -?> </form>
\ No newline at end of file diff --git a/appli_3_alpha_old/app/include/ludo/fonctions.inc.php b/appli_3_alpha_old/app/include/ludo/fonctions.inc.php index f24a8c2..0dc86a7 100644 --- a/appli_3_alpha_old/app/include/ludo/fonctions.inc.php +++ b/appli_3_alpha_old/app/include/ludo/fonctions.inc.php @@ -77,7 +77,7 @@ function generate_html_dispo_case($idR, $idP, $idC, $isEditable, $estDispo, $wit if ( ! isset($estDispo) || $estDispo == '' ) { // Dispo Inconnue generate_html_dispo_dire_oui($idR, $idC); - echo ' '; + //~ echo ' '; generate_html_dispo_dire_non($idR, $idC); } else @@ -85,13 +85,13 @@ function generate_html_dispo_case($idR, $idP, $idC, $isEditable, $estDispo, $wit if ( $estDispo == 'oui' ) { // Disponible generate_html_dispo_oui($idP, $idC); - echo ' '."\n "; + //~ echo ' '."\n "; generate_html_dispo_dire_non($idR, $idC); }else { // Non Disponible generate_html_dispo_dire_oui($idR, $idC); - echo ' '."\n "; + //~ echo ' '."\n "; generate_html_dispo_non($idP, $idC); } } @@ -126,7 +126,7 @@ function generate_html_array_personnes_crenaux($idR) list($montrerDispoR, $estAnnulee, $idP_orga, $idC_Fixe, $idL_interne) = mysql_fetch_row($result); $is_admin = ( $idP_Self == $idP_orga ); $montrerDispoR = ( ( $montrerDispoR === 'oui' ) || $is_admin ) ; - //echo "DEBUG : annuléé $estAnnulee\n"; + //echo "DEBUG : annulée $estAnnulee\n"; $estAnnulee = ( $estAnnulee == 'oui' ); $estFixee = ( $idC_Fixe != null); } @@ -144,8 +144,20 @@ function generate_html_array_personnes_crenaux($idR) <thead> <tr> <?php - if ( $is_admin ) { echo ' <th>Mail</th>' . "\n"; } - echo ' <th>Personnes</th>' . "\n"; + if ( $is_admin ) + { + echo ' <th>Mail</th>' . "\n"; + } + echo ' <th>' ."\n"; + if ( $is_admin ) + { + echo ' <a href="#poppersonne" onclick="loadid(\'poppersonne.php?idR=' . $idR; + echo '&idL=' . $idL_interne . '&idP_orga=' . $idP_orga . '\',\'poppersonne\',true);popon(\'poppersonne\');">' . "\n"; + echo ' <img src="images/addP.gif" alt="Ajouter une personne" title="Ajouter une personne" height="17" width="19" />' . "\n"; + echo ' </a> '; + } + echo 'Personnes' . "\n"; + 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;"; @@ -321,7 +333,7 @@ function traiter_formulaire_fixer_creneau() if ( ! isset($_GET['idR']) || !isset($_GET['idC']) ) { $errmsg="Impossible de fixer la réunion : paramètres manquants ou erroné"; - return; + return $errmsg; } $idR=addslashes($_GET['idR']); $idC=addslashes($_GET['idC']); @@ -330,41 +342,51 @@ function traiter_formulaire_fixer_creneau() if ( ! mysql_query($query) || mysql_affected_rows() != 1 ) { $errmsg='Impossible de fixer la réunion : ' . mysql_generate_errmsg(); + return $errmsg; } + return; } function traiter_formulaire_creer_reunion() { include_once('include/je.inc.php'); $idP=$_SESSION['session_idP']; - - // Création de la Réunion - $query='INSERT INTO Reunion(idP_Orga) VALUES' . "('$idP');"; - if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) - { - // Cas d'erreur - $errmsg ='Erreur lors de la création de la liste de participants : ' . mysql_generate_errmsg(); - return; - } - $idR=mysql_insert_id(); - // Création de la Liste des participants - if ( ! $idL=list_new("interne_idR_$idR","NULL",true) ) + // Recherche d'une réunion vierge déjà existante + $query='SELECT idR FROM Reunion WHERE idP_Orga=' . "('$idP') AND objetR='Renseignez';"; + if ( ( $result = mysql_query($query) ) && (mysql_num_rows($result) > 0) ) { - $errmsg ='Erreur lors de la création de la liste de participants : Erreur de base de donnée'; - return; + list($idR)=mysql_fetch_array($result); } - - $query="UPDATE Reunion SET idL='$idL' WHERE idR='$idR'"; - if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) + else { - // Cas d'erreur - $errmsg = 'Erreur lors de la création de la liste de participants : ' . mysql_generate_errmsg(); - return; + // 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');"; + if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) + { + // Cas d'erreur + $errmsg ='Erreur lors de la création de la liste de participants : ' . mysql_generate_errmsg(); + return $errmsg; + } + $idR=mysql_insert_id(); + + // Création de la Liste des participants + if ( ! $idL=list_new("interne_idR_$idR","NULL",true) ) + { + $errmsg ='Erreur lors de la création de la liste de participants : Erreur de base de données'; + return $errmsg; + } + + $query="UPDATE Reunion SET idL='$idL' WHERE idR='$idR'"; + if ( ! $result = @mysql_query($query) || (mysql_affected_rows() != 1) ) + { + // Cas d'erreur + $errmsg = 'Erreur lors de la création de la liste de participants : ' . mysql_generate_errmsg(); + return $errmsg; + } } - // TODO : moins bourin ! - $_REQUEST['idR']=$idR; - return; + + return (int) $idR; } function traiter_formulaire_modif_detail_reunion() @@ -373,8 +395,8 @@ function traiter_formulaire_modif_detail_reunion() { $errmsg = 'Impossible de modifier de détail de la réunion : Paramètres manquants'; // DEBUG : - echo "DEBUG : $query\n$errmsg\n"; - return; + //echo "DEBUG : $query\n$errmsg\n"; + return $errmsg; } $idR=addslashes($_GET['idR']); @@ -390,8 +412,8 @@ function traiter_formulaire_modif_detail_reunion() // Cas d'erreur $errmsg = 'Erreur lors de la modification de la réunion : ' . mysql_generate_errmsg(); // DEBUG : - echo "DEBUG : $query\n$errmsg\n"; - return; + //echo "DEBUG : $query\n$errmsg\n"; + return $errmsg; } // DEBUG : //echo "DEBUG : $query\n$errmsg\n"; @@ -406,11 +428,11 @@ function generate_html_reunion_detail2($idR) if ( ! $result || ( mysql_num_rows($result) !== 1 ) ) { $errmsg="Impossible de récuprérer les informations de la réunion : Erreur de base de données\n"; - return; + return $errmsg; } list($objetR, $ordreJourR, $lieuR, $remarquesR, $montrerDispoR, $estAnnulee, $idP_Orga, $idC_Fixe, $nomP, $prenomP) = mysql_fetch_row($result); - if ( $estAnnulee=='oui' ) { $etat = 'reunion_fixee'; } elseif ( $idC_Fixe!=null) { $etat ='reunion_fixee'; } else { $etat = 'reunion_en_cours'; } + if ( $estAnnulee=='oui' ) { $etat = 'reunion_annulee'; } elseif ( $idC_Fixe!=null) { $etat ='reunion_fixee'; } else { $etat = 'reunion_en_cours'; } ?> <table class="detail_reunion" summary="Détail de la réunion que vous avez sélectionnée"> diff --git a/appli_3_alpha_old/app/include/ludo/html_elements.inc.php b/appli_3_alpha_old/app/include/ludo/html_elements.inc.php index 4275653..f05f7e2 100644 --- a/appli_3_alpha_old/app/include/ludo/html_elements.inc.php +++ b/appli_3_alpha_old/app/include/ludo/html_elements.inc.php @@ -15,17 +15,29 @@ 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'] ) ) { - $cssfile = $_COOKIE['awor']['custom_css']; + $cssfilemain = $_COOKIE['awor']['custom_css']; } else { include 'config.inc.php'; - $cssfile=$CONFIG['CSS']['CHOOSER_LIST']['standard']; + $cssfilemain=$CONFIG['CSS']['CHOOSER_LIST']['standard']; + } + echo ' <link href="css/' . $cssfilemain . '.css" rel="stylesheet" type="text/css" />' . "\n"; + + if ( isset($CONFIG['CSS']['CHOOSER_LIST']) ) + { + foreach ( $CONFIG['CSS']['CHOOSER_LIST'] as $cssfile ) + { + if ( $cssfile != $cssfilemain ) + { + echo ' <link href="css/' . $cssfile . '.css" rel="alternate stylesheet" type="text/css" />' . "\n"; + } + echo ' <link href="css/' . $cssfile . '_nohelp.css" rel="alternate stylesheet" type="text/css" title="nohelp"/>' . "\n"; + } } - echo ' <link href="css/' . $cssfile . '.css" rel="stylesheet" type="text/css" />' . "\n"; - echo ' <link href="css/' . $cssfile . '_nohelp.css" rel="alternate stylesheet" type="text/css" title="nohelp"/>' . "\n"; ?> <link href="css/print.css" rel="alternate stylesheet" type="text/css" title="print"/> </head> @@ -34,6 +46,7 @@ echo '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n" function generate_html_divs_menu() { +include 'config.inc.php'; ?> <div id="titre"><h2>AWOR</h2></div> <div id="main_menu"> @@ -42,6 +55,9 @@ function generate_html_divs_menu() <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> +<?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"; } +?> <li id="deconnection"><a href="deco.php">Déconnexion</a></li> </ul> </div> @@ -78,13 +94,14 @@ function generate_html_div_errmsg($errmsg) function generate_html_div_css_chooser() { - // TODO : fonction JS qui fait ce qu'il faut !! (a mettre dans le head ??) - require_once('config.inc.php'); + @include 'include/ludo/config.inc.php'; + @include 'config.inc.php'; + if ( ! is_array($CONFIG['CSS']['CHOOSER_LIST']) ) { return false; } - if ( isset($_COOKIE['awor']['custom_css'] ) ) { $css_selected=$_COOKIE['awor']['custom_css']; }; + if ( isset($_COOKIE['awor']['custom_css'] ) ) { $css_selected=$_COOKIE['awor']['custom_css']; }else{$css_selected='';}; echo '<div class="css_chooser">' . "\n"; - echo ' <select>' . "\n"; + echo ' <select id="switcherCSS" onchange="switchCSS();">' . "\n"; foreach ( $CONFIG['CSS']['CHOOSER_LIST'] as $file => $name ) { echo ' <option value="' . $file; @@ -95,6 +112,22 @@ function generate_html_div_css_chooser() echo '</div>'. "\n"; } +function generate_html_div_footer() +{ +?> +<div id="footer"> + <ul> + <li class="left"> +<?php generate_html_div_css_chooser(); ?> + </li> + <li class="rigth"> + <span class="discret">Application réalisée par Jérémie Dénoyer, Ludovic Pouzenc, Julien Séré et Andriana Semouchtchak</span> + </li> + </ul> +</div> +<?php +} + function generate_html_div_deconnect() { echo '<div class="deco"><a href="deco.php">Deconnexion</a></div>'."\n"; @@ -106,30 +139,30 @@ function generate_html_div_back() function generate_html_dispo_inconnu($idP, $idC) { - echo '<img src="./images/question.gif" alt="Inconnu" height="15" width="15" />' . "\n"; + echo '<img class="spacing" src="./images/question.gif" alt="Inconnu" height="15" width="15" />' . "\n"; } function generate_html_dispo_oui($idP, $idC) { - echo '<img src="./images/ok.gif" alt="Disponible" height="16" width="16" />' . "\n"; + echo '<img class="spacing" src="./images/ok.gif" alt="Disponible" height="16" width="16" />' . "\n"; } function generate_html_dispo_non($idP, $idC) { - echo '<img src="./images/del.gif" alt="Non disponible" height="15" width="15" />' . "\n"; + echo '<img class="spacing" src="./images/del.gif" alt="Non disponible" height="15" width="15" />' . "\n"; } function generate_html_dispo_dire_oui($idR, $idC) { //~ echo '<img src="./images/button_ok.png" alt="Dire que je suis disponible" height="25" width="25" />' . "\n"; echo "<a href=\"#dispo_idC${idC}\" onclick=\"loadid('include/ludo/majDispo.php?idR=$idR&idC=$idC&estDispo=oui','dispo_idC${idC}',false);\">"; - echo '<img src="./images/button_ok.png" alt="Dire que je suis disponible" height="25" width="25" /></a>' . "\n"; + echo '<img class="spacing" src="./images/button_ok.png" alt="Dire que je suis disponible" height="25" width="25" /></a>' . "\n"; } function generate_html_dispo_dire_non($idR, $idC) { echo "<a href=\"#dispo_idC${idC}\" onclick=\"loadid('include/ludo/majDispo.php?idR=$idR&idC=$idC&estDispo=non','dispo_idC${idC}',false);\">"; - echo '<img src="./images/button_del.png" alt="Dire que je suis pas disponible" height="25" width="25" /></a>' . "\n"; + echo '<img class="spacing" src="./images/button_del.png" alt="Dire que je suis pas disponible" height="25" width="25" /></a>' . "\n"; } function generate_html_reunion_detail_button($idR) diff --git a/appli_3_alpha_old/app/include/ludo/mail_textarea.php b/appli_3_alpha_old/app/include/ludo/mail_textarea.php index 4861e1d..cf4b6d7 100644 --- a/appli_3_alpha_old/app/include/ludo/mail_textarea.php +++ b/appli_3_alpha_old/app/include/ludo/mail_textarea.php @@ -8,7 +8,7 @@ include('config.inc.php'); if ( isset($_GET['model']) ) { $model=$_GET['model']; } else { $model='empty'; } ?> -<textarea name="msgText" cols="80" rows="8"> +<textarea name="msgText" cols="80" rows="15"> <?php if ( $model != 'empty') { @@ -28,7 +28,7 @@ if ( isset($_GET['model']) ) { $model=$_GET['model']; } else { $model='empty'; } if (mysql_num_rows($result)===1) { list($objetR, $ordreJourR, $lieuR, $remarquesR) = mysql_fetch_array($result); - }
+ } } //echo 'DEBUG : ../../templates/' . $CONFIG['MAIL']['TEMPLATES'][$model]['tpl_file'] . "\n"; if (!@include('../../templates/' . $CONFIG['MAIL']['TEMPLATES'][$model]['tpl_file']) ) diff --git a/appli_3_alpha_old/app/include/ludo/majDispo.php b/appli_3_alpha_old/app/include/ludo/majDispo.php index ab7c200..106cc91 100644 --- a/appli_3_alpha_old/app/include/ludo/majDispo.php +++ b/appli_3_alpha_old/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'"; $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 ) ) + //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 |