# Thread: Help with Swimming Pool Party Rental Calculator

1. Registered User
Join Date
Mar 2006
Posts
13

## Help with Swimming Pool Party Rental Calculator

ok, i'm a newbie -- but persistent, willing to learn, and usually good at following instructions...

i don't know exactly how to get started with coding this... so i have nothing thus far... looking for beginning ideas.

goal: create a swimming pool party rental calculator for my neighborhood pool
inputs: party begin date and time, party end date and time, # of party people
calculation (this is my biggest hurdle): how to calculate the number of hours during "normal operational hours" and the number of hours "after operational hours". (reason: the cost per hour of the party goes up significantly for an "after hours" pool party)

example:
input party start time: 5/1/2006 6pm
input party end time: 5/2/2006 1am
number in party: 120

somehow? embed information about normal operational hours:
5/1/2006 9am-8pm
5/2/2006 10am-7pm
...and all other normal operational dates and times

Based upon the inputs, needs to return the following:
number of hours during normal operational hours = 2
number of hours after normal operational hours = 5

additional calculations are also necessary, but i think i know how to do those...

any help is most appreciated!!

2. Banned
Join Date
Dec 2004
Posts
8,637
Are the operational hours the same on a weekly schedule? ...or, what?

3. Registered User
Join Date
Mar 2006
Posts
13

the long answer is the schedule is all over the map and looks something like this (this is last years schedule -- this years schedule is not yet made):

May 14-24 M-Th 6:30pm-8pm, F 6:30pm-9pm, Sat 10am-9pm Sun 11am-8pm
May 25-July 8 M-Th 11am-8pm, F 11am-10pm, Sat 10am-9pm, Sun 11am-8pm
July 9-Aug 12 M-Th 10am-8pm, F 10am-10pm, Sat 10am-9pm, Sun 11am-8pm
Aug 11-Aug 21 M-Th 1pm-8pm, F 1pm-9pm, Sat 10am-9pm, Sun 11am-8pm
Aug 22-Sept 11 M-Th 4pm-8pm, F 4pm-8pm, Sat 10am-9pm, Sun 12am-8pm
Special note: Sept 5 (labor day) 10am-10pm

4. Banned
Join Date
Jan 2006
Location
I'm in GMT -5
Posts
561
-----
Last edited by James Gatka; 04-02-2006 at 07:38 AM.

5. Registered User
Join Date
Mar 2006
Posts
13
thanks!!!

I'll give it a shot.

6. Registered User
Join Date
Mar 2006
Posts
1
I am aswell a newbie with javascript...But that seems similar to what I was looking for. I wanted to use the "onblur" command to run the javascript...but when I use it, I recieve an error...

Line: 21
Char: 3
Error: 'value' is null or not an object
Code: 0

If i use the submit button, everything works fine...but when i attempt to choose the onblur and use that...It gives me that error.

Any ideas on how to fix that?

7. Registered User
Join Date
Mar 2006
Posts
13
James -- Again, THANK YOU very very much for trying to help me!!!

i've been studing your example and i have to admit it is pushing my capabilities but i'm trying hard to understand.

best i can tell, the code you provided allows for the same operational time each day and doesn't take into consideration the differing operational times based upon month and day. I'm therefore speculating i need to calculate the number of minutes that makes up the operational time for first part of my schedule as follows.

May 14-24 M-Th 6:30pm-8pm, F 6:30pm-9pm, Sat 10am-9pm Sun 11am-8pm
would look something like this in the code:

