calculate a php class with a new variable
I am not sure what a class is. i have a page already written that has classes in place for equations. I have made some new variables for some new equation but am getting incorrect results, I basically need to multiple / divide / subtract these prebuilt classes against my new variable
this is what i have so far
<?php
$utilityHost = 21.0;
$col4 = $option_two->amount_due_before - $option_two->four_weeks_security - $option_two->fee;
$col5 = $col4 / $row_Recordset1['rental_price'];
$col3 = $utilityHost * $col5;
$col6 = $row_Recordset1['rental_price'] * $col5;
?>
$col4 is the variable using the pre built classes.
all of these are being echoed out into a table
e.g
<?php
echo "£" . number_format($row_Recordset1['rental_price'] - $utilityHost);
?>
<?php
echo "£" . $utilityHost;
?>
the classes
<?php
require_once('../lib/PaymentOptionOne.php');
require_once('../lib/PaymentOptionTwo.php');
require_once('../lib/PaymentOptionThree.php');
require_once('../lib/PaymentOptionFour.php');
$rent = $row_Recordset1['rental_price'];
if($row_Recordset1['weekly_rate'] != 0.00)
$rent = $row_Recordset1['weekly_rate'];
$weeks = $row_Recordset1['weeks'] / 7;
$query = "SELECT * FROM editprop WHERE prop_id = %s";
$query = sprintf($query, GetSQLValueString($row_Recordset1['prop_id'], "text"));
$results = mysql_query($query);
while($row = mysql_fetch_array($results))
{
$option_three_rent = $row['rental_price_monthly'];
if(empty($option_three_rent))
{
$option_three_rent = $rent;
}
}
$option_one = new PaymentOptionOne($rent, $weeks);
$option_two = new PaymentOptionTwo($rent, $weeks);
$option_three = new PaymentOptionThree($option_three_rent, $weeks);
thanks in advance
