Accueil   |   Forums   |  Offres d'emplois   |  Contact    |   Mon compte   
mardi 6 janvier 2009 Rechercher :
Déposez votre CV gratuitement sur touslesemplois
 
comparer les prix
» Logiciels
» Jeux vidéos
» Matériel Informatique


» ASP.NET
» ASP
» SQL
» PHP
» JAVASCRIPT
» XML
 


» ACTUALITÉ / DIVERS
» DROIT DE L'INTERNET
» INFOS VIRUS
» PATCHS MICROSOFT
» SÉCURITÉ
» BASES DE DONNÉES
» DOWNLOAD .NET
» LOGITHÈQUE
» SERVICES WEB
» Y SONT FOUS !
» .NET
» ASP
» ASP.NET
» JAVA
» PHP
» XML
» LANGAGE C#
» LANGAGE VB.NET
» UNIX / LINUX
» WINDOWS
» EVÈNEMENTS
» GASP
» MICROSOFT
 


Vous êtes ici : Forums > Langage ASP > Urgent ( calendrier asp pour reservation hotel)

Urgent ( calendrier asp pour reservation hotel)
salut les asp-friend
j'ai besoin d'un script asp qui permet d'afficher deux menu deroulant de date, le 1er menu pour date depart et la 2eme pour date d'arriver !!! jusqu'a c bon mais mais mais ...
ce que je veux moi c'est surtout une date depart qui commence apartir d'aujourd'hui càd qu'il n'affiche pas les jour deja passer !!! rien que pour eviter que les gens me donnent des date de reservation depassé ...


merci a vous ...j'attend :-(

Message posté le 19/05/2002 par J.J

Répondre à ce message
 
AuteurRéponse 
Julia
21/05/2002
RE : Urgent ( calendrier asp pour reservation hotel)
Voila un calendrier dynamique, c'est qd même plus chic que les list box non ? lorsque tu cliques sur une date, il l'écrit dans ubne database. Voilà !

<%@ Language=VBScript %>
<!--#include file="../Scripts/dbConnct.inc"-->
<!--#include file="../Scripts/Cache.inc"-->
<!--#include file="../Scripts/adovbs.inc"-->
<!--#include file="../Scripts/FunLibValidate.inc"-->
<%
DateSeance= request("DateSeance")
CarteId=request("CarteId")
IF request("DateEU")<>"" THEN
fp_sQry=" UPDATE Formations SET "
if DateSeance="Date1Fr" then fp_sQry=fp_sQry& "Date1Fr='"&((Request("DateEU")))&"'"
if DateSeance="Date2Fr" then fp_sQry=fp_sQry& "Date2Fr='"&((Request("DateEU")))&"'"
if DateSeance="Date3Fr" then fp_sQry=fp_sQry& "Date3Fr='"&((Request("DateEU")))&"'"
if DateSeance="Date4Fr" then fp_sQry=fp_sQry& "Date4Fr='"&((Request("DateEU")))&"'"
if DateSeance="Date1Nl" then fp_sQry=fp_sQry& "Date1Nl='"&((Request("DateEU")))&"'"
if DateSeance="Date2Nl" then fp_sQry=fp_sQry& "Date2Nl='"&((Request("DateEU")))&"'"
if DateSeance="Date3Nl" then fp_sQry=fp_sQry& "Date3Nl='"&((Request("DateEU")))&"'"
if DateSeance="Date4Nl" then fp_sQry=fp_sQry& "Date4Nl='"&((Request("DateEU")))&"'"
fp_sQry=fp_sQry&" WHERE Id="&CarteId
'Response.write fp_sQry
objConn.Execute(fp_sQry)
response.redirect("GestionDate.asp?CarteId="&CarteId)
END IF

'------------------------------------------------------------
' This function finds the last date of the given month
'------------------------------------------------------------
Function GetLastDay(intMonthNum, intYearNum)
Dim dNextStart
If CInt(intMonthNum) = 12 Then
dNextStart = DateSerial(intYearNum, 1, 1)
Else
dNextStart = DateSerial(intYearNum, intMonthNum + 1, 1)
End If
GetLastDay = Day(dNextStart - 1)
End Function

'-------------------------------------------------------------------------
' This routine prints the individual table divisions for days of the month
'-------------------------------------------------------------------------
Sub Write_TD(sValue, sClass)
Response.Write " <TD ALIGN='CENTER' WIDTH=20 HEIGHT=15 VALIGN='BOTTOM' CLASS='" & sClass & "'> " & sValue & "</TD>" & vbCrLf
End Sub