Code:
``` 	var hrsOp = [];
hrsOp['may14sat'] = [192120,192780]; //min though April 30th + min in 13 days + min to 10am ..... then minutes to 9pm;
hrsOp['may15sun'] = [193620,194160]; //min though April 30th + min in 14 days + min to 11am ..... then minutes to 8pm;
hrsOp['may16mon'] = [195510,195600]; //min though April 30th + min in 15 days + min to 6:30pm ..... then minutes to 8pm;
hrsOp['may17tue'] = [196950,197040]; //min though April 30th + min in 16 days + min to 6:30pm ..... then minutes to 8pm;
hrsOp['may18wed'] = [198390,198480]; //min though April 30th + min in 17 days + min to 6:30pm ..... then minutes to 8pm;
hrsOp['may19thu'] = [199830,199920]; //min though April 30th + min in 18 days + min to 6:30pm ..... then minutes to 8pm;
hrsOp['may20fri'] = [201270,201420]; //min though April 30th + min in 19 days + min to 6:30pm ..... then minutes to 9pm;
hrsOp['may21sat'] = [202200,202860]; //min though April 30th + min in 20 days + min to 10am ..... then minutes to 9pm;
hrsOp['may22sun'] = [203700,204240]; //min though April 30th + min in 21 days + min to 11am ..... then minutes to 8pm;
hrsOp['may23mon'] = [205590,205680]; //min though April 30th + min in 22 days + min to 6:30pm ..... then minutes to 8pm;
hrsOp['may24tue'] = [207030,207120]; //min though April 30th + min in 23 days + min to 6:30pm ..... then minutes to 8pm;```
based upon:
number of minutes in Jan (31) = 44640
number of minutes in Feb (28) = 40320 84960
number of minutes in Mar (31) = 44640 129600
number of minutes in Apr (30) = 43200 172800
number of minutes in May (31) = 44640 217440
number of minutes in June (30) = 43200 260640
number of minutes in a day = 1440

then i'm lost on what i need to do below in the code...

can someone tell me if i'm at least on the right track or if there is a simplier way...

i was also hoping the calculations would take place when leaving the fields instead of having to press the calculate/submit button -- can this also be done?

thanks many times over for any help anyone can provide!

8. Banned
Join Date
Dec 2004
Posts
8,637
Yes, there is another way -- as many ways as there is imagination... This:

May 14-24 M-Th 6:30pm-8pm, F 6:30pm-9pm, Sat 10am-9pm Sun 11am-8pm

may be expressed as follows:
Code:
```var schedule = new Object();
schedule.getEntry = getScheduleEntry;
etc...```
Then, the following is untested (just typed it directly into this post), but you could have these functions:
Code:
```function addScheduleEntry(entryDate, openTime, closeTime) {
if(typeof entryDate != "string") {
alert('String Entry Date argument required ("mm/dd/yyyy").');
return false;
}
if(!entryDate.isDate()) {
alert(Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return false;
}
var objDate = new Date(entryDate);
return true;
}
function getScheduleEntry(entryDate) {
if(typeof entryDate != "string") {
alert('String Entry Date argument required ("mm/dd/yyyy").');
return null;
}
if(!entryDate.isDate()) {
alert(Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return null;
}
var objDate = new Date(entryDate);
}
String.prototype.isDate function() {
// validate that the object string is a valid mm/dd/yyyy date
if(this.toString().isEmpty()) return false;
var delim = (arguments.length>0) ? arguments[0] : "/";
delim = (typeOf(delim)=="string" && delim.length>0) ? delim : "/";
var dte = new Date(this.toString());
var ary = this.toString().split(delim);
for (var i in ary) { ary[i] = new Number(ary[i]); }
if(ary.length != 3
|| ary[0] != (dte.getMonth()+1)
|| ary[1] != dte.getDate()
|| ary[2] != dte.getFullYear() ) {
return false;
}
return true;
}
var str;
return (str="0"+(this.getMonth()+1)).substr(str.length-2) + "/" +
(str="0"+this.getDate()).substr(str.length-2) + "/" +
(str="000"+this.getFullYear()).substr(str.length-4)
}
function convert2Minutes(str24hrTime) {
if(typeof str24hrTime != "string") {
return 0;
}
var ary = str24hrTime.split(":");
if(ary.length != 2) {
alert('Hours and Minutes must be delimited with a colon (":").');
return 0;
}
ary[0] = Number(ary[0]);
if(isNaN(ary[0])
|| ary[0] < 0
|| ary[0] > 23) {
alert('Hours are not numeric or are out of range.');
return 0;
}
ary[1] = Number(ary[1]);
if(isNaN(ary[1])
|| ary[1] < 0
|| ary[1] > 59) {
alert('Minutes are not numeric or are out of range.');
return 0;
}
return ary[1] + (ary[0]*60);
}```
Last edited by phpnovice; 03-31-2006 at 09:35 AM.

