Pg 1: Pick Vehicle (done)
Pg 2: Pick Accessories using check boxes, and slam them into an array. (done)
Pg 3: Retun the array (done), strip out all the pricing, and add them together, and then create a variable equal to the total.
Pg 4: Make it all look nice for a print out.
I need help on page 3
Here is my code so far:
Code: Select all
<?php
# GRAB THE VARIABLES FROM THE FORM
$expr1 = $_POST['expr1'];
$msrp = $_POST['msrp'];
$type = $_POST['type'];
$make = $_POST['make'];
$expr2 = $_POST['expr2'];
$msrpA = $_POST['msrpA'];
$FitMK = $_POST['FitMK'];
$acclist = $_POST['chkexpert'];
$today = date("F j, Y, g:i a");
?>
<B>Vehicle: </B><?php echo $expr1;?><BR>
<?php
$tax = (($msrp+$msrpA)*1.06)-($msrp+$msrpA)
?>
<B>Tax: </B>$<?php
printf("%10.2f\n", $tax );
?><BR>
<B>Title: </B>
<?php
if ($type == "MC") {
echo "$150.00";
$titleprice = "150.00";
}
?>
<?php
if ($type == "UTIL") {
echo "$120.00";
$titleprice = "120.00";
}
?>
<?php
if ($type == "ATV") {
echo "$102.50";
$titleprice = "102.50";
}
?>
<BR>
<?php
$total = ($tax+$titleprice+$msrp+$msrpA)
?>
<B>Vehicle Total: </B>$<?php
printf("%10.2f\n", $total );
?><BR>
<BR>
<?php
if(isset($chkexpert))
{
print '<B>Accessories:</B> <BR>';
$n = count($chkexpert);
for($i = 0; $i <= $n; $i++)
{
print "" . $chkexpert[$i] . "<BR>";
}
} else
?>
<form method='POST' action='test4.php'>
<input type="hidden" value="
<?php
if(isset($chkexpert))
{
$n = count($chkexpert);
for($i = 0; $i <= $n; $i++)
{
print "" . $chkexpert[$i] . "<BR>";
}
} else
?>
" name="acclist">
<?php
print "
<table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='62%' id='table1'>
<tr>
<td colspan='4'><font face='Arial'><b>Customer Information</b></font></td>
</tr>
<tr>
<td width='10%'><font face='Arial' size='2'>Name:</font></td>
<td><input type='text' name='name' size='43'></td>
<td width='6%'><font face='Arial' size='2'>Phone</font></td>
<td><input type='text' name='phone' size='26'></td>
</tr>
<tr>
<td width='10%'><font face='Arial' size='2'>Address:</font></td>
<td><input type='text' name='address' size='43'></td>
<td width='6%'><font face='Arial' size='2'>Email</font></td>
<td><input type='text' name='email' size='26'></td>
</tr>
<tr>
<td width='10%'> </td>
<td><input type='text' name='city' size='31' value='City'><input type='text' name='state' size='5' value='State'><input type='text' name='zip' size='5' value='Zip'></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width='10%'><font face='Arial' size='2'>SSN:</font></td>
<td><input type='text' name='ssn' size='43'></td>
<td><font face='Arial' size='2'>Salesman</font></td>
<td><select size='1' name='salesman'>
<option>BS</option>
<option selected>Please Select</option>
<option>MH</option>
<option>JF</option>
<option>JM</option>
<option>DS</option>
<option>BK</option>
<option>CR</option>
</select></td>
</tr>
<tr>
<td width='10%'><font face='Arial' size='2'>DOB:</font></td>
<td><input type='text' name='dob' size='43'></td>
<td><font face='Arial' size='2'>Date</font></td>
<td>
<input type='text' name='date' size='20' onfocus='this.blur()' value='$today'></td>
</tr>
<tr>
<td width='10%'> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<input type='hidden' value='$expr2' name='expr2'>
<input type='hidden' value='$msrpA' name='msrpA'>
<input type='hidden' value='$FitMK' name='FitMK'>
<input type='hidden' value='$expr1' name='expr1'>
<input type='hidden' value='$msrp' name='msrp'>
<input type='hidden' value='$type' name='type'>
<input type='hidden' value='$make' name='make'>
<input type='hidden' value='$tax' name='tax'>
<input type='hidden' value='$titleprice' name='title'>
<input type='hidden' value='$total' name='total'>
<p><input type='submit' value='Submit' name='B1'></p>
</form>";
php?>Any guidance?