-
Notifications
You must be signed in to change notification settings - Fork 0
/
statManager.php
337 lines (262 loc) · 8.88 KB
/
statManager.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>dinliga.net</title>
<link rel="SHORTCUT ICON" href="favicon.png" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a.login-window').click(function() {
// Getting the variable's value from a link
var loginBox = $(this).attr('href');
//Fade in the Popup and add close button
$(loginBox).fadeIn(300);
//Set the center alignment padding + border
var popMargTop = ($(loginBox).height() + 24) / 2;
var popMargLeft = ($(loginBox).width() + 24) / 2;
$(loginBox).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
// Add the mask to body
$('body').append('<div id="mask"></div>');
$('#mask').fadeIn(300);
return false;
});
// When clicking on the button close or the mask layer the popup closed
$('a.close, #mask').live('click', function() {
$('#mask , .login-popup').fadeOut(300 , function() {
$('#mask').remove();
});
return false;
});
});
</script>
</head>
<div id="wrapper">
<!-- start header -->
<div id="header">
<div id="logo">
<h1><a href="index.php">DinLiga.net </a></h1>
<h2>Fantasy League</h2>
<div class="social">
<ul>
<li class="facebook"><a href="https://www.facebook.com/JogaBonitoFutsalBergen" title="Visit us on Facebook">Facebook</a></li>
<li class="twitter"><a href="https://twitter.com/DinLiga" title="Visit us on Twitter">Twitter</a></li>
<ul>
</div>
</div>
<?php
session_start();
include 'connect.php';
if (!isset($_SESSION['user'])) {
?> <div id="menu">
<ul>
<li><a href="index.php">Homepage</a></li>
<li class="current_page_item"> <a href="statistics.php">Statistics</a></li>
<li><a href="rules.php">Rules</a></li>
<li><a href="contact.php">Contact</a></li>
<li> <div class="btn-sign">
<a href="#login-box" class="login-window">Login</a>
</div>
<div id="login-box" class="login-popup">
<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
<form method="" class="signin" action="">
<fieldset class="textbox">
<label class="username">
<span>Username or email</span>
<input id="usernamelog" name="username" value="" type="text" autocomplete="on" placeholder="Email">
</label>
<label class="password">
<span>Password</span>
<input id="passwordlog" name="password" value="" type="password" placeholder="Password">
</label>
<input class="submit button login" type='button' name='submit' value='Sign in'>
<a href="http://www.dinliga.net/reset.php">Forgot Password?</a>
<div class="feedbacklog"> </div>
</fieldset>
</form>
</div>
</li>
<li>
<div class="btn-sign">
<a href="#reg-box" class="login-window">Register</a>
</div>
<div id="reg-box" class="login-popup">
<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
<form method="" class="signin" action="">
<fieldset class="textbox">
<label class="username">
<span>Email</span>
<input id="username" name="username" value="" type="text" autocomplete="on" placeholder="Email">
</label>
<label class="teamName">
<span>TeamName</span>
<input id="teamName" name="teamName" value="" type="text" autocomplete="on" placeholder="Teamname">
</label>
<label class="password">
<span>Password</span>
<input id="password" name="password" value="" type="password" placeholder="Password">
</label>
<input class="submit button register" type='button' name='submit' value='Register'>
<div class="feedback"> </div>
</fieldset>
</form>
</div>
</li>
</ul>
</div>
<?php } else{ $user=$_SESSION['user']; ?>
<div id="menu">
<ul>
<li><a href="index.php">Homepage</a></li>
<li class="current_page_item"><a href="statistics.php">Statistics</a></li>
<li><a href="points.php">Points</a></li>
<li><a href="team.php">My Team</a></li>
<li><a href="transfer.php">Transfer</a></li>
<li><a href="rules.php">Rules</a></li>
<li><a href="contact.php">Contact</a></li>
<li>
<div class="btn-sign1">
<form method="post" action="logout.php">
<input class="submitLogOut" type='submit' name='submit' value='Logout'>
</form>
</div>
</li>
</ul>
</div>
<?php } ?>
</div>
<!-- end header -->
<!-- start page -->
<div id="page">
<!-- start content -->
<div id="content">
</body>
<form method="post" action ="teamcheck.php">
<table id="newspaper-a" summary="2007 Major IT Companies' Profit">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Team</th>
<th scope="col">Points</th>
</tr>
</thead>
<tbody>
<?php
$string;
include 'connect.php';
$results = mysql_query("SELECT team, SUM(points) as 'poeng' FROM Squad GROUP BY team ORDER BY poeng DESC");
$platz = 1;
while($row = mysql_fetch_array($results)) {
$team = $row['team'];
$points = $row['poeng'];
?>
<tr>
<td><?php echo $platz?>.</td>
<td> <input class ="submitLink" type="submit" name= "managername" value="<?php echo $team?>" ></td>
<td><?php echo $points?></td>
</tr>
<?php
$platz = $platz + 1;
}
?>
</tbody>
</table>
</form>
</div>
<!-- end sidebar -->
<div style="clear: both;"> </div>
</div>
<!-- end page -->
</div>
<div id="s-box" class="login-popup">
<a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
<form method="post" class="signin" action="register.php">
<fieldset class="textbox2">
</fieldset>
</form>
</div>
<div id="footer">
<p id="legal">( c ) 2014. All Rights Reserved. <a href="http://www.anderslangseth.no" target="_blank">Anders Langseth</a></p>
</div>
<!-- end footer -->
<script type="text/javascript">
$(document).ready(function() {
$('.register').die('click').live('click', function () {
var pw = $('#password').val();
var tn = $('#teamName').val();
var un = $('#username').val();
$fb = $('.feedback');
if(pw && tn && un){
$.ajax({
type: "POST",
data: {"teamName":tn, "username":un, "password":pw, "submit":"submit"},
url: "register.php",
success: function(data){
if(data == "NOEMAIL"){
$fb.html("<p> This is no valid email address </p>");
}
else if(data =="TEAMNAMETAKEN"){
$fb.html("<p> This teamname is taken </p>");
}
else if(data =="USERNAMETAKEN"){
$fb.html("<p> This username is taken</p>");
}
else if(data =="SUCCESS"){
$fb.html("<p> Welcome </p>");
$('#reg-box').fadeOut(1000);
$('#mask').fadeOut(1000);
window.location.replace("http://dinliga.net/statistics.php");
}
}
});
}
else{
$fb.html("<p> Please fill in all fields. </p>");
$('#reg-box').addClass('b1');
}
});
$('.login').die('click').live('click', function () {
var pw = $('#passwordlog').val();
var un = $('#usernamelog').val();
$fb = $('.feedbacklog');
$loginbox = $('#login-box');
if(pw && un){
$.ajax({
type: "POST",
data: {"username":un, "password":pw, "submit":"submit"},
url: "login.php",
success: function(data){
if(data == "WRONGUNPW"){
$loginbox.addClass('b1');
$fb.html("<p> Email and Password is wrong </p>");
}
else if(data =="NOEMAIL"){
$loginbox.addClass('b1');
$fb.html("<p> This is not a valid Email address </p>");
}
else if(data =="SUCCESS"){
$loginbox.removeClass('b1');
$loginbox.addClass('b2');
$fb.html("<p> Welcome </p>");
$('#reg-box').fadeOut(1000);
$('#mask').fadeOut(1000);
window.location.replace("http://dinliga.net/statistics.php");
}
}
});
}
else{
$loginbox.addClass('b1');
$fb.html("<p> Please fill in all fields. </p>");
}
});
});
</script>
</body>
</html>