ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 22nd, 2004, 04:09 PM
jimriggott jimriggott is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 53 jimriggott User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 13 m 57 sec
Reputation Power: 6
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>&nbsp;</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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > data/time checking for appointment facility


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT