Hi all,
I have a problem trying to code the following script.
I have some vars which gets thier data from a MySQL table.
$row_pin_sales['saleprice'] // this var holds currency
$_SESSION'agentrate'] // this var hold a percentage, in the data table it is 33.3%
$row_pin_sales['discount'] // this var hold another percentage which can any amount under 33.3 %
$row_pin_sales['used_count'] // this var holds a number, lets say 2
$row_pin_sales['saleprice'];
$_SESSION'agentrate'];
$row_pin_sales['discount'] ;
$row_pin_sales['used_count'];
if ($row_pin_sales['used_count'] > 0) {
echo money_format('%i',$agentcomm = $row_pin_sales['saleprice'] - $_SESSION'agentrate'] - $row_pin_sales['discount']);
} else {
echo "0.00";
}
What I am trying to do is display a result of:
$saleprice minus $_SESSION'agentrate'] minus $row_pin_sales['discount'].
I think my question is how do I deal with the vars that hold percentages when it come to constructing my code.
I hope I have provided enough information and written it clearly.
Help is required, please