From 80fc39bf7fe010d3f58ebd6d369bee345ed68280 Mon Sep 17 00:00:00 2001 From: james Date: Fri, 11 Jun 2010 15:55:16 +0000 Subject: [PATCH] Implement start hour and end hour for schedule view Implement event duration height calculations --- admin/schedule.php | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/admin/schedule.php b/admin/schedule.php index f3936e1..2c34c8d 100644 --- a/admin/schedule.php +++ b/admin/schedule.php @@ -25,8 +25,24 @@ require("../common.inc.php"); require_once("../user.inc.php"); user_auth_required('committee', 'admin'); - if($_GET['date']) { - $date=$_GET['date']; + + $ROWHEIGHT=20; + $BORDERSIZE=2; + + if($_POST['date']) { + $date=$_POST['date']; + $starthour=$_POST['starthour']; + $endhour=$_POST['endhour']; + + //do some sanity checks + if($starthour<0 || $starthour>24) $starthour=7; + if($endhour<$starthour) + $endhour=$starthour+10; + if($endhour<0 || $endhour>24) $endhour=17; + + //minute increment + $increment=15; + if(!eregi("[0-9]{4}-[0-9]{2}-[0-9]{2}",$date)) { echo "Invalid date"; exit; @@ -48,9 +64,6 @@ foreach($locations AS $id=>$name) { echo " $name\n"; } - $starthour="7"; - $endhour="22"; - $increment=15; for($h=$starthour;$h<$endhour;$h++) { for($m=0;$m<60;$m+=$increment) { echo ""; @@ -83,10 +96,10 @@ //they will be moved by javascript after the fact $q=mysql_query("SELECT * FROM schedule WHERE conferences_id='{$conference['id']}' AND date='{$date}'"); while($r=mysql_fetch_object($q)) { - echo "
hour}_{$r->minute}_{$r->locations_id}\">"; + echo "
id}\">"; print_r($r); echo "
"; - $js.="eventdivs[$x]={hour:$r->hour,minute:$r->minute,location:$r->locations_id,duration:$r->duration};\n"; + $js.="eventdivs[$r->id]={hour:$r->hour,minute:$r->minute,location:$r->locations_id,duration:$r->duration};\n"; $x++; } echo "