www.uburst.com www.uburst.com

"Restrict reservation."

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

General Questions
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Restrict reservation."
Posted by Ed on Apr-11-02 at 10:11 PM (EST)
Hello,
Is there a way for me as admin to restrict
reservations to only 4 weeks out instead of
indefinite. People tend to forget about their
reservations if it is too far out. However, if a
request for 2 months out comes into
me, I would like to be able to schedule it.
Thanks
Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Restrict reservation., Bill Weiner, Apr-12-02, (1)
restricting, Ed, Apr-12-02, (2)
RE: restricting, Bill Weiner, Apr-16-02, (3)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Restrict reservation."
Posted by Bill Weiner on Apr-12-02 at 04:57 AM (EST)
There's not really an easy way to restrict the reservations to within 4 weeks, but here are some instructions on how you could make a simple modification to the script in order to accomplish that:

STEP 1: Make a backup of your current ureserve.pl script... just in case.

STEP 2: Open your ureserve.pl script with any text editor such as WordPad.

STEP 3: Do a search on the following line:

elsif ($command eq "goto_next_week")

STEP 4: About 3 lines down from there you will see this line:

$goto_seconds = $form_text{'seconds'};

Immediately AFTER that line, try adding these four lines:

if (($goto_seconds - time) > ($SECONDS_PER_DAY * 28))
{
&display_message("Out of Range","The reservation schedule is restricted to 4 weeks in advance.");
}

STEP 5: Do a search on the following line:

elsif ($command eq "goto_date")

STEP 6: About 4 lines down from there you will see this line:

$goto_seconds = &get_date_seconds($goto_date);

Immediately AFTER that line, try adding those same four lines:

if (($goto_seconds - time) > ($SECONDS_PER_DAY * 28))
{
&display_message("Out of Range","The reservation schedule is restricted to 4 weeks in advance.");
}

STEP 7: Save the script... as TEXT if your editor asks... and try it out!

The result of this modification should be that visitors can not view/make reservations further than 4 weeks in the future.

NOTE: When adding the code above, the &display_message lines should all be on one line... ie. don't let it wrap around to the next line.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "restricting"
Posted by Ed on Apr-12-02 at 09:40 AM (EST)
I tried that and it does what you say thanks.

Just wondering tho can I as admin surpass that and make a schedule for 2 or 3 months out if a special request is made.
Thanks again for your quick responces!

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "RE: restricting"
Posted by Bill Weiner on Apr-16-02 at 05:27 AM (EST)
The easiest way to keep the restriction modification that you made above... while allowing the admin to surpass that restriction... would be to just install a second copy of the ureserve.pl script... one in which just the admin would use. Here's how:

STEP 1: Rename the original (unmodified) ureserve.pl script to something like "ureserve_admin.pl".

STEP 2: Configure/install the "ureserve_admin.pl" script as you did with the regular ureserve.pl script.... and be sure that the $data_directory setting in configuration question #6 maps to the same "data" directory that your modified "ureserve.pl" script uses.

STEP 3: And just have the administorator always use this second script to make reservations and do other admin stuff.

Yes, this is not totally fool-proof in that if a regular website visitor guesses the name/URL of the second admin script... then they would be able to make reservations outside of the 4 week modification that you made to the public "ureserve.pl" script... but that would be very unlikely.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.