-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold_report.php
73 lines (72 loc) · 2.07 KB
/
old_report.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<? require_once("connect_to_DB.php"); // inserts contents of this file here ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Report</title>
<link rel="stylesheet" href="hw2.css"/>
<?session_start()?>
</head>
<?
connectDB();
session_start();?>
<head>
<title>Receipt</title>
<link rel="stylesheet" type="text/css" href="hw2.css"/>
</head>
<body>
<h1><a href="http://tinyurl.com/mstgdqk"><img src="http://tinyurl.com/on58dwh" alt=" photo Untitled_zps8bfcff57.jpg"/></a></h1>
<?
include ('navbar_func.php');
echo navbar();
?>
<center>
Order Number: <? echo $_POST["ordernumber"]; ?><br/>
Order Date: <? echo $_POST["orderdate"]; ?><br/>
Customer: <? echo $_POST["customer"]; ?><br/>
Sales Agent: <? echo $_POST["salesagent"]; ?><br/>
Order Status: <? echo $_POST["orderstatus"]; ?><br/>
</center>
<p/><p/>
<form method="post" action="hw2.php">
<input type="hidden" name="page" value="home"/>
<table border = "1">
<tr>
<th>Product</th>
<th>Quantity</th>
<th>Total Price</th>
</tr>
<?for($x=0; $x <= 10; $x++){?>
<tr>
<td><?= $_POST["P$x"]; ?></td>
<td><?= $_POST["Q$x"]; ?></td>
<?$sql = "INSERT INTO orderitem (item_quantity, order_id, item_linenum, product_id, item_unitprice)
VALUES ('Q<?=$x?>', 'ordernumber', '2', BC502', 'P<?=$x?>')";
if (mysqli_query($db, $sql))
{
echo "New record created successfully";
}
else
{
echo "Error: " . $sql . "<br>" . mysqli_error($db);
}?>
<td><?= $_POST["M$x"]*$_POST["Q$x"];//Since multiplication is just there to remind me what I was doing. I know it's not synatically correct.?></td>
</tr>
<?}?>
</table>
<center>
Total Cost of Order: $
<?php
$total = 0;
for($x=0; $x <= 10; $x++){
$total = $total + ($_POST["M$x"]*$_POST["Q$x"]);
}
echo $total;
?>
</br>
<input type="submit" value="Return"/>
<!--<input type="reset" value="Reset"/>-->
</center>
</form>
</body>
</html>