-
Notifications
You must be signed in to change notification settings - Fork 2
/
mytransactions.php
executable file
·299 lines (234 loc) · 9.33 KB
/
mytransactions.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<?php
include_once "db_functions.php";
session_start();
$curr_user = $_SESSION['curr_user'];
$msg = "";
if (empty($curr_user)) {
$msg = "curr_user is empty";
}
else {
$conn = connectDB();
$sql = "SELECT SellerId, ProductName, Price, Tag, Description, DATE(Date) AS Date FROM Transactions WHERE BuyerId = '$curr_user'";
$result = $conn->query($sql);
if ($result) {
$buyarray = array();
while($row = mysqli_fetch_assoc($result)){
$buyarray[]=$row;
}
} else {
$msg = "No buys" . $sql . "<br>" . $conn->error;
}
$sql = "SELECT BuyerId, ProductName, Price, Tag, Description, DATE(Date) AS Date FROM Transactions WHERE SellerId = '$curr_user'";
$result = $conn->query($sql);
if ($result) {
$sellarray = array();
while($row = mysqli_fetch_assoc($result)){
$sellarray[]=$row;
}
} else {
$msg = "No sells" . $sql . "<br>" . $conn->error;
}
$conn->close();
}
// echo "<script>console.log('$msg');</script>";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- start: Meta -->
<meta charset="utf-8">
<title>Beacon - My Transactions</title>
<meta name="description" content="Bootstrap Metro Dashboard">
<meta name="author" content="">
<meta name="keyword" content="">
<!-- end: Meta -->
<!-- start: Mobile Specific -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- end: Mobile Specific -->
<!-- start: CSS -->
<link id="bootstrap-style" href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link id="base-style" href="css/style.css" rel="stylesheet">
<link id="base-style-responsive" href="css/style-responsive.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,latin-ext' rel='stylesheet' type='text/css'>
<!-- end: CSS -->
<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<link id="ie-style" href="css/ie.css" rel="stylesheet">
<![endif]-->
<!--[if IE 9]>
<link id="ie9style" href="css/ie9.css" rel="stylesheet">
<![endif]-->
<!-- start: Favicon -->
<link rel="shortcut icon" href="img/favicon.ico">
<!-- end: Favicon -->
</head>
<body>
<!-- start: Header -->
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".top-nav.nav-collapse,.sidebar-nav.nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="index.php"><span>BEACON</span></a>
<!-- start: Header Menu -->
<div class="nav-no-collapse header-nav">
<ul class="nav pull-right">
<!-- start: User Dropdown -->
<li class="dropdown">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<span><span><i class="icon-user"> </i><?php echo $curr_user; ?></span></span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="dropdown-menu-title">
<span><?php echo $curr_user; ?></span>
</li>
<li><a href="myprofile.php"><i class="halflings-icon user"></i> Profile</a></li>
<li><a href="logout.php"><i class="halflings-icon off"></i> Logout</a></li>
</ul>
</li>
<!-- end: User Dropdown -->
</ul>
</div>
<!-- end: Header Menu -->
</div>
</div>
</div>
<!-- end: Header -->
<div class="container-fluid-full">
<div class="row-fluid">
<!-- start: Main Menu -->
<div id="sidebar-left" class="span2">
<div class="nav-collapse sidebar-nav">
<ul class="nav nav-tabs nav-stacked main-menu">
<!-- <i class="icon-user"></i> icon-user -->
<li><a href="myprofile.php"><i class="icon-user"></i><span class="hidden-tablet"> Personal Information</span></a></li>
<li><a href="myproducts.php"><i class="icon-inbox"></i><span class="hidden-tablet"> My Products</span></a></li>
<li><a href="myrequests.php"><i class="icon-flag"></i><span class="hidden-tablet"> My Requests</span></a></li>
<li><a href="myorders.php"><i class="icon-list"></i><span class="hidden-tablet"> Orders</span></a></li>
<li><a href="mytransactions.php"><i class="icon-money"></i><span class="hidden-tablet"> Transactions</span></a></li>
<li><a href="mymessages.php"><i class="icon-envelope"></i><span class="hidden-tablet"> Messages</span></a></li>
<li><a href="dashboard.php"><i class="icon-bar-chart"></i><span class="hidden-tablet"> Dashboard</span></a></li>
</ul>
</div>
</div>
<!-- end: Main Menu -->
<noscript>
<div class="alert alert-block span10">
<h4 class="alert-heading">Warning!</h4>
<p>You need to have <a href="" target="_blank">JavaScript</a> enabled to use this site.</p>
</div>
</noscript>
<!-- start: Content -->
<div id="content" class="span10">
<div class="row-fluid">
<div class="span12">
<h1>Transaction History</h1>
</br>
<div class="priority high"><span>I bought </span>
<a data-toggle="collapse" data-parent="#accordion" href="#needtocollapse" style="text-decoration:none;"><i class="icon-collapse-alt" style="color:#FA603D;"></i></a>
</div>
<div id="needtocollapse" class="panel-collapse collapse in">
<?php foreach($buyarray as $val): ?>
<div class="task high">
<div class="desc">
<div class="title"><?php echo $val['ProductName']; ?></div>
<div> Tag: <?php echo $val['Tag']; ?>; From <?php echo $val['SellerId']; ?>; Description: <?php echo $val['Description']; ?> </div>
</div>
<div class="time">
<div class="date">$<?php echo $val['Price']; ?></div>
<div> <?php echo $val['Date']; ?> </div>
</div>
</div>
<?php endforeach; ?>
</div>
</br>
<div class="priority medium"><span>I sold</span>
<a data-toggle="collapse" data-parent="#accordion" href="#needtocollapse2" style="text-decoration:none;"><i class="icon-collapse-alt" style="color:#FABB3D;"></i></a>
</div>
<div id="needtocollapse2" class="panel-collapse collapse in">
<?php foreach($sellarray as $val): ?>
<div class="task medium" >
<div class="desc">
<div class="title"><?php echo $val['ProductName']; ?></div>
<div> Tag: <?php echo $val['Tag']; ?>; To <?php echo $val['BuyerId']; ?>; Description: <?php echo $val['Description']; ?></div>
</div>
<div class="time">
<div class="date">$<?php echo $val['Price']; ?></div>
<div> <?php echo $val['Date']; ?> </div>
</div>
</div>
<?php endforeach; ?>
</div>
</div><!--/span12 -->
</div><!--/row-fluid -->
</div><!-- /span10 -->
<!-- end: Content -->
</div><!--/row-fluid-->
</div><!--/container-fluid-full-->
<div class="modal hide fade" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Settings</h3>
</div>
<div class="modal-body">
<p>Here settings can be configured...</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
<div class="common-modal modal fade" id="common-Modal1" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-content">
<ul class="list-inline item-details">
<li><a href="http://www.freemoban.com">Admin templates</a></li>
<li><a href="http://www.freemoban.com">Bootstrap themes</a></li>
</ul>
</div>
</div>
<div class="clearfix"></div>
<footer>
<p>
<span style="text-align:left;float:left">Copyright © 2016.Company name All rights reserved.</span>
</p>
</footer>
<!-- start: JavaScript-->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery-migrate-1.0.0.min.js"></script>
<script src="js/jquery-ui-1.10.0.custom.min.js"></script>
<script src="js/jquery.ui.touch-punch.js"></script>
<script src="js/modernizr.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src='js/fullcalendar.min.js'></script>
<script src='js/jquery.dataTables.min.js'></script>
<script src="js/excanvas.js"></script>
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.pie.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>
<script src="js/jquery.chosen.min.js"></script>
<script src="js/jquery.uniform.min.js"></script>
<script src="js/jquery.cleditor.min.js"></script>
<script src="js/jquery.noty.js"></script>
<script src="js/jquery.elfinder.min.js"></script>
<script src="js/jquery.raty.min.js"></script>
<script src="js/jquery.iphone.toggle.js"></script>
<script src="js/jquery.uploadify-3.1.min.js"></script>
<script src="js/jquery.gritter.min.js"></script>
<script src="js/jquery.imagesloaded.js"></script>
<script src="js/jquery.masonry.min.js"></script>
<script src="js/jquery.knob.modified.js"></script>
<script src="js/jquery.sparkline.min.js"></script>
<script src="js/counter.js"></script>
<script src="js/retina.js"></script>
<script src="js/custom.js"></script>
<!-- end: JavaScript-->
</body>
</html>