-
Notifications
You must be signed in to change notification settings - Fork 0
/
score.php
executable file
·263 lines (240 loc) · 14 KB
/
score.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
<?php
session_start();
require './_app/Config.inc.php';
$login = new Login;
$logoff = filter_input(INPUT_GET, 'logoff', FILTER_VALIDATE_BOOLEAN);
$eventoid = filter_input(INPUT_GET, 'evento', FILTER_VALIDATE_INT);
if (!$login->CheckLogin()):
unset($_SESSION['userlogin']);
header('Location: index.php?acesso=negado');
else:
$userlogin = $_SESSION['userlogin'];
$chall = new Chall;
if ($eventoid):
$chall->setEvento($eventoid);
endif;
$chall->setUserid($userlogin['id']);
endif;
if ($logoff):
unset($_SESSION['userlogin']);
header('Location: index.php?acesso=logoff');
endif;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo TITULO ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<?php echo "<meta http-equiv=\"refresh\" content=\"60;url=score.php?evento={$eventoid}\">"; ?>
<!-- Base Css Files -->
<link href="assets/libs/jqueryui/ui-lightness/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" />
<link href="assets/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link href="assets/libs/fontello/css/fontello.css" rel="stylesheet" />
<link href="assets/libs/animate-css/animate.min.css" rel="stylesheet" />
<link href="assets/libs/nifty-modal/css/component.css" rel="stylesheet" />
<link href="assets/libs/magnific-popup/magnific-popup.css" rel="stylesheet" />
<link href="assets/libs/ios7-switch/ios7-switch.css" rel="stylesheet" />
<link href="assets/libs/pace/pace.css" rel="stylesheet" />
<link href="assets/libs/sortable/sortable-theme-bootstrap.css" rel="stylesheet" />
<link href="assets/libs/bootstrap-datepicker/css/datepicker.css" rel="stylesheet" />
<link href="assets/libs/jquery-icheck/skins/all.css" rel="stylesheet" />
<!-- Code Highlighter for Demo -->
<link href="assets/libs/prettify/github.css" rel="stylesheet" />
<!-- Extra CSS Libraries Start -->
<link href="assets/libs/jquery-datatables/css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="assets/libs/jquery-datatables/extensions/TableTools/css/dataTables.tableTools.css" rel="stylesheet" type="text/css" />
<link href="assets/css/style.css" rel="stylesheet" type="text/css" />
<!-- Extra CSS Libraries End -->
<link href="assets/css/style-responsive.css" rel="stylesheet" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="assets/img/favicon.ico">
</head>
<body class="fixed-left">
<!-- Modal Start -->
<!-- Modal Task Progress -->
<?php require './metricaschall.php'; ?>
<!-- Modal Logout -->
<div class="md-modal md-just-me" id="logout-modal">
<div class="md-content">
<h3><strong>Logout</strong></h3>
<div>
<p class="text-center">Deseja realmente sair do Site?</p>
<p class="text-center">
<button class="btn btn-danger md-close">Não</button>
<a href="?logoff=true" class="btn btn-success md-close">Sim, Quero!</a>
</p>
</div>
</div>
</div>
<!-- Modal End -->
<!-- Begin page -->
<div id="wrapper">
<!-- Top Bar Start -->
<div class="topbar">
<div class="topbar-left">
<button class="button-menu-mobile open-left">
<i class="fa fa-bars"></i>
</button>
</div>
<!-- Button mobile view to collapse sidebar menu -->
<div class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-collapse2">
<ul class="nav navbar-nav hidden-xs">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-th"></i></a>
</li>
<!--linguagem-->
<li class="language_bar dropdown hidden-xs">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Português (PT-BR) <i class="fa fa-caret-down"></i></a>
<ul class="dropdown-menu pull-right">
<li><a href="#">English (US)</a></li>
</ul>
</li>
<!--linguagem-->
</ul>
<ul class="nav navbar-nav navbar-right top-navbar">
<li class="dropdown topbar-profile">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="rounded-image topbar-profile-image"><img src="images/users/user-35.jpg"></span> <?php echo $userlogin['username']; ?> <strong></strong> <i class="fa fa-caret-down"></i></a>
<ul class="dropdown-menu">
<li><a href="#">Meu Perfil</a></li>
<li><a href="#">Alterar Senha</a></li>
<li><a href="#">Configurações de Conta</a></li>
<li class="divider"></li>
<li><a class="md-trigger" data-modal="logout-modal"><i class="icon-logout-1"></i> Sair</a></li>
</ul>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
</div>
<!-- Top Bar End -->
<!-- Left Sidebar Start -->
<div class="left side-menu">
<div class="sidebar-inner slimscrollleft">
<div class="clearfix"></div>
<!--menu-->
<!--menu-->
<?php require 'menu.php';?>
<!--menu-->
<!--menu-->
<div class="clearfix"></div>
<div class="clearfix"></div><br><br><br>
</div>
<div class="left-footer">
<div class="progress progress-xs">
<div class="progress-bar bg-green-1" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span class="progress-precentage">0%</span>
</div>
<a data-toggle="tooltip" title="Task Progress" class="btn btn-default md-trigger" data-modal="task-progress"><i class="fa fa-inbox"></i></a>
</div>
</div>
</div>
<!-- Left Sidebar End -->
<!-- Start right content -->
<div class="content-page">
<div class="content">
<!-- Page Heading Start -->
<div class="row">
<div class="col-md-12">
<div class="widget">
<div class="widget-header">
<h2><strong>Evento: </strong> <?php echo $chall->getEvento() ?></h2>
<div class="additional-btn">
<a href="#" class="hidden reload"><i class="icon-ccw-1"></i></a>
<a href="#" class="widget-toggle"><i class="icon-down-open-2"></i></a>
</div>
</div>
<div class="widget-content">
<br>
<div class="table-responsive">
<form class='form-horizontal' role='form'>
<table id="datatables-1" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<th><center>#</center></th>
<th><center>Username</center></th>
<th><center>Team</center></th>
<th><center>Score</center></th>
</tr>
</thead>
<tbody>
<?php
$dados = new Read;
$dados->FullRead("SELECT usuario.username, score_total.score FROM score_total, usuario WHERE usuario.id = score_total.usuario_id and score_total.evento_id= :e ORDER BY score_total.score DESC, score_total.datahora ASC","e={$eventoid}");
$x = 0;
foreach ($dados->getResult() as $value) {
$x = $x + 1;
echo "<tr>";
echo "<td><center>{$x}</center></td>";
echo "<td><center>{$value['username']}</center></td>";
echo "<td><center></center></td>";
echo "<td><center><button type=\"button\" class=\"btn btn-success\">{$value['score']}</button></center></td>";
echo "</tr>";
}
?>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End right content -->
</div>
<!-- End of page -->
<!-- the overlay modal element -->
<div class="md-overlay"></div>
<!-- End of eoverlay modal -->
<script>
var resizefunc = [];
</script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="assets/libs/jquery/jquery-1.11.1.min.js"></script>
<script src="assets/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js"></script>
<script src="assets/libs/jquery-ui-touch/jquery.ui.touch-punch.min.js"></script>
<script src="assets/libs/jquery-detectmobile/detect.js"></script>
<script src="assets/libs/jquery-animate-numbers/jquery.animateNumbers.js"></script>
<script src="assets/libs/ios7-switch/ios7.switch.js"></script>
<script src="assets/libs/fastclick/fastclick.js"></script>
<script src="assets/libs/jquery-blockui/jquery.blockUI.js"></script>
<script src="assets/libs/bootstrap-bootbox/bootbox.min.js"></script>
<script src="assets/libs/jquery-slimscroll/jquery.slimscroll.js"></script>
<script src="assets/libs/jquery-sparkline/jquery-sparkline.js"></script>
<script src="assets/libs/nifty-modal/js/classie.js"></script>
<script src="assets/libs/nifty-modal/js/modalEffects.js"></script>
<script src="assets/libs/sortable/sortable.min.js"></script>
<script src="assets/libs/bootstrap-fileinput/bootstrap.file-input.js"></script>
<script src="assets/libs/bootstrap-select/bootstrap-select.min.js"></script>
<script src="assets/libs/bootstrap-select2/select2.min.js"></script>
<script src="assets/libs/magnific-popup/jquery.magnific-popup.min.js"></script>
<script src="assets/libs/pace/pace.min.js"></script>
<script src="assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="assets/libs/jquery-icheck/icheck.min.js"></script>
<!-- Demo Specific JS Libraries -->
<script src="assets/libs/prettify/prettify.js"></script>
<script src="assets/js/init.js"></script>
<!-- Page Specific JS Libraries -->
<script src="assets/libs/jquery-datatables/js/jquery.dataTables.min.js"></script>
<script src="assets/libs/jquery-datatables/js/dataTables.bootstrap.js"></script>
<script src="assets/libs/jquery-datatables/extensions/TableTools/js/dataTables.tableTools.min.js"></script>
<script src="assets/js/pages/datatables.js"></script>
</body>
</html>