-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
780 lines (534 loc) · 33.2 KB
/
index.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/bootstrap.min.css"></link>
<link rel="stylesheet" href="css/ideacss.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"/>
<link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,400italic' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<style>
@keyframes slidy {
0% { left: 0%; }
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}
body { margin: 0; }
div#slider { overflow: hidden; }
div#slider figure img { width: 20%; float: left; }
div#slider figure {
position: relative;
width: 500%;
margin: 0;
left: 0;
text-align: left;
font-size: 0;
animation: 15s slidy infinite;
}
.image2 {
position: relative;
width: 100%; /* for IE 6 */
}
#slideshow {
margin: 50px auto;
position: relative;
width: 240px;
height: 240px;
padding: 10px;
box-shadow: 0 0 20px rgba(0,0,0,0.4);
}
#slideshow > div {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
}
* {
margin: 0;
padding: 0;
}
body {
background-image:url(../images/body.jpg);
font-family: arial, verdana, tahoma;
}
/*Time to apply widths for accordian to work
Width of image = 640px
total images = 5
so width of hovered image = 640px
width of un-hovered image = 40px - you can set this to anything
so total container width = 640 + 40*4 = 800px;
default width = 800/5 = 160px;
*/
.accordian {
width: 805px; height: 320px;
overflow: hidden;
/*Time for some styling*/
margin: 5px auto;
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.35);
-webkit-box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.35);
-moz-box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.35);
}
/*A small hack to prevent flickering on some browsers*/
.accordian ul {
width: 2000px;
/*This will give ample space to the last item to move
instead of falling down/flickering during hovers.*/
}
.accordian li {
position: relative;
display: block;
width: 160px;
float: left;
border-left: 1px solid #888;
box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 25px 10px rgba(0, 0, 0, 0.5);
/*Transitions to give animation effect*/
transition: all 0.5s;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
/*If you hover on the images now you should be able to
see the basic accordian*/
}
/*Reduce with of un-hovered elements*/
.accordian ul:hover li {width: 40px;}
/*Lets apply hover effects now*/
/*The LI hover style should override the UL hover style*/
.accordian ul li:hover {width: 640px;}
.accordian li img {
display: block;
}
/*Image title styles*/
.image_title {
background: rgba(0, 0, 0, 0.5);
position: absolute;
left: 0; bottom: 0;
width: 640px;
min-height: 110px;
}
.image_title a {
display: block;
color: #fff;
text-decoration: none;
padding: 20px;
font-size: 16px;
min-height: 110px;
}
</style>
</head>
<body>
<div class="container-fluid header">
<div class="row headerrow">
<div class="col-md-4">
<img src="images/logo.png" class="img img-responsive"/>
</div>
<div class="col-md-2">
</div>
<div class="col-md-2">
</div>
<div class="col-md-1">
</div>
<div class="col-md-1">
<?php
if(!isset($_SESSION))
{
session_start();
}
if(isset($_SESSION["name"])&&$_SESSION["level"]=='Operator')
{
?>
<a class="btn btn-danger btndanger" href="adminPanel.php">Admin</a>
<?php
}
?>
</div>
<div class="col-md-2">
<?php
if(!isset($_SESSION))
{
session_start();
}
if(!isset($_SESSION["name"]))
{
?>
<a class="btn btn-success" href="login.php">Login</a>
<?php
}else{
?>
<a class="btn btn-success" href="logout.php">Logout</a>
<?php
}
?>
</div>
</div>
<div class="row textrow">
<h1 class="text1">SHARE YOUR IDEA WITH US</h1>
</div>
<div class="row textrow">
<h3 class="text2">WHAT YOU SAY WILL MAKE A DIFFERENCE</h3>
</div>
<div class="row textrow">
<?php
if(!isset($_SESSION))
{
session_start();
}
if(!isset($_SESSION["name"]))
{
?>
<a href="register.php"><button class="submitidea ">Get Started</button></a>
<?php
}else{
?>
<a href="#"><button class="submitidea" >Welcome <?php echo " ".$_SESSION["name"] ?></button></a>
<?php
}
?>
</div>
<div class="row">
<a href="indexGame.php"><img src="images/game_icon.png" height="50px" width="70px"></a>
</div>
<div class="row games">
Free Games
</div>
</div>
</div>
<div class="col-md-20 box" style="background-color : transparent">
<div class="row " style="min-height: 300px;padding-left: 50px">
<table>
<th style="padding-left: 90px">
<td style="padding-left: 80px ;padding-right: 10px;min-width: 200px"><h3 style="color: red">Best Award Winners</h3>
<div id="slider">
<figure>
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
$k=3;
$sqlGetData="Select * FROM register WHERE reward=".$k;
$result=mysqli_query($con,$sqlGetData);
while($row=mysqli_fetch_array($result)){
?>
<div class="image2">
<img src="<?php echo $row['Image']; ?>" height="150px" width="100px"/>
<h2 style="position: absolute;top: 200px; left: 0; width: 100%; "><?php echo $row['fname']; ?></h2>
</div>
<?php } ?>
</figure>
</div>
</td>
<td style="padding-left: 10px">
<div class="col-md-12" style="padding-left: 180px">
<div class="row">
<marquee behavior="slide" direction="left">
<h1 style="padding-left: 100px">THE EASIEST WAY </h1></marquee>
<marquee behavior="slide" direction="left">
<h1 style="padding-left: 30px"> TO SHARE YOUR IDEAS</h1></marquee>
<hr/>
</div>
<div class="row">
<?php
if(!isset($_SESSION))
{
session_start();
}
if(!isset($_SESSION["name"]))
{
?>
<marquee behavior="slide" direction="left"> <a style="padding-left: 150px"><button class="submitidea" data-toggle="tooltip" data-placement="bottom" title="Please Register">SUBMIT IDEA</button></a></marquee>
<?php
}else{
?><marquee behavior="slide" direction="left">
<a href="postSubmission.php"><button class="submitidea">SUBMIT IDEA</button></a>
<a href="view4.php"><button class="submitidea">VIEW IDEAS</button></a></marquee>
<?php
}
?>
</div>
</div>
</td>
</th>
</table>
</div>
</div>
<div class="col-md-20 box" style="background-color : transparent">
<div class="row greenboxx">
<h2 style="color: red">TOP VOTES</h2>
</div>
<div class="row description" style="min-height: 300px">
<div class="accordian" style="width: 1250px">
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
$i=0;
$sqlGetData="Select postId,dateTime,faculty,department,category,title,content,views,files FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE voteType='Upvote' GROUP BY p.postId ORDER BY SUM(C.weight) DESC";
$result=mysqli_query($con,$sqlGetData);
while($row=mysqli_fetch_array($result)){
if($i<6){
?>
<ul>
<li>
<div class="image_title">
<a href="#"><h1><?php echo $row['title'];?></h1></a>
<a href="#"><?php echo $row['content'];?></a>
<div class="col-md-4 departments" style="min-width: 800px;padding-left: 7px">
<table style="color: #1aa3ff">
<tr>
<td style="padding-left: 7px"><h5><?php echo $row['faculty'];?></h5></td></td>
<td style="padding-left: 58px"><h5><?php echo $row['department'];?></h5></td>
<td style="padding-left: 58px"><h5><?php echo $row['category'];?></h5></td>
<td style="padding-left: 58px"><h5><?php echo $row['dateTime'];?></h5></td>
</tr>
</table>
</div>
<table style="color: #A8A8A8 ">
<tr>
<td><h6 style="padding-left: 100px"><?php echo $row['views'];?> Views</h6></td>
<?php
$pid=$row['postId'];
$sql2="select COUNT(*) AS comments FROM comment AS C JOIN register AS R ON C.userId=R.id WHERE C.submissionId='$pid' ORDER BY C.date desc";
$sql3="select COUNT(*) AS upvote FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Upvote' ";
$sql5="select SUM(weight) AS weight FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Upvote' ";
$sql4="select COUNT(*) AS downvote FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Downvote' ";
$sql6="select SUM(weight) AS weightd FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Downvote' ";
$result2=mysqli_query($con,$sql2);
$result3=mysqli_query($con,$sql3);
$result4=mysqli_query($con,$sql4);
$result5=mysqli_query($con,$sql5);
$result6=mysqli_query($con,$sql6);
if (!$result2) {
printf("Error: %s\n", mysqli_error($con));
exit();
}
while($row2= mysqli_fetch_array($result2))
{
?>
<td style="padding-left: 25px"><h6><?php echo $row2['comments'];?> Comment</h6></td>
<?php }
while($row3= mysqli_fetch_array($result3))
{
?>
<td style="padding-left: 25px"><h6><?php echo $row3['upvote'];?> Upvotes</h6></td>
<?php }
while($row5= mysqli_fetch_array($result5))
{
$w=$row5['weight'];
if($w<1){
$w=0;
}
?>
<td style="padding-left: 25px"><h6><?php echo $w ;?> Upvote Weight</h6></td>
<?php }
while($row4= mysqli_fetch_array($result4))
{
?>
<td style="padding-left: 25px"><h6><?php echo $row4['downvote'];?> Downvotes</h6></td>
<?php }
while($row6= mysqli_fetch_array($result6))
{
$dw=$row6['weightd'];
if($dw<1){
$dw=0;
}
?>
<td style="padding-left: 25px"><h6><?php echo $dw ;?> Downvote Weight</h6></td>
<?php }
?>
</tr>
</table>
</div>
<a href="#">
<?php
$img=$row["files"];
if(file_exists($img)&&strcmp($img,"images/")!=0)
{
?>
<img src=<?= $row["files"]?> width="1000" height="300" />
<?php } else{?>
<img src="images/brain.jpg" width="1000" height="300" />
<?php } ?>
</a>
</li>
</ul>
<?php
}
$i=$i+1;
}
?>
</div>
</div>
</div>
<div class="col-md-20 box" style="background-color : transparent">
<div class="row greenboxx">
<h2 style="color: red">RECENT IDEAS</h2>
</div>
<div class="row description" style="min-height: 300px">
<div class="accordian" style="width: 1250px">
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
$i=0;
$sqlGetData="Select postId,dateTime,faculty,department,category,title,content,views,files FROM votes AS C JOIN post AS p ON C.submissionId=p.postId GROUP BY p.postId ORDER BY MAX(p.dateTime) DESC";
$result=mysqli_query($con,$sqlGetData);
while($row=mysqli_fetch_array($result)){
if($i<6){
?>
<ul>
<li>
<div class="image_title">
<a href="#"><h1><?php echo $row['title'];?></h1></a>
<a href="#"><?php echo $row['content'];?></a>
<div class="col-md-4 departments" style="min-width: 800px;padding-left: 7px">
<table style="color: #1aa3ff">
<tr>
<td style="padding-left: 7px"><h5><?php echo $row['faculty'];?></h5></td></td>
<td style="padding-left: 58px"><h5><?php echo $row['department'];?></h5></td>
<td style="padding-left: 58px"><h5><?php echo $row['category'];?></h5></td>
<td style="padding-left: 58px"><h5><?php echo $row['dateTime'];?></h5></td>
</tr>
</table>
</div>
<table style="color: #A8A8A8 ">
<tr>
<td><h6 style="padding-left: 100px"><?php echo $row['views'];?> Views</h6></td>
<?php
$pid=$row['postId'];
$sql2="select COUNT(*) AS comments FROM comment AS C JOIN register AS R ON C.userId=R.id WHERE C.submissionId='$pid' ORDER BY C.date desc";
$sql3="select COUNT(*) AS upvote FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Upvote' ";
$sql5="select SUM(weight) AS weight FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Upvote' ";
$sql4="select COUNT(*) AS downvote FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Downvote' ";
$sql6="select SUM(weight) AS weightd FROM votes AS C JOIN post AS p ON C.submissionId=p.postId WHERE C.submissionId='$pid' and voteType='Downvote' ";
$result2=mysqli_query($con,$sql2);
$result3=mysqli_query($con,$sql3);
$result4=mysqli_query($con,$sql4);
$result5=mysqli_query($con,$sql5);
$result6=mysqli_query($con,$sql6);
if (!$result2) {
printf("Error: %s\n", mysqli_error($con));
exit();
}
while($row2= mysqli_fetch_array($result2))
{
?>
<td style="padding-left: 25px"><h6><?php echo $row2['comments'];?> Comment</h6></td>
<?php }
while($row3= mysqli_fetch_array($result3))
{
?>
<td style="padding-left: 25px"><h6><?php echo $row3['upvote'];?> Upvotes</h6></td>
<?php }
while($row5= mysqli_fetch_array($result5))
{
$w=$row5['weight'];
if($w<1){
$w=0;
}
?>
<td style="padding-left: 25px"><h6><?php echo $w ;?> Upvote Weight</h6></td>
<?php }
while($row4= mysqli_fetch_array($result4))
{
?>
<td style="padding-left: 25px"><h6><?php echo $row4['downvote'];?> Downvotes</h6></td>
<?php }
while($row6= mysqli_fetch_array($result6))
{
$dw=$row6['weightd'];
if($dw<1){
$dw=0;
}
?>
<td style="padding-left: 25px"><h6><?php echo $dw ;?> Downvote Weight</h6></td>
<?php }
?>
</tr>
</table>
</div>
<a href="#">
<?php
$img=$row["files"];
if(file_exists($img)&&strcmp($img,"images/")!=0)
{
?>
<img src=<?= $row["files"]?> width="1000" height="300" />
<?php } else{?>
<img src="images/brain.jpg" width="1000" height="300" />
<?php } ?>
</a>
</li>
</ul>
<?php
}
$i=$i+1;
}
?>
</div>
</div>
</div>
</div>
<div class="container section3container" style="padding-left: 80px">
<div class="col-md-4">
<img src="images/sec4.1.png" height="200px" width="200px" class="section4size"/>
</div>
<div class="col-md-4">
<img src="images/sec4.2.png" height="200px" width="200px" class="section4size"/>
</div>
<div class="col-md-4">
<img src="images/sec4.3.png" height="200px" width="200px" class="section4size" />
</div>
</div>
<div class="container-fluid footer">
<div class="container">
<div class="col-md-4" align="center">
<img src="images/logo.png" class="img img-responsive footerimg" />
</div>
<div class="col-md-4" align="center">
<h6> CONTACT CURTIN </h6>
<br />
<p>
<b>General enquiries</b> <br />
Telephone: +61 8 9266 9266 <br />
Fax: +61 8 9266 3131 <br />
<br /><br/>
<b>Address</b> <br />
Kent Street, <br /> Bentley, <br /> Perth <br />
Western Australia 6102
</p>
</div>
<div class="col-md-4" align="center">
<p><b>LOCATIONS</b> <br /> <br />
Bentley (main campus) <br />
Other WA campuses <br />
Curtin University Sydney <br />
Curtin Sarawak <br />
Curtin Singapore <br />
</p>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$("#slideshow > div:gt(0)").hide();
setInterval(function() {
$('#slideshow > div:first')
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo('#slideshow');
}, 3000);
</script>
</body>
</html>