-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent_submission.php
162 lines (137 loc) · 3.9 KB
/
event_submission.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
<?php
$myArray = explode('/', $_GET['Name']);
require 'config.php';
$query="show tables";
$result = mysqli_query($dbConn,$query);
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel=stylesheet href="code/doc/docs.css">
<link rel="stylesheet" href="bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="portal_design.css">
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<title>Code here ;)</title>
<link rel='icon' href='IIITGLogo2.png'>
<style>
/* Set height of the grid so .sidenav can be 100% (adjust if needed) */
.row.content {height: 1000px}
/* Set gray background color and 100% height */
.sidenav {
background-color: #f1f1f1;
height: 100%;
}
/* Set black background color, white text and some padding */
footer {
background-color: #555;
color: white;
padding: 15px;
}
/* On small screens, set height to 'auto' for sidenav and grid */
@media screen and (max-width: 767px) {
.sidenav {
height: auto;
padding: 15px;
}
.row.content {height: auto;}
}
</style>
</head>
<body>
<ul class="nav nav-tabs" >
<li class="active"><a href="admin_index.php">Home</a></li>
<li><a href="registration.php">Add_Student</a></li>
<li><a href="add_problem.php">Add_Problem</a></li>
<li><a href="event.php">Event</a></li>
<li><a href="questions.php">View_Problems</a></li>
<li><a href="admin_submission.php?NAME=default">Submissions</a></li>
<li><a href="event_submission.php?Name=EVNT001">Event_Submissions</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
<div class="container-fluid">
<div class="row content">
<div class="col-sm-2 sidenav">
<ul class="nav nav-pills nav-stacked">
<?php
while($row= mysqli_fetch_array($result))
{
if( strpos( $row[0], "EVNT" ) !== false ) {
if( strpos( $row[0], "_" ) === false ) {
$event=$row[0]."/default";
echo " <li><a href=event_submission.php?Name=$event>$row[0]</a></li>";
}
}
}
?>
</div>
<div class="col-sm-9">
<h3><b><i> Submissions</i></b></h3>
<select id="attribute" onchange="color_click();" >
<option value="default">Sort_Submission</option>
<option value="id">Submission_id</option>
<option value="date">Date</option>
<option value="problem_id">Code_id</option>
</select></br>
<div class="table-responsive">
<table class="table" border="0" align="center">
<col width="10%">
<col width="10%">
<thead class="thead-inverse" style="color: black">
<tr>
<th> Roll_Number</th>
<th> Code_Id </th>
<th> Submission_Id </th>
<th> Date </th>
<th> Result </th>
<th> Time </th>
<th> Runtime </th>
<th> Memory </th>
<th> Language </th>
<th> Solution </th>
</tr>
</thead>
<tbody>
<?php
if($myArray[1]=="default")
{
$query = "SELECT * FROM $myArray[0]";
}
else
{
$query = "SELECT * FROM $myArray[0] order by $myArray[1]";
}
$result = mysqli_query($dbConn, $query) or die(mysqli_error($dbConn));
while ($row = mysqli_fetch_array($result)) {
echo ' <tr> ';
echo ' <td> ' . $row[0] . ' </td> ';
echo ' <td> ' . $row[1] . ' </td> ';
echo ' <td> ' . $row[2] . ' </td> ';
echo ' <td> ' . $row[3] . ' </td> ';
echo ' <td> ' . $row[4] . ' </td> ';
echo ' <td> ' . $row[5] . ' </td> ';
echo ' <td> ' . $row[6] . ' </td> ';
echo ' <td> ' . $row[7] . ' </td> ';
echo ' <td> ' . $row[8] . ' </td> ';
echo ' <td><a href=problem_solution.php?Name='.$row[9].'>Link</a></td>';
echo ' </tr> ';
}
?>
</tbody>
</div>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
function color_click(){
var myVar = document.getElementById('attribute').value;
var simple = '<?php echo $myArray[0]; ?>';
window.location.href="event_submission.php?Name="+simple+"/"+myVar;
}
</script>
</body>
</html>