Révision 3a9db70f
| b/index.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 | 2 |
/* |
| 3 |
* index.php - Visualisation des congés |
|
| 3 |
* index.php - Visualisation des congés |
|
| 4 | 4 |
* Copyright (C) 2011 Romuald DELAVERGNE <delavergne@free.fr> |
| 5 | 5 |
* |
| 6 | 6 |
* This source code is licensed under the GNU General Public License, |
| 7 | 7 |
* Version 2. See the file COPYING for more details. |
| 8 | 8 |
* |
| 9 |
* Le système de fichiers doit être au même encodage |
|
| 10 |
* que les chaîne de caractère de PHP (default_charset). |
|
| 9 |
* Le système de fichiers doit être au même encodage |
|
| 10 |
* que les chaîne de caractère de PHP (default_charset). |
|
| 11 | 11 |
*/ |
| 12 | 12 |
|
| 13 | 13 |
function getConges($path, &$employes, &$conges) {
|
| ... | ... | |
| 36 | 36 |
} |
| 37 | 37 |
fclose($fh); |
| 38 | 38 |
} else {
|
| 39 |
echo "ERROR d'écriture dans $path/$nom"; |
|
| 39 |
echo "ERROR d'écriture dans $path/$nom"; |
|
| 40 | 40 |
} |
| 41 | 41 |
} |
| 42 | 42 |
|
| ... | ... | |
| 74 | 74 |
break; |
| 75 | 75 |
case 'mois': |
| 76 | 76 |
case 'trimestre': |
| 77 |
case 'année': |
|
| 77 |
case 'année': |
|
| 78 | 78 |
$vue = $_GET['action']; |
| 79 | 79 |
break; |
| 80 | 80 |
} |
| ... | ... | |
| 94 | 94 |
<html> |
| 95 | 95 |
<head> |
| 96 | 96 |
<title>Gestion de congés</title> |
| 97 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
|
| 97 |
<meta http-equiv="Content-Type" content="text/html; charset=utf8" /> |
|
| 98 | 98 |
<meta http-equiv="Content-language" content="fr" /> |
| 99 |
<meta name="copyright" content="Tous droits réservés - All Rights Reserved" /> |
|
| 99 |
<meta name="copyright" content="Tous droits réservés - All Rights Reserved" /> |
|
| 100 | 100 |
<meta name="author" content="Romuald DELAVERGNE"> |
| 101 | 101 |
<script language=JavaScript> |
| 102 | 102 |
function updateConges(jour, nom, str_date) {
|
| ... | ... | |
| 138 | 138 |
<td align="right"><input type="submit" name="action" value=">>" /></td> |
| 139 | 139 |
</tr> |
| 140 | 140 |
<?php |
| 141 |
for ($v = 0; $v == 0 || ($vue == "trimestre" && $v < 3) || ($vue == "année" && $v < 12); $v++) {
|
|
| 141 |
for ($v = 0; $v == 0 || ($vue == "trimestre" && $v < 3) || ($vue == "année" && $v < 12); $v++) {
|
|
| 142 | 142 |
$ts2 = strtotime("+$v month", $ts);
|
| 143 | 143 |
$date_annee = date("Y", $ts2);
|
| 144 | 144 |
$date_mois = date("m", $ts2);
|
| ... | ... | |
| 168 | 168 |
$day = "we"; |
| 169 | 169 |
} else if (isset($conges[$nom]) && in_array($str_date, $conges[$nom])) {
|
| 170 | 170 |
$color = "blue"; |
| 171 |
$day = "congé"; |
|
| 171 |
$day = "congé"; |
|
| 172 | 172 |
} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
|
| 173 | 173 |
$color = "blue"; |
| 174 |
$day = "congé AP"; |
|
| 174 |
$day = "congé AP"; |
|
| 175 | 175 |
} else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom])) {
|
| 176 | 176 |
$color = "blue"; |
| 177 |
$day = "congé AM"; |
|
| 177 |
$day = "congé AM"; |
|
| 178 | 178 |
} else if (isset($conges[$nom]) && in_array("$str_date PM", $conges[$nom])) {
|
| 179 | 179 |
$color = "blue"; |
| 180 |
$day = "congé PM"; |
|
| 180 |
$day = "congé PM"; |
|
| 181 | 181 |
} else {
|
| 182 | 182 |
$color = "white"; |
| 183 |
$day = "ouvré"; |
|
| 183 |
$day = "ouvré"; |
|
| 184 | 184 |
} |
| 185 | 185 |
?> |
| 186 | 186 |
<?php |
| 187 |
if ($day == "congé AM") {
|
|
| 187 |
if ($day == "congé AM") {
|
|
| 188 | 188 |
?> |
| 189 | 189 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
| 190 | 190 |
<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
| 191 |
<?php } elseif ($day == "congé PM") { ?>
|
|
| 191 |
<?php } elseif ($day == "congé PM") { ?>
|
|
| 192 | 192 |
<td style="cursor: pointer; background-color: white" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
| 193 | 193 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
| 194 |
<?php } elseif ($day == "congé AP") { ?>
|
|
| 194 |
<?php } elseif ($day == "congé AP") { ?>
|
|
| 195 | 195 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> AM')"> </td> |
| 196 | 196 |
<td style="cursor: pointer; background-color: <?=$color?>" onClick="updateConges(this, '<?=$nom?>', '<?=$str_date?> PM')"> </td> |
| 197 | 197 |
<?php } else {?>
|
Formats disponibles : Unified diff