Sub Write_TD_IMG(sValue, sClass)
Response.Write " <TD BACKGROUND='i\Today.gif' ALIGN='CENTER' WIDTH=20 HEIGHT=15 VALIGN='BOTTOM' CLASS='" & sClass & "'> " & sValue & "</TD>" & vbCrLf
End Sub

' Constants for the days of the week
Const cSUN = 1, cMON = 2, cTUE = 3, cWED = 4, cTHU = 5, cFRI = 6, cSAT = 7

' Get the name of this file
sScript = Request.ServerVariables("SCRIPT_NAME") & "?frm=" & Request("frm") & "&edt=" & Request("edt")

' Check for valid month input
If IsEmpty(Request("MONTH")) OR NOT IsNumeric(Request("MONTH")) Then
datToday = Date()
intThisMonth = Month(datToday)
ElseIf CInt(Request("MONTH")) < 1 OR CInt(Request("MONTH")) > 12 Then
datToday = Date()
intThisMonth = Month(datToday)
Else
intThisMonth = CInt(Request("MONTH"))
End If

' Check for valid year input
If IsEmpty(Request("YEAR")) OR NOT IsNumeric(Request("YEAR")) Then
datToday = Date()
intThisYear = DatePart("yyyy",datToday)
Else
intThisYear = CInt(DatePart("yyyy",DateSerial(Request("YEAR"), 1, 1)))
End If

strMonthName = MonthName(intThisMonth)
datFirstDay = DateSerial(intThisYear, intThisMonth, 1)
intFirstWeekDay = WeekDay(datFirstDay, vbSunday)
intLastDay = GetLastDay(intThisMonth, intThisYear)

' Get the previous month and year
' Get the next month and year

intPrevMonth = intThisMonth - 1
intNextMonth = intThisMonth + 1
intPrevYear = intThisYear - 1
intNextYear = intThisYear + 1
If intPrevMonth < 1 Then intPrevMonth = 12
If intNextMonth > 12 Then intNextMonth = 1

' Get the last day of previous month. Using this, find the sunday of
' last week of last month
LastMonthDate = GetLastDay(intPrevMonth, intPrevYear) - intFirstWeekDay + 2
NextMonthDate = 1

' Initialize the print day to 1
intPrintDay = 1
%>


<html>
<head>

