maarten423
Gebruiker
- Lid geworden
- 8 mrt 2008
- Berichten
- 26
Goedemiddag helpers,
Helaas heb ik helemaal geen verstand van html codes.
Ik heb onderstaande code gevonden bij een taxibedrijf en een beetje gewijzigd.
Ik wil graag dat hij automatisch uitrekent wat het kost om een piano te verhuizen.
De formule vindt ik wel in de code; alleen het html gedeelte is wat lastig.
Kan iemand eens kijken of hier iets van te maken is. Alvast heel erg bedankt.
Hier volgt de code.
Vriendelijke groet,
Maarten
<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br--><strong>Verhuismijnpiano.</strong>nl>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key= ABQIAAAAFjGMd37qp2cnjj7vtZkuaBR_jae4U6hu_46tYn146USExer-oRQ-rqM1Gvx6bHdV4iocxLZK70GiFQ"></script><!-- type="text/javascript"> // --><script type="text/javascript">// <![CDATA[
function initialize() { if (GBrowserIsCompatible()) { // nieuw object ZONDER parameters, want we willen nl. geen geschreven route EN geen map tonen.... // http://code.google.com/apis/maps/documentation/referen...tml#GDirections gdir = new GDirections(); GEvent.addListener(gdir,"load", set_distance); } } function setDirections(fromAddress, toAddress, locale) { // http://code.google.com/apis/maps/documentation/referen...rectionsOptions gdir.load("from: " + fromAddress + " to: " + toAddress, {locale: locale, travelMode:G_TRAVEL_MODE_DRIVING,avoidHighways: false} ); } function set_distance() { // extra: foutafhandeling, kan handig zijn!!! handleErrors(); // document.getElementById("afstand").innerHTML = (gdir.getDistance().meters); var adl_afstand = gdir.getDistance().meters var prijsOnafgerond = (((adl_afstand/1000)-2)*2.2)+7.5 prijs = Math.round(prijsOnafgerond + 0.5) prijsEuro = 'De geschatte ritprijs is: € ' + prijs.toFixed(2) document.getElementById("ritprijs").innerHTML = prijsEuro; } // aantal kilometers - 2 *2.2+150= prijs function handleErrors() { // http://code.google.com/apis/maps/documentation/referen...#GGeoStatusCode if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY || gdir.getStatus().code == G_GEO_MISSING_ADDRESS) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNAVAILABLE_ADDRESS) alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNKNOWN_DIRECTIONS) alert("The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_TOO_MANY_QUERIES) alert("The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n Error code: " + gdir.getStatus().code); }
// ]]></script>
<!-- body { background-color: #5f5f5f; color: #fff; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; } #rittabel { border: } #ritprijs { font-weight: bold; font-size: 14px; color: #fff; } #euro { text-align: right; font-size: 13px; } #tableprijs { padding-top: 15px; } #rights { font-size: 9px; color: #ccc; } h1 { font-size: 16px; font-weight: bold; } -->
<form action="#" enctype="application/x-www-form-urlencoded" method="get">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<h1>Verhuismijnpiano kosten berekenen</h1>
</td>
</tr>
<tr>
<td colspan="2">Via het onderstaande formulier kunt u berekenen wat de verhuizing gaat kosten. Deze prijs is gebaseerd op een verhuizing van de begane grond naar de begane grond.</td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van het ophaaladres in: </td>
<td valign="top"><input id="fromAddress" name="from" size="30" type="text" value="Leeuwendalersweg, Amsterdam" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van aankomst in: </td>
<td valign="top"><input id="toAddress" name="to" size="30" type="text" value="bijv.: 1061 BH, 103" /></td>
</tr>
<tr>
<td> </td>
<td><input name="submit" type="submit" value="Bereken verhuisprijs!" tabindex="1" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2">
<table id="tableprijs" border="0" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td id="rights">Aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>
Helaas heb ik helemaal geen verstand van html codes.
Ik heb onderstaande code gevonden bij een taxibedrijf en een beetje gewijzigd.
Ik wil graag dat hij automatisch uitrekent wat het kost om een piano te verhuizen.
De formule vindt ik wel in de code; alleen het html gedeelte is wat lastig.
Kan iemand eens kijken of hier iets van te maken is. Alvast heel erg bedankt.
Hier volgt de code.
Vriendelijke groet,
Maarten
<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br--><strong>Verhuismijnpiano.</strong>nl>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key= ABQIAAAAFjGMd37qp2cnjj7vtZkuaBR_jae4U6hu_46tYn146USExer-oRQ-rqM1Gvx6bHdV4iocxLZK70GiFQ"></script><!-- type="text/javascript"> // --><script type="text/javascript">// <![CDATA[
function initialize() { if (GBrowserIsCompatible()) { // nieuw object ZONDER parameters, want we willen nl. geen geschreven route EN geen map tonen.... // http://code.google.com/apis/maps/documentation/referen...tml#GDirections gdir = new GDirections(); GEvent.addListener(gdir,"load", set_distance); } } function setDirections(fromAddress, toAddress, locale) { // http://code.google.com/apis/maps/documentation/referen...rectionsOptions gdir.load("from: " + fromAddress + " to: " + toAddress, {locale: locale, travelMode:G_TRAVEL_MODE_DRIVING,avoidHighways: false} ); } function set_distance() { // extra: foutafhandeling, kan handig zijn!!! handleErrors(); // document.getElementById("afstand").innerHTML = (gdir.getDistance().meters); var adl_afstand = gdir.getDistance().meters var prijsOnafgerond = (((adl_afstand/1000)-2)*2.2)+7.5 prijs = Math.round(prijsOnafgerond + 0.5) prijsEuro = 'De geschatte ritprijs is: € ' + prijs.toFixed(2) document.getElementById("ritprijs").innerHTML = prijsEuro; } // aantal kilometers - 2 *2.2+150= prijs function handleErrors() { // http://code.google.com/apis/maps/documentation/referen...#GGeoStatusCode if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS) alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_SERVER_ERROR) alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_MISSING_QUERY || gdir.getStatus().code == G_GEO_MISSING_ADDRESS) alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_KEY) alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_BAD_REQUEST) alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNAVAILABLE_ADDRESS) alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_UNKNOWN_DIRECTIONS) alert("The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.\n Error code: " + gdir.getStatus().code); else if (gdir.getStatus().code == G_GEO_TOO_MANY_QUERIES) alert("The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.\n Error code: " + gdir.getStatus().code); }
// ]]></script>
<!-- body { background-color: #5f5f5f; color: #fff; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; } #rittabel { border: } #ritprijs { font-weight: bold; font-size: 14px; color: #fff; } #euro { text-align: right; font-size: 13px; } #tableprijs { padding-top: 15px; } #rights { font-size: 9px; color: #ccc; } h1 { font-size: 16px; font-weight: bold; } -->
<form action="#" enctype="application/x-www-form-urlencoded" method="get">
<table id="rittabel" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<h1>Verhuismijnpiano kosten berekenen</h1>
</td>
</tr>
<tr>
<td colspan="2">Via het onderstaande formulier kunt u berekenen wat de verhuizing gaat kosten. Deze prijs is gebaseerd op een verhuizing van de begane grond naar de begane grond.</td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van het ophaaladres in: </td>
<td valign="top"><input id="fromAddress" name="from" size="30" type="text" value="Leeuwendalersweg, Amsterdam" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2"> </td>
</tr>
<tr>
<td>Voer uw postcode of adres van aankomst in: </td>
<td valign="top"><input id="toAddress" name="to" size="30" type="text" value="bijv.: 1061 BH, 103" /></td>
</tr>
<tr>
<td> </td>
<td><input name="submit" type="submit" value="Bereken verhuisprijs!" tabindex="1" /></td>
</tr>
<tr>
<td style="height: 20px;" colspan="2">
<table id="tableprijs" border="0" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td id="rights">Aan deze prijsschatting kunnen geen rechten worden ontleend.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>