summaryrefslogtreecommitdiff
path: root/appli_3_alpha_old/include/ju.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'appli_3_alpha_old/include/ju.inc.php')
-rw-r--r--appli_3_alpha_old/include/ju.inc.php150
1 files changed, 64 insertions, 86 deletions
diff --git a/appli_3_alpha_old/include/ju.inc.php b/appli_3_alpha_old/include/ju.inc.php
index 7267de1..3402f39 100644
--- a/appli_3_alpha_old/include/ju.inc.php
+++ b/appli_3_alpha_old/include/ju.inc.php
@@ -1,129 +1,107 @@
<?php
-function traiter_formulaire_cequetuveux_aussi()
+function traiter_formulaire_popfichier()
{
- echo "coucou\n";
+ $file = "fichier";
+ if(isset($_FILES[$file]))
+ {
+ if($_FILES[$file]["error"] == 0)
+ {
+ //Récupération de l'extension
+ $ext = explode(".", $_FILES[$file]["name"]);
+ $ext = array_pop($ext);
+ if($ext == "txt" || $ext == "doc" || $ext == "jpg" || $ext == "gif" || $ext == "zip")
+ {
+ if(move_uploaded_file($_FILES[$file]["tmp_name"], $_SERVER['DOCUMENT_ROOT']."/fichiers/".$_FILES[$file]["name"]))
+ {
+ echo "DEBUG :".$_SERVER['DOCUMENT_ROOT']."/fichiers/\n";
+ $requete = "INSERT INTO Fichier(nomFic, idR) VALUES ('".$_FILES[$file]["name"]."', '".$_GET["idR"]."')";
+ mysql_query($requete);
+ echo "DEBUG : ".mysql_error()."<br/>\n";
+ echo "DEBUG : ".$requete."<br/>\n";
+ }
+ else
+ {
+ echo "NOK";
+ }
+ }
+ }
+ else
+ {
+ switch($_FILES[$file]["error"])
+ {
+ case 1 : $erreur = "Le fichier a une taille trop importante."; break;
+ case 2 : $erreur = "Le fichier a une taille trop importante."; break;
+ case 3 : $erreur = "Le fichier n'a pas ete envoye en entier."; break;
+ case 4 : $erreur = "Aucun fichier recu."; break;
+ }
+ echo $erreur;
+ }
+ }
+ else
+ {
+ echo "isset";
+ }
}
// Modifiée par Ludo pour les problèmes de vriables de session et pour d'autres détails :
// S'il n'y a pas de commentaire, on affiche le tableau vide
function generate_html_reunion_commentaires($idR)
{
-?>
- <table cellspacing="0" class="commentaires" summary="Liste des commentaires laissés pour les personnes conviées à cette réunion">
+ $idP = $_SESSION['session_idP'];
+ $requete = "SELECT * FROM Repondre WHERE idP != '".$idP."' AND idR = '".$idR."'";
+ //echo "DEBUG : requete : $requete\n";
+ $resultat = mysql_query($requete);
+ if($resultat != false)
+ {
+ echo '<table cellspacing="0" class="commentaires" summary="Liste des commentaires laissés pour les personnes conviées à cette réunion">
<thead>
<tr>
<th>Commentaires <a href="#">(Editer votre commentaire)</a></th>
</tr>
- </thead>
- <tbody>
-
-<?php
- $idP=$_SESSION['session_idP'];
- $idR=addslashes($idR);
-
-
-
- $requete = "SELECT idP, commentaireReponse FROM Repondre WHERE idP != '$idP' AND idR = '$idR'";
- echo "DEBUG : requete : $requete\n";
- $resultat = mysql_query($requete);
- if($resultat != false)
- {
+ </thead>';
if(mysql_num_rows($resultat) > 0)
{
- while($commentaire = mysql_fetch_array($resultat));
+ while($fichier = mysql_fetch_array($resultat))
{
if ( isset($_SESSION['session_nomP']) && isset($_SESSION['session_prenomP']) )
{
- $nom = $_SESSION['session_nomP'] . $_SESSION['session_prenomP'];
+ $nom = $_SESSION['session_nomP']." ".$_SESSION['session_prenomP'];
}
else
{
- $nom = $commentaire['idP'];
+ $nom = $fichier["idP"];
}
- echo ' <tr><td>'.$nom." : ".$commentaire['commentaireReponse']."</td></tr>\n";
+ echo '<tr><td>'.$nom." : ".$fichier["commentaireReponse"]."</td></tr>\n";
}
-
}
+ else
+ {
+ echo "<tr><td>Aucun commentaire pour le moment.</td></tr>\n";
+ }
+ echo '</table>';
}
-?>
- </tbody>
- </table>
-<?php
}
function generate_html_reunion_fichiers($idR)
{
- $requete = "SELECT * FROM Repondre WHERE idP != '".$_SESSION['session_idP']."' AND idR = '".$idR."'";
+ $requete = "SELECT * FROM Fichier WHERE idR = '".$idR."'";
$resultat = mysql_query($requete);
if($resultat != false)
{
if(mysql_num_rows($resultat) > 0)
{
- echo '<table cellspacing="0" class="commentaires">';
+ echo '<table cellspacing="0" class="fichiers" summary="Liste des fichiers postés par les participants de la réunion.">';
echo '<thead>';
echo '<tr>';
- echo '<th>Commentaires <a href="#">(Editer votre commentaire)</a></th>';
- echo '</tr>';
+ echo '<th>Fichiers attach&eacute;s <a href="#" onclick="popon(\'popfichier\')">(Ajouter un fichier)</a></th>';
+ echo '</tr>'."\n";
echo '</thead>';
- while($commentaire = mysql_fetch_array($resultat))
+ while($fichier = mysql_fetch_array($resultat))
{
- if(isset($_SESSION["PrenomP"]))
- {
- $nom = $_SESSION["PrenomP"];
- }
- else
- {
- $nom = $commentaire["idP"];
- }
- echo "<tr><td>".$nom." : ".$commentaire["commentaireReponse"]."</td></tr>\n";
+ echo "<tr><td><a href=\"../fichiers/".$fichier["nomFic"]."\">".$fichier["nomFic"]."</a></td></tr>\n";
}
echo '</table>';
}
}
- echo '<table cellspacing="0" class="fichiers">';
- echo '<thead>';
- echo '<tr>';
- echo '<th>Fichiers attach&eacute;s <a href="#popfichier" class="pop">(Ajouter un fichier)</a></th>';
- echo '</tr>';
- echo '</thead>';
- echo '<tr>';
- echo '<td><a href="compte-rendu.txt">compte-rendu.txt</a></td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td><a href="photos-ru.jpg">photos-ru.jpg</a></td>';
- echo '</tr>';
- echo '</table>';
-}
-
-function generate_html_reunion_detail($idR)
-{
- echo '<table cellspacing="0" class="detail_reunion">
- <thead>
- <tr>
- <th>D&eacute;tails de la r&eacute;union </th>
- <th>&nbsp;</th>
- </tr>
- </thead>
- <tr>
- <td><strong>Objet : </strong></td>
- <td>D&eacute;tails stages NEWI</td>
- </tr>
- <tr>
- <td><strong>Organisateur : </strong></td>
- <td>Mme Verdier</td>
- </tr>
- <tr>
- <td><strong>Lieu : </strong></td>
- <td>Salle 209 </td>
- </tr>
- <tr>
- <td><strong>Ordre du jour : </strong></td>
- <td>Le logement, le s&eacute;jour, les contacts</td>
- </tr>
- <tr>
- <td><strong>Remarque :</strong></td>
- <td>aucune</td>
- </tr>
- </table>';
}
?> \ No newline at end of file