This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.php
106 lines (80 loc) · 3.04 KB
/
main.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
<?php
/**
* template for main page
*
* It can be overriden
*
* @since 2.0.0
*/
global $uci_results_post, $uci_rankings;
$selected_discipline=89;
$selected_date=$uci_rankings->recent_date($selected_discipline);
$riders=$uci_rankings->get_rankings(array(
'order_by' => 'rank',
'discipline' => $selected_discipline,
'limit' => 10,
));
$races=uci_get_races(array(
'per_page' => 10,
));
?>
<div class="uci-results uci-results-main em-container">
<div class="em-row">
<div class="em-col-md-6">
<div class="uci-results-races">
<h3>Race Results</h3>
Filters for Discipline / Date
<div class="em-row header">
<div class="em-col-md-6 race-name">Name</div>
<div class="em-col-md-2 race-date">Date</div>
<div class="em-col-md-2 race-nat">Nat</div>
<div class="em-col-md-2 race-class">Class</div>
</div>
<?php if (count($races)) : foreach ($races as $race) : ?>
<div class="em-row">
<div class="em-col-md-6 race-name"><a href="<?php uci_results_race_url($race->post_name); ?>"><?php echo $race->post_title; ?></a></div>
<div class="em-col-md-2 race-date"><?php echo $race->race_date; ?></div>
<div class="em-col-md-2 race-nat"><?php echo uci_results_get_country_flag($race->nat); ?></div>
<div class="em-col-md-2 race-class"><?php echo $race->class; ?></div>
</div>
<?php endforeach; endif; ?>
<a class="view-all" href="<?php uci_results_races_url(); ?>">View All Races »</a>
</div>
</div>
<div class="em-col-md-6">
<div class="uci-rankings">
<h3>UCI Rankings</h3>
<div class="row filters">
<div class="em-col-md-3">
<select name="discipline" id="uci-rankings-discipline">
<option value="0">Select Discipline</option>
<?php foreach ($uci_rankings->disciplines() as $discipline) : ?>
<option value="<?php echo $discipline->id; ?>" <?php selected($selected_discipline, $discipline->id, true); ?>><?php echo $discipline->discipline; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="em-col-md-3">
<select name="date" id="uci-rankings-date">
<option value="0">Select Date</option>
<?php foreach ($uci_rankings->get_rankings_dates($selected_discipline) as $date) : ?>
<option value="<?php echo $date->date; ?>" <?php selected($selected_date, $date->date, true); ?>><?php echo $date->date; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="em-row header">
<div class="em-col-md-1 rider-rank">Rank</div>
<div class="em-col-md-5 rider-name">Rider</div>
<div class="em-col-md-1 rider-nat">Nat</div>
<div class="em-col-md-2 rider-points">Points</div>
</div>
<div class="riders-list-wrap">
<?php if (count($riders)) : foreach ($riders as $rider) : ?>
<?php echo uci_get_template_part('uci-rankings-rider-row', $rider); ?>
<?php endforeach; endif; ?>
</div>
<a class="view-all" href="#">View All Riders »</a>
</div>
</div>
</div>
</div>