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 100 101 102 103 104 105 106 107 108 109 110 111 112
| <html>
<head>
<title>Calendrier</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
function calendrier($choixmois,$choixannee,$nomfichier){?>
<style type="text/css">
body {font-family:"Andale Mono", Arial, Verdana, sans-serif;font-size: 12px;margin:10 0 0 0;padding:0 0 0 0;}
a {color:#822;text-decoration:none ;}
#table_calendrier{font-size:11px;text-align:center;border-left: solid 5px #666;border-top: solid 5px #666;border-right:solid 2px #ccc; border-bottom:solid 5px #ccc;background-color:#ddd;}
#table_calendrier td{border : 2px solid #586;height:18px;}
.textegras14{font-size: 14px ;font-weight:bold;color:#006633;}
.numsem{background-color:#88a;height:20px}
.fond1{background-color:#ee5;}
.fond2{background-color:#fa5;}
.fond3{background-color:#afa;}
.choixjour1{background-color:#5bf;}
.choixjour2{background-color:#fff;}
</style><?php
if($choixmois==Null) $choixmois=date('n', mktime(0,0,0,date('n')+1,0,0));
if($choixannee==Null)$choixannee=date('Y', mktime(0,0,0,0,0, date('Y')+1));
$nbrejourmois = date('t', mktime(0,0,0,$choixmois,1, $choixannee));
$premierjour= date('w', mktime(0,0,0,$choixmois,1, $choixannee));
$jourcourant=date('j', mktime(0,0,0,0,date('j'),0));
$moiscourant= date('m', mktime(0,0,0,date('m')+1,0,0));
$anneecourante= date('Y', mktime(0,0,0,0,0, date('Y')+1));
$mois = Array ( "", "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre" );
$i=$choixmois;
if ($premierjour==0) $premierjour=7;
if ($i<1) $i=12;
if ($i >12) $i=1;?>
<table id="table_calendrier">
<tr>
<td colspan="8" class="fond1" >
<a href="<?php echo $nomfichier ?>?choixannee=<?php echo $choixannee-1 ?>&choixmois=<?php echo $choixmois ?>"><< </a>
<span class="textegras14"><?php echo $choixannee ;?></span>
<a href="<?php echo $nomfichier ?>?choixannee=<?php echo $choixannee+1 ?>&choixmois=<?php echo $choixmois ?>"> >> </a>
</td>
</tr>
<tr>
<td colspan="8" class="fond2" >
<a href="<?php echo $nomfichier ?>?choixmois=<?php echo $i-1 ?>&choixannee=<?php echo $choixannee ?>"><< </a>
<span class="textegras14"><?php echo $mois[$i] ;?></span>
<a href="<?php echo $nomfichier ?>?choixmois=<?php echo $i+1?>&choixannee=<?php echo $choixannee ?>"> >> </a>
</td>
</tr>
<tr class="fond3" ><td>N° S</td><td>Lun</td><td>Mar</td><td>Mer</td><td>Jeu</td><td>Ven</td><td>Sam</td><td>Dim</td></tr><?php
$varjour=1;
$jour_increment=Null;
for($s=0;$s<6;$s++){?>
<tr><?php
for($j=1;$j<8;$j++){
if($varjour>=$premierjour){
$jour_increment += 1 ;
if($jour_increment<10)$jour_increment='0'.$jour_increment;
}
if($j<2 ){
($jour_increment<=$nbrejourmois)?$numsemaine= date('W', mktime(0,0,0,$choixmois,$jour_increment, $choixannee)):$numsemaine='';//n° semaine?>
<td class="numsem"><?php echo $numsemaine ?> </td><?php
}
if($jour_increment<=$nbrejourmois) {
if(strlen($choixmois)==1) $choixmois='0'.$choixmois;
$returndate=$jour_increment.'/'.$choixmois.'/'.$choixannee;
($jour_increment==$jourcourant && $choixmois ==$moiscourant && $choixannee==$anneecourante)? $class=' class="choixjour1"': $class=' class="choixjour2"';?>
<td <?php echo $class ?> ><a href="<?php echo $nomfichier ?>?returndate=<?php echo $returndate ?>&choixmois=<?php echo $i ?>&choixannee=<?php echo $choixannee ?>"><?php echo $jour_increment ?> </a></td><?php
}else{
$j=8;
}
$varjour=$varjour+1;
}?>
</tr>
<?php
}?>
</tr>
<tr><td colspan="8">Calendrier créé par A. DITO</td></tr>
</table>
<?php
}?>
</head>
<body>
<?php
(isset($_GET['choixmois']))?$choixmois =$_GET['choixmois']:$choixmois=Null;
(isset($_GET['choixannee']))?$choixannee =$_GET['choixannee']:$choixannee=Null;
(isset($_GET['returndate']))?$returndate =$_GET['returndate']:$returndate=Null;
calendrier($choixmois,$choixannee,$_SERVER['PHP_SELF'] );
echo $returndate.'<br/>';
$dateJ = $returndate;
echo $dateJ.'<br/>';
?>
<form method = "POST" action = "date.php">
<select name="type">
<option value=""> ----- Choisir ----- </option>
<option value="LIQ"> LIQ </option>
<option value="MEP"> MEP </option>
</select>
<input type="submit" value="valider" name="OK">
</form>
</body>
</html> |