summaryrefslogtreecommitdiff
path: root/maquette/popcreneau.php
blob: 8202d7e4875b8a9e1686c20c5bf4fa9baacbf212 (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
<?php
	if (isset($_GET['idR']))
	{
		include ('connect.inc.php');
		echo '<h2>Cr&eacute;neaux de la r&eacute;union </h2>';
		echo '<div class="popup_contenu">';
		echo '<form id="formcreneau" method="get" action="'.$_GLOBAL['php_self'].'" onsubmit="return dataListe(\'creneaux\',\'dataCreneaux\');">';
		echo '<table>';
		echo '<tr>';
		echo '<td>Cr&eacute;er un cr&eacute;neau </td>';
		echo '<td>&nbsp;</td>';
		echo '<td>Cr&eacute;neaux</td>';
		echo '</tr>';
		echo '<tr>';
		echo '<td>Date : ';
		echo '<select name="day">';
		for ($i=1;$i<=31;$i++) {$i = "0$i";	$i = substr($i,-2);	echo "<option value=\"$i\">$i</option>"; }
		echo '</select>/';
		echo '<select name="month">';
		for ($i=1;$i<=12;$i++) {$i = "0$i";	$i = substr($i,-2);	echo "<option value=\"$i\">$i</option>"; }
		echo '</select>/';
		echo '<select name="year">';
		for ($i=date('Y');$i<=((int)date('Y')+4);$i++) echo "<option value=\"$i\">$i</option>";
		echo '</select><br />D&eacute;but : ';
		echo '<select name="hourStart">';
		for ($i=0;$i<=23;$i++) {$i = "0$i";	$i = substr($i,-2);	echo "<option value=\"$i\">$i</option>"; }
		echo '</select>:';
		echo '<select name="minuteStart">';
		for ($i=0;$i<=59;$i++) {$i = "0$i";	$i = substr($i,-2);	echo "<option value=\"$i\">$i</option>"; }
		echo '</select><br />Fin : ';
		echo '<select name="hourEnd">';
		for ($i=0;$i<=23;$i++) {$i = "0$i";	$i = substr($i,-2);	echo "<option value=\"$i\">$i</option>"; }
		echo '</select>:';
		echo '<select name="minuteEnd">';
		for ($i=0;$i<=59;$i++) {$i = "0$i";	$i = substr($i,-2);	echo "<option value=\"$i\">$i</option>"; }
		echo '</select></td>';
		echo '<td><input name="AjouterCreneau" type="button" value="Ajouter" onclick="addcreneau(this.form);"/><br/><br/>';
		echo '<input name="supprimerCreneau" type="button" value="Retirer" onclick="removecreneau(this.form);"/></td>';
		echo '<td><select name="creneaux" size="10" id="creneaux">';
		
		$result = mysql_query("SELECT UNIX_TIMESTAMP(dateHeure),duree FROM Creneau WHERE idR=".$_GET['idR']);
		if (mysql_num_rows($result)>0)
		{
			for($i=0;$i<mysql_num_rows($result);$i++)
			{
				$row = mysql_fetch_array($result);
				$date_deb =$row[0]; 
				$date_fin = $date_deb + 60 * $row[1];
				echo '<option>' . date('H:i',$date_deb) . ' -&gt; ' . date('H:i',$date_fin)  . ' ' . date('d/m/Y',$date_deb);
			}
		}

		echo '</select></td></tr></table><br/>';
		echo '<input type="hidden" id="dataCreneaux" name="dataCreneaux" />';
		echo '<input type="submit" value="Valider" name="action" /><input type="button" value="Fermer" onclick="popoff(\'popcreneau\')"/>';
		echo '</form>';
		echo '</div>';
	}
	else
	{
		echo '<div class="popup_contenu">';
		echo 'Erreur - pas d\'identifiant de r&eacute;union !';
		echo '<form id="formcreneau" method="get" action="'.$_GLOBAL['php_self'].'">';
		echo '<input type="button" value="Fermer" onclick="popoff(\'popcreneau\')"/>';
		echo '</form>';
		echo '</div>';
	}
?>