9. Registered User
Join Date
Mar 2006
Posts
13
Many thanks phpnovice!!

i really like the format of having the date, opentime, and closetime the way you suggested -- this will make it easy for even someone like me to edit in the future as the operational dates and times change.

so i'm trying to implement what you have. keep in mind i'm really really green like grasshopper with very little experience in javascripting!!

i tried to show at least some progress and worked on the format and fields that i believe i need and this is where i am -- it gives me an error and i realize i don't really have any formulas in it -- but could use a little more help if possible just to get the basics working...

here is first of two parts (hope this is ok to post it this way...)
Code:
```<html>

<script type="text/javascript">

var schedule = new Object();
schedule.getEntry = getScheduleEntry;

if(typeof entryDate != "string")
{
alert('String Entry Date argument required ("mm/dd/yyyy").');
return false;
}
if(!entryDate.isDate())
{
alert('Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return false;
}
var objDate = new Date(entryDate);
return true;
}
function getScheduleEntry(entryDate) {
if(typeof entryDate != "string") {
alert('String Entry Date argument required ("mm/dd/yyyy").');
return null;
}
if(!entryDate.isDate()) {
alert('Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return null;
}
var objDate = new Date(entryDate);
}
String.prototype.isDate; function() {
// validate that the object string is a valid mm/dd/yyyy date
if(this.toString().isEmpty()) return false;
var delim = (arguments.length>0) ? arguments[0] : "/";
delim = (typeOf(delim)=="string" && delim.length>0) ? delim : "/";
var dte = new Date(this.toString());
var ary = this.toString().split(delim);
for (var i in ary) { ary[i] = new Number(ary[i]); }
if(ary.length != 3
|| ary[0] != (dte.getMonth()+1)
|| ary[1] != dte.getDate()
|| ary[2] != dte.getFullYear() ) {
return false;
}
return true;
}
var str;
return (str="0"+(this.getMonth()+1)).substr(str.length-2) + "/" +
(str="0"+this.getDate()).substr(str.length-2) + "/" +
(str="000"+this.getFullYear()).substr(str.length-4)
}
function convert2Minutes(str24hrTime) {
if(typeof str24hrTime != "string") {
return 0;
}
var ary = str24hrTime.split(":");
if(ary.length != 2) {
alert('Hours and Minutes must be delimited with a colon (":").');
return 0;
}
ary[0] = Number(ary[0]);
if(isNaN(ary[0])
|| ary[0] < 0
|| ary[0] > 23) {
alert('Hours are not numeric or are out of range.');
return 0;
}
ary[1] = Number(ary[1]);
if(isNaN(ary[1])
|| ary[1] < 0
|| ary[1] > 59) {
alert('Minutes are not numeric or are out of range.');
return 0;
}
return ary[1] + (ary[0]*60);
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Pool Rental Calculator</title>

<body>
<tr>
<td width="97%" height="38" align="right" valign="top" colspan="5">

&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top">&nbsp;</td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><b>
<font size="4">Party Details</font></b></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
<font size="2">
Please enter the details of your party below to calculate an automatic
price quote:</font></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
Start Information:</font></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date (mm/dd/yyyy):
<input type="text" name="startdate" size="13" onblur='validhours()'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Time (x:xx am or x:xx pm):
<input type="text" name="starttime" size="9"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
End Information:</font></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date (mm/dd/yyyy):
<input type="text" name="enddate" size="13" onblur='validhours()'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Time (x:xx am or x:xx pm):
<input type="text" name="endtime" size="9"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
Number of Attendees:</font></td>
<td width="29%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Quantity:
<input type="text" name="quantity" size="13"> </td>
<td width="66%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="3">
(according to County regulations, must include total quantity of
attendees both in the pool and on the deck)</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
Include Clubhouse Rental:</font></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
<input type="radio" value="V2" name="clubrent" onBlur='valid(this.form)' checked>No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Are you a current member of the pool:&nbsp;
<input type="radio" value="V2" name="currentmember" onBlur='valid(this.form)' checked>No&nbsp;&nbsp;&nbsp; </td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top">&nbsp;</td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="2">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="4">
<b>Rental Price Quote</b></font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="2">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
</tr>
</table>
<table border="1" cellspacing="0" width="100%" cellpadding="4" id="table2" bordercolor="#000000">
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Rate per unit</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Sub-Total</td>
</tr>
<tr>```

