I have gotten some really good help here in the last few days, wanted to say thanks for that 🙂.
Now I have some code partially built but have hit another road block.. I can't figure out how to make fields for the user to specify a 'Discount' & 'Quantity' in the below code.
Any help would be appreciated, and I wouldn't mind a critique of the code itself either... thanks
(I have sense edited the code, so I changed it here also to reflect those changes)
<?php
$time = time(); // Stores the Timestamp
echo date("m/d/y G.i:s", $time);
echo " | ";
Echo "Today is ";
echo date ("F j of Y, \a\\t g.i a", $time);
echo "<br>";
echo "<br>";
?>
<?php
$qty = 1;
$item = 'Product Name 1'; // Product Name w Desc
$pec = 1000001; // Secondary Part Number
$sap = 1000111; // Part Number
$price = 1000.00; // Standard Price
$install = 50.00; // Install Cost
$maint = 5.00; // Maintenace Cost
$discount = 5.00; // Percentage, use percent*100 format
$ext_price = 1000.00; // Standard Price * Qty
$ext_install = 50.00; // Install Cost * Qty
$ext_maint = 0.00; // Maintenace Cost * Qty
$ext_usc = 0.00; // Price after Discount
$ext_discount = 5.00; // Percentage, use percent*100 format
?>
<?php
echo "<pre>";
printf("%-5s%-20s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", "QTY", "Item", "PEC", "SAP", "Price", "Install", "Maint", "Disc", "w Disc", "X Price", "X Inst", "X Maint", "w Disc");
printf("%'-135s\n", "");
echo "</pre>";
?>
<?php
$with_disc = round( (($price*(round($discount/100, 2)))-$price), 2);
$with_ext_price = ($ext_price*$qty);
$with_ext_install = ($ext_install*$qty);
$with_ext_maint = ($ext_maint*$qty);
$with_disc2 = round( (($price*(round($discount/100, 2)))-$cost), 2);
echo "<pre>";
printf("%-5s%-20s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s%-10s\n", $qty, $item, $pec, $sap, $price, $install, $maint, $discount, $with_disc, $with_ext_price, $ext_install, $ext_maint, $with_disc2);
echo "</pre>";
?>