-
Notifications
You must be signed in to change notification settings - Fork 3
/
mns_races.inc.php
124 lines (109 loc) · 5.08 KB
/
mns_races.inc.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
<?php /* zavody - zobrazeni zavodu - Menu malého trenéra */
if (!defined("__HIDE_TEST__")) exit; /* zamezeni samostatneho vykonani */ ?>
<?
DrawPageTitle('Hromadné přihlášky na závody');
?>
<CENTER>
<?
require_once ("./common_race.inc.php");
require_once ('./url.inc.php');
$fA = (IsSet($fA) && is_numeric($fA)) ? (int)$fA : 0;
$fB = (IsSet($fB) && is_numeric($fB)) ? (int)$fB : 0;
$fC = (IsSet($fC) && is_numeric($fC)) ? (int)$fC : 0; // old races
$fD = (IsSet($fD) && is_numeric($fD)) ? (int)$fD : 0; // type 0
$sql_sub_query = form_filter_racelist('index.php?id='.$id.(($subid != 0) ? '&subid='.$subid : ''),$fA,$fB,$fC,$fD);
//when show all races reverse order
$order = ($fC == 1) ? "desc" : "";
$query = "SELECT id,datum,datum2,prihlasky,prihlasky1,prihlasky2,prihlasky3,prihlasky4,prihlasky5, nazev,misto,ranking,typ0,typ,vicedenni,odkaz,oddil,cancelled FROM ".TBL_RACE.$sql_sub_query." ORDER BY datum $order, datum2 $order, id $order";
@$vysledek=query_db($query);
?>
<script language="javascript">
<!--
/* "status=yes,width=600,height=350" */
function confirm_delete() {
return confirm('Opravdu se chcete odhlásit?');
}
javascript:set_default_size(800,600);
//-->
</script>
<?
$num_rows = mysqli_num_rows($vysledek);
if ($num_rows > 0)
{
show_link_to_actual_race($num_rows);
$data_tbl = new html_table_mc();
$col = 0;
$data_tbl->set_header_col($col++,'Datum',ALIGN_CENTER);
$data_tbl->set_header_col($col++,'Název',ALIGN_LEFT);
$data_tbl->set_header_col($col++,'Místo',ALIGN_LEFT);
$data_tbl->set_header_col_with_help($col++,'Poř.',ALIGN_CENTER,"Pořadatel");
$data_tbl->set_header_col_with_help($col++,'T',ALIGN_CENTER,"Typ akce");
$data_tbl->set_header_col_with_help($col++,'S',ALIGN_CENTER,"Sport");
$data_tbl->set_header_col_with_help($col++,'W',ALIGN_CENTER,"Web závodu");
$data_tbl->set_header_col($col++,'Možnosti',ALIGN_CENTER);
$data_tbl->set_header_col($col++,'Přihlášky',ALIGN_CENTER);
echo $data_tbl->get_css()."\n";
echo $data_tbl->get_header()."\n";
echo $data_tbl->get_header_row()."\n";
$i = 1;
$brk_tbl = false;
$old_year = 0;
while ($zaznam=mysqli_fetch_array($vysledek))
{
$race_is_old = (GetTimeToRace($zaznam['datum']) == -1);
$prefix = ($zaznam['datum'] < GetCurrentDate()) ? '<span class="TextAlertExp">' : '';
$suffix = ($zaznam['datum'] < GetCurrentDate()) ? '</span>' : '';
$row = array();
//----------------------------
if($zaznam['vicedenni'])
$datum=Date2StringFT($zaznam['datum'],$zaznam['datum2']);
else
$datum=Date2String($zaznam['datum']);
$prihlasky_curr = raceterms::GetActiveRegDateArr($zaznam);
$prihlasky=Date2String($prihlasky_curr[0]);
if($zaznam['prihlasky'] > 1)
$prihlasky .= ' / '.$prihlasky_curr[1];
$time_to_reg = GetTimeToReg($prihlasky_curr[0]);
$prihlasky_out = raceterms::ColorizeTermUser($time_to_reg,$prihlasky_curr,$prihlasky);
$prihl_finish = (($time_to_reg == -1 && $prihlasky_curr[0] != 0) || $race_is_old);
//----------------------------
$row[] = $prefix.$datum.$suffix;
$row[] = "<A href=\"javascript:open_race_info(".$zaznam['id'].")\" class=\"adr_name\">".$prefix.GetFormatedTextDel($zaznam['nazev'], $zaznam['cancelled']).$suffix."</A>";
$row[] = $prefix.GetFormatedTextDel($zaznam['misto'], $zaznam['cancelled']).$suffix;
$row[] = $prefix.$zaznam['oddil'].$suffix;
$row[] = GetRaceType0($zaznam['typ0']);
$row[] = GetRaceTypeImg($zaznam['typ']);
$row[] = GetRaceLinkHTML($zaznam['odkaz']);
if (!$prihl_finish)
{
$row[] = "<A HREF=\"javascript:open_win('./race_regs_1.php?gr_id="._SMALL_MANAGER_GROUP_ID_."&id=".$zaznam['id']."&show_ed=1','')\">Př-1</A> / <A HREF=\"javascript:open_win('./race_regs_all.php?gr_id="._SMALL_MANAGER_GROUP_ID_."&id=".$zaznam['id']."','')\">Př-V</A> / <A HREF=\"javascript:open_win('./race_reg_view.php?gr_id="._SMALL_MANAGER_GROUP_ID_."&id=".$zaznam['id']."&select=1','')\"><span class=\"TextAlertExpLight\">Zč</span></A> / <A HREF=\"javascript:open_win('./race_reg_view.php?gr_id="._SMALL_MANAGER_GROUP_ID_."&id=".$zaznam['id']."','')\"><span class=\"TextAlertExpLight\">Zbr</span></A>";
}
else
{
$row[] = "<A HREF=\"javascript:open_win('./race_reg_view.php?gr_id="._SMALL_MANAGER_GROUP_ID_."&id=".$zaznam['id']."&select=1','')\"><span class=\"TextAlertExpLight\">Zbr.čl.</span></A> / <A HREF=\"javascript:open_win('./race_reg_view.php?gr_id="._SMALL_MANAGER_GROUP_ID_."&id=".$zaznam['id']."','')\"><span class=\"TextAlertExpLight\">Zobrazit</span></A>";
}
$row[] = $prihlasky_out;
if (!$brk_tbl && $zaznam['datum'] >= GetCurrentDate())
{
if($i != 1)
echo $data_tbl->get_break_row()."\n";
$brk_tbl = true;
}
else if($i != 1 && Date2Year($zaznam['datum']) != $old_year)
{
echo $data_tbl->get_break_row(true)."\n";
}
echo $data_tbl->get_new_row_arr($row)."\n";
$i++;
$old_year = Date2Year($zaznam['datum']);
}
echo $data_tbl->get_footer()."\n";
}
?>
<p>
Př-1 = přihlašování po jednom členu.<BR>
Př-V = přihlašování všech členů naráz.<BR>
Zč = zobrazení přiřazených přihlášených členů.<BR>
Zbr = zobrazení všech přihlášených členů.<BR>
</p>
</CENTER>