|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
data/time checking for appointment facility
I am working on a modified version of an appointment system from this site http://www.johann.tk
The current version will for any given day, print out a list of appointments. You can click on an appointment to see extra information about the appointment. It does this by having a <TD> for each day of the week. It then loops through each day of the week and compares the loop value with the date taken from the database. If the loop day matches the database date, it loops through the appointments for that day, and prints a list of appointments withing the <TD> for that day. This working version can be seen here: http://jimpix.co.uk/japan/cal002_v2...sp?d=19/01/2004 weekview.asp checks for matches and prints them via this: RS.MoveFirst While Not RS.EOF If RS("dags") = CDate(TWSaturday) Then response.write "<p class=dashed><a href=""pop_detail.asp?ID="&RS("ID")&""" onclick=""window.open(this.href, 'popupwindow', 'width=400,height=350,scrollbars'); return false;"">" response.write "<font color="&OrderColor&">" response.write TimeValue(RS("kl1"))&"<font></a></p>" End If RS.MoveNext Wend In my version I still want to have the days printed across the top of the page, but I want to have the day split into 48 half hour periods. I have done this here: http://jimpix.co.uk/japan/cal002_v2/weekview_005.asp However, I have been pulling my hair out for the last couple of days working out how to loop through each day to look for appointments, and then how to fit them into the code which prints out the 48 half hour blocks of the day. The code to print out a blank table 7 cells across by 48 down is this: intPrintDay = 1 bg="eeeeee" the_time = "00:00:00" For x = 0 to 47 if bg="eeeeee" then bg = "f1f1f1" else bg = "eeeeee" NewDate = DateAdd("n", x * 30, the_time) response.write "<TR bgcolor=#"&bg&">" & vbcrlf & "<TD>" & newdate & "</TD>" & vbcrlf Do While intPrintDay < 8 response.write "<TD> </TD>" & vbcrlf intPrintDay = intPrintDay + 1 Loop response.write "</TR>" & vbcrlf intPrintDay = 1 Next This works fine, but what I could really do with, if anyone would be so kind, is any advice on how to loop through the records to be able to go through this table and print a link to an appt. if there is one, or a different coloured cell if there is no appointment, within each table cell. What has got me foxed is trying to nest a loop checking the recordset against todays current date, within the loop which splits the day into 48 half hour blocks. I can't work out if I need to go across each row (i.e. check for each of the 48 half hour time blocks, one at a time, across all 7 days), or to go down each column, and check each single day against each of the 48 time blocks. Even if I decide one way over the other, I haven't got the skill to work out how to code what I decide! The links to the full source for each file is here if it can be of use to anyone: http://jimpix.co.uk/japan/cal002_v2/weekview.txt http://jimpix.co.uk/japan/cal002_v2/weekview_005.txt Thanks Jim |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > data/time checking for appointment facility |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|