-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmyprof.php
366 lines (320 loc) · 9.5 KB
/
myprof.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cz">
<?php
error_reporting(1);
?>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
</style>
<style>
table {
border-collapse: collapse;
width: 100%;
align:center;
}
th, td {
text-align: center;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color:Green;
color: white;
}
tr:nth-child(even){background-color: #f2f2f2}
</style>
<style>
body
{
background-image: url("back.jpg");
background-position:0px 0px;
background-size: cover;
background-repeat: repeat;
}
</style>
<style>
.center {
margin: auto;
width: 60%;
padding: 100px;
}
]
body
{
background-image: url(back.jpg);
background-position:0px 0px;
background-attachment:fixed;
background-size: cover;
background-repeat: repeat;
}
.a{
opacity: 0.7;
filter: alpha(opacity=50);
}
.ascroll{
max-height:605px;
overflow-y:scroll;
}
.bscroll{
max-height:600px;
overflow-y:scroll;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="index.php">NewBooks</a></li>
<li><a href="oldbook.php">OldBooks</a></li>
<li><a href="rentbook.php">Rent a book</a></li>
<li><a href="feedback.php">Feedback</a></li>
<li><a href="contact.php">ContactUs</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="login.php"><span class="glyphicon glyphicon-user"></span> MyProfile</a></li>
<?php
session_start();
$id=$_SESSION['eid'];
if($id!="")
echo"<li><a href='?log=out'><span class='glyphicon glyphicon-log-out'></span> Logout</a></li>";
if(isset($_REQUEST['log'])=='out')
{
session_destroy();
header("location:index.php");
}
?>
</ul>
</div>
</div>
</nav>
</br>
</br>
</br>
</br>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2"><br/>
<div align="center">
<img class="a" src="logo.jpg" width="100%" >
</div>
<br/>
<div class="bscroll">
<div>
<h3>My Profile</h3>
<li class="list-group-item"><a href="myprof.php">MyOrders</a></li>
<li class="list-group-item"><a href="myprof.php?itemno=1">MyCart</a></li>
<li class="list-group-item"><a href="myprof.php?itemno=2">RentBookStatus</a></li>
<li class="list-group-item"><a href="myprof.php?itemno=3">Delete Add</a></li>
<li class="list-group-item"><a href="myprof.php?itemno=4">change Password</a></li>
</ul>
</div>
</div>
</div>
<br/>
<div class="ascroll">
<div class="col-sm-10">
<br/>
<br/>
<br/>
<br/>
<br/>
<div align:center>
<br/>
<?php
session_start();
$id=$_SESSION['eid'];
$itemno=$_REQUEST['itemno'];
require "connect.php";
$sql="select * from mycart where user_name='$id'";
$row=$conn->query($sql);
if($itemno==1)
{
echo"<h1 align='center'><strong>MYCART</strong></h1>";
if($row->fetch_assoc()>0)
{
$sml="select * from myacart where user_name='$id'";
$sql="select * from mycart where user_name='$id'";
$row = $conn->query($sql);
echo "<table align='center'><tr> <th>BOOKNAME</th><th>Author</th><th>Price</th><th>Discount</th><th></th><th></th></tr>";
while($arr = $row->fetch_assoc())
{
$bi=$arr['BookId'];
$cartid=$arr['cartid'];
$sel="select * from nbook where BookID='$bi'";
$rowb = $conn->query($sel);
if($arb = $rowb->fetch_assoc())
{
$bn=$arb['BOOKNAME'];
$ammount=$arb['Price'];
$Dis=$arb['Discount'];
$ar=$arb['Author'];
}
echo "<tr><td>" .$bn."</td><td>" . $ar."</td><td>" .$ammount."</td><td>".$Dis."</td><td>.<a href='loginshop.php?itemno=$bi'><img src='images/MetalPlakDa5new.gif' width='70' height='20'/></a>.</td>
<td>.<a href='deletecart.php?itemno=$cartid'><img src='images/delete.gif' width='70' height='20'/>
</a>.</td></tr>";
}
echo "</table>";
}
else
{
echo"<h2 align='center'><strong>NOTHING IN THE CART</strong></h2>";
}
}
if($itemno=="")
{
//order code
$sql="select * from orders where user_name='$id'";
$row=$conn->query($sql);
echo"<h2 align='center'><strong>ORDER STATUS</strong></h2>";
if($row->fetch_assoc()>0)
{
$sql="select * from orders where user_name='$id'";
$row = $conn->query($sql);
echo "<table align='center'><tr> <th>ORDERNO</th><th>BOOKNAME</th><th>Amount Paid</th><th>DiliveryAddress</th><th>Courier</th><th>orderstatus</th><th></th></tr>";
while($arr = $row->fetch_assoc())
{
$on=$arr['order_no'];
$ad=$arr['Address'];
$bi=$arr['BookId'];
$ci=$arr['courire_id'];
$os=$arr['OrderStatus'];
$sel="select * from nbook where BookID='$bi'";
$rowb = $conn->query($sel);
if($arb = $rowb->fetch_assoc())
{
$bn=$arb['BOOKNAME'];
$ammount=$arb['Price'];
$Dis=$arb['Discount'];
$ap=$ammount-($ammount*$Dis)/100;
}
$scl="select * from courier where courire_id='$ci'";
$rowc = $conn->query($scl);
if($arc = $rowc->fetch_assoc())
{
$cnb=$arc['courier_name'];
}
$rowc = $conn->query($scl);
echo "<tr><td>" .$on."</td><td>" . $bn."</td><td>" .$ap."</td><td>".$ad."</td><td>".$cnb."</td><td>".$os."</td> <td>.<a href='cancel.php?itemno=$on'><img src='images/cancel.gif' width='70' height='20'/>
</a>.</td></tr>";
}
echo "</table>";
}
else
{
echo"<h2 align='center'><strong>NO ORDER YET</strong></h2>";
}
}
if($itemno==2)
{ //rent code
echo"<h2 align='center'><strong>BOOK RENT STATUS</strong></h2>";
$srl="select * from users where user_name='$id'";
$rrow = $conn->query($srl);
if($rar = $rrow->fetch_assoc())
{
$us=$rar['servicea'];
}
if($us=='PRO')
{
$sql="select * from booksonrent where user_name='$id'";
$row = $conn->query($sql);
echo"<h2 align='center'><strong>BOOK RENT STATUS</strong></h2>";
if($row->fetch_assoc()>0)
{
$spl="select * from booksonrent where user_name='$id'";
$rw = $conn->query($spl);
echo "<table align='center'><tr> <th>ORDERNO</th><th>BOOKNAME</th><th>Rent</th><th>DAys Issued</th><th>Ammount</th><th>Status</th></tr>";
while($arr = $rw->fetch_assoc())
{
$onr=$arr['order_no'];
$bid=$arr['ID'];
$di=$arr['daysissued'];
$par=$arr['PayAmnt'];
$rent=$arr['rent'];
$osr=$arr['Status'];
$sel="select * from rbook where ID='$bid'";
$rowb = $conn->query($sel);
if($arb = $rowb->fetch_assoc())
{
$bnr=$arb['BOOKNAME'];
}
echo "<tr><td>" .$onr."</td><td>" . $bnr."</td><td>" .$rent."</td><td>".$di."</td><td>".$par."</td><td>".$osr."</td></tr>";
}
echo "</table>";
}
else
{
echo"<h2 align='center'><strong>NO ORDER YET</strong></h2>";
}
}
else
{
echo"<h4 align='center'><strong>You are Not a pro user</strong></h4>";
echo"<h4 align='center'><strong><a href='proreg.php'>Apply </a>for Pro membership to rent a book</strong></h4>";
}
}
if($itemno==3)
{
$sql="select * from obook where SELLER='$id'";
$row=$conn->query($sql);
echo"<h1 align='center'><strong>MY POSTS</strong></h1>";
if($row->fetch_assoc()>0)
{
$sml="select * from obook where SELLER='$id'";
$sql="select * from obook where SELLER='$id'";
$row = $conn->query($sql);
echo "<table align='center'><tr> <th>BOOKNAME</th><th>Author</th><th>Price</th><th></th></tr>";
while($arb = $row->fetch_assoc())
{
$bi=$arb['BOOKID'];
$bn=$arb['BOOKNAME'];
$ammount=$arb['PRICE'];
$Dis=$arb['AUTHOR'];
echo "<tr><td>" .$bn."</td><td>" . $Dis."</td><td>" .$ammount."</td>
<td>.<a href='deletepost.php?itemno=$bi'><img src='images/delete.gif' width='70' height='20'/>
</a>.</td></tr>";
}
echo "</table>";
}
else
{
echo"<h2 align='center'><strong>NO POST YET</strong></h2>";
}
}
if($itemno==4)
header("location:changepwd.php");
if($itemno>4)
header("location:myprof.php");
if(isset($_REQUEST['log'])=='out')
{
session_destroy();
header("location:index.php");
}
else if($id=="")
{
header("location:index.php");
}
error_reporting(1);
?>
<div class="cleaner"></div>
</div>
</div>
</div>
</div>
<br/>
<br/>
<br/>
<div id="Bottom" align='center'>
<h5 class="down" align='center'><b>DONT USE THIS PROJECT FOR COMMERCIAL PURPOSE</b></h5>
<h5 class="down" align='center'><b>Copyright © ABHISHEK DUDHAL</b></h5>
</div>
</body>
</html>