Révision dfb6ddbf
b/index.php | ||
---|---|---|
10 | 10 |
* que les chaîne de caractère de PHP (default_charset). |
11 | 11 |
*/ |
12 | 12 |
|
13 |
function jourFeries($ts) { |
|
14 |
$annee = date("Y", $ts); |
|
15 |
$mois = date("m", $ts); |
|
16 |
$jour = date("d", $ts); |
|
17 |
if ($mois == "01" && $jour == "01") return "jour de l'an"; |
|
18 |
if ($mois == "05" && $jour == "01") return "fête du travail"; |
|
19 |
if ($mois == "05" && $jour == "08") return "victoire 1945"; |
|
20 |
if ($mois == "07" && $jour == "14") return "fête Nationale"; |
|
21 |
if ($mois == "08" && $jour == "15") return "l'Assomption"; |
|
22 |
if ($mois == "11" && $jour == "01") return "la Toussaint"; |
|
23 |
if ($mois == "11" && $jour == "11") return "armistice 1918"; |
|
24 |
if ($mois == "12" && $jour == "25") return "Noël"; |
|
25 |
$tsPaques = easter_date($annee); |
|
26 |
if ($mois == date("m", $tsPaques) && $jour == date("d", $tsPaques)) return "Pâques"; |
|
27 |
$ts = strtotime("-7 days", $tsPaques); |
|
28 |
if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "les Rameaux"; |
|
29 |
$ts = strtotime("+1 day", $tsPaques); |
|
30 |
if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "lundi de Pâques"; |
|
31 |
$ts = strtotime("+39 days", $tsPaques); |
|
32 |
if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "l'Ascension"; |
|
33 |
$ts = strtotime("+49 days", $tsPaques); |
|
34 |
if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "la Pentecôte"; |
|
35 |
$ts = strtotime("+50 days", $tsPaques); |
|
36 |
if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "lundi de Pentecôte"; |
|
37 |
return ""; |
|
38 |
} |
|
39 |
|
|
13 | 40 |
function getConges($path, &$employes, &$conges) { |
14 | 41 |
$employes = array(); |
15 | 42 |
$conges = array(); |
... | ... | |
162 | 189 |
<?php for ($n = 1; $n <= $nb_jours; $n++) { |
163 | 190 |
$date_jour = sprintf("%02d", $n); |
164 | 191 |
$str_date = "$date_annee/$date_mois/$date_jour"; |
165 |
$jour_semaine = date("w", strtotime($str_date)); |
|
166 |
if ($jour_semaine == 0 || $jour_semaine == 6) { |
|
192 |
$ts3 = strtotime($str_date); |
|
193 |
$jour_semaine = date("w", $ts3); |
|
194 |
$libOnClick = ""; |
|
195 |
$libTitle = ""; |
|
196 |
$day = ""; |
|
197 |
if (($libFerie = jourFeries($ts3))) { |
|
198 |
$color = "gray"; |
|
199 |
$libTitle = " title=\"$libFerie\""; |
|
200 |
} elseif ($jour_semaine == 0 || $jour_semaine == 6) { |
|
167 | 201 |
$color = "lightgray"; |
168 |
$day = "we"; |
|
169 | 202 |
} else if (isset($conges[$nom]) && in_array($str_date, $conges[$nom])) { |
170 | 203 |
$color = "blue"; |
171 | 204 |
$day = "congé"; |
205 |
$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date')\""; |
|
172 | 206 |
} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom]) && in_array("$str_date PM", $conges[$nom])) { |
173 | 207 |
$color = "blue"; |
174 | 208 |
$day = "congé AP"; |
... | ... | |
180 | 214 |
$day = "congé PM"; |
181 | 215 |
} else { |
182 | 216 |
$color = "white"; |
183 |
$day = "ouvré"; |
|
217 |
$libOnClick = " onClick=\"updateConges(this, '$nom', '$str_date')\""; |
|
184 | 218 |
} |
185 | 219 |
?> |
186 | 220 |
<?php |
187 | 221 |
if ($day == "congé AM") { |
188 | 222 |
?> |
189 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
|
190 |
<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
|
223 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
|
224 |
<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
|
191 | 225 |
<?php } elseif ($day == "congé PM") { ?> |
192 |
<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
|
193 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
|
226 |
<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
|
227 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
|
194 | 228 |
<?php } elseif ($day == "congé AP") { ?> |
195 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
|
196 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
|
229 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
|
230 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
|
197 | 231 |
<?php } else {?> |
198 |
<td colspan="2" style="cursor: pointer; background-color: <?=$color?>"<?=($day == "we") ? "" : " onClick=\"updateConges(this, '$nom', '$str_date')\""?>> </td> |
|
232 |
<td colspan="2" style="cursor: pointer; background-color: <?=$color?>"<?=$libOnClick?><?=$libTitle?>> </td> |
|
199 | 233 |
<?php } ?> |
200 | 234 |
<?php } ?> |
201 | 235 |
</tr> |
Formats disponibles : Unified diff