http://www.freewebs.com/go5pel/Signature.html
<html>
<body>
<head>
<SCRIPT LANGUAGE="JavaScript">
var effectlisting=new Array();
effectlisting[0]="";
var points=new Array();
points[0]=0;
var coolpoints=new Array();
coolpoints[0]=0;
cycle=0;
function see()
{
effectlisting[cycle]=document.form2.List.value;
document.form2.List.value=document.form2.List.value+"
"+document.form1.select1.value+" Intensity: "+Intensity +"
Duration: " +Duration+" Total Cost: "+
document.form1.Total.value+"\n";
cycle=cycle+1;
effectlisting[cycle]=document.form2.List.value;
points[cycle]=document.form1.Total.value*(1-
(document.form2.option[1].checked*1)*Drawback)+points[cycle-
1];
coolpoints[cycle]=document.form1.Total.value*(1-
(document.form2.option[0].checked*1)*Drawback)+coolpoints
[cycle-1];
pointsupdate()
}
function clear_textbox()
{
if (document.form1.text1.value == "Name of signature")
document.form1.text1.value= "";
}
function clear_desc()
{
if (document.form2.Signature.value == "Signature description
goes here")
document.form2.Signature.value= "";
}
function final()
{
document.write(document.form1.text1.value + "<br>"+
document.form2.Signature.value +"<br>effects list: <br><table
border=1><tr><td>" + effectlisting[cycle].replace(/\n/,
'<br>') + "</td></tr></table> <br>Points spent=" +
document.form2.totalpoints.value + "<br>Cooldown="+
document.form2.coolpoints.value/40 + "<br>");
}
function unsee()
{
cycle=cycle-1;
document.form2.List.value=effectlisting[cycle];
pointsupdate()
}
function pointsupdate()
{
document.form2.totalpoints.value=points[cycle];
document.form2.coolpoints.value=coolpoints[cycle];
}
</SCRIPT>
<?php
echo("<SCRIPT LANGUAGE=\"JavaScript\">
function argle(e)
{
bargle=0
for (i=e; i>=0; i--)
{
bargle=bargle+i;
}
return(bargle);
}
function refresh()
{
Intensity=document.form1.Int.value*1;
Duration=document.form1.Dur.value*1;
Cost=document.form1.Cost.value*1;
Stacking=document.form1.Stack.value*1;
Base=document.form1.Base.value*1;
Drawback=document.form1.Drawback.value*1;
document.form1.Total.value=((Intensity*Cost+(argle(Intensity
-1)*Stacking))*Duration+Base)*(1-2*Drawback);
Total=document.form1.Total.value;
}
function update_label()
{
n=document.form1.select1.value;
switch(n)
{
");
$sql_csatlakozas = mysql_connect("localhost",
"root","********");
mysql_selectdb("rern", $sql_csatlakozas);
$sql = "select effect_name as eff, description as des, base,
cost, stack, drawback from effect order by drawback,
effect_name";
$eredmeny1 = mysql_query($sql, $sql_csatlakozas);
while ($sor1 = mysql_fetch_array($eredmeny1, MYSQL_ASSOC))
{
echo("case \"$sor1[eff]\":
document.form1.Comments.value= \"$sor1[des]\";
document.form1.Base.value=\"$sor1[base]\";
document.form1.Cost.value=\"$sor1[cost]\";
document.form1.Stack.value=\"$sor1[stack]\";
document.form1.Drawback.value=\"$sor1[drawback]\";
break;
");
}
echo("
}
refresh();
}
</SCRIPT>");
?>
</head>
<form name="form1">
<input type=text name="text1" value="Name of signature"
onFocus=clear_textbox()><br>
<select name="select1" onchange=update_label()>
<?php
$sql_csatlakozas = mysql_connect("localhost",
"root","***********");
mysql_selectdb("rern", $sql_csatlakozas);
$sql = "select effect_name as eff, description as des,
drawback from effect order by drawback, effect_name";
$eredmeny = mysql_query($sql, $sql_csatlakozas);
while ($sor = mysql_fetch_array($eredmeny, MYSQL_ASSOC))
{
echo("<option>$sor[eff]</option>
");
}
echo("</select>");
?>
<br>
<table border="1" >
<tr>
<td rowspan=3>
<TEXTAREA name="Comments" readonly rows=15
cols=22></TEXTAREA>
</td>
<td align="right">Cost= <input type=text name="Cost"
readonly></td>
<td align="right">Intensity: <input type=text name="Int"
value=1 maxlength=3 size="2" onchange=refresh()
value=1></td><tr>
<td align="right">Stacking Cost= <input type=text
name="Stack" readonly ></td>
<td align="right">Duration: <input type=text name="Dur"
value=1 maxlength=3 size="2" onchange=refresh()
></td></tr><tr>
<td align="right">Base Cost= <input type=text name="Base"
readonly></td>
<td align="right">Total: <input type=text name="Total"
value="00" size="2" readonly></td>
</tr>
</table>
<input type=hidden name="Drawback" value=0>
</form>
<INPUT type="submit" Value="Add to effects list" onclick=see
()>
<INPUT type="submit" Value="Remove last effect"
onclick=unsee()>
<form name="form2" method="post">
<TEXTAREA name="List" readonly cols=60></TEXTAREA>
<br><table border="1">
<tr><td>
Points used so far: <input type=text name="totalpoints"
readonly size="2" value=0>
<br>Cooldown calculated from: <input type=text
name="coolpoints" readonly size="2" value=0><br>
Drawback deducted from:
<br>
<INPUT type="radio" name="option" value="base"> Base cost
<INPUT type="radio" name="option" value="cooldown" CHECKED>
Cooldown
</td>
<td><TEXTAREA name="Signature" cols=33 rows=5
onFocus=clear_desc()>Signature description goes
here</TEXTAREA></td></tr>
</table>
</form>
<input type=submit value="Describe signature" onclick=final
()>
</body>
</html>