summaryrefslogtreecommitdiff
path: root/final/app/include/ludo/majDispo.php
blob: febd9c3c100be82939446ed03ac222acd0c741a7 (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
<?php
require('../connect.inc.php');
require('session_verify.inc.php');
require('fonctions.inc.php');

// TODO : v&eacute;rification que la r&eacute;union nous concerne bien !

if ( /*!isset($_GET['idR']) ||*/  !isset($_GET['idC']) ||  !isset($_GET['estDispo']) ||   !isset($_SESSION['session_idP']) )
{
	$errmsg="Param&egrave;tres incorrects\n";
}

if ( isset( $errmsg ) )
{
	// TODO
}
else
{
	$idR=addslashes($_GET['idR']);
	$idC=addslashes($_GET['idC']);
	$estDispo=addslashes($_GET['estDispo']);
	$idP=$_SESSION['session_idP'];
	
	$query="UPDATE AWOR_Choisir SET estDispo = '$estDispo' WHERE idC='$idC' AND idP='$idP'";
	$result = @mysql_query($query);
	if ( ! $result || ( mysql_affected_rows() !== 1 ) )
	{
		$query="INSERT INTO AWOR_Choisir(idC,idP,estDispo) VALUES ('$idC', '$idP', '$estDispo')";
		//echo "DEBUG :$query";
		$result = mysql_query($query);
		if ( ! $result || ( mysql_affected_rows() !== 1 ) )
		{
			echo "Erreur BD\n";
			return;
		}
	}
	generate_html_dispo_case($idR, $idP, $idC, true, $estDispo, false);
}
?>