-
Notifications
You must be signed in to change notification settings - Fork 4
/
sitestats.php
170 lines (138 loc) · 6.21 KB
/
sitestats.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
<?php
include "./core/bootstrap.php";
//connect to database
include 'dbconnect.php';
//check that user has a valid cookie, redirect if no valid cookie
include 'php_common/cookiecheck.php';
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Gym Climbing Tracker</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Latest compiled and minified CSS -->
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="style.php/mycss.scss">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="bower_components/flot/jquery.flot.js"></script>
<script src="bower_components/flot-axislabels/jquery.flot.axislabels.js"></script>
<script src="bower_components/flot/jquery.flot.categories.js"></script>
<script src="bower_components/flot-tickrotor/jquery.flot.tickrotor.js"></script>
<script src="bower_components/flot/jquery.flot.resize.js"></script>
<script src="js/sitePath.js"></script>
<script src="js/uservoice.js"></script>
<script src="js/plots/get_update_ClimbDataAll.js"></script>
<link rel="stylesheet" type="text/css" href="style.php/mycss.scss">
</head>
<body>
<?php include_once("php_common/analyticstracking.php") ?>
<?php require("navigation.php"); ?>
<div class="container">
<div class="page-header">
<h1>Community Statistics</h1>
</div>
<ul class="nav nav-tabs" role="tablist" id="sitestats-tabs">
<li class="active"><a href="#site-climb-histogram" role="tab" data-toggle="tab">Climb Distribution</a></li>
<li><a href="#site-climber-histogram" role="tab" data-toggle="tab">Climber Distribution</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane fade in active" id="site-climb-histogram">
<!--Plot a histogram of all climbing grades (so number of climbs vs. grade)-->
<h3>Boulder Grade Distribution</h3>
<div class="histogram-div">
<select id="ascentSelect" onchange="getTotalBoulderData(this.value,'-1',<?php echo $userid ?>,'-1')">
<option value="Project" >Attempt</option>
<option value="Redpoint" >Redpoint</option>
<option value="Flash">Flash</option>
<option value="Onsight">Onsight</option>
<option value="RFO" selected>>=Redpoint</option>
</select>
<div class="gradehistogram" id = "bouldergradehistogram">
</div>
</div>
<h3>Top Rope Grade Distribution</h3>
<div class="histogram-div">
<select id="ascentSelect" onchange="getTotalTRData(this.value,'-1',<?php echo $userid ?>,'-1')">
<option value="Project" >Attempt</option>
<option value="Redpoint">Redpoint</option>
<option value="Flash">Flash</option>
<option value="Onsight">Onsight</option>
<option value="RFO" selected>>=Redpoint</option>
</select>
<div class="gradehistogram" id = "trgradehistogram">
</div>
</div>
<h3>Lead Grade Distribution</h3>
<div class="histogram-div">
<select id="ascentSelect" onchange="getTotalLeadData(this.value,'-1',<?php echo $userid ?>,'-1')">
<option value="Project" >Attempt</option>
<option value="Redpoint">Redpoint</option>
<option value="Flash">Flash</option>
<option value="Onsight">Onsight</option>
<option value="RFO" selected>>=Redpoint</option>
</select>
<div class="gradehistogram" id = "leadgradehistogram">
</div>
</div>
</div>
<div class="tab-pane fade" id="site-climber-histogram">
<!--Plot histogram of highest climbing grade of each type-->
<h3>Highest Boulder Grade Climbed</h3>
<div class="histogram-div">
<select id="ascentSelect2" onchange="getHighestClimbDataAll('boulder',this.value,<?php echo $userid ?>)">
<option value="Project" >Attempt</option>
<option value="Redpoint">Redpoint</option>
<option value="Flash">Flash</option>
<option value="Onsight">Onsight</option>
<option value="RFO" selected>>=Redpoint</option>
</select>
<div class="gradehistogram" id = "highestbouldergradeplot_all">
</div>
</div>
<div class="histogram-div">
<h3>Highest Top-Rope Grade Climbed</h3>
<select id="ascentSelect2" onchange="getHighestClimbDataAll('tr',this.value,<?php echo $userid ?>)">
<option value="Project" >Attempt</option>
<option value="Redpoint">Redpoint</option>
<option value="Flash">Flash</option>
<option value="Onsight">Onsight</option>
<option value="RFO" selected>>=Redpoint</option>
</select>
<div class="gradehistogram" id = "highesttrgradeplot_all">
</div>
</div>
<div class="histogram-div">
<h3>Highest Lead Grade Climbed</h3>
<select id="ascentSelect2" onchange="getHighestClimbDataAll('lead',this.value,<?php echo $userid ?>)">
<option value="Project" >Attempt</option>
<option value="Redpoint">Redpoint</option>
<option value="Flash">Flash</option>
<option value="Onsight">Onsight</option>
<option value="RFO" selected>>=Redpoint</option>
</select>
<div class="gradehistogram" id = "highestleadgradeplot_all">
</div>
</div>
</div>
</div>
<p id = "scroll-padding"></p>
</div>
</body>
<script>
getTotalBoulderData('RFO','-1',<?php echo $userid ?>,'-1');
getTotalTRData('RFO','-1',<?php echo $userid ?>,'-1');
getTotalLeadData('RFO','-1',<?php echo $userid ?>,'-1');
//getHighestClimbDataAll('boulder','Redpoint',<?php echo $userid ?>);
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
if (e.target.hash == "#site-climber-histogram") {
getHighestClimbDataAll('boulder','RFO',<?php echo $userid ?>);
getHighestClimbDataAll('tr','RFO',<?php echo $userid ?>);
getHighestClimbDataAll('lead','RFO',<?php echo $userid ?>);
}
})
</script>
</html>