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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
<%
' --------------------------------------------------------------------------------------------
' ---------------------------- Debut Fonction----------------------------------------------
' --------------------------------------------------------------------------------------------
function nom_mois (mois)
select case mois
case "1"
nom_mois = "Janvier"
case "2"
nom_mois = "Février"
case "3"
nom_mois = "Mars"
case "4"
nom_mois = "Avril"
case "5"
nom_mois = "Mai"
case "6"
nom_mois = "Juin"
case "7"
nom_mois = "Juillet"
case "8"
nom_mois = "Août"
case "9"
nom_mois = "Septembre"
case "10"
nom_mois = "Octobre"
case "11"
nom_mois = "Novembre"
case "12"
nom_mois = "Décembre"
end select
end function
' -------------------------------------------------------------------------------------------
' ---------------------------- Fin Fonction ------------------------------------------------
' -------------------------------------------------------------------------------------------
D=date()
' --- récupération du mois recherché --- '
mois = request.querystring("mois")
if mois = "" then
D=date()
else
an=year(D)
D=dateserial(an,mois,1)
end if
' --- récupération de l'année recherchée --- '
an = request.querystring("an")
if an = "" then
D=date()
else
mois=month(D)
D=dateserial(an,mois,1)
end if
' --- création de mes variables ---'
an=year(D)
jour=day(D)
mois=month(D)
jour_semaine=weekdayname(weekday(D))
' --- gestion des années pour la liste de choix ---'
ann_rep = year(Date())
an_deb = ann_rep - 2
an_fin = ann_rep + 4
' --- nombre de jours dans le mois actuel --- '
D1 = dateserial(an,mois,1)
jour_mois=weekdayname(weekday(D1))
D2 = dateserial(an,mois + 1,1)
jours_mois = datediff("d",D1,D2)
' --- détermination du jour de la semaine pour le premier du mois --- '
pos_premier = Weekday(D1,2)
pos_premier = pos_premier - 1
' --- détermination des variables de calcul du tableau --- '
j=1 ' compteur de jours du mois
l=0 ' compteur de ligne... permet de déterminer le positionnement du 1 dans la première ligne
c=0 ' compteur de cellule... permet de déterminer le saut de ligne du tableau
p=0 ' positionnement du premier jours du mois dans une semaine de 7 jours
%>
<table >
<tr>
<td colspan="7">
<p align="center">
<select onchange="window.location='?an=<%= an %>&mois='+this.value">
<option value="1" <% if mois=1 then response.write "selected" end if%> >Janvier</option>
<option value="2" <% if mois=2 then response.write "selected" end if%> >Février</option>
<option value="3" <% if mois=3 then response.write "selected" end if%> >Mars</option>
<option value="4" <% if mois=4 then response.write "selected" end if%> >Avril</option>
<option value="5" <% if mois=5 then response.write "selected" end if%> >Mai</option>
<option value="6" <% if mois=6 then response.write "selected" end if%> >Juin</option>
<option value="7" <% if mois=7 then response.write "selected" end if%> >Juillet</option>
<option value="8" <% if mois=8 then response.write "selected" end if%> >Août</option>
<option value="9" <% if mois=9 then response.write "selected" end if%> >Septembre</option>
<option value="10" <% if mois=10 then response.write "selected" end if%> >Octobre</option>
<option value="11" <% if mois=11 then response.write "selected" end if%> >Novembre</option>
<option value="12" <% if mois=12 then response.write "selected" end if%> >Décembre</option>
</select>
-
<select onchange="window.location='?mois=<%=mois%>&an='+this.value">
<%
for i = an_deb to an_fin
%>
<option value="<%= an_deb %>"
<% if an=an_deb then response.write "selected" end if%> ><%= an_deb %></option>
<%
an_deb = an_deb + 1
next
%>
</select>
</td>
</tr>
<tr>
<BR>
</tr>
<tr bgcolor="#F4F28C" bordercolor="#F4F28C">
<td align="center"><font color="#000000" size="2" face="Arial">L</font></td>
<td align="center"><font color="#000000" size="2" face="Arial">M</font></td>
<td align="center"><font color="#000000" size="2" face="Arial">M</font></td>
<td align="center"><font color="#000000" size="2" face="Arial">J</font></td>
<td align="center"><font color="#000000" size="2" face="Arial">V</font></td>
<td align="center"><font color="#000000" size="2" face="Arial">S</font></td>
<td align="center"><font color="#000000" size="2" face="Arial">D</font></td>
</tr>
<tr>
<%
for i = 1 to jours_mois
' --- incrémentation de ma variable cellule jusqu'à la valeur 7 ---
c=c+1
if l=0 then
for p = 1 to pos_premier
c=c+1
%>
<td align="center"><font size="2" face="Arial"></font></td>
<%
next
end if
date_agenda = dateserial(an,mois,i)
%>
<td align="center" <% if date_agenda = date() then %> style="border:1 solid #FF0000" <% end if %> >
<font size="2" face="Arial">
<a href="#?><%= date_agenda %>" ><%= i %></a>
</font>
</td>
<%
' --- gestion du retour à la ligne après 7 jours affichés ---
if c=7 then
response.write "</tr>"
c=0
end if
' --- incrémente la variable l précisant le passage à la deuxième ligne ---
l=1
' --- boucle de mon for to next ---
next
%>
</tr>
</table> |
Partager