phpScheduleIt
May 23, 2013, 10:33:11 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: 1 [2]
  Print  
Author Topic: 45 Min Increments  (Read 19100 times)
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #15 on: April 27, 2006, 05:33:11 PM »

For that, I would suggest trying this.  Change the code that you just added to this:

Code:
if ($interval == 15) {
$interval = 45;
$res->end = $res->start + $interval;
}


I hope I'm covering everything here.  Let me know if that works.
Logged
Diap
Newbie
*

Karma: 0
Posts: 9


« Reply #16 on: April 28, 2006, 02:51:22 AM »

Quote from: "Nick"
For that, I would suggest trying this.  Change the code that you just added to this:

Code:
if ($interval == 15) {
$interval = 45;
$res->end = $res->start + $interval;
}


I hope I'm covering everything here.  Let me know if that works.


Almost there.

This works well if you just pick the start time being 9.00, 9.45, 10.30 etc with 45 min intervals, then it works. But since there is 15 min timespan you could also chose to make a reservation starting from 9.15 or 9.30. In those two cases - with the above solution you get startime 9.00 and endtime 9.00 in the reservationwindow. Not quiet sure why, thought the above code would add 45 min to all the startimes, no matter if it is 9.00, 9.15 or 9.30.

Another thing is there a way of chaning the printed times on the calender 8.00, 9.00, 10.00 to what ever I would like. Then maybe I can solve it that way.

Thanks so so much for your help so far - and sorry to keep bothering you.

best,

- diap
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #17 on: April 28, 2006, 12:23:52 PM »

The reason it is choosing 9:00 is because it is trying to select 9:15 from the pull down list and it is not there, so it just defaults to the first one.

If you just want the selected end time to be 45 minutes after the start if the interval is 15, then just undo what we did before and change line 178 of reserve.php to this:

Code:
$res->end_date = $res->sched['timespan'] == 15 ? $_GET['start_date'] + 45 : $_GET['start_date'];


Getting the schedule to print those times isn't going to be easy because right now it is written with hourly constraints, meaning the intervals must go into one hour evenly.
Logged
Diap
Newbie
*

Karma: 0
Posts: 9


« Reply #18 on: April 29, 2006, 03:50:33 PM »

Thanks for all your help.

I did not understand the last one, since it involved start_date etc. But it was enough to point me in the right direction. Here is the code that I substituted the code in line 154 of reserve.php with:

Code:

$res->end = $res->sched['timespan'] == 15 ? $_GET['start_time'] + 45:
$_GET['end_time'];


it works now with 45 min timespan and correct times.

Since it isnt possibel to change the main times, it is possible to change or add a number to the second row underneath the times. F.eks. I have 15 min incentments - so there are 4 slots underneath each of the one our times. I would like to use these for something like:

9:00                   10:00                 11:00
00  15  30 45      00  15  30 45       00  15  30 45

Or can I just "hardcode" the times so they are always 8.00 8.45 9.00 9.45 etc?

Thanks for a GREAT program and all your help - it works now with 45 min timespan and correct times - hopefully this is the last "bothering" post from me =)

best

- Diap
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!