1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<!DOCTYPE HTML>
<html>
<head>
<title>Recap</title>
<style>
.janvier {;}
</style>
<script>
function changeConges(mois,jour)
{
var TDs=document.GetElementsByClassName(mois.value);
for(var i=0;i<TDs.length;i++)
{
document.writeln('<b>' + TDs[i] + '</b>');
}
}
</script>
</head>
<body>
<?php
if (file_exists('Calendrier2012.xml'))
{
$xml = simplexml_load_file('Calendrier2012.xml');
}
else
{
exit('Echec lors de l\'ouverture du fichier Calendrier2012.xml.');
}
?>
<h3 style="align:center">Calendrier</h3>
<table border="1">
<tr align="center" style="font-weight:bolder;font-size:10pt;"><td/>
<td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td>
<td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td>
<td>21</td><td>22</td><td>23</td><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td>
</tr>
<?php
$numero_mois=0;
foreach($xml->mois as $month)
{
echo '<tr><td style="font-size:10pt">'.$month.'</td>';
$numero_jour=1;
foreach($xml->mois[$numero_mois]->j as $jour)
{
switch($jour)
{
case 'RH' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:orange;font-size:10pt">'.$jour.'</td>';
break;
case 'CA' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#f080d0;font-size:10pt">'.$jour.'</td>';
break;
case 'RT' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#40f040;font-size:10pt">'.$jour.'</td>';
break;
case 'HP' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#80f0d0;font-size:10pt">'.$jour.'</td>';
break;
case 'JS' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#f04040;font-size:10pt">'.$jour.'</td>';
break;
case 'FR' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#f04040;font-size:10pt">'.$jour.'</td>';
break;
case 'FP' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#4080f0;font-size:10pt">'.$jour.'</td>';
break;
case 'RR' :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#4080f0;font-size:10pt">'.$jour.'</td>';
break;
default :
echo '<td id="'.$numero_jour.'" class="'.$month.'" style="background-color:#f0f080;font-size:10pt">'.$jour.'</td>';
}
$numero_jour++;
}
$numero_mois++;
echo '</tr>';
}
?>
</table>
<form onsubmit="changeConges(this.mois,this.jour);">
CA<input type="radio" name="type" value="ca"/>
RH<input type="radio" name="type" value="rh"/>
RT<input type="radio" name="type" value="rt"/>
HP<input type="radio" name="type" value="hp"/>
JS<input type="radio" name="type" value="js"/>
FR<input type="radio" name="type" value="fr"/>
FP<input type="radio" name="type" value="fp"/>
RR<input type="radio" name="type" value="rr"/>
Otaf<input type="radio" name="type" value="otaf"/><br/>
Mois :<input type="text" name="mois" maxlength="10"/>
Jour :<input type="text" name="jour" maxlength="2"/>
Duree :<input type="text" name="duree"maxlength="2"/><br/>
<input type="submit" name="valider" value="OK"/>
</form>
</body>
</html> |
Partager