...

View Full Version : Help with a php calc



AlexDigital
07-16-2012, 03:16 PM
/*
RN = RENDARFAM NOTE
FD= DIVISION FACTOR
TF = TIMPE PER FRAME
NF = NO OF FRAME
NU = NOTE CPU USER
FU = FREQUENCY CPU - SELECTED FROM LIST VALUE
FP = FREQUENCY CPU - SELECTED FROM FORM INPUT
CN = CPU NO
TRU = TIME RENDER USER - CONVERT h.min.sec INTO MINUTES
TR = TIME RENDER FARM
NSU = NOTE USER SIST
AMOUNT = TOTAL PAYMENT
DISCOUNT = DISCOUNT RULES
*/

$RN =$_POST['RN'] =977;
$FU =$_POST['GHZ'];
$FP =$_POST['CLOC'];
$NSU =($NU/$FU)*$FP;
$FD =$RN/$NSU;
$TRU =$TF*$NF;
$TR =$TRU*$FD;
$PRICE =3.8;
$AMOUNT =(($TR*$PRICE*'2000')/100);
$DISCOUNT=$_POST['AMOUNT'];
<form action="" method="">
<label>Your CPU-type:</label>
<select id="type" name="type">
<option value="17.040">Intel Xeon</option>
<option value="16.321">AMD</option>
</select>
<label>Cloc[GHz]:</label>
<input type="text" maxlength="4" size="8"/>
<label>#CPU</label>
<select id="cpu" name="cpu">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<label>Average render time per frame:</label>
<input type="text" size="2" maxlength="2" >.h
<input type="text" size="2" maxlength="2" >.min
<input type="text" size="2" maxlength="2" >.sec
<label>Total frames: </label>
<input type="text" maxlength="6" size="8" >
<input type="submit" value="Calculate" name="Calculate" />
</form>


hello again, im trying to make a php calc for a wp theme. This calc has to show the user how much is the cost if he will use the render farm services.

the list in your cpu type is from cpubenchmark and the values are the marks shown on the site this is the first step.
the point of this calc is to show the time / frame that the user is geting on hes pc and the time per frame in the rander farm.

Keleth
07-16-2012, 03:34 PM
Welcome to Coding Forums.

Please wrap your code in the appropriate tags (code or php) and actually describe your problem and steps you've taken, as well as what you're trying to accomplish. You've thrown us a bunch of code and expect what from it?

Len Whistler
07-16-2012, 10:06 PM
I would also consider using Javascript for the calculator instead of PHP. With PHP the page has to be reloaded to get the output, with Javascript the output is updated instantly without a page reload.

It makes for a nicer web experience for the user.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum