summaryrefslogtreecommitdiff
path: root/final/app/details_reunion.php
blob: 64731d4b953fedadf1121b21dd0f6998465fde8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
require('include/ludo/session_verify.inc.php');
require_once('include/connect.inc.php');
require_once('include/ludo/html_elements.inc.php');
require_once('include/ludo/fonctions.inc.php');

require_once('include/je.inc.php');
require_once('include/ju.inc.php');



generate_html_doctype_and_head("D&eacute;tail de la r&eacute;union");
echo "<body>\n";

// DEBUG
//~ echo '<pre>';
//~ print_r($_REQUEST);
//~ echo '</pre>';

generate_html_divs_menu();
?>
	<div id="sous_menu">
		<p class="arbre">
		&gt; <a href="index.php">Accueil</a>
		&gt; <a href="index.php">R&eacute;unions</a>
		&gt; D&eacute;tails d'une r&eacute;union
		</p>
	</div>
<?php
	if ( isset($_REQUEST['action']) )
	{
		switch ($_REQUEST['action'])
		{
			case 'creer_reunion':
				$ret=traiter_formulaire_creer_reunion();
				//~ echo "DEBUG : idR==$ret\n";
				if ( is_string($ret) ) { $errmsg=$ret; } else { $idR=$ret;}
			break;
			case 'popfichier':
			case 'maj_profil':
			case 'valider_modif_personnes':
			case 'valider_creneau':
			case 'delete_list':
			case 'commentaire':
			case 'fixer_creneau':
			case 'modif_detail_reunion':
				$nom_func = 'traiter_formulaire_' . $_REQUEST['action'];
				$errmsg = $nom_func();
			break;
			default:
				$errmsg = 'Impossible de traiter la requete : type de formulaire non enregistr&eacute; !'."\n";
		}
	}
	// Connexion &agrave; la base et s&eacute;lection de la database
	require_once 'include/connect.inc.php';
	if ( ! isset($idR) && ( ! isset($_REQUEST['idR'] ) || ! is_numeric($_REQUEST['idR']) ) || ! isset($_SESSION['session_idP']) )
	{
		$errmsg='Erreur de g&eacute;n&eacute;ration de la page : param&egrave;tres erron&eacute;s ou manquant';
	}
	else
	{
		if ( ! isset($idR) ) { $idR=addslashes($_REQUEST['idR']); }
		$idP=$_SESSION['session_idP'];
		
		// V&eacute;rification que la r&eacute;union nous concerne bien
		$query="SELECT * FROM AWOR_Appartenir a WHERE a.idL=$idR, a.idP=$idP;";
		if ( ( $result = @mysql_query($query) ) && ( mysql_num_rows($result) === 1 ) )
		{
			$errmsg='Vous n\'avez pas le droit de consulter cette page : cette r&eacute;union n\'existe pas ou ne vous concerne pas !';
		}
	}
	if ( isset($errmsg) && is_string($errmsg) )
	{
		generate_html_div_errmsg($errmsg);
		echo '</body></html>';
		exit();
	}
	
	if ( isset($_REQUEST['action']) && ($_REQUEST['action']==='creer_reunion' ) )
	{
		//~ echo "DEBUG : generate_html_div_help('help/details_reunion_new.php.hlp');\n";
		generate_html_div_help('help/details_reunion_new.php.hlp');
	}
	else
	{
		$query="SELECT idP_Orga FROM AWOR_Reunion WHERE idR=$idR;";
		if ( ( $result = @mysql_query($query) ) && ( mysql_num_rows($result) === 1 ) && ( list($idP_Orga)=mysql_fetch_array($result) ) &&($idP == $idP_Orga) )
		{
			//~ echo "DEBUG : generate_html_div_help('help/details_reunion_admin.php.hlp');\n";
			generate_html_div_help('help/details_reunion_admin.php.hlp');
		}
		else
		{
			//~ echo "DEBUG : generate_html_div_help('help/details_reunion.php.hlp');\n";
			generate_html_div_help('help/details_reunion.php.hlp');
		}
	}
	
	
	echo '<div id="contenu">' . "\n";
	echo '<div id="details_reunion">' . "\n";
	generate_html_reunion_detail2($idR);
	echo "</div>\n";
	echo "<br />\n";
	generate_html_array_personnes_crenaux($idR, $idP);
	echo "<br />\n";
	generate_html_reunion_commentaires($idR);
	echo "<br />\n";
	generate_html_reunion_fichiers($idR);
?>
</div>
<div id="popcommentaire" class="popup_commentaire">
<h2>Editer votre commentaire</h2>
<div class="popup_contenu">
<form id="formcommentaire" method="get" action="details_reunion_admin.php">
Commentaire : <input name="txtCommentaire" type="text" id="txtCommentaire" />
<br/><br/>
<input type="submit" name="Submit" value="Enregistrer" /><input type="button" name="fermer" value="Fermer" alt="commentaire" />
</form>
</div>
</div>

<div id="popfichier" class="popup_fichier">
<h2>Ajouter un fichier</h2>
<div class="popup_contenu">
<form id="formfichier" method="post" action="details_reunion.php?idR=<?php echo $idR; ?>" enctype="multipart/form-data">
Fichier : <input name="fichier" type="file" id="fichier"/>
<br/><br/>
<input type="hidden" name="action" value="popfichier" />
<input type="submit" name="Submit" value="Valider" onclick="popoff('popfichier');"/>
<input type="button" value="fermer" onclick="popoff('popfichier');"/>
</form>
</div>
</div>
<?php generate_html_div_footer(); ?>
<div class="popup" id="popfixer"></div>
<div class="popup_creneau" id="popcreneau"></div>
<div id="poppersonne" class="popup_personne"></div>
<div id="masque"></div>
<div id="msg"></div>
</body>
</html>