-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatch.php
More file actions
176 lines (157 loc) · 5.67 KB
/
Copy pathmatch.php
File metadata and controls
176 lines (157 loc) · 5.67 KB
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
<?php
include_once ("php_includes/db-conx.php");
session_start();
if ((isset($_GET['game']))&&(isset($_GET['table']))) {
$game = $_GET['game'];
$table = $_GET['table'];
//Session varijable,izvode se ako postoji sessija
if(isset($_SESSION['sudionik'])){
//Dohvaćanje podataka o ekipi putem sessije
$team = $_SESSION['sudionik'];
$sql="SELECT * FROM `Teams` WHERE username='$team' LIMIT 1";
$q = mysqli_query($db_conx, $sql);
$team_string = mysqli_fetch_array($q);
$my_team = $team_string["teamName"];
}else {
header("location: /login");
exit();
}
$table_name = "Results_".$table; //Ime tablice rezultata
$sql = "SELECT * FROM `$table_name` WHERE game='$game' LIMIT 1";
$q = mysqli_query($db_conx, $sql);
$count = mysqli_num_rows($q);
$game_string = mysqli_fetch_array($q);
//Postoji zapis, Prikaži turnir
if (($count == 1)&&($game_string["res1"] == "")&&($game_string["res2"] == "")){
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Belot-organizer | Utakmica</title>
<link rel="shortcut icon" href="img/favicon.png">
<!-- METAS -->
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="keywords" content="Tournament organizer,Belot" />
<meta name="description" content="Web app for Belot tournament organization">
<meta name="author" content="Matej Prpic">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- STYLES -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/icomoon.css">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/customfont.css">
<link rel="stylesheet" href="css/loader.css">
<link rel="stylesheet" href="css/tournament.css">
<!-- MODERNIZR -->
<script src="js/vendor/modernizr.js"></script>
</head>
<body>
<!-- LOADER -->
<div id="loading">
<div id="loading-center">
<div id="loading-center-absolute">
<div class="loading-logo">
<i class="icon icon-Belot-organizer"></i>
</div>
<div class="animated_lines" id="line_one"></div>
<div class="animated_lines" id="line_two"></div>
<div class="loading-text">
<p>Belot-organizer</p>
</div>
</div>
</div>
</div>
<?php
//Header za ekipe/organizatore
if(isset($_SESSION['sudionik'])){
echo '
<div class="header" style="">
<a href ="team" class="left"><i class="fa fa-group"></i> '.$team.'</a>
<a href ="logout" class="right"><i class="fa fa-sign-out"></i> Odjava</a>
</div>';
}
?>
<!-- Global -->
<div class="logo">
<i class="icon icon-Belot-organizer"></i>
</div>
<!-- From toggling -->
<div class="module form-module">
<div class="form-toggle">
<h3><i class="icon icon-clipboard"></i>Utakmica</h3>
<form onsubmit="return false;">
<div class="login-style">
<div class="row">
<div class="col-md-4">
<div class="form-group form-group-lg">
<label style="margin-left:120px;"><?php echo $game_string["team1"]; ?></label>
<input id="res1" class="form-control" placeholder="Rezultat prve ekipe" type="text" />
</div>
</div>
<div class="col-md-4" style="margin-left:130px;">
<div class="form-group form-group-lg">
<label style="margin-left:120px;"><?php echo $game_string["team2"]; ?></label>
<input id="res2" class="form-control" placeholder="Rezultat druge ekipe" type="text" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<label style="margin-left:135px;"><h2 id="res1-uk">0</h2></label>
</div>
<div class="col-md-4">
<label style="margin-left:265px;"><h2 id="res2-uk">0</h2></label>
</div>
</div>
<div class="row">
<button id="unos" class="btn btn-default btn-lg" style="width:100px; font-size:16px; margin-left:300px; margin-bottom:30px; margin-top:-10px;">U redu</button>
</div>
<div class="row">
<div class="col-md-4" style="margin-left:232px;">
<table class="table table-bordered table-striped table-booking-history">
<thead>
<tr>
<th style="text-align:center; font-size:18px;">MI</th>
<th style="text-align:center; font-size:18px;">VI</th>
</tr>
</thead>
<tbody>
<tr>
<td id="res1-part" style="text-align:center; font-size:15px; width:50%;">0</td>
<td id="res2-part" style="text-align:center; font-size:15px; width:50%;">0</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr class="tab-gap"></hr>
<div id = "status">
<button id="save-res" class="btn btn-primary btn-lg" style="width:200px; margin-left:235px; display:none;">Spremi rezultat</button>
</div>
</div>
</form>
</div>
</div>
<div class="footer" style="margin-bottom:30px;">
<p>Copyright © 2016 <a href="index">Belot-organizer</a> • <span style="font-style:italic;">WebApp</span> • 31 000 Osijek</p>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/vendor/bootstrap.js"></script>
<script src="js/vendor/nicescroll.js"></script>
<script src="js/vendor/imagesloaded.pkgd.min.js"></script>
<script src="js/ajax.js"></script>
<script src="js/match.js"></script>
</body>
</html>
<?php
//Greške kod ne dohvaćanja id-a ili nepostojećeg turnira
}
else {
include_once ("php_includes/tournament-error.php");
}
}
else {
include_once ("php_includes/tournament-error.php");
}
?>