<title>Cliquez sur une date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>
<style TYPE="text/css">
TD.NON {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#C0C0C0; font-weight :normal;}
TD.TOP {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#0000FF; font-weight :bold;}
TD.Some {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#FFFFFF; font-weight :normal;}
TD.Day {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#000000; font-weight :normal;}
TD.Sun {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#FF0000; font-weight :normal;}

A.NOEVENT:Link {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#000000; font-weight :normal; text-decoration: << none>> ;}
A.NOEVENT:Visited {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#000000; font-weight :normal; text-decoration: << none>> ;}
A.TODAY:Link {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#0000FF; font-weight :normal; text-decoration: << none>> ;}
A.TODAY:Visited {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#0000FF; font-weight :normal; text-decoration: << none>> ;}

A.EVENT:Link {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#000000; font-weight :bold; text-decoration: << none>> ;}
A.EVENT:Visited {font-family :Tahoma, Verdana, Arial; font-size :12px; color :#000000; font-weight :bold; text-decoration: << none>> ;}

A.NORMAL:Link {font-family :Verdana, Arial; font-size :12px; color :#10011F; font-weight :normal; text-decoration: << none>> ;}
A.NORMAL:Visited {font-family :Verdana, Arial; font-size :12px; color :#0000FF; font-weight :normal; text-decoration: << none>> ;}
</style>
</head>
<body BGCOLOR="#FFFFFF" TEXT="#0000FF" LEFTMARGIN="3" LINK="#000000" VLINK="#000000">

<table>
<TR><TD>

<table ALIGN="CENTER" BORDER="1" CELLSPACING="0" CELLPADDING="2" BGCOLOR="White" BORDERCOLOR="Gray">
<tr><td>
<table WIDTH="200" BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#FFFFFF">
<tr HEIGHT="18" BGCOLOR="#00006A">
<td WIDTH="20" HEIGHT="18" ALIGN="LEFT" VALIGN="MIDDLE"><a HREF="<% =sScript%>&amp;month=<% =IntThisMonth %>&amp;year=<% =IntPrevYear %>&amp;CarteId=<%=CarteId%>&amp;Category=<%=CategoryId%>&amp;DateSeance=<%=DateSeance%>"><img SRC="../i/prev2Bis.jpg" WIDTH="10" HEIGHT="18" BORDER="0" ALT="Previous Year"></a></td>
<%if intThisMonth = 1 then%>
<td WIDTH="20" HEIGHT="18" ALIGN="LEFT" VALIGN="MIDDLE"><a HREF="<% =sScript%>&amp;month=<% =IntPrevMonth %>&amp;year=<% =IntThisYear - 1 %>&amp;CarteId=<%=CarteId%>&amp;Category=<%=CategoryId%>&amp;DateSeance=<%=DateSeance%>"><img SRC="../i/prev1Bis.jpg" WIDTH="10" HEIGHT="18" BORDER="0" ALT="Previous Month"></a></td>
<%else%>
<td WIDTH="20" HEIGHT="18" ALIGN="LEFT" VALIGN="MIDDLE"><a HREF="<% =sScript%>&amp;month=<% =IntPrevMonth %>&amp;year=<% =IntThisYear %>&amp;CarteId=<%=CarteId%>&amp;Category=<%=CategoryId%>&amp;DateSeance=<%=DateSeance%>"><img SRC="../i/prev1Bis.jpg" WIDTH="10" HEIGHT="18" BORDER="0" ALT="Previous Month"></a></td>
<%end if%>
<td WIDTH="120" COLSPAN="5" ALIGN="CENTER" VALIGN="MIDDLE" CLASS="SOME"><% = strMonthName & " " & intThisYear %></td>
<%if intThisMonth = 12 then%>
<td WIDTH="20" HEIGHT="18" ALIGN="RIGHT" VALIGN="MIDDLE"><a HREF="<% =sScript %>&amp;month=<% =IntNextMonth %>&amp;year=<% =IntThisYear + 1 %>&amp;CarteId=<%=CarteId%>&amp;Category=<%=CategoryId%>&amp;DateSeance=<%=DateSeance%>"><img SRC="../i/next1Bis.jpg" WIDTH="10" HEIGHT="18" BORDER="0" ALT="Next Month"></a></td>
<%else%>
<td WIDTH="20" HEIGHT="18" ALIGN="RIGHT" VALIGN="MIDDLE"><a HREF="<% =sScript %>&amp;month=<% =IntNextMonth %>&amp;year=<% =IntThisYear %>&amp;CarteId=<%=CarteId%>&amp;Category=<%=CategoryId%>&amp;DateSeance=<%=DateSeance%>"><img SRC="../i/next1Bis.jpg" WIDTH="10" HEIGHT="18" BORDER="0" ALT="Next Month"></a></td>
<%end if%>
<td WIDTH="20" HEIGHT="18" ALIGN="RIGHT" VALIGN="MIDDLE"><a HREF="<% =sScript %>&amp;month=<% =IntThisMonth %>&amp;year=<% =IntNextYear %>&amp;CarteId=<%=CarteId%>&amp;Category=<%=CategoryId%>&amp;DateSeance=<%=DateSeance%>"><img SRC="../i/next2Bis.jpg" WIDTH="10" HEIGHT="18" BORDER="0" ALT="Next Year"></a></td>
</tr>
<tr><td height="2" colspan="7"></td></tr>
<tr>
<td></td>
<td ALIGN="RIGHT" CLASS="Sun" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">SU</td>
<td ALIGN="RIGHT" CLASS="Day" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">MO</td>
<td ALIGN="RIGHT" CLASS="Day" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">TU</td>
<td ALIGN="RIGHT" CLASS="Day" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">WE</td>
<td ALIGN="RIGHT" CLASS="Day" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">TH</td>
<td ALIGN="RIGHT" CLASS="Day" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">FR</td>
<td ALIGN="RIGHT" CLASS="Day" WIDTH="20" HEIGHT="15" VALIGN="BOTTOM">SA</td>
</tr>
<tr><td HEIGHT="1" ALIGN="MIDDLE" COLSPAN="11"><img SRC="../i/line.gif" HEIGHT="1" WIDTH="190" BORDER="0"></td></tr>
<%
' Initialize the end of rows flag to false
EndRows = False
Response.Write vbCrLf

'**********Loop until all the rows are exhausted****************
Do While EndRows = False
' Start a table row
Response.Write " <TR>" & vbCrLf
Response.Write " <TD></TD>"
'***This is the loop for the days in the week
For intLoopDay = cSUN To cSAT
'** si the first day is not sunday then print the last days of previous month in grayed font
If intFirstWeekDay > cSUN Then
Write_TD LastMonthDate, "NON"
LastMonthDate = LastMonthDate + 1
intFirstWeekDay = intFirstWeekDay - 1
' The month starts on a sunday
Else
'** si in grayed font
If intPrintDay > intLastDay Then
Write_TD NextMonthDate, "NON"
NextMonthDate = NextMonthDate + 1
EndRows = True
Else
'** Si last day of the month, flag the end of the row
If intPrintDay = intLastDay Then
EndRows = True
End If

tmpdToday = intThisMonth & "/" &intPrintDay& "/" &DatePart("yyyy",CDate( "1/1/" & intThisYear))
dToday = tmpdToday'DateAdd("d",0,tmpdToday)
DateEU= intPrintDay& "/" &intThisMonth& "/" &DatePart("yyyy",CDate( "1/1/" & intThisYear)) '***pour affichage dans le form***
'** si the event flag is not raise for that day, print it in a plain font
If bEvents = False Then
if CDate(DateEU) = Date() then '***si on implémente sur un srv Uk, mettre alors dToday au lieu de DateEU*****
Write_TD_IMG "<A HREF=""CalendMegabyte.asp?CarteId=" &CarteId& "&DateSeance="&DateSeance& "&Category=" &CategoryId& "&DateEU=" &dToday& "&DatePerempt=" &dToday& """ CLASS='TODAY'> " & intPrintDay & "</A>", "SOME"
else
Write_TD "<A HREF=""CalendMegabyte.asp?CarteId=" &CarteId& "&DateSeance="&DateSeance& "&Category=" &CategoryId& "&DateEU=" &dToday& "&DatePerempt=" &dToday& """ CLASS='NOEVENT'> " & intPrintDay & "</A>", "SOME"
end if
End If
End If

' Increment the date. Done once in the loop.
intPrintDay = intPrintDay + 1
End If

' Move to the next day in the week
Next
Response.Write " </TR>" & vbCrLf
Loop
%>
<tr><td height="8" colspan="7"></td></tr>
</table>
</td></tr>
</table>

</body> ...
Répondre
Yannick
22/07/2005
RE : Urgent ( calendrier asp pour reservation hotel)
Salut, j'ai vu que tu recherchai un calendrier pour des reservations, et le truc c'est que moi aussi je suis a la recherche de ceci pour la location de bungalows en guadeloupe, si tu pouvais m'envoyer ce que tu a pu avoir je te remercie.
Ou si les autres on des choses je suis prenneur. ecrivez moi. ...
Répondre


Project Hoshimi


A RETENIR CETTE SEMAINE
06/01/2009 - Comment appeler Biztalk via un Web Service ?
Souvent les exemples Biztalk prennent en entrée des fichiers qui sont ensuite consommés avant d’être ...
06/01/2009 - TechDays - Téléchargez les goodies officiels
Si vous ne les avez pas encore téléchargés, il est encore temps : les goodies officiels des TechDays ...
06/01/2009 - TechDays - Venez découvrir la table Surface !
Mitsuru Furuta saura-t-il vous convaincre d'assister à la session "Développer avec Microsoft Surface ...
06/01/2009 - Utilisez log4net pour mettre en place l'audit au sein de vos applications
Les développeurs écrivent très souvent des applications qui nécessitent une fonctionnalité de log. C ...
05/01/2009 - Comment étendre le databinding
Je prends pour exemple la démo fournie avec l’article : je veux attacher une liste de CustomerRow (a ...
05/01/2009 - Mettez en place un serveur asp.net sous Linux avec Apache
La technologie ASP.NET est une technologie bien connue des développeurs .NET, mais malheureusement a ...
05/01/2009 - Internet Explorer de moins en moins populaire
Selon Net Applications, Internet Explorer a perdu des usagers en décembre, au profit de ses concurre ...
(c) 1999-2006 ASP MAGAZINE SARL
Partenaires : Codes sources c2i ASP-PHP
Hébergement serveurs dédiés Windows


Hit-Parade