Bonjour,
je doit ajouter un module de réservations sur un site déjà existant. Il faut que le propriétaire de l'appartement puisse afficher sur un calendrier les jours ou son bien est déjà réservé.

J'ai donc trouver ce script pour créer le calendrier, il faut quelques modifications, étant pas un grand développeur php, j'espère trouver de l'aide auprès de vous ... Voici le code actuel :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<style TYPE="text/css">
<!--
.titremois  { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: #FDFC65; background: #1C2D67 }
.titremois:link  { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: #FDFC65; background: #1C2D67; text-decoration: none }
.titremois:visited  { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: #FDFC65; background: #1C2D67; text-decoration: none }
.titremois:hover  { font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; color: #FF0000; background: #1C2D67; text-decoration: underline }
 
.titrejours  { font-family: Helvetica, Arial; font-size: 9px; color: #FDFC65; background: #1C2D67 }
.titrenum  { font-family: Helvetica, Arial; font-size: 11px; color: #FDFC65; background: #1C2D67 }
.titrenum2  { font-family: Helvetica, Arial; font-size: 11px; color: #AAAAAA; background: #1C2D67 }
.titreweek  { font-family: Helvetica, Arial; font-size: 9px; color: #AAAAAA; background: #1C2D67 }
.titreweek2  { font-family: Helvetica, Arial; font-size: 11px; color: #AAAAAA; background: #1C2D67 }
.titrewend  { font-family: Helvetica, Arial; font-size: 11px; color: #FDFC65; background: #5060A0 }
.titrewend2  { font-family: Helvetica, Arial; font-size: 11px; color: #AAAAAA; background: #5060A0 }
.titrenow  { font-family: Helvetica, Arial; font-size: 11px; color: #FDFC65; background: #90A0E0 }
-->
</style>
<?
function calcul_joursferies($month,$day,$year)
{
$resultat=false;
 
$jf1=$year-1900;
$jf2=$jf1%19;
$jf3=intval((7*$jf2+1)/19);
$jf4=(11*$jf2+4-$jf3)%29;
$jf5=intval($jf1/4);
$jf6=($jf1+$jf5+31-$jf4)%7;
$jfj=25-$jf4-$jf6;
$jfm=4;
if ($jfj<=0){
	$jfm=3;
	$jfj=$jfj+31;
	}
 
 
$paques=(($jfm < 10) ? "0".$jfm : $jfm)."/".(($jfj < 10) ? "0".$jfj : $jfj);
$lunpaq=date("m/d",mktime(12,0,0,$jfm,$jfj+1,$Year));
$ascension=date("m/d",mktime(12,0,0,$jfm,$jfj+39,$Year));
$lunpent=date("m/d",mktime(12,0,0,$jfm,$jfj+50,$Year));
 
$JourFerie= Array("01/01","05/01","05/08","07/14","08/15","11/01","11/11","12/25","$paques","$lunpaq","$ascension","$lunpent");
 
$nbj=0;
$val=	$lien=date("m/d", mktime(0,0,0,$month,$day,$year));
  while ($nbj<=count($JourFerie)){
 
    if ($JourFerie[$nbj]==$val){
	$resultat=true;
	$nbj=15;
	}
    $nbj++;
  }
return( $resultat );
}
 
 
$tabmonth  = Array("Janvier", "F&eacute;vrier", "Mars", "Avril", "Mai", "Juin","Juillet", "Ao&ucirc;t", "Septembre", "Octobre", "Novembre","D&eacute;cembre");
$tabday  = Array("Lun", "Mar", "Mer", "Jeu", "Ven", "Sam","Dim");
 
// selectionne la date d aujourd hui si aucune saisie
if (!$dt){
$year = date("Y");
$now   = date("Y/m/d");
$month  = date("n");
$day = date("d");
	}else{
$data=explode(" ",$dt);
$year=$data[0];
$month=$data[1];
$day=$data[2];
$now=date("Y/m/d", mktime(0,0,0,$month,$day,$year));
	}
$moyear=$tabmonth[$month-1]."&nbsp;&nbsp;".$year;
?>
Date de disponobilté :<br /><br />
<table WIDTH="160" BORDER="0" CELLSPACING="0" CELLPADDING="2">
  <tr> 
    <td CLASS='titremois' colspan="8" ALIGN="center">
<?
	$lien=date("Y+m+d", mktime(0,0,0,$month-1,$day,$year));
	echo "<A CLASS='titremois' href=\"?dt=$lien\"><<</a>";
 
	echo "<A CLASS='titremois'>&nbsp;$moyear&nbsp;</a>";
 
	$lien=date("Y+m+d", mktime(0,0,0,$month+1,$day,$year));
	echo "<A CLASS='titremois' href=\"?dt=$lien\">>></a>";
?>
    </td>
  </tr>
 
  <tr> 
<?
echo"<td WIDTH=20 class='titreweek' ALIGN='center'>Sem</td>\n";
for ($i=0;$i<7;$i++) {
echo"<td WIDTH=20 class='titrejours' ALIGN='center'>$tabday[$i]</td>\n";
}
?>
  </tr>
 
<?
$num_day=date("w", mktime(0,0,0,$month,01,$year));
if($num_day==0){$num_day=7;}
$max_day=date("t", mktime(0,0,0,$month,01,$year));
$cpt_day=2;
while ($cpt_day<=$max_day+$num_day) {
  echo "<tr>";
 
// calcul le numero de semaine
 
  $nb_day=date("z", mktime(0,0,0,$month,$cpt_day-$num_day+3,$year));
  $val=intval($nb_day/7)+1;
  echo "<td WIDTH=20 class='titreweek2' ALIGN='center'>".(($val < 10) ? "0".$val : $val)."</td>\n";
 
// affiche les jours du mois
 
  for ($i=0;$i<7;$i++) {
	$theday=date("D", mktime(0,0,0,$month,$cpt_day-$num_day,$year));
	$val=date("d", mktime(0,0,0,$month,$cpt_day-$num_day,$year));
	$jourferie=calcul_joursferies($month,$cpt_day-$num_day,$year);
	$class="titrenum";
	if (($theday=="Sun") or ($theday=="Sat")or ($jourferie)){ $class="titrewend";}
	if ($now==date("Y/m/d",mktime(0,0,0,$month,$cpt_day-$num_day,$year))){ $class="titrenow";}
	if ((($cpt_day-$num_day)<1) or (($cpt_day-$num_day)>$max_day)){
	  $class="titrenum2";	  
	  if (($theday=="Sun") or ($theday=="Sat")or ($jourferie)){ $class="titrewend2";}
	}
	$cpt_day++;
	echo "<td WIDTH=20 class='$class'ALIGN='center'>".$val."</td>\n";
  }
  echo "</tr>";
 
}
?>
 
</table>
Dans un premier temps je voudrais savoir si c'est possible de bloquer le calendrier pour pas qu'il affiche les mois qui sont déjà passés ... Donc si quelqu'un peut me mettre sur la voix ... (je rappelle que je suis novice)

Merci