-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShowTCPaid.php
69 lines (60 loc) · 2.07 KB
/
ShowTCPaid.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
<?php
// Login Credentials required.
require('../includes/ProtectMB.php');
// Destroy session at time limit.
require('../includes/SessionExpire.php');
//Turn on error reporting
ini_set('display_errors', 'On');
// Import dBase Credentials.
require('../../project/g3f2Kcd57nE4s25.php');
// Connect to the database.
$mysqli = new mysqli($servername, $username, $password, $database);
?>
<!DOCTYPE HTML>
<html>
<head>
<?php
include('../includes/HeadMB.php');
?>
</head>
<body>
<h1>MoonBuyers InterGalactic</h1>
<h2>Show Transactions and Commissions Paid By Date Range</h2>
<div class="container">
<h3>Confidential</h3>
<!-- Note inline stle override - force table width and centering! Noop from style.css -->
<table class="table table-hover table-bordered" style="width: 35%; margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th class="text-center bold">Contracted</th>
<th class="text-center bold">Total Commissions</th>
</tr>
</thead>
<tbody>
<?php
if (!($stmt = $mysqli->prepare("SELECT SUM(Trans_at) AS 'Contracted', SUM(Com_pd) AS 'Total_Commissions'
FROM Contract
WHERE Eff_Date >= ? AND Eff_Date <= ?"))) {
echo "Prepare failed: " . $stmt->errno . " " . $stmt->error;
}
if (!($stmt->bind_param("ss", $_POST['begDate'], $_POST['endDate']))) {
echo "Bind failed: " . $stmt->errno . " " . $stmt->error;
}
if (!$stmt->execute()) {
echo "Execute failed: " . $mysqli->connect_errno . " " . $mysqli->connect_error;
}
if (!$stmt->bind_result($Contracted, $Total_Commissions)) {
echo "Bind failed: " . $mysqli->connect_errno . " " . $mysqli->connect_error;
}
while ($stmt->fetch()) {
echo "<tr>\n<td align=\"center\">\n" . "$" . $Contracted . "\n</td>\n<td align=\"center\">\n" . "$" . $Total_Commissions . "\n</td>\n</tr>";
}
$stmt->close();
?>
</tbody>
</table>
<br>
<button type="button" class="button" onclick="location.href = 'IndexMB.php';">Return to Main Page</button>
</div>
</body>
</html>