Bob's Auto Parts

Order Results

Order processed at '; echo $date; echo '

'; echo '

Your order is as follows:

'; $totalqty = 0; $totalqty = $tireqty + $oilqty + $sparkqty; echo 'Items ordered: '.$totalqty.'
'; if( $totalqty == 0) { echo 'You did not order anything on the previous page!
'; } else { if ( $tireqty>0 ) echo $tireqty.' tires
'; if ( $oilqty>0 ) echo $oilqty.' bottles of oil
'; if ( $sparkqty>0 ) echo $sparkqty.' spark plugs
'; } $totalamount = 0.00; define('TIREPRICE', 100); define('OILPRICE', 10); define('SPARKPRICE', 4); $totalamount = $tireqty * TIREPRICE + $oilqty * OILPRICE + $sparkqty * SPARKPRICE; $totalamount=number_format($totalamount, 2, '.', ' '); echo '

Total of order is '.$totalamount.'

'; echo '

Address to ship to is '.$address.'

'; $outputstring = $date."\t".$tireqty." tires \t".$oilqty." oil\t" .$sparkqty." spark plugs\t\$".$totalamount ."\t". $address."\n"; // As this script is on the web, I don't want anyone to actually // use it: if ( FALSE ) { // open file for appending $fp = fopen("$DOCUMENT_ROOT/PHP/orders.txt", 'ab'); if (!$fp) { echo '

Your order could not be processed at this time. ' .'Please try again later.

'; exit; } fwrite($fp, $outputstring, strlen($outputstring)); fclose($fp); } echo '

Order written. (Not really)

'; ?>