This repository has been archived by the owner on Jul 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
souteze.inc
88 lines (78 loc) · 1.8 KB
/
souteze.inc
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
<?php
/*
* greybox
* $Id: souteze.inc,v 1.13 2007/02/13 21:04:31 che0 Exp $
* vypis vsech soutezi v sezone
*/
pg_head();
if ($GLOBALS["cps_souteze"] >= 2) cph_p(
cphs_link("./?page=soutez.add",$lang["add competition"])
. " | " . cphs_link("./?page=liga.add",$lang["add league"])
);
if (! cpdb_fetch_all("
select
0 as liga,
soutez_ID as ID,
rocnik,
nazev,
jazyk,
zamceno,
(select count(*) from debata where soutez_ID = soutez.soutez_ID) as debaty
from
soutez
union
select
1 as liga,
liga_ID as ID,
rocnik,
nazev,
(
select group_concat(distinct jazyk separator ',')
from turnaj left join soutez using (soutez_ID)
where liga_ID = liga.liga_ID
) as jazyk,
0 as zamceno,
(
select count(debata_ID)
from turnaj, debata
where turnaj.liga_ID = liga.liga_ID
and debata.turnaj_ID = turnaj.turnaj_ID
) as debaty
from
liga
order by
rocnik desc,
liga desc,
zamceno,
jazyk
", array(), $souteze)) {
pg_achtung($lang["no records"]);
return;
}
de_html($souteze);
cph_table_head(array($lang["season"], $lang["competition"], $lang["type"], $lang["lang"], $lang["active"] ,$lang["debates"]));
foreach ($souteze as $soutez) {
if ($soutez["liga"]) {
// league
cph_table_row(array(
season_to_str($soutez["rocnik"]),
cphs_link("./?page=liga&liga_id=" . $soutez["ID"], $soutez["nazev"]),
$lang["league"],
is_null($soutez["jazyk"]) ? $lang["n/a"] : $soutez["jazyk"],
$lang["n/a"],
$soutez["debaty"]
));
} else {
// regular competition
cph_table_row(array(
season_to_str($soutez["rocnik"]),
cphs_link("./?page=soutez&soutez_id=" . $soutez["ID"], $soutez["nazev"]),
$lang["cup"],
$soutez["jazyk"],
$soutez["zamceno"] ? $lang["no"] : $lang["yes"],
$soutez["debaty"]
));
}
}
cph_table_end();
?>