-
Notifications
You must be signed in to change notification settings - Fork 3
/
full-statement.php
139 lines (123 loc) · 6.34 KB
/
full-statement.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
//include auth.php file on all secure pages
include("auth.php");
//sql database
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "amazon";
$conn = mysqli_connect($servername, $username, $password, $dbname) or die("Connection failed: " . mysqli_connect_error());
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$limit = 15;
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * $limit;
$sql = "SELECT * FROM settlements ORDER BY id ASC LIMIT $start_from, $limit";
$rs_result = mysqli_query($conn, $sql);
?>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Amazon Statement Project</title>
<!-- Bootstrap core CSS -->
<?php include 'nav/css.php';?>
<link rel="stylesheet" href="css/simplePagination.css" />
<script src="js/jquery.simplePagination.js"></script>
</head>
<body id="page-top">
<?php include 'nav/nav.php';?>
<?php include 'nav/header.php';?>
<div class="">
<div class="table-responsive"> </div>
<div style="padding-top:20px;">
<table class="table table-condensed table-bordered table-striped table-hover dt-responsove wrap" cellspacing="0" >
<thead>
<tr style="font-size: 11px; font-weight: bold;">
<th>transaction type</th>
<th>order id</th>
<th>merchant order id</th>
<th>marketplace name</th>
<th>amount type</th>
<th>amount description</th>
<th>amount</th>
<th>fulfillment id</th>
<th>posted date</th>
<th>posted date time</th>
<th>order item code</th>
<th>merchant order item id</th>
<th>merchant adjustment item id</th>
<th>sku</th>
<th>quantity purchased</th>
<th>promotion id</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_assoc($rs_result)) {
?>
<tr class="table-smaller-text">
<td><?php echo $row["transaction_type"]; ?></td>
<td><?php echo $row["order_id"]; ?></td>
<td><?php echo $row["merchant_order_id"]; ?></td>
<td><?php echo $row["marketplace_name"]; ?></td>
<td><?php echo $row["amount_type"]; ?></td>
<td><?php echo $row["amount_description"]; ?></td>
<td><?php echo $row["amount"]; ?></td>
<td><?php echo $row["fulfillment_id"]; ?></td>
<td><?php echo $row["posted_date"]; ?></td>
<td><?php echo $row["posted_date_time"]; ?></td>
<td><?php echo $row["order_item_code"]; ?></td>
<td><?php echo $row["merchant_order_item_id"]; ?></td>
<td><?php echo $row["merchant_adjustment_item_id"]; ?></td>
<td><?php echo $row["sku"]; ?></td>
<td><?php echo $row["quantity_purchased"]; ?></td>
<td><?php echo $row["promotion_id"]; ?></td>
</tr>
<?php
};
?>
</tbody>
</table>
</div>
<div class="container" style="padding-bottom:30px;">
<div class="row">
<div class="col-sm-offset-5 col-sm-7">
<?php
$sql = "SELECT COUNT(id) FROM settlements";
$rs_result = mysqli_query($conn, $sql);
$row = mysqli_fetch_row($rs_result);
$total_records = $row[0];
$total_pages = ceil($total_records / $limit);
$pagLink = "<nav class='center'><ul class='pagination pagination-sm'>";
for ($i=1; $i<=$total_pages; $i++) {
$pagLink .= "<li><a href='full-statement.php?page=".$i."'>".$i."</a></li>";
};
echo $pagLink . "</ul></nav>";
?>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.pagination').pagination({
items: <?php echo $total_records;?>,
itemsOnPage: <?php echo $limit;?>,
cssStyle: 'light-theme',
currentPage : <?php echo $page;?>,
hrefTextPrefix : 'full-statement.php?page='
});
});
</script>
</div>
<?php include 'nav/footer.php';?>
<?php include 'nav/script.php';?>
</body>
</html>