PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 7th, 2011, 05:57 PM
slaterino slaterino is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 33 slaterino User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 27 m 38 sec
Reputation Power: 10
General - Listing events - filtered to next 7 days and grouped by day

Okay,
I'm really hoping someone can help me with this or at least point me in the right direction!

I have a list of events, which are either single day events or multiple day events. If they are a single day they simply have a startDate field. If they are a multiple day event they have a startDate and an endDate.

What I want is just to show the next seven days events, but split the events into each day. So, there would be a header for Monday and then a list of Monday's events, and so on. If the event lasted all week it would show under each day.

Okay, now I have this short piece of code that works out the next seven days and their headers. How would I begin to incoporate the events into this loop? Any help would be massively appreciated!

Code:
<?php
$date = time();
for($i=0; $i<7; $i++) {
   echo date('D d', strtotime("+$i days", $date)) . "<br />";
}
?>


There are a few different fields in the events table but the important ones are:

eventName
startDate (formatted like this: 2011-06-06 21:00:00)
endDate (as above)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > General - Listing events - filtered to next 7 days and grouped by day


Developer Shed Advertisers and Affiliates


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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap