/
gallery.php
913 lines (684 loc) · 42.7 KB
/
gallery.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
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
<!--************************************** Database connection ***************************-->
<?php
session_start();
$con = mysqli_connect('localhost', 'root', 'Jigyasha#$') or die();
$db = mysqli_select_db($con, 'pixlr') or die();
// You can set the value however you like.
$id = $_GET['new_id_view'];
$id_loggedin = $_SESSION['new_id'];
$gallery_id = $_GET['galleryid'];
?>
<!--************************************** End Database connection ***************************-->
<!DOCTYPE html>
<html lang="en">
<!--************************************** HEAD ***************************-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="shortcut icon" href="img/fav6icon.ico" type="image/x-icon" />
<title>Pixelr : Home </title>
<!-- Font Awesome -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="css/indigo.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/material.min.css">
<link rel="stylesheet" href="css/material.css">
<script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="css/mdb.min.css" rel="stylesheet">
<!-- Template styles -->
<style rel="stylesheet">
.disable{
background-color: #212121;
pointer-events: none;
cursor: default;
}
.disable1{
pointer-events: none;
cursor: default;
}
.active1{
background-color: #212121;
color: white;
}
.active{
background-color: #424242;
}
.mdl-navigation__link:hover{
background-color: #282828;
}
.mdl-navigation__link:active{
background-color: #212121;
}
.navbar1 {
background-color: #424242;
}
@media only screen and (max-width: 768px) {
.navbar {
background-color:#424242;
}
}
main {
margin-top: 3rem;
}
main .card {
margin-bottom: 2rem;
}
@media only screen and (max-width: 768px) {
.read-more {
text-align: center;
}
}
</style>
</head>
<body>
<!--************************************** HEADER ***************************-->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header ">
<header class="mdl-layout__header elegant-color">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Pixlr</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation. We hide it in small screens. -->
<nav class="mdl-navigation mdl-layout--large-screen-only">
<a style = "position: absolute;left:140px;" class="mdl-navigation__link " href="home.php">Home</a>
<?php
if (isset($_SESSION['new_id'])) {
echo'
<a class="mdl-navigation__link show-modal" href="#!" id=tt3 style="position:relative;margin:395px;outline: none;" >
<img style="outline: none;align:left;display: inline;" width="38px" height="38px" src="/pixlr/images/upload.png" class="img-fluid" alt=""> Upload
</a>';
} else
echo'
<a class="mdl-navigation__link disable" href="#!" id=tt3 style="position:relative;margin-right:395px;outline: none;" >
<img style="outline: none;align:left;display: inline;" width="38px" height="38px" src="/pixlr/images/upload.png" class="img-fluid" alt=""> Upload
</a>';
?>
<div class="mdl-tooltip" data-mdl-for="tt3">Upload Image</div>
<form action="search.php" method="POST">
<div style="align:left;display: inline;padding-right: 5px;" class="mdl-textfield mdl-js-textfield mdl-textfield--expandable">
<label class="mdl-button mdl-js-button mdl-button--icon" for="sample11">
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input" type="text" id="sample11" name="searchBox" placeholder="Enter name">
</div>
</div>
</form>
<a class="mdl-navigation__link" href="profile.php?new_id_view=<?php echo $id_loggedin; ?>" >
<?php
if (isset($_SESSION['new_id']))
echo'<a class="mdl-navigation__link" href="profile.php?new_id_view=' . $id_loggedin . '">Profile</a>';
?>
</a>
<?php
$sql = "SELECT * FROM member WHERE mem_id = '$id_loggedin'";
$sth = mysqli_query($con, $sql);
$result = mysqli_fetch_array($sth);
if ($result['profile_image'] != NULL)
echo' <a class="mdl-navigation__link" > <div class="card" style=" outline:none;top:5px;background-color: white;width: 43px; height: 43px; border-radius: 100%;">
<div class="mask" style="border-radius : 100%;"></div>
<div class="view overlay hm-white-slight">
<img id=tt1 style="width:43px; height: 43px; border-radius: 100%;padding: 3px;outline:none;" src="data:image/jpeg;base64,' . base64_encode($result['profile_image']) . '" class="img-fluid" alt="">
</div> </div></a> ';
else
echo' <a class="mdl-navigation__link " > <img id=tt10 style="outline: none;" width="43px" height="43px" src="ic_account_circle_white_48dp/ic_account_circle_white_48dp/web/ic_account_circle_white_48dp_1x.png" class="img-fluid" alt=""></a>';
?>
</a>
<div class="mdl-tooltip" data-mdl-for="tt1">Profile</div>
<div class="mdl-tooltip" data-mdl-for="tt10">Login to create profile</div>
<?php
if (isset($_SESSION['new_id'])) {
//header("Location: /"); // redirects them to homepage
// exit; // for good measure
echo('<a class="mdl-navigation__link" href=" logout.php">Log out</a>');
} else {
echo('<a class="mdl-navigation__link show-modal1" href="#!">Login</a>
<a class="mdl-navigation__link show-modal3" href="#!">SignUp</a>');
}
?>
</nav>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">Pixlr</span>
<nav class="mdl-navigation">
<a class="mdl-navigation__link " href="home.php">Home</a>
<?php
if (isset($_SESSION['new_id'])) {
//header("Location: /"); // redirects them to homepage
// exit; // for good measure
echo('<a class="mdl-navigation__link" href=" logout.php">Log out</a>');
} else {
echo('<a class="mdl-navigation__link " id="sm2" href="#!">Login</a>
<a class="mdl-navigation__link " id="sm4" href="#!">SignUp</a>');
}
?>
<?php
if (isset($_SESSION['new_id'])) {
echo'
<a class="mdl-navigation__link" href="profile.php?new_id_view==' . $id . '">Profile</a>'
;
}
?>
<div class="mdl-tooltip" data-mdl-for="tt2">Profile</div>
<form action="search.php" method="POST">
<div style="display: inline;left: 33px;" class="mdl-textfield mdl-js-textfield mdl-textfield--expandable">
<label class="mdl-button mdl-js-button mdl-button--icon" for="sample12">
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input" type="text" id="sample12" name="searchBox" placeholder="Enter name">
</div>
</div>
</form>
</nav>
</div>
<main>
<!--Main layout-->
<div class="container">
<hr>
<?php
$counter = 0;
$sql1 = "SELECT * FROM r_category where gallery_id = '$gallery_id' ";
$result1 = mysqli_query($con, $sql1) or die(mysqli_error($db));
//$row1 = mysqli_fetch_array($result1);
$totalpost = mysqli_num_rows($result);
$articlesPerPage = 6;
$totalPages = ceil($totalpost / $articlesPerPage);
$c_i = 0;
if (!isset($_GET['page'])) {
$page = 1;
//$page1=1;
} else
$page = $_GET['page'];
$c_j = 0;
//$row = mysqli_fetch_assoc($result);
//echo ($articlesPerPage)*($page-1);
while ($c_j < ($articlesPerPage) * ($page - 1)) {
echo $c_j = $c_j + 1;
$row = mysqli_fetch_array($result);
}
while ($row1 = mysqli_fetch_array($result1)) {
$img_id_temp_12 = $row1['img_id'];
$sql = "SELECT * FROM image where img_id='$img_id_temp_12'";
$result = mysqli_query($con, $sql) or die(mysqli_error($db));
$row = mysqli_fetch_array($result);
//$row = mysqli_fetch_assoc($result);
$c_i++;
$title = $row['title'];
$caption = $row['caption'];
$img_id = $row['img_id'];
$img_id_temp = "#pop" . $img_id;
$img_id_preview = "#preview" . $img_id;
$img_id_with = "#" . $img_id;
$img_id_like = "tt3" . $img_id;
$img_id_likesize = "image_name" . $img_id;
$img_id_likewidth = "image_name.width" . $img_id;
$img_id_likeheight = "image_name.height" . $img_id;
$img_id_temp_1 = "pop" . $img_id;
$img_id_preview_1 = "preview" . $img_id;
$img_id_with_1 = $img_id;
$mem_id_temp_13 = $row['mem_id'];
if ($counter % 3 == 0) {
//echo'<div class="container-fluid">';
echo'<div class="row">';
}
echo'
<div class = "col-md-4">
<!--Card-->
<div class = "card">
<div class = "card-block" style = "height:55px;padding-left:6px;padding-right:0px;padding-top:6px; padding-bottom:5px;" >
';
echo '
<a href = "profile.php?new_id_view=' . $row['mem_id'] . '">
<div class = "card" style = " background-color: white;position:absolute;float:left;width: 40px; height: 40px; border-radius: 100%;">
<div class = "mask" style = "border-radius : 100%;"></div>
<div class = "view overlay hm-white-slight">';
$sql1 = "SELECT * FROM member where mem_id='$mem_id_temp_13'";
$result1 = mysqli_query($con, $sql1) or die(mysqli_error($db));
$row1 = mysqli_fetch_array($result1);
$profileimage = $row1['profile_image'];
$fullname = $row1['fname'] . " " . $row1['lname'];
if ($profileimage != NULL)
echo' <img style = "width: 40px; height: 40px; border-radius: 100%;padding: 3px; " src = "data:image/jpeg;base64,' . base64_encode($profileimage) . '" class = "img-fluid" alt = "">';
else
echo' <img style = "width: 40px; height: 40px; border-radius: 100%;padding: 0.6px;" src = "/pixlr/images/default_profile.jpg" class = "img-fluid" alt = "">';
echo'
</div>
</div></a>
<h5 style = "position:relative;text-transform: uppercase; text-shadow: 1px 0.8px #BDBDBD;top:14px;left:50px;">';
echo" <b>$fullname</b>";
echo'</h5 > ';
$follower_id = $_SESSION['new_id'];
//$following_id = $_GET['following_id']; // alter here
$following_id = $mem_id_temp_13;
if ($following_id != $follower_id) {
$followings;
$followers;
$query2 = mysqli_query($con, "SELECT * FROM `r_follow` where follower = '$follower_id' AND following = '$following_id'");
$row2 = mysqli_fetch_array($query2);
$redirect_gallery="2".$gallery_id;
if ($row2) {
echo' <a href="q3.php?following_id=' . $following_id . '&redirect='.$redirect_gallery.'">
<button style="float:right; margin-top:-30px;padding:4px;" id="btnfollow" type="button" class="btn bg-success " "><span style="font-size:135%">✓</span>Following</button> '; //already a follower
} else {
echo' <a href="q3.php?following_id=' . $following_id . '&redirect='.$redirect_gallery.'">
<button id="btnfollow" style="float:right; margin-top:-30px;" type="button" class="btn bg-primary" ">+Follow</button>
'; // not a follower
}
}
echo'<h4>';
echo'</div>
<!--Card image-->
<div class="view overlay hm-white-slight" style="height:220px;">';
echo"
<a href='#!' id='" . $img_id_temp_1 . "'>";
echo'<div class="mask"></div>';
//$row = mysqli_fetch_assoc($result);
$image_t = $row['path'];
echo "<img src='" . $image_t . "' class='img-fluid' alt='' style='width:100%;height:auto;padding:5px ;min-height:220px;position:absolute;left:50%;top:50%; -webkit-transform: translateY(-50%) translateX(-50%); '></a></div>";
echo'
<div class="modal fade" id="mod' . $img_id . '" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>';
$profileimage = $row1['profile_image'];
echo' <div class="card-block" style="height:55px;padding-left:6px;padding-right:0px;padding-top:6px; padding-bottom:5px;" >
<a href = "profile.php?new_id_view=' . $row['mem_id'] . '">
<div class = "card" style = " background-color: white;position:absolute;width: 50px; height: 50px; border-radius: 100%;left:270px;">
<div class = "mask" style = "border-radius : 100%;"></div>
<div class = "view overlay hm-white-slight">';
if ($profileimage != NULL)
echo' <img style = "width: 50px; height: 50px; border-radius: 100%;padding: 3px; " src = "data:image/jpeg;base64,' . base64_encode($profileimage) . '" class = "img-fluid" alt = "">';
else
echo' <img style = "width: 50px; height: 50px; border-radius: 100%;padding: 0.4px;" src = "/pixlr/images/default_profile.jpg" class = "img-fluid" alt = "">';
echo ' </div>
</div></a>
</div>';
echo'</div>
<div class = "modal-body">
<div class = "card">
<!--Card image-->
<div class = "view overlay hm-white-slight">
';
echo "<img src='" . $image_t . "' class='img-fluid' alt='' >";
echo'
<a href = "#!">
<div class = "mask"></div>
</a>
</div>
<!--/.Card image-->
<hr>
</div>
<div class = "card">
<div class = "card-block">
<form action = "q3.php?image_id_test=' . $img_id . '&redirect='.$redirect_gallery.'&person_id=' . $id . '" method = "POST" >
<div class = "mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class = "mdl-textfield__input" name = "my_comment" type = "text" placeholder = "your comment">
</div>
<button name = "post_comment" class = "btn btn-elegant" style = "position: absolute;top: 40px;right:10px;" >Post comment</button>
</form>
</div>
</div>
</div>'; //var[i]=img_id;i++;
//$ _SESSION['img_id'] = $img_id_comment;
$con2 = mysqli_connect('localhost', 'root', 'Jigyasha#$') or die();
$db2 = mysqli_select_db($con2, 'pixlr') or die();
//echo $img_id;
$query = "SELECT * FROM r_comment WHERE img_id= " . $img_id . " ORDER BY comment_id DESC";
$res = mysqli_query($con2, $query);
if ($res) {
while ($row = mysqli_fetch_array($res)) {
// printf("heloo");
echo '<div class = "card" >';
echo '<div class = "card-block">';
$mem_id = $row['mem_id'];
$q = "SELECT * FROM member WHERE mem_id = '$mem_id'";
$r = mysqli_query($con2, $q);
$row1 = mysqli_fetch_array($r);
echo '<div>
<a href="profile.php?new_id_view=' . $row['mem_id'] . '">
<div class="card" style=" background-color: white;position:absolute;float:left;width: 40px; height: 40px; border-radius: 100%;">
<div class="mask" style="border-radius : 100%;"></div>
<div class="view overlay hm-white-slight">';
if ($row1['profile_image'] != NULL)
echo '<img src = "data:image/jpeg;base64,' . base64_encode($row1['profile_image']) . '" class = "img-fluid" alt = ""style = "width: 40px; height: 40px; border-radius: 100%;padding: 3px;"/>';
else
echo '<img src = "/pixlr/images/default_profile.jpg" class = "img-fluid" alt = ""style = "width: 40px; height: 40px; border-radius: 100%;padding: 2px;"/>';
//echo' <img id = tt1 style = "width: 32px; height: 32px; border-radius: 100%;padding: 2px;" src = "" class = "img-fluid" alt = "">';
echo'
</div>
</div></a>
<h5 style="position:relative;text-transform: capitalize; text-shadow: 1px 0.8px #BDBDBD;top:14px;left:50px;">';
echo $row1['fname'];
echo ' ';
echo $row1['lname'];
echo'</h5>';
$comment_id_close = $row["comment_id"];
echo'<form action = "q3.php?comment_id=' . $comment_id_close . '&redirect='.$redirect_gallery.'" method = "POST">';
echo '<button name = "delete_comment" style="position:absolute;top:10px;right:10px;" class = "close" aria-label = "Close">';
echo '</form>';
echo'
<span aria-hidden = "true">×
</span>
</button>';
echo '</div>';
echo '<br><hr><b style="position:relative;text-transform: capitalize;">';
printf("\n%s", $row["comment"]);
echo '</b></div>';
echo '</div>';
}
}
mysqli_close($con2);
echo'
<div class = "modal-footer">
</div>
</div>
</div>
</div>
<!--/.Card image-->
<!--Card content-->
<div class = "card-block">
<!--Title-->
<h6 class = "card-title" style = "position:relative;text-transform: capitalize; text-shadow: 1px 0.8px #BDBDBD;margin : 0 auto;float:left;height:5px;">';
echo" <b>$title</b>";
echo'</h6></div><hr><div class = "card-block" style = "height:5px" >';
// $id = $_SESSION['new_id'];
$query = mysqli_query($con, "SELECT * FROM `r_like` where img_id = '$img_id' AND mem_id = '$id'");
$row = mysqli_fetch_array($query);
if ($row) {
//$query = mysqli_query($con,"DELETE FROM 'r_like' WHERE mem_id='$id' AND img_id='$img_id'");
$path = "/pixlr/images/2000px-Love_Heart_SVG.png";
$key=1;
} else {
//$query = mysqli_query($con,"INSERT INTO `r_like` VALUES('$id','$img_id','')");
$path = "/pixlr/images/2000px-Love_Heart_SVGcopy.png";
$key=0;
}
echo'
<a href="#!" onclick="like(\''.$id.'\',\''.$img_id.'\', \''.$key.'\')">
<img class = "img1" name = "' . $img_id_likesize . '" id="'.$id.'_'.$img_id.'" id = tt101 style = "outline: none;position :absolute;top:345px;left:120px;" width = "32px" height = "32px" src = "' . $path . '" class = "img-fluid" alt = "" >
</a>
<div style = "outline: none;">
';
$query = mysqli_query($con, "SELECT * FROM `r_like` where img_id = '$img_id'");
$count = 0;
while (mysqli_fetch_array($query)) {
$count = $count + 1;
}
echo'
<h3 id="'.$id.'_'.$img_id.'" style = "position:absolute;text-shadow: 1px 0.8px #BDBDBD;left:160px;top:345px;">' . $count . '</h3>
</div >
<div class = "mdl-tooltip" data-mdl-for = "#tt101">Like</div>';
echo'
<!--Text-->
</div>
<!--/.Card content-->
</div>
<!--/.Card-->
</div>
<!--/.Third column-->
';
$counter = $counter + 1;
if ($counter % 3 == 0) {
echo' </div>';
//echo' </div>';
}
if ($c_i >= $articlesPerPage)
break;
echo'<script>
$("#' . $img_id_temp_1 . '") . click(function() {
img_id = $(this) . attr("id");
$("#imagepreview1").attr("src", $("#imageresource1").attr("src"));
$("#mod' . $img_id . '") . modal("show");
});
</script>';
}
if ($counter % 3 != 0)
echo' </div>';
?>
<hr>
<!--Pagination-->
<nav class="row text-xs-center">
<ul class="pagination">
<li class="page-item disabled">
</li>
<?php
$totalPages;
$c_p = 1;
while ($c_p < $page) {
echo'
<li class="page-item"><a class="page-link" href="home.php?page=' . $c_p . '">';
echo $c_p;
echo'</a></li>';
$c_p++;
}
echo' <li class="page-item active">
<a class="page-link" href="home.php?page=' . $page . '">';
echo $page;
echo'<span class="sr-only">(current)</span></a>
</li>';
$c_p = $page + 1;
while ($c_p <= $totalPages) {
echo'<li class="page-item"><a class="page-link" href="home.php?page=' . $c_p . '">';
echo $c_p;
echo'</a></li>';
$c_p = $c_p + 1;
}
/* <li class="page-item">
<a class="page-link" href="#!" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li> */
?>
</ul>
</nav>
<!--/.Pagination-->
<hr>
</div>
</main>
<dialog class="mdl-dialog " style="width:30%;">
<div class="mdl-dialog__content">
<h1>Upload Image</h1>
<div class="mdl-card__supporting-text">
<div class="container">
<!-- Modal -->
<form method="POST" action="q3.php" onSubmit="return myFunction()" enctype="multipart/form-data">
<input type="file" name="myimage" id="img">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" name = "title" type="text" id="title" placeholder="Title"/>
</div>
<div class="container">
<div class="row">
<div class="button-group">
<!--<button type="button" class="btn btn-elegant btn-sm dropdown-toggle" data-toggle="dropdown"><span>Category</span> <span class="caret"></span></button>-->
<select name="category">
<option value="" disabled selected>Select category</option>
<li><option value = '1'/> Nature</option></li>
<li><option value = '2'/> Animals</option></li>
<li><option value = '3'/> Plants</option></li>
<li><option value = '4'/> Art</option></li>
<li><option value = '5'/> People</option></li>
<li><option value = '6'/> City</option></li>
</select>
</div>
-
</div>
</div>
<br>
<input type="submit" style="background-color: #212121;color:white;" name="submit_image" value="Upload">
</form>
</div>
</div>
</div>
<div class="mdl-dialog__actions mdl-dialog__actions--full-width">
<button type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<script>
var dialog = document.querySelector('dialog');
var showModalButton = document.querySelector('.show-modal');
if (!dialog.showModal) {
dialogPolyfill.registerDialog(dialog);
}
showModalButton.addEventListener('click', function () {
dialog.showModal();
});
dialog.querySelector('.close').addEventListener('click', function () {
dialog.close();
});
</script>
<dialog class="mdl-dialog dialog2 " style="width:30%;">
<div class="mdl-dialog__content">
<h1>Pixlr : Login</h1>
<div class="mdl-card__supporting-text">
<div class="container">
<form method="POST" action="q3.php">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label" style="background-color:white;">
<input class="mdl-textfield__input" type="email" name="email" id="sample3" autocomplete="off" required="yes">
<label class="mdl-textfield__label" for="sample3">Email...</label>
</div><br>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label "style="background-color:white;">
<input class="mdl-textfield__input" type="password" id="sample4" autocomplete="off" name="password" required="yes">
<label class="mdl-textfield__label" for="sample4" >Password....</label>
</div><br>
<button class="mdl-button bg-primary mdl-js-button mdl-js-ripple-effect" name="Login" value="Login">Login</button>
<button href="#!" class="mdl-button bg-danger mdl-js-button mdl-js-ripple-effect" style="float:right;">Forgot Password?</button>
</form>
</div>
</div>
</div>
<div class="mdl-dialog__actions mdl-dialog__actions--full-width">
<button type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<script>
var dialog2 = document.querySelector('.dialog2');
var showModalButton1 = document.querySelector('.show-modal1');
var showModalButton2 = document.querySelector('#sm2');
if (!dialog2.showModal) {
dialog2Polyfill.registerDialog(dialog);
}
showModalButton1.addEventListener('click', function () {
dialog2.showModal();
});
showModalButton2.addEventListener('click', function () {
dialog2.showModal();
});
dialog2.querySelector('.close').addEventListener('click', function () {
dialog2.close();
});
</script>
<!-- ************************** signup ************************ -->
<dialog class="mdl-dialog dialog3" style="width:30%;">
<div class="mdl-dialog__content">
<h1>Pixlr : Signup</h1>
<div class="mdl-card__supporting-text">
<div class="container">
<form method="POST" action="q3.php">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="fname" id="sample1" required="yes" >
<label class="mdl-textfield__label" for="sample1">First Name...</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="lname" id="sample2" >
<label class="mdl-textfield__label" for="sample2">Last Name...</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="email" name="email" id="sample10" required="yes">
<label class="mdl-textfield__label" for="sample10">Email...</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="number" name="age" id="sample5" max="75" min="15" >
<label class="mdl-textfield__label" for="sample5" >Age...</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="tel" name="contact" id="sample6" pattern="^\d{10}$" required="yes">
<label class="mdl-textfield__label" for="sample6" >Phone...</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="password" id="sample11" name="password" required="yes">
<label class="mdl-textfield__label" for="sample11" >Password....</label>
</div><br>
<button class="mdl-button bg-primary mdl-js-button mdl-js-ripple-effect" name="signup" value="signup">Signup</button>
</form>
</div>
</div>
</div>
<div class="mdl-dialog__actions mdl-dialog__actions--full-width">
<button type="button" class="mdl-button close">Close</button>
</div>
</dialog>
<script>
var dialog3 = document.querySelector('.dialog3');
var showModalButton3 = document.querySelector('.show-modal3');
var showModalButton4 = document.querySelector('#sm4');
if (!dialog3.showModal) {
dialog3Polyfill.registerDialog(dialog);
}
showModalButton3.addEventListener('click', function () {
dialog3.showModal();
});
showModalButton4.addEventListener('click', function () {
dialog3.showModal();
});
dialog3.querySelector('.close').addEventListener('click', function () {
dialog3.close();
});
</script>
<div class="mdl-layout-spacer"></div>
<!--/.Footer-->
<!--/.Footer-->
<footer class="mdl-mini-footer elegant-color-dark" style="padding-bottom: 60px;width:100%;margin-top: 10%;" >
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">Pixlr</div>
<ul class="mdl-mini-footer__link-list">
<li><a href="#">About</a></li>
<li><a href="#">Team</a></li>
<li><a href='#!'>Contact</a></li>
</ul>
</div>
</footer>
<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/tether.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script>
function like(prsn, img, key) {
var id = prsn + "_" + img;
$.get("q3.php", {"image_id_like": img, "person_id": prsn}, function (reply) {
if ($("img[id='" + id + "']").attr("src") == "/pixlr/images/2000px-Love_Heart_SVG.png") {
$("img[id='" + id + "']").attr({"src": "/pixlr/images/2000px-Love_Heart_SVGcopy.png"});
var x = $("h3[id='" + id + "']").text();
var y = ((parseInt(x)) - 1).toString();
$("h3[id='" + id + "']").html(y);
} else {
$("img[id='" + id + "']").attr("src", "/pixlr/images/2000px-Love_Heart_SVG.png");
var x = $("h3[id='" + id + "']").html();
var y = ((parseInt(x)) + 1).toString();
$("h3[id='" + id + "']").html(y);
}
});
}
</script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.min.js"></script>
<script src="https://code.getmdl.io/1.2.1/material.min.js"></script>
</div>
</body>
</html>