What I want to do here is use the cf_455 info (which is either a 1 or 0) to do some simple math ie: If cf_455 is 1 then I want the $taxtotal to be the product of subtotal * .06 and then be displayed in the table marked Sales Tax. With what I have below (marked in Red, if I did it right) all I get is a blank screen. Would someone care to comment on what I have done wrong?
Thanks Alot!!
CODE
$quoteinfo = "SELECT
`vtiger_quotes`.`quoteid`,
`vtiger_quotesbillads`.`bill_city`,
`vtiger_quotesbillads`.`bill_code`,
`vtiger_quotesbillads`.`bill_street`,
`vtiger_quotesbillads`.`bill_state`,
`vtiger_quotesshipads`.`ship_city`,
`vtiger_quotesshipads`.`ship_code`,
`vtiger_quotesshipads`.`ship_state`,
`vtiger_quotesshipads`.`ship_street`,
`vtiger_quotes`.`accountid`,
`vtiger_account`.`accountname`,
`vtiger_quotes`.`total`,
`vtiger_quotes`.`adjustment`,
`vtiger_quotes`.`subtotal`,
`vtiger_quotes`.`contactid`,
`vtiger_quotes`.`validtill`,
`vtiger_quotes`.`terms_conditions`,
`vtiger_quotes`.`s_h_amount`,
`vtiger_accountscf`.`cf_455`
FROM
`vtiger_quotesbillads`
Inner Join `vtiger_quotesshipads` ON `vtiger_quotesbillads`.`quotebilladdressid` = `vtiger_quotesshipads`.`quoteshipaddressid`
Inner Join `vtiger_quotes` ON `vtiger_quotes`.`quoteid` = `vtiger_quotesbillads`.`quotebilladdressid`
Inner Join `vtiger_account` ON `vtiger_quotes`.`accountid` = `vtiger_account`.`accountid`
Inner Join `vtiger_accountscf` ON `vtiger_accountscf`.`accountid` = `vtiger_account`.`accountid`
WHERE
`vtiger_quotes`.`quoteid` = '$record'";
$result = mysql_query($quoteinfo);
while ($row = mysql_fetch_assoc($result)) {
echo "<table>";
echo "<table border=\"2\" align=\"center\" width=\"500\"><Caption> Billing and Installation Address</caption";
echo "<tr><td>".$row['bill_street']."</td><td>".$row['ship_street']."</td></tr>";
echo "<tr><td>".$row['bill_city']."</td><td>".$row['ship_city']."</td></tr>";
echo "<tr><td>".$row['bill_state']."</td><td>".$row['ship_state']."</td></tr>";
echo "<tr><td>".$row['bill_code']."</td><td>".$row['ship_code']."</td></tr>";
echo "</table><br/>";
}
$result = mysql_query($quoteinfo);
while ($row = mysql_fetch_assoc($result)) {
echo "<table>";
echo "<table border=\"2\" align=\"center\" width=\"700\"><Caption>Proposal Synopsis</caption";
echo "<tr><td>".$row['description']."</td><td>";
echo "</table><br/>";
}
include ('include/baaGrid.php');
$queryString1 = "SELECT
`vtiger_inventoryproductrel`.`productid`,
`vtiger_products`.`productid`,
`vtiger_inventoryproductrel`.`quantity`,
`vtiger_inventoryproductrel`.`listprice`,
`vtiger_products`.`productname`,
`vtiger_products`.`product_description`,
`vtiger_inventoryproductrel`.`id`,
`vtiger_inventoryproductrel`.`tax2`
FROM
`vtiger_inventoryproductrel`
Inner Join `vtiger_products` ON `vtiger_inventoryproductrel`.`productid` = `vtiger_products`.`productid`
WHERE
`vtiger_inventoryproductrel`.`id` = '$record'";
//***********This is where we build the Table*************************
$grid = new baaGrid($queryString1);
$grid->setTableAttr('border="2" cellspacing="1" width="700" ');
$grid->setDateFormat('d M y');
//$grid->setHeadings("productid,quantity,listprice");
$grid->hideColumn(0);
$grid->hideColumn(1);
$grid->hideColumn(3);
$grid->hideColumn(6);
$grid->hideColumn(7);
$grid->setAlign(4,c);
$grid->setHeadings("productid,productid,Qty.,price,Part No.,Description,id,tax");
$grid->setHeaderClass('head1');
$grid->setColClass('data2,data1');
$grid->display();
//mysql_close($conn)
//************Totals Area**********************
$taxstatus = 'cf_455'
if $taxstatus = '1' then $taxtotal = ('subtotal'* .06);
$result = mysql_query($quoteinfo);
while ($row = mysql_fetch_assoc($result)) {
echo "<table>";
echo "<table border=\"2\" align=\"center\" width=\"500\"><Caption>Proposal Totals</caption";
echo "<tr><td>SubTotal</td><td>".$row['subtotal']."</td></tr>";
echo "<tr><td>Adjustment</td><td>".$row['adjustment']."</td></tr>";
echo "<tr><td>Sales Tax</td><td>".$row['$taxtotal']."</td></tr>";
echo "<tr><td>Labor Total</td><td>".$row['s_h_amount']."</td></tr>";
echo "<tr><td>Grand Total</td><td>".$row['total']."</td></tr>";
[mod edit] how come code tags are so hard to comprehend?