10. Registered User
Join Date
Mar 2006
Posts
13
second part:

Code:
```          <td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">
Number of Attendees:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="quantity0" size="11" onBlur='valid(this.form)' readonly>&nbsp; </td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="quatityrate0" size="10" value="\$3.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="quantitysubtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">Hours of the party during normal operational hours:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="normalhours0" size="11" onBlur='valid(this.form)'>&nbsp;
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="normalhoursrate0" size="10" value="\$15.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000"><font size="2">
Hours of the party after normal operational hours:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="afterhours0" size="11" onBlur='valid(this.form)'>&nbsp;
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="afterhoursrate0" size="10" value="\$40.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">Clubhouse Rental:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubrentdescript0" size="11" onBlur='valid(this.form)'>&nbsp;
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubhouserate0" size="10" value="\$250.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubhousesubtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">
Hours required for setup and cleaning:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="cleaninghours0" size="11" onBlur='valid(this.form)'></td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="cleaningrate0" size="10" value="\$15.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="cleaningsubtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
=========</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Total Rental Quote (not including Deposit)</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="subtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000"><font size="2">
Deposit for Pool Rental:</font></td>
<td width="43%" height="28" valign="top" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="pooldeposit0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000"><font size="2">
Deposit for Clubhouse Rental:</font></td>
<td width="43%" height="28" valign="top" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubhousedeposit0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
=========</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Total Rental Quote</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="renttotal0" size="10"></td>
</tr>
</table>
<table border="0" cellspacing="0" width="100%" cellpadding="4" id="table1" height="43">
<tr>

<td width="5%">
<p style="margin:0in;margin-bottom:.0001pt" align="center">
<strong>

<font <p align="center" FACE="Arial">
&nbsp;<input class="go130" type="submit" value="Submit"
onclick="now=new Date;document.getElementById('t').value=now.toString();"/>
&nbsp;
<input
type="reset" value="Reset" name="reset"></font></strong></p>&nbsp;</td>
<font>

</body>

</html>```

