Révision 4b5c5da9

b/index.php
76 76
			$conges[$nom][] = $str_date.($demi_jour ? " $demi_jour" : "");
77 77
			setConges('datas', $nom, $conges);
78 78
		}
79
	} elseif ($_POST['action'] == 'delete') {
79
	} elseif ($_POST['action'] == 'del') {
80 80
		if ($conges[$nom] && in_array($str_date, $conges[$nom])) {
81 81
			$key = array_search($str_date, $conges[$nom]);
82 82
			unset($conges[$nom][$key]);
......
126 126
	<meta name="copyright" content="Tous droits réservés - All Rights Reserved" />
127 127
	<meta name="author" content="Romuald DELAVERGNE">
128 128
	<script language=JavaScript>
129
		function updateConges(jour, nom, str_date) {
130
			if (jour.style.backgroundColor == 'white') {
131
				//jour.style.backgroundColor='lightblue';
132
				document.forms["update"].action.value = 'add';
133
			} else {
134
				//jour.style.backgroundColor='white';
135
				document.forms["update"].action.value = 'delete';
136
			}
129
		function updateConges(jour, nom, str_date, action) {
130
			document.forms["update"].action.value = action;
137 131
			document.forms["update"].nom.value = nom;
138 132
			document.forms["update"].str_date.value = str_date;
139 133
			document.forms["update"].submit();
......
202 196
				} else if (isset($conges[$nom]) && in_array($str_date, $conges[$nom])) {
203 197
					$color = "blue";
204 198
					$day = "congé";
205
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date')\"";
199
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date', 'del')\"";
206 200
				} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
207 201
					$color = "blue";
208 202
					$day = "congé AP";
......
214 208
					$day = "congé PM";
215 209
				} else {
216 210
					$color = "white";
217
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date')\"";
211
					$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date', 'add')\"";
218 212
				}
219 213
?>
220 214
<?php
221 215
				if ($day == "congé AM") {
222 216
?>
223
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')">&nbsp;</td>
224
			<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')">&nbsp;</td>
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>
225 219
<?php 	} elseif ($day == "congé PM") { ?>
226
			<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')">&nbsp;</td>
227
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')">&nbsp;</td>
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>
228 222
<?php 	} elseif ($day == "congé AP") { ?>
229
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')">&nbsp;</td>
230
			<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')">&nbsp;</td>
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>
231 225
<?php 	} else {?>
232 226
			<td colspan="2" style="cursor: pointer; background-color: <?=$color?>"<?=$libOnClick?><?=$libTitle?>>&nbsp;</td>
233 227
<?php 	} ?>

Formats disponibles : Unified diff