-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcust_book_det.php
553 lines (480 loc) · 18.1 KB
/
cust_book_det.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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<?php
ob_start();
session_start();
if(!isset($_SESSION["CUS_ID"])){
header("location:login.php");
}
include("db.php");
$i=0;
if(isset($_GET["bid"])){
$chk1 = $db->query("SELECT * from payments where bid={$_GET['bid']} and cus_id={$_SESSION["CUS_ID"]}");
$chk2 = $db->query("SELECT * from cart where bid={$_GET['bid']} and cus_id={$_SESSION["CUS_ID"]}");
if($chk1->num_rows == 0 && $chk2->num_rows == 0){
$qry="INSERT INTO cart (cus_id, bid) values ({$_SESSION["CUS_ID"]}, {$_GET["bid"]});";
$db->query($qry);
header("location:cust_book_det.php?id={$_GET['bid']}");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Book</title>
<link rel="stylesheet" type="text/css" href="css/tables.css">
<link rel="stylesheet" type="text/css" href="css/book_btn.css">
<style>
.blackboard {
position: absolute;
width: 500px;
border: tan solid 12px;
border-top: #bda27e solid 12px;
border-left: #b19876 solid 12px;
border-bottom: #c9ad86 solid 12px;
box-shadow: 0px 0px 6px 5px rgba(58, 18, 13, 0), 0px 0px 0px 2px #c2a782, 0px 0px 0px 4px #a58e6f, 3px 4px 8px 5px rgba(0, 0, 0, 0.5);
background-image: radial-gradient( circle at left 30%, rgba(34, 34, 34, 0.3), rgba(34, 34, 34, 0.3) 80px, rgba(34, 34, 34, 0.5) 100px, rgba(51, 51, 51, 0.5) 160px, rgba(51, 51, 51, 0.5)), linear-gradient( 215deg, transparent, transparent 100px, #222 260px, #222 320px, transparent), radial-gradient( circle at right, #111, rgba(51, 51, 51, 1));
background-color: #333;
}
.blackboard:before {
box-sizing: border-box;
display: block;
position: absolute;
width: 100%;
height: 100%;
background-image: linear-gradient( 175deg, transparent, transparent 40px, rgba(120, 120, 120, 0.1) 100px, rgba(120, 120, 120, 0.1) 110px, transparent 220px, transparent), linear-gradient( 200deg, transparent 80%, rgba(50, 50, 50, 0.3)), radial-gradient( ellipse at right bottom, transparent, transparent 200px, rgba(80, 80, 80, 0.1) 260px, rgba(80, 80, 80, 0.1) 320px, transparent 400px, transparent);
border: #2c2c2c solid 2px;
content: "Add Comment";
font-family: 'Permanent Marker', cursive;
font-size: 2.2em;
color: rgba(238, 238, 238, 0.7);
text-align: center;
padding-top: 20px;
}
.form {
padding: 70px 20px 20px;
}
p {
position: relative;
margin-bottom: 1em;
}
label {
vertical-align: middle;
font-family: 'Permanent Marker', cursive;
font-size: 1.6em;
color: rgba(238, 238, 238, 0.7);
}
p:nth-of-type(5) > label {
vertical-align: top;
}
input,
textarea {
vertical-align: middle;
padding-left: 10px;
background: none;
border: none;
font-family: 'Permanent Marker', cursive;
font-size: 1.6em;
color: rgba(238, 238, 238, 0.8);
line-height: .6em;
outline: none;
}
input[type="submit"] {
cursor: pointer;
color: rgba(238, 238, 238, 0.7);
line-height: 1em;
padding: 0;
}
input[type="submit"]:focus {
background: rgba(238, 238, 238, 0.2);
color: rgba(238, 238, 238, 0.2);
}
::-moz-selection {
background: rgba(238, 238, 238, 0.2);
color: rgba(238, 238, 238, 0.2);
text-shadow: none;
}
::selection {
background: rgba(238, 238, 238, 0.4);
color: rgba(238, 238, 238, 0.3);
text-shadow: none;
}
@media screen and (min-width: 400px) {
body {
background-color: lightgreen;
}
}
</style>
</head>
<body>
<?php
$sql = "SELECT book.*, category.cat_name from book inner join category
on book.cat_id = category.cat_id where book.bid = {$_GET['id']};";
$sql1 = "SELECT comment.comment, comment.logs, customer.cus_name from comment inner join customer
where comment.cus_id = customer.cus_id and comment.bid = {$_GET['id']}
ORDER BY comment.com_id DESC;";
$sql2 = "SELECT * from payments where cus_id = {$_SESSION["CUS_ID"]} and bid = {$_GET["id"]}";
$res = $db->query($sql);
$res1 = $db->query($sql1);
$res3 = $db->query($sql1);
$res2 = $db->query($sql2);
$rows = $res->fetch_assoc();
while($rows3 = $res3->fetch_assoc()){
$i++;
}
echo '<div class="background"></div>';
include("includes/header.php");
echo '<head>
<link rel="stylesheet" type="text/css" href="css/cat_card.css">
<link rel="stylesheet" type="text/css" href="css/font.scss">
<meta name="viewport" content="width=device-width, initial-scale=0.3">
</head>';
if($res->num_rows>0)
{
if($res2->num_rows>0){
$file = "admin/{$rows['bfile']}";
$file = preg_replace('/\s+/', '%20', $file);
echo"
<div>
<a href={$file} target='_blank' style='text-decoration:none;'>
<div id='curve' class='card' style='float:left; margin: 10%'>
<div class='footer'>
<div class='connections'>
<div class='connection facebook'><div class='icon'>View</div></div>
</div>
<svg id='curve'>
<path id='p' d='M0,200 Q80,100 400,200 V150 H0 V50' transform='translate(0 300)' />
<rect id='dummyRect' x='0' y='0' height='450' width='400'
fill='transparent' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,100 400,50 V150 H0 V50' fill='freeze' begin='dummyRect.mouseover' end='dummyRect.mouseout' dur='0.1s' id='bounce1' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,0 400,50 V150 H0 V50' fill='freeze' begin='bounce1.end' end='dummyRect.mouseout' dur='0.15s' id='bounce2' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,80 400,50 V150 H0 V50' fill='freeze' begin='bounce2.end' end='dummyRect.mouseout' dur='0.15s' id='bounce3' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,45 400,50 V150 H0 V50' fill='freeze' begin='bounce3.end' end='dummyRect.mouseout' dur='0.1s' id='bounce4' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,50 400,50 V150 H0 V50' fill='freeze' begin='bounce4.end' end='dummyRect.mouseout' dur='0.05s' id='bounce5' />
<animate xlink:href='#p' attributeName='d' to='M0,200 Q80,100 400,200 V150 H0 V50' fill='freeze' begin='dummyRect.mouseout' dur='0.15s' id='bounceOut' />
</svg>
<div class='info'>
<div class='name' style='color:black'>{$rows['bname']}</div>
<div class='job' style='color:black'>{$rows['author']}</div>
</div>
</div>
<div class='card-blur'></div>
</div>
</div>
</a>
<div style='float:right; margin-left: 20%; margin-top: 5%; position: absolute;'>
<table class='container' style='background-color:#1F2739; width: 60%'>
<thead>
<tr>
<th style='color: #FB667A'>BOOK NAME</th>
<td><b>{$rows['bname']}</b></td>
</tr>
<tr>
<th style='color: #FB667A'>AUTHOR</th>
<td><b>{$rows['author']}</b></td>
</tr>
<tr>
<th style='color: #FB667A'>DESCRIPTION   </th>
<td><b>{$rows['keywords']}</b></td>
</tr>
<tr>
<tr>
<th style='color: #FB667A'>CATEGORY</th>
<td><b>{$rows['cat_name']}</b></td>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
";
}
else{
$file = $rows['bfile'];
$file = preg_replace('/\s+/', '%20', $file);
echo"
<div>
<a href='payment.php?id={$rows['bid']}' target='_blank' style='text-decoration:none;'>
<div id='curve' class='card' style='float:left; margin: 10%'>
<div class='footer'>
<div class='connections'>
<div class='connection facebook'><div class='icon'>Buy</div></div>
</div>
<svg id='curve'>
<path id='p' d='M0,200 Q80,100 400,200 V150 H0 V50' transform='translate(0 300)' />
<rect id='dummyRect' x='0' y='0' height='450' width='400'
fill='transparent' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,100 400,50 V150 H0 V50' fill='freeze' begin='dummyRect.mouseover' end='dummyRect.mouseout' dur='0.1s' id='bounce1' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,0 400,50 V150 H0 V50' fill='freeze' begin='bounce1.end' end='dummyRect.mouseout' dur='0.15s' id='bounce2' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,80 400,50 V150 H0 V50' fill='freeze' begin='bounce2.end' end='dummyRect.mouseout' dur='0.15s' id='bounce3' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,45 400,50 V150 H0 V50' fill='freeze' begin='bounce3.end' end='dummyRect.mouseout' dur='0.1s' id='bounce4' />
<animate xlink:href='#p' attributeName='d' to='M0,50 Q80,50 400,50 V150 H0 V50' fill='freeze' begin='bounce4.end' end='dummyRect.mouseout' dur='0.05s' id='bounce5' />
<animate xlink:href='#p' attributeName='d' to='M0,200 Q80,100 400,200 V150 H0 V50' fill='freeze' begin='dummyRect.mouseout' dur='0.15s' id='bounceOut' />
</svg>
<div class='info'>
<div class='name' style='color:black'>{$rows['bname']}</div>
<div class='job' style='color:black'>{$rows['author']}</div>
</div>
</div>
<div class='card-blur'></div>
</div>
</div>
</a>
<div style='float:right; margin-left: 20%; margin-top: 5%; position: absolute;'>
<table class='container' style='background-color:#1F2739; width: 60%'>
<thead>
<tr>
<th style='color: #FB667A'>BOOK NAME</th>
<td><b>{$rows['bname']}</b></td>
</tr>
<tr>
<th style='color: #FB667A'>AUTHOR</th>
<td><b>{$rows['author']}</b></td>
</tr>
<tr>
<th style='color: #FB667A'>DESCRIPTION   </th>
<td><b>{$rows['keywords']}</b></td>
</tr>
<tr>
<th style='color: #FB667A'>PRICE</th>
<td><b>₹ {$rows['price']}</b></td>
</tr>
<tr>
<th style='color: #FB667A'>CATEGORY</th>
<td><b>{$rows['cat_name']}</b></td>
</tr>";
$qry1="SELECT * from cart where cart.bid={$_GET["id"]} and cart.cus_id={$_SESSION["CUS_ID"]}";
$ans=$db->query($qry1);
echo"
<tr>
<th colspan='2' style='color: #FB667A; text-align:center; background-color:#5499C7'>";
if($ans->num_rows==0){
echo"
<a style='text-decoration:none' href='cust_book_det.php?bid={$rows['bid']}'>
<button class='custom-btn btn' style='background-color: red; background-image: linear-gradient(315deg, orange 0%, tomato 74%)'>
<b>Add to Cart</b>
</button>
</a>";
}
else{
echo"
<a style='text-decoration:none'>
<button class='custom-btn btn' style='background-color: green; background-image: linear-gradient(315deg, green 0%, greenyellow 74%)' disabled>
<b><span style='color:black'>Added to Cart</span></b>
</button>
</a>";
}
echo"
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
";
}
}
else {
echo "<p style='color: red'>No Records found</p>";
}
?>
<?php
echo "<h1 style='position: absolute; margin-top: 650px; margin-left: 30%;'>Customer Comments</h1> <br><br>";
if($res2->num_rows>0){
echo "
<div class='container content' style='position: absolute; float:left; height: 400px; margin-top: 700px; margin-left: 10%;'>
<form action='{$_SERVER['REQUEST_URI']}' method='post'>
<div class='blackboard'>
<div class='form'>
<hr>";
if(isset($_POST["submit"])){
$_POST["comment"] = addslashes($_POST["comment"]);
$sql3 = "INSERT into comment (cus_id, bid, comment, logs) values ({$_SESSION["CUS_ID"]}, {$_GET["id"]}, '{$_POST["comment"]}', now())";
$res3 = $db->query($sql3);
if($res){
echo "<p style='color:green'>Comment added</p>";
header("location:{$_SERVER['REQUEST_URI']}");
}
}
echo"
<p><br>
<label for='name'><b>Comment</b></label>
<input type='text' name='comment' required>
</p><br><br>
<p class='wipeout'>
<input type='submit' name='submit' value='Add:-' /></p>
</div>
</div>
</form>
</div>";
}
if ($res1->num_rows > 0) {
if($res2->num_rows>0){
echo "<div style='position: absolute; float:right; width:50%; margin-top: 700px; margin-left: 600px;'>";
}
else{
echo "<div style='position: absolute; margin-top: 680px; margin-left: 10%; width: 60%'>";
}
echo"
<table class='container' style='background-color:#1F2739;'>
<thead>
<tr>
<th>CUSTOMER NAME</th>
<th>COMMENT</th>
<th>TIME LOG</th>
</tr>
</thead>
<tbody>
";
while($rows1 = $res1->fetch_assoc()){
echo"
<tr>
<td><b>{$rows1['cus_name']}</b></td>
<td>{$rows1['comment']}</td>
<td><i>{$rows1['logs']}</i></td>
</tr>";
}
echo "
</tbody>
</table>
</div>
";
}
else {
if($res2->num_rows>0){
echo "<div style='margin: 680px; margin-left:1000px; margin-right:0px; position:absolute; float:right'>";
}
else{
echo "<div style='margin: 680px; margin-left:700px; margin-right:0px; position:absolute; float:right'>";
}
echo"
<p style='color: red; text-align:center; font-size:30px'><span style=' background-color:white;'>No Comments</span></p>
</div>";
}
ob_end_flush();
?>
<style>
html,
body {
height: 100%;
width: 100%;
}
.background {
position: absolute;
top: -40px;
left: -40px;
height: <?php echo 200+($i*7.5)?>%;
width: 103%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
-webkit-filter: blur(30px);
filter: blur(30px);
}
.card {
position: absolute;
border-radius: 8px;
height: 500px;
width: 400px;
top: 0;
right: 0;
left: 0;
bottom: 0;
margin: auto;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
box-shadow: 0 0 80px -10px black;
overflow: hidden;
}
.card-blur {
position: absolute;
height: 100%;
width: calc(100% + 1px);
background-color: black;
opacity: 0;
transition: opacity 0.15s ease-in;
}
.card:hover .card-blur {
opacity: 0.6;
}
.footer {
z-index: 1;
position: absolute;
height: 80px;
width: 100%;
bottom: 0;
}
svg#curve {
position: absolute;
fill: white;
left: 0;
bottom: 0;
width: 400px;
height: 450px;
}
.connections {
height: 80px;
width: 400px;
position: absolute;
left: 0;
right: 0;
bottom: 100px;
margin: auto;
}
.connection {
height: 25px;
width: 25px;
border-radius: 100%;
background-color: white;
display: inline-block;
padding: 5px;
margin-right: 25px;
transform: translateY(200px);
transition: transform 1s cubic-bezier(.46, 1.48, .18, .81);
}
.card:hover .connection {
transform: translateY(0px);
}
.info {
font-family: Inconsolata;
padding-left: 20px;
transform: translateY(250px);
transition: transform 1s cubic-bezier(.31,1.21,.64,1.02);
}
.card:hover .info {
transform: translateY(0px);
}
.name {
font-weight: bolder;
padding-top: 5px;
}
.job {
margin-top: 10px;
}
.connection.facebook {
height: 40px;
width: 70px;
margin-left: 20px;
padding: 5px 13px;
border-radius: 10%;
overflow: hidden;
background-color: #ff1a75;
}
.connection.facebook .icon {
height: 100%;
width: 100%;
background-position: center;
background-size: cover;
color: black;
font-size: 20px;
font-weight: bold;
}
.card {
background-image: url("<?php echo "admin/{$rows['bimage']}"?>");
}
.background {
background-image: url("<?php echo "admin/{$rows['bimage']}"?>");
}
</style>
</body>
</html>