-
Notifications
You must be signed in to change notification settings - Fork 0
/
judContest.php
68 lines (64 loc) · 2.35 KB
/
judContest.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
<?php
require_once 'header.php';
if (!verifySession()) {
header("Location: index.php");
}
$par=getUsername();
$id=mysqli_query($connection,"SELECT `id` FROM `users` where `email`='$par'");
$i = mysqli_fetch_assoc($id);
$dum=$i['id'];
$contest= mysqli_query($connection,"SELECT `contest_id` FROM `result` where `id`='$dum' and `j_p`='j'");
$con = [];
$conid = [];
while($c = mysqli_fetch_assoc($contest) ){
$cid=$c['contest_id'];
$temp = mysqli_query($connection,"SELECT `c_name` FROM `contests` where `contest_id`='$cid'");
$temp = mysqli_fetch_assoc($temp);
$cname = $temp['c_name'];
array_push($con,$cname);
$temp=mysqli_query($connection,"SELECT `contest_id` FROM `contests` where `c_name`='$cname'");
$temp = mysqli_fetch_assoc($temp);
$cid = $temp['contest_id'];
array_push($conid,$cid);
}
?>
<div class="container-fluid">
<div class="row">
<nav class="col-md-2 d-none d-md-block sidebar">
<?php require_once 'sidebar.php';?>
</nav>
<div class="col-md-10 mt-3">
<div class="row">
<label style='color:black; font-size:24px; font-family: Verdana, Geneva, Tahoma, sans-serif;'>Assigned Contests</label>
<br/><br/>
<br/>
<div>
</div>
</div>
<div class="row mt-4">
<div class="col-md-9">
<h4 class = "panel-title"><ul class = "list-group">
<?php for($id=0;$id<count($con);$id++) {?>
<li class = "list-group-item" >
<form action="viewContestpar.php" method="get">
<input type="text" name="id" value="<?php echo $conid[$id] ?>" hidden>
<button style=' background-color: Transparent;
background-repeat:no-repeat;
border: none;
cursor:pointer;
overflow: hidden;
outline:none;
color:black;color:black; font-size:18px; font-family: Verdana, Geneva, Tahoma, sans-serif;'
type="submit" class="btn btn-primary"><?php echo $con[$id] ?></button></li>
</form>
<?php }?>
</ul>
</h4>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>