nookiemon
04-24-2006, 04:16 PM
Hi, I'm looking for help on getting a dynamic schedule. Basically, the page will open with todays date and the events. It formats the tabs depending on what day today is and pulls the data off my database using sql.
So I've managed to get that part done. See http://www.graemejones.co.uk/ASP/life/whatson.asp.
The next part I'm stuck with is how to get my date variables to change using the links i.e. if I click on tues it adds 1 day to my variable, wed 1 days, or one week 7.
Here are my variables used and their functions
This part will pull up the info for the adjusted date
<% Dim DateToday
DateToday = date()%>
sSQL="SELECT schedules.Date, schedules.Time, schedules.Show FROM schedules WHERE (((schedules.Date)=#" & DateToday & "#))"
Sorts out the info re schedule for today
<%
Dim strDay
Dim strMonth
strDay=(weekday(date))
Select Case strDay
case 1 Response.write("Sunday")
case 2 Response.write("Monday")
case 3 Response.write("Tuesday")
case 4 Response.write("Wednesday")
case 5 Response.write("Thursday")
case 6 Response.write("Friday")
case 7 Response.write("Saturday")
End Select
Response.Write(" "&day(date)&" ")
strMonth=(month(date))
Select Case strMonth
case 1 Response.write("January")
case 2 Response.write("February")
case 3 Response.write("March")
case 4 Response.write("April")
case 5 Response.write("May")
case 6 Response.write("June")
case 7 Response.write("July")
case 8 Response.write("August")
case 9 Response.write("September")
case 10 Response.write("October")
case 11 Response.write("November")
case 12 Response.write("December")
End Select
%>
Sorts out my css for the tabs
<%
Dim dayNo
dayNo=(weekday(date)) %>
<li><%
If dayNo=2 Then
response.write "<span>MON</span>"
Else
response.write "<a href='#'>MON</a>"
End If
%> </li>
I hope i explained myself well and would appreciate some advice.
Many thanks
So I've managed to get that part done. See http://www.graemejones.co.uk/ASP/life/whatson.asp.
The next part I'm stuck with is how to get my date variables to change using the links i.e. if I click on tues it adds 1 day to my variable, wed 1 days, or one week 7.
Here are my variables used and their functions
This part will pull up the info for the adjusted date
<% Dim DateToday
DateToday = date()%>
sSQL="SELECT schedules.Date, schedules.Time, schedules.Show FROM schedules WHERE (((schedules.Date)=#" & DateToday & "#))"
Sorts out the info re schedule for today
<%
Dim strDay
Dim strMonth
strDay=(weekday(date))
Select Case strDay
case 1 Response.write("Sunday")
case 2 Response.write("Monday")
case 3 Response.write("Tuesday")
case 4 Response.write("Wednesday")
case 5 Response.write("Thursday")
case 6 Response.write("Friday")
case 7 Response.write("Saturday")
End Select
Response.Write(" "&day(date)&" ")
strMonth=(month(date))
Select Case strMonth
case 1 Response.write("January")
case 2 Response.write("February")
case 3 Response.write("March")
case 4 Response.write("April")
case 5 Response.write("May")
case 6 Response.write("June")
case 7 Response.write("July")
case 8 Response.write("August")
case 9 Response.write("September")
case 10 Response.write("October")
case 11 Response.write("November")
case 12 Response.write("December")
End Select
%>
Sorts out my css for the tabs
<%
Dim dayNo
dayNo=(weekday(date)) %>
<li><%
If dayNo=2 Then
response.write "<span>MON</span>"
Else
response.write "<a href='#'>MON</a>"
End If
%> </li>
I hope i explained myself well and would appreciate some advice.
Many thanks