11. Banned
Join Date
Dec 2004
Posts
8,637
I re-arranged the HEAD section of your page and corrected a few things:
HTML Code:
```<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Pool Rental Calculator</title>
<script type="text/javascript">
<!--//
var str;
return (str="0"+(this.getMonth()+1)).substr(str.length-2) + "/" +
(str="0"+this.getDate()).substr(str.length-2) + "/" +
(str="000"+this.getFullYear()).substr(str.length-4)
}
String.prototype.isDate = function() {
// validate that the object string is a valid mm/dd/yyyy date
if(this.toString().isEmpty()) return false;
var delim = (arguments.length>0) ? arguments[0] : "/";
delim = (typeof delim == "string" && delim.length > 0) ? delim : "/";
var dte = new Date(this.toString());
var ary = this.toString().split(delim);
for (var i in ary) { ary[i] = new Number(ary[i]); }
if(ary.length != 3
|| ary[0] != (dte.getMonth()+1)
|| ary[1] != dte.getDate()
|| ary[2] != dte.getFullYear() ) {
return false;
}
return true;
}
String.prototype.isEmpty = function() {
// validate that the object string has just white space in it
return /^\s*\$/.test(this.toString());
}
//-->
</script>
<script type="text/javascript">
<!--//
var schedule = new Object();
schedule.getEntry = getScheduleEntry;
//
if(typeof entryDate != "string") {
alert('String Entry Date argument required ("mm/dd/yyyy").');
return false;
}
if(!entryDate.isDate()) {
alert('Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return false;
}
var objDate = new Date(entryDate);
return true;
}
function getScheduleEntry(entryDate) {
if(typeof entryDate != "string") {
alert('String Entry Date argument required ("mm/dd/yyyy").');
return null;
}
if(!entryDate.isDate()) {
alert('Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return null;
}
var objDate = new Date(entryDate);
}
function convert2Minutes(str24hrTime) {
if(typeof str24hrTime != "string") {
return 0;
}
var ary = str24hrTime.split(":");
if(ary.length != 2) {
alert('Hours and Minutes must be delimited with a colon (":").');
return 0;
}
ary[0] = Number(ary[0]);
if(isNaN(ary[0])
|| ary[0] < 0
|| ary[0] > 23) {
alert('Hours are not numeric or are out of range.');
return 0;
}
ary[1] = Number(ary[1]);
if(isNaN(ary[1])
|| ary[1] < 0
|| ary[1] > 59) {
alert('Minutes are not numeric or are out of range.');
return 0;
}
return ary[1] + (ary[0]*60);
}
//-->
</script>
Last edited by phpnovice; 03-31-2006 at 01:22 PM.

12. Registered User
Join Date
Mar 2006
Posts
13
i'm not having much success -- guess i'm not such a good student...

this is where i am...

part one:

Code:
```<html>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Pool Rental Calculator</title>
<script type="text/javascript">
<!--//
var str;
return (str="0"+(this.getMonth()+1)).substr(str.length-2) + "/" +
(str="0"+this.getDate()).substr(str.length-2) + "/" +
(str="000"+this.getFullYear()).substr(str.length-4)
}
String.prototype.isDate = function() {
// validate that the object string is a valid mm/dd/yyyy date
if(this.toString().isEmpty()) return false;
var delim = (arguments.length>0) ? arguments[0] : "/";
delim = (typeof delim == "string" && delim.length > 0) ? delim : "/";
var dte = new Date(this.toString());
var ary = this.toString().split(delim);
for (var i in ary) { ary[i] = new Number(ary[i]); }
if(ary.length != 3
|| ary[0] != (dte.getMonth()+1)
|| ary[1] != dte.getDate()
|| ary[2] != dte.getFullYear() ) {
return false;
}
return true;
}
String.prototype.isEmpty = function() {
// validate that the object string has just white space in it
return /^\s*\$/.test(this.toString());
}
//-->
</script>
<script type="text/javascript">
<!--//
var schedule = new Object();
schedule.getEntry = getScheduleEntry;
//
if(typeof entryDate != "string") {
alert('String Entry Date argument is required ("mm/dd/yyyy").');
return false;
}
if(!entryDate.isDate()) {
alert('Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return false;
}
var objDate = new Date(entryDate);
return true;
}
function getScheduleEntry(entryDate) {
if(typeof entryDate != "string") {
alert('String Entry Date argument required ("mm/dd/yyyy").');
return null;
}
if(!entryDate.isDate()) {
alert('Entry Date is invalid or incorrectly formatted ("mm/dd/yyyy").');
return null;
}
var objDate = new Date(entryDate);
}
function convert2Minutes(str24hrTime) {
if(typeof str24hrTime != "string") {
return 0;
}
var ary = str24hrTime.split(":");
if(ary.length != 2) {
alert('Hours and Minutes must be delimited with a colon (":").');
return 0;
}
ary[0] = Number(ary[0]);
if(isNaN(ary[0])
|| ary[0] < 0
|| ary[0] > 23) {
alert('Hours are not numeric or are out of range.');
return 0;
}
ary[1] = Number(ary[1]);
if(isNaN(ary[1])
|| ary[1] < 0
|| ary[1] > 59) {
alert('Minutes are not numeric or are out of range.');
return 0;
}
return ary[1] + (ary[0]*60);
}
//-->
</script>

