Você está na página 1de 6

<!

DOCTYPE html>
<html>
<head>
<title>Bob's Auto Parts - Order Form</title>
</head>
<body>
<form action="processorder_v2.php" method="post">
<table style="border: 0px;">
<tr style="background: #cccccc;">
<td style="width: 150px; text-align: center;">Item</td>
<td style="width: 15px; text-align: center;">Quantity</td>
</tr>
<tr>
<td>Tires</td>
<td><input type="text" name="tireqty" size=="3" maxlength="3" /></td>
</tr>
<tr>
<td>Oil</td>
<td><input type="text" name="oilqty" size=="3" maxlength="3" /></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td><input type="text" name="sparkqty" size=="3" maxlength="3" /></td>
</tr>
<tr>
<td>How did you find Bob's?</td>
<td><select name="find">
<option value = "a">I'm a regular customer</option>
<option value = "b">TV advertising</option>
<option value = "c">Phone directory</option>
<option value = "d">Word of mouth</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><input type="submit"
value="Submit Order" /></td>
</tr>
</table>
</form>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
<title>Bob's Auto Parts - Order Form</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<p>Order processed at <?php echo date('H:i, js F Y'); ?></p>
<?php
//get the submitted data from orderform.html
$tireqty = $_POST['tireqty'];
$oilqty = $_POST['oilqty'];
$sparkqty = $_POST['sparkqty'];
$find = $_POST['find'];
?>
<p>Your order are as follows:</p>

<p>
<?php
echo $tireqty .' tires<br />';
echo $oilqty .' bottles of oil<br />';
echo $sparkqty .' spark plugs<br />';
$totalqty = 0;
$totalqty = $tireqty + $oilqty + $sparkqty;
echo '<br ?>';
echo 'Item ordered: ' . $totalqty;
echo '<br ?>';
if ($totalqty == 0) {
echo "You did not order anything on the previous page!<br />";
}else {
if ($tireqty > 0) {
echo $tireqty." tires<br />";
}
if ($oilqty > 0) {
echo $oilqty." bottles of oil<br />";
}
if ($sparkqty > 0) {
echo $sparkqty." spark plugs<br />";
}
}
$totalamount=0.00;
$totalamount = ($tireqty * 100) +($oilqty * 10) +($sparkqty * 4);
echo '<br ?>';
echo 'Sub Total: ' . number_format($totalamount,2);
echo '<br ?>';
if($find == "a") {
echo "<p>Regular customer.</p>";
} else if($find == "b") {
echo "<p>Customer referred by TV advert.</p>";
} else if($find == "c") {
echo "<p>Customer referred by phone directory.</p>";
} else if($find == "d") {
echo "<p>Customer referred by word of
mouth.</p>";
} else {
echo "<p>We do not know how this customer
found us.</p>";
}
?>
</p>
</body>
</html>
-bobs-
<!DOCTYPE html>
<html>
<head>

<title>Play It Again Movies</title>

<style type="text/css">
body{
font-family: sans-serif;
font-size: 20px;
margin-left: 10%;
}
h1{
font-weight: normal;
font-size: 32px;
}
</style>
</head>
<body>

<h1><img src="logo.png" ><br/>Play It Again Movies Order Form</h1>

<form>

<!--Add textbox's and buttons here -->


<table border="1">
<tr>
<td>Customer:</td>
<td><input type="text" name="cname" size="25"></td>
</tr>
<tr>
<td>Date:</td>
<td><input type="text" name="mname" size="15"></td>
</tr>
<tr>
<td>DVDs:</td>
<td><input type="text" name="dvd" size="8"></td>
</tr>
<tr>
<td>Blu-Rays:</td>
<td><input type="text" name="dvd" size="8"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Process Order"></td>
</tr>
</table>
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Play It Again Movies</title>
<style type="text/css">
body{
font-family: sans-serif;
font-size: 20px;
margin-left: 10%;
}
h1{
font-weight: normal;
font-size: 32px;
}
</style>
</head>
<body>

<h1><img src="logo.png" ><br/>Play It Again Movies Order Form</h1>

<form method="post" action="result_form.php">

<!--Add textbox's and buttons here -->


<table border="1">
<tr>
<td>Customer:</td>
<td><input type="text" name="cname" size="25"></td>
</tr>
<tr>
<td>Date:</td>
<td><input type="text" name="mname" size="15"></td>
</tr>
<tr>
<td>DVDs:</td>
<td><input type="text" name="dvd" size="8"></td>
</tr>
<tr>
<td>Blu-Rays:</td>
<td><input type="text" name="dvd" size="8"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Process Order"></td>
</tr>
</table>
</form>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
<title>Play It Again Movies</title>
<style type="text/css">
body{
font-family: sans-serif;
font-size: 20px;
margin-left: 10%;
}
h1{
font-weight: normal;
font-size: 32px;
}
</style>
</head>
<body>
<!-- Page Content Here.. -->
<h1> Order Receipt</h1>
<p>Date: </p>
<p>Thank you John Doe. Your Order has been processed.</p>
<p>You ordered the following items:</p>
<table cellpadding="5" cellspacing="5">
<tr bgcolor="gray">
<td width="250">ITEMS</td>
<td>QUANTITY</td>
</tr>
<tr>
<td>DVDs</td>
<td align="right">0.00</td>
</tr>
<tr>
<td>Blu-ray</td>
<td align="right">0.00</td>
</tr>
<tr>
<td>Total Disk</td>
<td align="right">0.00</td>
</tr>
<tr>
<td>Total Sales</td>
<td align="right">0.00</td>
</tr>
</table>
</body>
</html>
<?php
$customer =$_POST['cname'];
$cDate =$_POST['mname'];
$dvd =(int) $_POST['dvd'];
$bluray =(int)$_POST['bluray'];
$totalDisk =$dvd + $bluray;
$subtotal =$totalDisk * 7;
$tax = $subtotal * (3.5/100);
$total = $subtotal + $tax;
?>
<!DOCTYPE html>
<html>
<head>

<title>Play It Again Movies</title>

<style type="text/css">
body{
font-family: sans-serif;
font-size: 20px;
margin-left: 10%;
}
h1{
font-weight: normal;
font-size: 32px;
}
</style>
</head>
<body>
<!-- Page Content Here.. -->
<h1> Order Receipt</h1>
<p>Date: </p>
<p>Thank you <?php echo $customer?>. Your Order has been processed.</p>
<p>You ordered the following items:</p>
<table cellpadding="5" cellspacing="5">
<tr bgcolor="gray">
<td width="250">ITEMS</td>
<td>QUANTITY</td>
</tr>
<tr>
<td>DVDs</td>
<td align="right"><?php echo $dvd?></td>
</tr>
<tr>
<td>Blu-ray</td>
<td align="right"><?php echo $bluray?></td>
</tr>
<tr>
<td>Total Disk</td>
<td align="right"><?php echo $totalDisk?></td>
</tr>
<tr>
<td>Total Sales</td>
<td align="right"><?php echo '$'.number_format($total,2)?></td>
</tr>
</table>
</form>
</body>
</html>

Você também pode gostar