Révision 00cab91c

b/index.php
187 187
				$jour_semaine = date("w", $ts3);
188 188
				$libOnClick = "";
189 189
				$libTitle = "";
190
				$day = "";
191 190
				if (($libFerie = jourFeries($ts3))) {
192 191
					$color = "gray";
193 192
					$libTitle = " title=\"$libFerie\"";
......
195 194
					$color = "lightgray";
196 195
				} else if (isset($conges[$nom]) && in_array($str_date, $conges[$nom])) {
197 196
					$color = "blue";
198
					$day = "congé";
199 197
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date', 'del')\"";
200 198
				} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
201
					$color = "blue";
202
					$day = "congé AP";
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 203
				} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom])) {
204
					$color = "blue";
205
					$day = "congé AM";
204
					$colorAM = "blue";
205
					$colorPM = "white";
206
					$libOnClickAM = " onClick=\"updateConges(this, '$nom', '$str_date AM', 'del')\"";
207
					$libOnClickPM = " onClick=\"updateConges(this, '$nom', '$str_date PM', 'add')\"";
206 208
				} else if (isset($conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
207
					$color = "blue";
208
					$day = "congé PM";
209
					$colorAM = "white";
210
					$colorPM = "blue";
211
					$libOnClickAM = " onClick=\"updateConges(this, '$nom', '$str_date AM', 'add')\"";
212
					$libOnClickPM = " onClick=\"updateConges(this, '$nom', '$str_date PM', 'del')\"";
209 213
				} else {
210 214
					$color = "white";
211 215
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date', 'add')\"";
212 216
				}
213 217
?>
214 218
<?php
215
				if ($day == "congé AM") {
219
				if (isset($conges[$nom]) && (in_array("$str_date AM", $conges[$nom]) || in_array("$str_date PM", $conges[$nom]))) {
216 220
?>
217
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM', 'del')">&nbsp;</td>
218
			<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM', 'add')">&nbsp;</td>
219
<?php 	} elseif ($day == "congé PM") { ?>
220
			<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM', 'add')">&nbsp;</td>
221
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM', 'del')">&nbsp;</td>
222
<?php 	} elseif ($day == "congé AP") { ?>
223
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM', 'del')">&nbsp;</td>
224
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM', 'del')">&nbsp;</td>
221
			<td style="cursor: pointer; background-color: <?=$colorAM?>"<?=$libOnClickAM?><?=$libTitle?>>&nbsp;</td>
222
			<td style="cursor: pointer; background-color: <?=$colorPM?>"<?=$libOnClickPM?><?=$libTitle?>>&nbsp;</td>
225 223
<?php 	} else {?>
226 224
			<td colspan="2" style="cursor: pointer; background-color: <?=$color?>"<?=$libOnClick?><?=$libTitle?>>&nbsp;</td>
227 225
<?php 	} ?>

Formats disponibles : Unified diff