<body>
<tr>
<td width="97%" height="38" align="right" valign="top" colspan="5">

&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top">&nbsp;</td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><b>
<font size="4">Party Details</font></b></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
<font size="2">&nbsp;&nbsp;&nbsp;
Please enter the details of your party below to calculate an automatic
price quote:</font></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
Start Information:</font></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date (mm/dd/yyyy):
<input type="text" name="entryDate" size="13" onblur='return addScheduleEntry()'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Time (x:xx am or x:xx pm):
<input type="text" name="openTime" size="9" onblur='return addScheduleEntry()'></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
End Information:</font></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date (mm/dd/yyyy):
<input type="text" name="enddate" size="13" onblur='return addScheduleEntry()'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Time (x:xx am or x:xx pm):
<input type="text" name="closeTime" size="9" onblur='return addScheduleEntry()'></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
Number of Attendees:</font></td>
<td width="29%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Quantity:
<input type="text" name="quantity" size="13" onblur='return addScheduleEntry()'> </td>
<td width="66%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="3">
(according to County regulations, must include total quantity of
attendees both in the pool and on the deck)</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="2">
Include Clubhouse Rental:</font></td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">
Are you a current member of the pool:&nbsp;
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top">&nbsp;</td>
<td width="76%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="4">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="2">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top"><font size="4">
<b>Rental Price Quote</b></font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" colspan="2">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic">&nbsp;</td>
</tr>```

13. Registered User
Join Date
Mar 2006
Posts
13
part two:

Code:
```			</table>
<table border="1" cellspacing="0" width="100%" cellpadding="4" id="table2" bordercolor="#000000">
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Rate per unit</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Sub-Total</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">
Number of Attendees:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="quatityrate0" size="10" value="\$3.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="quantitysubtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">Hours of the party during normal operational hours:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="normalhours0" size="11" onBlur='return addScheduleEntry()'>&nbsp;
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="normalhoursrate0" size="10" value="\$15.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000"><font size="2">
Hours of the party after normal operational hours:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="afterhours0" size="11" onBlur='return addScheduleEntry()'>&nbsp;
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="afterhoursrate0" size="10" value="\$40.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">Clubhouse Rental:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubrentdescript0" size="11" onBlur='return addScheduleEntry()'>&nbsp;
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubhouserate0" size="10" value="\$250.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubhousesubtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">
<font size="2">
Hours required for setup and cleaning:</font></td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="cleaninghours0" size="11" onBlur='return addScheduleEntry()'></td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="cleaningrate0" size="10" value="\$15.00"></td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="cleaningsubtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
=========</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Total Rental Quote (not including Deposit)</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="subtotal0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000"><font size="2">
Deposit for Pool Rental:</font></td>
<td width="43%" height="28" valign="top" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="pooldeposit0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000"><font size="2">
Deposit for Clubhouse Rental:</font></td>
<td width="43%" height="28" valign="top" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="clubhousedeposit0" size="10"></td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
&nbsp;</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
=========</td>
</tr>
<tr>
<td width="21%" height="28" align="right" valign="top" bordercolor="#000000">&nbsp;</td>
<td width="43%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">&nbsp;</td>
<td width="14%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
Total Rental Quote</td>
<td width="16%" height="28" valign="bottom" style="font-family: aria; font-size: 10pt; font-style: italic" bordercolor="#000000">
<input type="text" name="renttotal0" size="10"></td>
</tr>
</table>
<table border="0" cellspacing="0" width="100%" cellpadding="4" id="table1" height="43">
<tr>

