summaryrefslogtreecommitdiff
path: root/appli_3_alpha_old/sendmail.php
blob: e73988437ffe7bf9a42df06f169b6ca007b2d8c7 (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
<?php
require('include/ludo/session_verify.inc.php');
require_once('include/ludo/html_elements.inc.php');
require_once('include/connect.inc.php');



generate_html_doctype_and_head("Envoi de courriel");
echo "<body>\n";
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; Envoi de courriel
		</p>
	</div>
<?php generate_html_div_help();
if( isset($_GET['envoi']) )
{
	// TODO : code d'envoi
	echo '<div id="contenu"><pre>';
	print_r($_REQUEST);	
	echo '</div></body></html>';
	exit();
}

if( isset($_GET['idR']) )
{
	$idR=addslashes($_GET['idR']);
}
else
{
	$errmsg="";
}

$result = mysql_query("SELECT idL FROM Reunion WHERE idR='$idR'");
if (mysql_num_rows($result)===1)
{
	list($idL) = mysql_fetch_array($result);
}
else
{
	$errmsg="";
}


if ( isset($errmsg) )
	{
		echo '<div id="contenu">' . $errmsg .'</div></body></html>';
		exit();
	}

?>

	<div id="contenu">
		<form id="formmail" action="sendmail.php" method="get" onsubmit="return dataListe('participants','dataParticipants');">
			<table>
				<tbody>
					<tr>
						<td>Contacts disponibles</td>
						<td>&nbsp;</td>
						<td>Destinataires</td>
					</tr>
					<tr>
						<td>
							<select name="contactDispo" size="10" id="contactDispo">
<?php
	$personnes = array();
	$req = 'SELECT P.idP , P.courrielP , P.nomP , P.prenomP FROM Personne P, Appartenir A WHERE P.idP=A.idP AND A.idL=' . $idL;
	$result = mysql_query($req) ;
	
	if (mysql_num_rows($result)>0)
	{
		for($i=0;$i<mysql_num_rows($result);$i++)
		{
			list($idP, $courrielP, $nomP, $prenomP) = mysql_fetch_array($result);
			$personnes[$idP]=array($courrielP, $nomP, $prenomP);
			echo '<option value="'.$idP.'"  onDblClick="addPers(this.form);">';
			echo $nomP . " " . $prenomP;
			echo "</option>\n";
		}
	}
?>
							</select>
						</td>
						<td>
							<input name="AjouterParticipant" id="AjouterParticipant" value="Ajouter" onclick="addPers(this.form);" type="button" />
							<br />
							<br />
							<input name="supprimerParticipant" id="supprimerParticipant" value="Retirer" onclick="removePers(this.form);" type="button" />
						</td>
						<td>
							<select name="participants" size="10" id="participants">
<?php
	foreach( $personnes as $idP=>$p)
	{
		if ( isset($_GET['mail_idP' . $idP] ) )
		{
			echo '<option value="'.$idP.'"  onDblClick="addPers(this.form);">';
			echo $p[1] . " " . $p[2];
			echo "</option>\n";
		}
	}
?>
							</select>
						</td>
					</tr>
				</tbody>
			</table>
			<div>
				Mod�le :&nbsp;
<?php
	echo '<select name="modelsList" id="modelsList" onchange="loadlist(\'include/ludo/mail_textarea.php?idR=';
	echo $idR . "&model=','modelsList','divMsg');\">\n";
?>
					<option value="empty">Vierge</option>
					<option value="cree">Nouvelle R�union</option>
					<option value="modif">R�union modifi�e</option>
					<option value="annul">R�union annul�e</option>
					<option value="fixee">R�union fix�e</option>
				</select>
			</div>
			<div>
				Objet :&nbsp;<input name="msgObject" type="text" size="40" value="AWOR : Courriel de notification" />
			<div id='divMsg'>
<?php include 'include/ludo/mail_textarea.php'; ?>
			</div>
			<div>
				<input name="envoi" type="hidden" value="1" />
				<input type="submit" value="Envoyer" />
			</div>
		</form>
	</div>
</body>
</html>