summaryrefslogtreecommitdiff
path: root/appli_3_alpha_old/popfixer.php
blob: 578e2fb83e508286c8b59b5f166e9c7df1a4d147 (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
<?php
	if (isset($_GET['idC']))
	{
		include ('include/connect.inc.php');
		echo '<h2>D&eacute;sirez-vous fixer ce cr&eacute;neau ?</h2>';
		echo '<div class="popup_contenu">';
		$result = mysql_query("SELECT UNIX_TIMESTAMP(dateHeure),duree FROM Creneau WHERE idC=".$_GET['idC']);
		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 'Le ' . date('d/m/y', $date_deb) . ' de ' . date('H:i', $date_deb)  . ' &agrave; ' . date('H:i', $date_fin);
			}
		}

		echo '<br/><br/>';
		//~ echo '<form id="formfixer" method="get" action="'.$_SERVER['PHP_SELF'].'">';
		echo '<form id="formfixer" method="get" action="">';
		echo '<input type="hidden" name="action" value="fixer_creneau" />';
		echo '<input type="hidden" name="idR" value="'.$_GET['idR'].'" />';
		echo '<input type="hidden" name="idC" value="'.$_GET['idC'].'" />';
		echo '<input type="submit" value="Valider"/>';
		echo '<input type="button" value="Annuler" onclick="popoff(\'popfixer\')"/>';
		echo '</form>';
		echo '</div>';
	}
	else
	{
		echo '<div class="popup_contenu">';
		echo 'Erreur - pas d\'identifiant de cr&eaneau !';
		echo '<form id="formfixer" method="get" action="">';
		echo '<input type="button" value="Fermer" onclick="popoff(\'popfixer\')"/>';
		echo '</form>';
		echo '</div>';
	}
?>