<td width="5%">
<p style="margin:0in;margin-bottom:.0001pt" align="center">
<strong>

<font <p align="center" FACE="Arial">
&nbsp;<input class="go130" type="submit" value="Submit"
onclick="now=new Date;document.getElementById('t').value=now.toString();"/>
&nbsp;
<input
type="reset" value="Reset" name="reset"></font></strong></p>&nbsp;</td>
<font>

</body>

</html>```

14. Banned
Join Date
Jan 2006
Location
I'm in GMT -5
Posts
561
-----
Last edited by James Gatka; 04-02-2006 at 01:39 PM.

15. Registered User
Join Date
Mar 2006
Posts
13
James thank you very much for your coding assistance!!
Last edited by waynej; 04-02-2006 at 06:23 PM.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

"

"

## X vBulletin 4.2.2 Debug Information

• Page Generation 0.18553 seconds
• Memory Usage 3,153KB
• Queries Executed 15 (?)
Template Usage (37):
• (7)bbcode_code
• (1)bbcode_html
• (1)footer
• (1)forumjump
• (1)forumrules
• (1)gobutton
• (15)memberaction_dropdown
• (1)navbar
• (1)navbar_moderation
• (1)navbar_noticebit
• (1)navbar_tabs
• (2)option
• (1)pagenav
• (1)pagenav_curpage
• (15)postbit
• (15)postbit_onlinestatus
• (15)postbit_wrapper
• (1)spacer_close
• (1)spacer_open
• (1)tagbit_wrapper

Phrase Groups Available (6):
• global
• inlinemod
• postbit
• posting
• reputationlevel
Included Files (26):
• ./global.php
• ./includes/class_bootstrap.php
• ./includes/init.php
• ./includes/class_core.php
• ./includes/config.php
• ./includes/functions.php
• ./includes/class_friendly_url.php
• ./includes/class_hook.php
• ./includes/class_bootstrap_framework.php
• ./vb/vb.php
• ./vb/phrase.php
• ./includes/functions_calendar.php
• ./includes/functions_bigthree.php
• ./includes/class_postbit.php
• ./includes/class_bbcode.php
• ./includes/functions_reputation.php
• ./includes/functions_notice.php
• ./packages/vbattach/attach.php
• ./vb/types.php
• ./vb/cache.php
• ./vb/cache/db.php
• ./vb/cache/observer/db.php
• ./vb/cache/observer.php

Hooks Called (74):
• init_startup
• friendlyurl_resolve_class
• init_startup_session_setup_start
• database_pre_fetch_array
• database_post_fetch_array
• init_startup_session_setup_complete
• global_bootstrap_init_start
• global_bootstrap_init_complete
• cache_permissions
• fetch_postinfo_query
• fetch_postinfo
• fetch_foruminfo
• global_state_check
• global_bootstrap_complete
• global_start
• style_fetch
• global_setup_complete
• strip_bbcode
• friendlyurl_clean_fragment
• friendlyurl_geturl
• forumjump
• cache_templates
• cache_templates_process
• template_register_var
• template_render_output
• fetch_template_start
• fetch_template_complete
• parse_templates
• notices_check_start
• notices_noticebit
• process_templates_complete
• friendlyurl_redirect_canonical
• bbcode_fetch_tags
• bbcode_create
• postbit_factory
• postbit_display_start
• postbit_imicons
• bbcode_parse_start
• bbcode_parse_complete_precache
• bbcode_parse_complete
• postbit_display_complete
• memberaction_dropdown
• pagenav_page
• pagenav_complete
• tag_fetchbit_complete
• forumrules
• navbits
• navbits_complete