...

View Full Version : Need A Cost Calculator Coding



pixelWORKmedia
08-09-2010, 05:58 PM
Breif Description:
Hello, I'm about to start work with a client and they would like a cost calculator on there website. What I mean by this is, it has a form, where by the person viewing the website can choose between two different times of the year (which has a seperate basic rate) then a calculation is done by the script of how many miles between the UK Postal Codes imputted into the form (there will be 3 postcode inputs on the form)

Detailed Description:
I'm about to start work with a client who owns a classic car, and is looking to do wedding car hire. What they would like to do is have a 2 basic rates which is selectable from a List Menu. One being between April & October, the other being between November & March.

Once one of the options is selected, it then has a basic cost stored prusumablely in a variable. (I dont know, just an idea, if you have a better way, please do surguest it) then I need to be able to have 3 different inputs for the postal code and the script works out how many miles the journey will be, charged at a rate per mile on top of the basic cost.

The form should look a little bit like this I should imagine (like I said earlier, I'm open to surguestions)


<form id="form1" name="form1" method="post" action="">
<p>
<label>
Date of Car Hire
<select name="select" id="select">
<option value="Please Select" selected="selected">Please Select</option>
<option value="April to October">April to October</option>
<option value="November to March">November to March</option>
</select>
</label>
</p>
<p>Initial Pickup Postcode:
<input type="text" name="initialPostcode" id="initialPostcode" />
</p>
<p>Church Postcode:
<label>
<input type="text" name="churchPostcode" id="churchPostcode" />
</label>
</p>
<p>Reception / Venue Postcode:</p>
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</form>

I understand this is going to be quite a complex script and was wondering how much it would cost me.

If you could reply to the thread and if I belive your responce is a serious responce then I will private message you my E-Mail, if you want to private message to discuss this also please feel free to do so! I hope I have explained everything clearly enough for you, if I haven't and you ahve any queries please ask.

bcarl314
08-09-2010, 10:18 PM
Interesting idea. I'm not familiar with UK postal codes, but to calculate distance, you'd need to know the latitude and longitude for the postal code, which might be tricky.

An alternative might be to use the google Maps API and ask for a specific address, then you could calculate a better distance (and even have the API give you actual driving distance).

_Aerospace_Eng_
08-09-2010, 10:24 PM
Do you care if the page reloads or are you wanting to avoid a page refresh? What language do you need this done in? I'm assuming php?

Mike_O
08-10-2010, 04:39 PM
Yes, this sounds like an interesting project. I would definitely rely on something like Google API to achieve this, taking into consideration the actual roads, rather than calculating the spherical distance by brute force (Haversine formula, is it?)

Mike

Developr
08-10-2010, 07:06 PM
Interesting idea. I'm not familiar with UK postal codes, but to calculate distance, you'd need to know the latitude and longitude for the postal code, which might be tricky.

An alternative might be to use the google Maps API and ask for a specific address, then you could calculate a better distance (and even have the API give you actual driving distance).

Correct. You need lat/long as there is no freely available database or API of any sort for UK postal codes.

_Aerospace_Eng_
08-11-2010, 04:30 AM
The distance the google api will use would be the center of whatever post code you give it so it would be just an estimate.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum