PDA

View Full Version : Credit - HC - Typo Converter



Verrou
23-08-2007, 07:05 AM
Make a HTML file, and put the following code into it:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Converter</title>
<script type="text/javascript" src="credit.js"></script>
</head>

<div align=center>
<form>
<table id="example" cellpadding="3" cellspacing="3">
<tr>
<td align="center">Credits</td>
<td align="center">Hc(s)</td>
<td align="center">Typo(s)or Thrones</td>
</tr>
<tr>

<td align="center">
<input type="text" size="10" name="credit" value="0"></td>
<td align="center"><input type="text" size="10" name="hc" value="0"></td>
<td align="center"><input type="text" size="10" name="t" value="0"></td>
</tr>
<tr>
<td align="center"><input type="button" name="B2" value=" > "
onClick="convert(this.form)"></td>
<td align="center"><input type="button" name="B22" value=" < > "
onClick="converthc(this.form)"></td>
<td align="center"><input type="button" name="B23" value=" < "
onClick="convertt(this.form)"></td>
</tr>
</table>
</form>
</div>
<body>
</body>
</html>



Make a JS file and put the following into it:


function convert(f) {
f.hc.value=Math.round(f.credit.value/60*100000)/100000
f.t.value=Math.round(f.credit.value/4200*100000)/100000
}

function converthc(f) {
f.credit.value=Math.round(f.hc.value*60*100000)/100000
f.t.value=Math.round(f.hc.value/70*100000)/100000
}

function convertt(f) {
f.credit.value=Math.round(f.t.value*4200*100000)/100000
f.hc.value=Math.round(f.t.value*70*100000)/100000
}

Once all completed, change the values in red to suit your hotels values.

Hotel Conversions:

70 = How many hcs for a typo/throne.
60 = How many credits for a hc sofa
4200 = How many credits in a typo/throne

And Et Voila! You have yourself a converter!

Demo (http://andrehamon.evenhosting.com/testconverter.html)

Have fun,
Verrou.

Want to hide these adverts? Register an account for free!