summaryrefslogtreecommitdiff
path: root/appli_3_alpha_old/app/include/ju.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'appli_3_alpha_old/app/include/ju.inc.php')
-rw-r--r--appli_3_alpha_old/app/include/ju.inc.php75
1 files changed, 53 insertions, 22 deletions
diff --git a/appli_3_alpha_old/app/include/ju.inc.php b/appli_3_alpha_old/app/include/ju.inc.php
index 3402f39..3ec7453 100644
--- a/appli_3_alpha_old/app/include/ju.inc.php
+++ b/appli_3_alpha_old/app/include/ju.inc.php
@@ -1,6 +1,7 @@
<?php
function traiter_formulaire_popfichier()
{
+ require("include/ludo/config.inc.php");
$file = "fichier";
if(isset($_FILES[$file]))
{
@@ -9,21 +10,34 @@ function traiter_formulaire_popfichier()
//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(is_numeric(array_search(strtolower($ext), $CONFIG["UPLOAD"]["accepted_files"])))
{
- if(move_uploaded_file($_FILES[$file]["tmp_name"], $_SERVER['DOCUMENT_ROOT']."/fichiers/".$_FILES[$file]["name"]))
+ if(!file_exists($_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";
+ 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"]."')";
+ if(mysql_query($requete) == false)
+ {
+ echo "DEBUG : ".mysql_error()."<br/>\n";
+ echo "DEBUG : ".$requete."<br/>\n";
+ }
+ }
+ else
+ {
+ echo "DEBUG : Erreur Uploader file";
+ }
}
else
{
- echo "NOK";
+ echo "DEBUG : Le fichier existe deja";
}
}
+ else
+ {
+ echo "DEBUG : Le fichier n'a pas ete uploader correctement.";
+ }
}
else
{
@@ -53,12 +67,12 @@ function generate_html_reunion_commentaires($idR)
$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>';
+ echo '<table cellspacing="0" class="commentaires" summary="Liste des commentaires laissés pour les personnes conviées à cette réunion">';
+ echo '<thead>';
+ echo '<tr>';
+ echo "<th>Commentaires <a href=\"#\" onclick=\"loadid('popcommentaire.php?idP=".$idP."','popcommentaire',true);popon('popcommentaire');\">(Editer votre commentaire)</a></th>";
+ echo '</tr>';
+ echo '</thead>';
if(mysql_num_rows($resultat) > 0)
{
while($fichier = mysql_fetch_array($resultat))
@@ -88,20 +102,37 @@ function generate_html_reunion_fichiers($idR)
$resultat = mysql_query($requete);
if($resultat != false)
{
+ 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>Fichiers attach&eacute;s <a href="#" onclick="popon(\'popfichier\')">(Ajouter un fichier)</a></th>';
+ echo '</tr>'."\n";
+ echo '</thead>';
if(mysql_num_rows($resultat) > 0)
{
- 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>Fichiers attach&eacute;s <a href="#" onclick="popon(\'popfichier\')">(Ajouter un fichier)</a></th>';
- echo '</tr>'."\n";
- echo '</thead>';
while($fichier = mysql_fetch_array($resultat))
{
- echo "<tr><td><a href=\"../fichiers/".$fichier["nomFic"]."\">".$fichier["nomFic"]."</a></td></tr>\n";
+ echo "<tr><td><a href=\"../fichiers/".$fichier["nomFic"]."\" target=\"_blank\" >".$fichier["nomFic"]."</a></td></tr>\n";
}
- echo '</table>';
}
+ else
+ {
+ echo "<tr><td>Aucun fichier pour cette reunion.</td></tr>\n";
+ }
+ echo '</table>';
}
}
+/*
+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']."'";
+ mysql_query($requete) or die("ERREUR : ".mysql_error());
+ $_SESSION['session_prenomP'] = $_POST["prenomP"];
+ $_SESSION['session_nomP'] = $_POST["nomP"];
+}
?> \ No newline at end of file