root / index.php @ 3c8d56df813da36723d1f595835f49c5b4486d6e
Historique | Voir | Annoter | Télécharger (11,23 ko)
| 1 | 52a3c866 | Romuald | <?php
|
|---|---|---|---|
| 2 | 52a3c866 | Romuald | /*
|
| 3 | 3a9db70f | Romuald | * index.php - Visualisation des congés |
| 4 | 52a3c866 | Romuald | * Copyright (C) 2011 Romuald DELAVERGNE <delavergne@free.fr> |
| 5 | 52a3c866 | Romuald | * |
| 6 | 52a3c866 | Romuald | * This source code is licensed under the GNU General Public License, |
| 7 | 52a3c866 | Romuald | * Version 2. See the file COPYING for more details. |
| 8 | e464d4d0 | Romuald | * |
| 9 | 3a9db70f | Romuald | * Le système de fichiers doit être au même encodage |
| 10 | 8a3773db | Romuald | * que les chaînes de caractères de PHP (default_charset). |
| 11 | 52a3c866 | Romuald | */ |
| 12 | 52a3c866 | Romuald | |
| 13 | dfb6ddbf | Romuald | function jourFeries($ts) { |
| 14 | dfb6ddbf | Romuald | $annee = date("Y", $ts); |
| 15 | dfb6ddbf | Romuald | $mois = date("m", $ts); |
| 16 | dfb6ddbf | Romuald | $jour = date("d", $ts); |
| 17 | dfb6ddbf | Romuald | if ($mois == "01" && $jour == "01") return "jour de l'an"; |
| 18 | dfb6ddbf | Romuald | if ($mois == "05" && $jour == "01") return "fête du travail"; |
| 19 | dfb6ddbf | Romuald | if ($mois == "05" && $jour == "08") return "victoire 1945"; |
| 20 | dfb6ddbf | Romuald | if ($mois == "07" && $jour == "14") return "fête Nationale"; |
| 21 | dfb6ddbf | Romuald | if ($mois == "08" && $jour == "15") return "l'Assomption"; |
| 22 | dfb6ddbf | Romuald | if ($mois == "11" && $jour == "01") return "la Toussaint"; |
| 23 | dfb6ddbf | Romuald | if ($mois == "11" && $jour == "11") return "armistice 1918"; |
| 24 | dfb6ddbf | Romuald | if ($mois == "12" && $jour == "25") return "Noël"; |
| 25 | dfb6ddbf | Romuald | $tsPaques = easter_date($annee); |
| 26 | dfb6ddbf | Romuald | if ($mois == date("m", $tsPaques) && $jour == date("d", $tsPaques)) return "Pâques"; |
| 27 | dfb6ddbf | Romuald | $ts = strtotime("-7 days", $tsPaques); |
| 28 | dfb6ddbf | Romuald | if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "les Rameaux"; |
| 29 | dfb6ddbf | Romuald | $ts = strtotime("+1 day", $tsPaques); |
| 30 | dfb6ddbf | Romuald | if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "lundi de Pâques"; |
| 31 | dfb6ddbf | Romuald | $ts = strtotime("+39 days", $tsPaques); |
| 32 | dfb6ddbf | Romuald | if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "l'Ascension"; |
| 33 | dfb6ddbf | Romuald | $ts = strtotime("+49 days", $tsPaques); |
| 34 | dfb6ddbf | Romuald | if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "la Pentecôte"; |
| 35 | dfb6ddbf | Romuald | $ts = strtotime("+50 days", $tsPaques); |
| 36 | dfb6ddbf | Romuald | if ($mois == date("m", $ts) && $jour == date("d", $ts)) return "lundi de Pentecôte"; |
| 37 | dfb6ddbf | Romuald | return ""; |
| 38 | dfb6ddbf | Romuald | } |
| 39 | dfb6ddbf | Romuald | |
| 40 | 52a3c866 | Romuald | function getConges($path, &$employes, &$conges) { |
| 41 | 52a3c866 | Romuald | $employes = array(); |
| 42 | 52a3c866 | Romuald | $conges = array(); |
| 43 | 52a3c866 | Romuald | if ($dir = opendir($path)) { |
| 44 | 52a3c866 | Romuald | while (($file = readdir($dir)) !== FALSE) { |
| 45 | 52a3c866 | Romuald | if (is_file("$path/$file")) { |
| 46 | e464d4d0 | Romuald | $employes[] = $file; |
| 47 | 52a3c866 | Romuald | $dates = file("$path/$file"); |
| 48 | 52a3c866 | Romuald | foreach ($dates as $date) $conges[$file][] = rtrim($date); |
| 49 | 52a3c866 | Romuald | } |
| 50 | 52a3c866 | Romuald | } |
| 51 | 52a3c866 | Romuald | closedir($dir); |
| 52 | 52a3c866 | Romuald | } |
| 53 | 52a3c866 | Romuald | } |
| 54 | 52a3c866 | Romuald | |
| 55 | 52a3c866 | Romuald | function setConges($path, $nom, $conges) { |
| 56 | 52a3c866 | Romuald | $fh = @fopen("$path/$nom", 'w'); |
| 57 | 52a3c866 | Romuald | if ($fh) { |
| 58 | 52a3c866 | Romuald | if ($conges[$nom]) { |
| 59 | 52a3c866 | Romuald | asort($conges[$nom]); |
| 60 | 52a3c866 | Romuald | foreach ($conges[$nom] as $str_date) { |
| 61 | 52a3c866 | Romuald | fwrite($fh, "$str_date\n"); |
| 62 | 52a3c866 | Romuald | } |
| 63 | 52a3c866 | Romuald | } |
| 64 | 52a3c866 | Romuald | fclose($fh); |
| 65 | 52a3c866 | Romuald | } else {
|
| 66 | 3a9db70f | Romuald | echo "ERROR d'écriture dans $path/$nom"; |
| 67 | 52a3c866 | Romuald | } |
| 68 | 52a3c866 | Romuald | } |
| 69 | 52a3c866 | Romuald | |
| 70 | 52a3c866 | Romuald | $str_date = $_POST['str_date']; |
| 71 | 52a3c866 | Romuald | $nom = $_POST['nom']; |
| 72 | 52a3c866 | Romuald | getConges("datas", $employes, $conges); |
| 73 | 52a3c866 | Romuald | if ($_POST['action'] == 'add') { |
| 74 | 52a3c866 | Romuald | if (!$conges[$nom] || !in_array($str_date, $conges[$nom])) { |
| 75 | 179d8f27 | Romuald | if ($conges[$nom]) { |
| 76 | 179d8f27 | Romuald | # On supprime l'autre demi-journée au cas où
|
| 77 | 179d8f27 | Romuald | $key = array_search("$str_date AM", $conges[$nom]); |
| 78 | 179d8f27 | Romuald | if ($key !== FALSE) unset($conges[$nom][$key]); |
| 79 | 179d8f27 | Romuald | $key = array_search("$str_date PM", $conges[$nom]); |
| 80 | 179d8f27 | Romuald | if ($key !== FALSE) unset($conges[$nom][$key]); |
| 81 | 179d8f27 | Romuald | } |
| 82 | 3d5328c4 | Romuald | $conges[$nom][] = $str_date; |
| 83 | 52a3c866 | Romuald | setConges('datas', $nom, $conges); |
| 84 | 52a3c866 | Romuald | } |
| 85 | 4b5c5da9 | Romuald | } elseif ($_POST['action'] == 'del') { |
| 86 | 52a3c866 | Romuald | if ($conges[$nom] && in_array($str_date, $conges[$nom])) { |
| 87 | 52a3c866 | Romuald | $key = array_search($str_date, $conges[$nom]); |
| 88 | 52a3c866 | Romuald | unset($conges[$nom][$key]); |
| 89 | 52a3c866 | Romuald | setConges('datas', $nom, $conges); |
| 90 | 52a3c866 | Romuald | } |
| 91 | 52a3c866 | Romuald | } |
| 92 | 52a3c866 | Romuald | |
| 93 | 30d9bfc1 | Romuald | $tsNow = time(); |
| 94 | 30d9bfc1 | Romuald | $dateNow = date("Y/m/d", $tsNow); |
| 95 | 30d9bfc1 | Romuald | |
| 96 | 52a3c866 | Romuald | $vue = $_GET['vue']; |
| 97 | 0acd1792 | Romuald | if (!$vue) $vue = "mois"; |
| 98 | 0acd1792 | Romuald | |
| 99 | 0acd1792 | Romuald | $dateCurrent = $_GET['date']; |
| 100 | 0acd1792 | Romuald | if (!$dateCurrent) { |
| 101 | 0acd1792 | Romuald | $tsCurrent = strtotime(date("Y/m/01", $tsNow)); |
| 102 | 52a3c866 | Romuald | } else {
|
| 103 | 0acd1792 | Romuald | $tsCurrent = strtotime(date("Y/m/01", strtotime($dateCurrent))); |
| 104 | 52a3c866 | Romuald | } |
| 105 | 52a3c866 | Romuald | |
| 106 | 52a3c866 | Romuald | switch ($_GET['action']) { |
| 107 | 52a3c866 | Romuald | case '<<': |
| 108 | 0acd1792 | Romuald | $tsCurrent = strtotime("-1 month", $tsCurrent); |
| 109 | 52a3c866 | Romuald | break;
|
| 110 | 52a3c866 | Romuald | case '>>': |
| 111 | 0acd1792 | Romuald | $tsCurrent = strtotime("+1 month", $tsCurrent); |
| 112 | 52a3c866 | Romuald | break;
|
| 113 | 52a3c866 | Romuald | } |
| 114 | 52a3c866 | Romuald | |
| 115 | 0acd1792 | Romuald | switch ($vue) { |
| 116 | 0acd1792 | Romuald | case "trimestre": |
| 117 | 41e59592 | Romuald | $nbMois = 3; |
| 118 | 0acd1792 | Romuald | $dateDeb = date("Y/m/01", strtotime("-1 month", $tsCurrent)); |
| 119 | 0acd1792 | Romuald | break;
|
| 120 | 0acd1792 | Romuald | case "année": |
| 121 | 41e59592 | Romuald | $nbMois = 12; |
| 122 | 0acd1792 | Romuald | $dateDeb = date("Y/01/01", $tsCurrent); |
| 123 | 0acd1792 | Romuald | break;
|
| 124 | 0acd1792 | Romuald | case "mois": |
| 125 | 0acd1792 | Romuald | default:
|
| 126 | 41e59592 | Romuald | $nbMois = 1; |
| 127 | 0acd1792 | Romuald | $dateDeb = date("Y/m/01", $tsCurrent); |
| 128 | 0acd1792 | Romuald | break;
|
| 129 | 0acd1792 | Romuald | } |
| 130 | 0acd1792 | Romuald | $dateCurrent = date("Y/m/d", $tsCurrent); |
| 131 | 52a3c866 | Romuald | |
| 132 | 52a3c866 | Romuald | /*
|
| 133 | 52a3c866 | Romuald | echo "<pre>\n"; |
| 134 | 52a3c866 | Romuald | print_r($_POST); |
| 135 | 52a3c866 | Romuald | //print_r($employes); |
| 136 | 52a3c866 | Romuald | print_r($conges); |
| 137 | 52a3c866 | Romuald | echo "</pre>\n"; |
| 138 | 52a3c866 | Romuald | */ |
| 139 | 52a3c866 | Romuald | |
| 140 | 52a3c866 | Romuald | ?>
|
| 141 | 52a3c866 | Romuald | <html>
|
| 142 | 52a3c866 | Romuald | <head>
|
| 143 | e464d4d0 | Romuald | <title>Gestion de congés</title> |
| 144 | 76029821 | Romuald | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 145 | 52a3c866 | Romuald | <meta http-equiv="Content-language" content="fr" /> |
| 146 | 3a9db70f | Romuald | <meta name="copyright" content="Tous droits réservés - All Rights Reserved" /> |
| 147 | 52a3c866 | Romuald | <meta name="author" content="Romuald DELAVERGNE"> |
| 148 | 3d5328c4 | Romuald | <style type="text/css"> |
| 149 | 46a8277f | Romuald | a.button:link, a.button:visited {
|
| 150 | 46a8277f | Romuald | float: left; |
| 151 | 46a8277f | Romuald | padding: 2px; |
| 152 | 46a8277f | Romuald | width: 50px; |
| 153 | 46a8277f | Romuald | border-top: 1px solid #cccccc; |
| 154 | 46a8277f | Romuald | border-bottom: 1px solid black; |
| 155 | 46a8277f | Romuald | border-left: 1px solid #cccccc; |
| 156 | 46a8277f | Romuald | border-right: 1px solid black; |
| 157 | 46a8277f | Romuald | background: #cccccc; |
| 158 | 46a8277f | Romuald | text-align: center; |
| 159 | 46a8277f | Romuald | text-decoration: none; |
| 160 | 46a8277f | Romuald | color: black; |
| 161 | 46a8277f | Romuald | } |
| 162 | 46a8277f | Romuald | |
| 163 | 46a8277f | Romuald | a.button:hover {
|
| 164 | 46a8277f | Romuald | background: #eeeeee; |
| 165 | 46a8277f | Romuald | } |
| 166 | 46a8277f | Romuald | |
| 167 | 46a8277f | Romuald | a.button:active {
|
| 168 | 46a8277f | Romuald | border-bottom: 1px solid #eeeeee; |
| 169 | 46a8277f | Romuald | border-top: 1px solid black; |
| 170 | 46a8277f | Romuald | border-right: 1px solid #eeeeee; |
| 171 | 46a8277f | Romuald | border-left: 1px solid black; |
| 172 | 46a8277f | Romuald | } |
| 173 | 46a8277f | Romuald | |
| 174 | b644c0cf | Romuald | a.popupmenu {
|
| 175 | 3d5328c4 | Romuald | display: block; |
| 176 | 3d5328c4 | Romuald | width: 100%; |
| 177 | 3d5328c4 | Romuald | background-color: white; |
| 178 | 3d5328c4 | Romuald | color: black; |
| 179 | 3d5328c4 | Romuald | text-decoration: none; |
| 180 | 3d5328c4 | Romuald | text-align: center; |
| 181 | 3d5328c4 | Romuald | font-family: Arial, Helvetica, sans-serif; |
| 182 | 3d5328c4 | Romuald | font-weight: bold; |
| 183 | 3d5328c4 | Romuald | cursor: pointer; |
| 184 | 3d5328c4 | Romuald | } |
| 185 | b644c0cf | Romuald | a.popupmenu:hover {
|
| 186 | 3d5328c4 | Romuald | background-color: gray; |
| 187 | 3d5328c4 | Romuald | color: white; |
| 188 | 3d5328c4 | Romuald | } |
| 189 | 3d5328c4 | Romuald | </style>
|
| 190 | 52a3c866 | Romuald | <script language=JavaScript> |
| 191 | 3d5328c4 | Romuald | var ie = document.all; |
| 192 | 3d5328c4 | Romuald | var ns6 = document.getElementById&&!document.all; |
| 193 | 3d5328c4 | Romuald | var isMenu = false; |
| 194 | 3d5328c4 | Romuald | var overpopupmenu = false; |
| 195 | 3d5328c4 | Romuald | var selectNom = ''; |
| 196 | 3d5328c4 | Romuald | var selectDate = ''; |
| 197 | 3d5328c4 | Romuald | |
| 198 | 3d5328c4 | Romuald | function $(id) {
|
| 199 | 3d5328c4 | Romuald | return document.getElementById(id); |
| 200 | 3d5328c4 | Romuald | } |
| 201 | 3d5328c4 | Romuald | |
| 202 | 3d5328c4 | Romuald | function updateConges(nom, str_date, action) {
|
| 203 | 4b5c5da9 | Romuald | document.forms["update"].action.value = action; |
| 204 | 52a3c866 | Romuald | document.forms["update"].nom.value = nom; |
| 205 | 52a3c866 | Romuald | document.forms["update"].str_date.value = str_date; |
| 206 | 52a3c866 | Romuald | document.forms["update"].submit(); |
| 207 | 52a3c866 | Romuald | } |
| 208 | 3d5328c4 | Romuald | |
| 209 | 3d5328c4 | Romuald | function mouseSelect(e) {
|
| 210 | 8ce53449 | Romuald | var evt = e || window.event; |
| 211 | 8ce53449 | Romuald | var obj = ns6 ? evt.target.parentNode : evt.srcElement.parentElement; |
| 212 | 3d5328c4 | Romuald | if (isMenu) {
|
| 213 | 3d5328c4 | Romuald | if (overpopupmenu == false) {
|
| 214 | 3d5328c4 | Romuald | isMenu = false; |
| 215 | 3d5328c4 | Romuald | overpopupmenu = false; |
| 216 | 3d5328c4 | Romuald | $('popupMenu').style.display = "none";
|
| 217 | 3d5328c4 | Romuald | if (obj.id == 'AM' || obj.id == 'PM' ) {
|
| 218 | 3d5328c4 | Romuald | updateConges(selectNom, selectDate+' '+obj.id, 'add'); |
| 219 | 3d5328c4 | Romuald | } |
| 220 | 3d5328c4 | Romuald | selectNom = ''; |
| 221 | 3d5328c4 | Romuald | selectDate = ''; |
| 222 | 3d5328c4 | Romuald | return true; |
| 223 | 3d5328c4 | Romuald | } |
| 224 | 3d5328c4 | Romuald | return true; |
| 225 | 3d5328c4 | Romuald | } |
| 226 | 3d5328c4 | Romuald | return false; |
| 227 | 3d5328c4 | Romuald | } |
| 228 | 3d5328c4 | Romuald | |
| 229 | 3d5328c4 | Romuald | function ItemSelMenu(e, nom, strDate) {
|
| 230 | 8ce53449 | Romuald | var evt = e || window.event; |
| 231 | 8ce53449 | Romuald | var obj = ns6 ? evt.target : evt.srcElement; |
| 232 | 8ce53449 | Romuald | if (obj.className != 'menu') return false; |
| 233 | 3d5328c4 | Romuald | if (ns6) {
|
| 234 | 8ce53449 | Romuald | $('popupMenu').style.left = evt.clientX+document.body.scrollLeft;
|
| 235 | 8ce53449 | Romuald | $('popupMenu').style.top = evt.clientY+document.body.scrollTop;
|
| 236 | 3d5328c4 | Romuald | } else {
|
| 237 | 3d5328c4 | Romuald | $('popupMenu').style.pixelLeft = event.clientX + document.body.scrollLeft;
|
| 238 | 3d5328c4 | Romuald | $('popupMenu').style.pixelTop = event.clientY + document.body.scrollTop;
|
| 239 | 3d5328c4 | Romuald | } |
| 240 | 3d5328c4 | Romuald | $('popupMenu').style.display = "";
|
| 241 | 3d5328c4 | Romuald | $('AM').style.backgroundColor = 'white';
|
| 242 | 3d5328c4 | Romuald | $('PM').style.backgroundColor = 'white';
|
| 243 | 3d5328c4 | Romuald | $('annuler').style.backgroundColor = 'white';
|
| 244 | 3d5328c4 | Romuald | isMenu = true; |
| 245 | 3d5328c4 | Romuald | selectNom = nom; |
| 246 | 3d5328c4 | Romuald | selectDate = strDate; |
| 247 | 3d5328c4 | Romuald | return false; |
| 248 | 3d5328c4 | Romuald | } |
| 249 | 3d5328c4 | Romuald | |
| 250 | 3d5328c4 | Romuald | document.onmousedown = mouseSelect; |
| 251 | 52a3c866 | Romuald | </script>
|
| 252 | 52a3c866 | Romuald | </head>
|
| 253 | 52a3c866 | Romuald | <html>
|
| 254 | 52a3c866 | Romuald | <body>
|
| 255 | 52a3c866 | Romuald | <form id="update" method="post"> |
| 256 | 52a3c866 | Romuald | <input type="hidden" name="nom" value="" /> |
| 257 | 52a3c866 | Romuald | <input type="hidden" name="str_date" value="" /> |
| 258 | 52a3c866 | Romuald | <input type="hidden" name="action" value="" /> |
| 259 | 52a3c866 | Romuald | </form>
|
| 260 | 52a3c866 | Romuald | <table>
|
| 261 | 52a3c866 | Romuald | <tr>
|
| 262 | 41e59592 | Romuald | <td><a class="button" title="<?=$vue?> précédent<?=$vue=="année" ? "e" : ""?>" href="?date=<?=date("Y/m/01", strtotime("-$nbMois month", $tsCurrent))?>&vue=<?=$vue?>"><<</a></td> |
| 263 | 52a3c866 | Romuald | <td align="center"> |
| 264 | c882c2d0 | Romuald | <a title="mois courant" href="?date=<?=$dateCurrent?>&vue=mois">mois</a> | |
| 265 | c882c2d0 | Romuald | <a title="mois autour du mois courant" href="?date=<?=$dateCurrent?>&vue=trimestre">trimestre</a> | |
| 266 | c882c2d0 | Romuald | <a title="année courante" href="?date=<?=$dateCurrent?>&vue=année">année</a> |
| 267 | 41e59592 | Romuald | <td><a class="button" title="<?=$vue?> suivant<?=$vue=="année" ? "e" : ""?>" style="float: right" href="?date=<?=date("Y/m/01", strtotime("+$nbMois month", $tsCurrent))?>&vue=<?=$vue?>">>></a></td> |
| 268 | 52a3c866 | Romuald | </tr>
|
| 269 | 52a3c866 | Romuald | <?php
|
| 270 | 41e59592 | Romuald | for ($v = 0; $v < $nbMois; $v++) { |
| 271 | 0acd1792 | Romuald | $ts = strtotime("+$v month", strtotime($dateDeb)); |
| 272 | 0acd1792 | Romuald | $date_annee = date("Y", $ts); |
| 273 | 0acd1792 | Romuald | $date_mois = date("m", $ts); |
| 274 | 3c8d56df | Romuald | setlocale(LC_TIME, "fr_FR.UTF8"); |
| 275 | 3c8d56df | Romuald | $nom_mois = strftime("%B", $ts); |
| 276 | 0acd1792 | Romuald | $nb_jours = date("t", $ts); |
| 277 | 52a3c866 | Romuald | ?>
|
| 278 | 52a3c866 | Romuald | <tr><td colspan="3"> |
| 279 | 52a3c866 | Romuald | <table border="1" width="100%"> |
| 280 | 52a3c866 | Romuald | <tr>
|
| 281 | 52a3c866 | Romuald | <th rowspan="2"> </th> |
| 282 | 81df0456 | Romuald | <th colspan="<?=2*$nb_jours?>" align="center"><a href="?date=<?=$date_annee?>/<?=$date_mois?>/01&vue=<?=$vue?>"><?=$nom_mois?> <?=$date_annee?></a></th> |
| 283 | 52a3c866 | Romuald | </tr>
|
| 284 | 52a3c866 | Romuald | <tr>
|
| 285 | 30d9bfc1 | Romuald | <?php for ($n = 1; $n <= $nb_jours; $n++) { |
| 286 | 30d9bfc1 | Romuald | $date_jour = sprintf("%02d", $n); |
| 287 | 30d9bfc1 | Romuald | $str_date = "$date_annee/$date_mois/$date_jour"; |
| 288 | 30d9bfc1 | Romuald | $bgColor = ($str_date == $dateNow) ? "red" : "white"; |
| 289 | 30d9bfc1 | Romuald | ?>
|
| 290 | 30d9bfc1 | Romuald | <th colspan="2" bgcolor="<?=$bgColor?>"><?=$date_jour?></th> |
| 291 | 52a3c866 | Romuald | <?php } ?> |
| 292 | 52a3c866 | Romuald | </tr>
|
| 293 | 52a3c866 | Romuald | <?php foreach ($employes as $nom) { ?> |
| 294 | 52a3c866 | Romuald | <tr>
|
| 295 | 52a3c866 | Romuald | <td align="right"><?=$nom?></td> |
| 296 | 52a3c866 | Romuald | <?php for ($n = 1; $n <= $nb_jours; $n++) { |
| 297 | 52a3c866 | Romuald | $date_jour = sprintf("%02d", $n); |
| 298 | 52a3c866 | Romuald | $str_date = "$date_annee/$date_mois/$date_jour"; |
| 299 | dfb6ddbf | Romuald | $ts3 = strtotime($str_date); |
| 300 | dfb6ddbf | Romuald | $jour_semaine = date("w", $ts3); |
| 301 | dfb6ddbf | Romuald | $libOnClick = ""; |
| 302 | dfb6ddbf | Romuald | $libTitle = ""; |
| 303 | 3d5328c4 | Romuald | $menu = ""; |
| 304 | dfb6ddbf | Romuald | if (($libFerie = jourFeries($ts3))) { |
| 305 | dfb6ddbf | Romuald | $color = "gray"; |
| 306 | dfb6ddbf | Romuald | $libTitle = " title=\"$libFerie\""; |
| 307 | dfb6ddbf | Romuald | } elseif ($jour_semaine == 0 || $jour_semaine == 6) { |
| 308 | 52a3c866 | Romuald | $color = "lightgray"; |
| 309 | 52a3c866 | Romuald | } else if (isset($conges[$nom]) && in_array($str_date, $conges[$nom])) { |
| 310 | 52a3c866 | Romuald | $color = "blue"; |
| 311 | 3d5328c4 | Romuald | $libOnClick = " onClick=\"updateConges('$nom', '$str_date', 'del')\""; |
| 312 | a92b1e97 | Romuald | } else if (isset($conges[$nom]) && in_array("$str_date AM", $conges[$nom])) { |
| 313 | 00cab91c | Romuald | $colorAM = "blue"; |
| 314 | 00cab91c | Romuald | $colorPM = "white"; |
| 315 | 3d5328c4 | Romuald | $libOnClickAM = " onClick=\"updateConges('$nom', '$str_date AM', 'del')\""; |
| 316 | 3d5328c4 | Romuald | $libOnClickPM = " onClick=\"updateConges('$nom', '$str_date', 'add')\""; |
| 317 | a92b1e97 | Romuald | } else if (isset($conges[$nom]) && in_array("$str_date PM", $conges[$nom])) { |
| 318 | 00cab91c | Romuald | $colorAM = "white"; |
| 319 | 00cab91c | Romuald | $colorPM = "blue"; |
| 320 | 3d5328c4 | Romuald | $libOnClickAM = " onClick=\"updateConges('$nom', '$str_date', 'add')\""; |
| 321 | 3d5328c4 | Romuald | $libOnClickPM = " onClick=\"updateConges('$nom', '$str_date PM', 'del')\""; |
| 322 | 52a3c866 | Romuald | } else {
|
| 323 | 52a3c866 | Romuald | $color = "white"; |
| 324 | 3d5328c4 | Romuald | $libOnClick = " onClick=\"updateConges('$nom', '$str_date', 'add')\""; |
| 325 | 3d5328c4 | Romuald | $menu = " class=\"menu\" onContextMenu=\"ItemSelMenu(event, '$nom', '$str_date'); return false;\""; |
| 326 | 52a3c866 | Romuald | } |
| 327 | 52a3c866 | Romuald | ?>
|
| 328 | a92b1e97 | Romuald | <?php
|
| 329 | 00cab91c | Romuald | if (isset($conges[$nom]) && (in_array("$str_date AM", $conges[$nom]) || in_array("$str_date PM", $conges[$nom]))) { |
| 330 | a92b1e97 | Romuald | ?>
|
| 331 | 00cab91c | Romuald | <td style="cursor: pointer; background-color: <?=$colorAM?>"<?=$libOnClickAM?><?=$libTitle?>> </td> |
| 332 | 00cab91c | Romuald | <td style="cursor: pointer; background-color: <?=$colorPM?>"<?=$libOnClickPM?><?=$libTitle?>> </td> |
| 333 | a92b1e97 | Romuald | <?php } else {?> |
| 334 | 3d5328c4 | Romuald | <td colspan="2" style="cursor: pointer; background-color: <?=$color?>"<?=$libOnClick?><?=$menu?><?=$libTitle?>> </td> |
| 335 | a92b1e97 | Romuald | <?php } ?> |
| 336 | 52a3c866 | Romuald | <?php } ?> |
| 337 | 52a3c866 | Romuald | </tr>
|
| 338 | 52a3c866 | Romuald | <?php
|
| 339 | 52a3c866 | Romuald | } |
| 340 | 52a3c866 | Romuald | ?>
|
| 341 | 52a3c866 | Romuald | </td></tr> |
| 342 | 52a3c866 | Romuald | </table>
|
| 343 | 52a3c866 | Romuald | <?php
|
| 344 | 52a3c866 | Romuald | } |
| 345 | 52a3c866 | Romuald | ?>
|
| 346 | 52a3c866 | Romuald | </table>
|
| 347 | 3d5328c4 | Romuald | <div id="popupMenu" style="position: absolute; display: none; top: 0px; left: 0px; z-index: 10000;" onMouseOver="javascript:overPopupMenu=true;" onMouseOut="javascript:overPopupMenu=false;"> |
| 348 | 3d5328c4 | Romuald | <table border="0" bgcolor="lightgray"> |
| 349 | b644c0cf | Romuald | <tr><td id="AM"><a class="popupmenu" href="#">Matin</a></td></tr> |
| 350 | b644c0cf | Romuald | <tr><td id="PM"><a class="popupmenu" href="#">Après-midi</a></td></tr> |
| 351 | b644c0cf | Romuald | <tr><td id="annuler"><a class="popupmenu" href="#">Annuler</a></td></tr> |
| 352 | 3d5328c4 | Romuald | </table>
|
| 353 | 3d5328c4 | Romuald | </div>
|
| 354 | 52a3c866 | Romuald | </body>
|
| 355 | 52a3c866 | Romuald | </html> |