Salve amici,
utilizzo questo script per creare un calendario:
Vorrei però che i giorni che corrispondono ad alcune date presenti in un DB fossero evidenziati...codice:<table width="300" border="0" align="center" cellpadding="0" cellspacing="0" class="tab_Cal"> <tr> <td class="tab_titolo"><a href="default.asp?data=<%=DateAdd("m", -1, data)%>"><</td> <td colspan="5" align="center" class="tab_titolo"><%=MonthName(Month(data)) & " " & Year(data)%></td> <td align="righ" class="tab_titolo"><a href="default.asp?data=<%=DateAdd("m", 1, data)%>">></td> </tr> <tr > <td class="tab_celle">D</td> <td class="tab_celle">L</td> <td class="tab_celle">M</td> <td class="tab_celle">M</td> <td class="tab_celle">G</td> <td class="tab_celle">V</td> <td class="tab_celle">S</td> </tr> <% DataInizio = CDate(anno&"-"&mese&"-01") 'DataInizio = CDate("01/" & mese & "/" & anno) ' saltiamo primi giorni della settimana for i = 1 to WeekDay(DataInizio)-1 if i = 1 then Response.Write "<tr>" Response.write "<td></td>" next 'mostriamo il calendario for i = 1 to giornidelmese(mese,anno) 'data = Cdate(( i & "/" & mese & "/" & anno)) data = Cdate((anno&"-"&mese&"-"&i)) if WeekDay(data) = 1 then Response.Write "<tr>" 'dispo.movefirst 'do while not dispo.EOF and not dispo.BOF 'if (dispo.Fields.Item("DATA").Value) = (anno&"-0"&mese&"-0"&i) then Response.Write("<td align=""center"" class=""tab_titolo"">" & i & "</td>") 'else 'Response.Write("<td align=""center"" class=""tab_titolo"">" & i & "</td>") 'end if 'dispo.movenext 'loop if WeekDay(data) = 7 then Response.Write "</tr>" next ' saltiamo primi giorni della settimana for j = WeekDay(Data)+1 to 7 Response.write "<td></td>" if j mod 7 = 0 then Response.Write "</tr>" : exit for next %> </table>
Come posso integrarlo con i rcord che trova uguali nel DB???![]()

Rispondi quotando