forked from SecareLupus/fc_pos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewhowfound.php
38 lines (31 loc) · 1.01 KB
/
viewhowfound.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
<?php
// viewhowfound.php
// A report of how people found the store in reverse date order
$title = "How People Found Out About Us";
include('funcs.inc');
include('header.php');
$cxn = open_stream();
$sql = "SELECT m.fname fname,
m.lname lname,
m.ID ID,
h.dt date,
h.howfound howfound
FROM members m
JOIN howFound h
ON h.memberID = m.ID
ORDER BY h.dt desc";
$result = query($cxn, $sql);
echo "<table border cellpadding=3><tr><td>Name</td><td>Date</td><td>How'd ey find us?</td><td>Sales</td></tr>\n";
while($row = mysqli_fetch_assoc($result))
{
extract($row);
echo "<tr><td>$fname $lname</td><td>$date</td><td>$howfound</td>";
$sql = "SELECT SUM(totalPrice) FROM transactions WHERE customerID='$ID'";
$rzlt = query($cxn, $sql);
$r2 = mysqli_fetch_row($rzlt);
$sales = $r2[0];
echo "<td>" . money($sales) . "</td></tr>\n";
}
echo "</table>";
include('footer.php');
?>