Révision 179d8f27

b/index.php
73 73
	getConges("datas", $employes, $conges);
74 74
	if ($_POST['action'] == 'add') {
75 75
		if (!$conges[$nom] || !in_array($str_date, $conges[$nom])) {
76
			if ($conges[$nom]) {
77
				# On supprime l'autre demi-journée au cas où
78
				$key = array_search("$str_date AM", $conges[$nom]);
79
				if ($key !== FALSE) unset($conges[$nom][$key]);
80
				$key = array_search("$str_date PM", $conges[$nom]);
81
				if ($key !== FALSE) unset($conges[$nom][$key]);
82
			}
76 83
			$conges[$nom][] = $str_date.($demi_jour ? " $demi_jour" : "");
77 84
			setConges('datas', $nom, $conges);
78 85
		}
......
195 202
				} else if (isset($conges[$nom]) && in_array($str_date, $conges[$nom])) {
196 203
					$color = "blue";
197 204
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date', 'del')\"";
198
				} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
199
					$colorAM = "blue";
200
					$colorPM = "blue";
201
					$libOnClickAM = " onClick=\"updateConges(this, '$nom', '$str_date AM', 'del')\"";
202
					$libOnClickPM = " onClick=\"updateConges(this, '$nom', '$str_date PM', 'del')\"";
203 205
				} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom])) {
204 206
					$colorAM = "blue";
205 207
					$colorPM = "white";
206 208
					$libOnClickAM = " onClick=\"updateConges(this, '$nom', '$str_date AM', 'del')\"";
207
					$libOnClickPM = " onClick=\"updateConges(this, '$nom', '$str_date PM', 'add')\"";
209
					$libOnClickPM = " onClick=\"updateConges(this, '$nom', '$str_date', 'add')\"";
208 210
				} else if (isset($conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
209 211
					$colorAM = "white";
210 212
					$colorPM = "blue";
211
					$libOnClickAM = " onClick=\"updateConges(this, '$nom', '$str_date AM', 'add')\"";
213
					$libOnClickAM = " onClick=\"updateConges(this, '$nom', '$str_date', 'add')\"";
212 214
					$libOnClickPM = " onClick=\"updateConges(this, '$nom', '$str_date PM', 'del')\"";
213 215
				} else {
214 216
					$color = "white";

Formats disponibles : Unified diff