forked from asoltys/avadepth
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathccc_detail.html
214 lines (191 loc) · 7.04 KB
/
ccc_detail.html
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="x-ua-compatible" content="IE=edge">
<title>Least Soundings and Available Widths</title>
<script src="/wet-boew/js/jquery/1.11.1/jquery.min.js"></script>
<script src="/scripts/jquery/jquery.ui.core.js"></script>
<script src="/scripts/moment.min.js"></script>
<script src="/wet-boew/js/deps/jquery.dataTables.min.js"></script>
<script src="/scripts/avadepth_util.js"></script>
<noscript><link rel="stylesheet" href="/wet-boew/css/noscript.min.css" /></noscript>
<link href="/GCWeb/assets/favicon.ico" rel="icon" type="image/x-icon" />
<link rel="stylesheet" href="/GCWeb/css/theme.min.css" />
<!-- CustomCSSStart -->
<link rel="stylesheet" href="/css/custom.css" />
<link rel="stylesheet" media="print" href="/css/print.css" />
<link rel="stylesheet" href="/css/smoothness/jquery-ui-1.7.1.custom.css" />
<!-- CustomCSSEnd -->
<style type="text/css" media="screen">
.span-8 {
width: 98%;
}
#verify_wrapper {
display: table;
margin: 0 auto;
}
.print_holder {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
height: 50px;
}
.btn {
height: 26px;
margin: auto;
}
</style>
<style type="text/css" media="print">
.btn {
display: none;
}
</style>
<script>
var formatDate = function(date){
var dateFormat = "YYYY-M-D";
return (date === undefined)
? moment().format(dateFormat)
: moment(date).format(dateFormat);
}
var channelItem = function(apiLineItem){
this.grade = apiLineItem.grade.toFixed(1);
this.sounding = apiLineItem.sounding.toFixed(1);
this.width = apiLineItem.width;
this.widthPerc = apiLineItem.widthperc;
this.isHigh = "";
this.isHighAst = "";
if (apiLineItem.grade > apiLineItem.sounding) {
this.isHigh = " class=\"red\"";
this.isHighAst = "*";
}
};
$(document).ready(function () {
$('button[name="print"]').click(function () {
window.print()
});
var chainage = avadepth.util.getUrlParameter("chainage");
var today = formatDate();
var apiURL = "/api/History?date=" + today + "&chainage=" + chainage;
$('#print_remove').addClass('align-center')
$('#heading').text("km " + (chainage - 1) + " - " + (chainage));
$('#detail_print').find('#segment').text($(this).next().text()); // updates print div with current channel information
$('#surveys tbody').html('');
$.when(
$.getJSON(apiURL + "&lane=1"),
$.getJSON(apiURL + "&lane=2")
).done(function(innerChannelData, outterChannelData){
var combinedData = [];
$.each(outterChannelData[0], function(outterIx, outterVal){
var outterValDate = formatDate(outterVal.date);
$.each(innerChannelData[0], function(innerIx, innerVal){
var innerValDate = formatDate(innerVal.date);
if(innerValDate == outterValDate){
if (this.Plan.slice(0, 2) != "FR") {
combinedData.push({date: innerVal.date, plan: this.Plan});
combinedData[combinedData.length-1]["outterChannel"] = new channelItem(outterVal);
combinedData[combinedData.length-1]["innerChannel"] = new channelItem(innerVal);
}
return false;
}
});
});
$.each(combinedData, function () {
var row;
var surveydate = moment(this.date).format("D-MMM-YYYY");
row = "<tr>" +
"<td>" + surveydate + "</td>" +
"<td><a href='http://avadepth.ccg-gcc.gc.ca/Data/dwf/" + this.plan + ".dwf?' target='blank'>" + this.plan + "</a></td>" +
"<td" + this.innerChannel.isHigh + ">" + this.innerChannel.grade + "</td>" +
"<td" + this.innerChannel.isHigh + ">" + this.innerChannel.sounding + this.innerChannel.isHighAst + "</td>" +
"<td" + this.innerChannel.isHigh + ">" + this.innerChannel.width + "</td>" +
"<td" + this.innerChannel.isHigh + ">" + this.innerChannel.widthPerc + "</td>" +
"<td" + this.outterChannel.isHigh + ">" + this.outterChannel.grade + "</td>" +
"<td" + this.outterChannel.isHigh + ">" + this.outterChannel.sounding + this.outterChannel.isHighAst + "</td>" +
"<td" + this.outterChannel.isHigh + ">" + this.outterChannel.width + "</td>" +
"<td" + this.outterChannel.isHigh + ">" + this.outterChannel.widthPerc + "</td>" +
"</tr>";
return $("#surveys tbody").append(row);
});
});
});
</script>
</head>
<body>
<div id="detail_content">
<div class="print_holder">
<button name="print" class="btn btn-primary print_button print_hide">
<span class="glyphicon glyphicon-print"></span> Print
</button>
<input class="btn btn-primary" onclick="window.close()" type="button" value="Close">
</div>
<div>
<div>
<div class="grid-12">
<div class="align-center print-align-center print-margin-0">
<h3 style="margin: 0px;">Least Soundings and Available Widths</h3>
<h3 style="margin: 0px;"><span>for Fraser River - South Arm, </span><span id="heading"></span></h3>
<h3 style="margin: 0px;"><span class="print_show_inline" id="segment"></span></h3>
</div>
<table class="styled align-center" id="survey-header"
style="width: 600px; margin-right: auto; margin-left: auto;">
<thead>
<tr>
<td>Note: All soundings / depths are relative to local low water level</td>
</tr>
</thead>
<tbody>
<tr class="print_hide">
<td>Users will need to download an Autodesk DWF viewer to view and display the Reference Plan. <a
href="https://www.autodesk.com/products/design-review/download" target="_blank">Download Autodesk
viewer</a></td>
</tr>
</tbody>
</table>
</div>
<div class="grid-12">
<table class="styled align-center" id="surveys" style="margin-right: auto; margin-left: auto;">
<thead>
<tr>
<th colspan="2"> </th>
<th colspan="4">Inner Channel</th>
<th colspan="4">Outter Channel</th>
</tr>
<tr>
<th rowspan="2">Date of Survey</th>
<th rowspan="2">Reference Plan</th>
<th style="width: 55px;">Design Grade</th>
<th style="width: 55px;">Least Soundings</th>
<th colspan="2">Available Width</th>
<th style="width: 55px;">Design Grade</th>
<th style="width: 55px;">Least Soundings</th>
<th colspan="2">Available Width</th>
</tr>
<tr>
<th>(m)</th>
<th>(m)</th>
<th>(m)</th>
<th>(%)</th>
<th>(m)</th>
<th>(m)</th>
<th>(m)</th>
<th>(%)</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="page-break"></div>
<div class="print_holder">
<button name="print" class="btn btn-primary print_button print_hide">
<span class="glyphicon glyphicon-print"></span> Print
</button>
<input class="btn btn-primary" onclick="window.close()" type="button" value="Close">
</div>
</div>
</body>
</html>