Sun, 21 Jun 2015 19:51:58 +0200
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
333 | 1 | <?php |
2 | /***************************************************************************** | |
3 | * Copyright (C) 2015 | |
4 | * | |
5 | * Michiel Broek <mbroek at mbse dot eu> | |
6 | * | |
7 | * This file is part of ThermFerm | |
8 | * | |
9 | * This is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License as published by the | |
11 | * Free Software Foundation; either version 2, or (at your option) any | |
12 | * later version. | |
13 | * | |
14 | * ThermFerm is distributed in the hope that it will be useful, but | |
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | * General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
22 | *****************************************************************************/ | |
23 | ||
24 | require_once('utilities.php'); | |
357 | 25 | $my_style = 'ui-redmond'; |
333 | 26 | |
27 | if (isset($_GET['action'])) { | |
28 | switch ($_GET['action']) { | |
29 | case 'dl': archive_dl(); | |
30 | break; | |
31 | case 'view': archive_view(); | |
32 | break; | |
33 | default: break; | |
34 | } | |
35 | } else { | |
36 | archive_dir(); | |
37 | } | |
38 | ||
39 | exit; | |
40 | ||
41 | /**************************************************************************** | |
42 | * | |
43 | */ | |
44 | ||
357 | 45 | /* |
46 | * View an archived file in graph format | |
47 | */ | |
48 | function archive_view() { | |
49 | ||
50 | global $my_style; | |
51 | ||
52 | $name = urldecode($_GET['name']); | |
53 | ||
54 | $answer = send_cmd('GLOBAL GET'); | |
55 | $arr = explode("\r\n", $answer); | |
56 | $version = "?"; | |
57 | ||
58 | if (startsWith($arr[0], "213")) { | |
59 | $j = 1; | |
60 | while (1) { | |
61 | if (strcmp($arr[$j], ".") == 0) | |
62 | break; | |
63 | $f = explode(",", $arr[$j]); | |
64 | ||
65 | if ($f[0] == "RELEASE") | |
66 | $version = $f[1]; | |
67 | $j++; | |
68 | } | |
69 | } | |
70 | ||
71 | $outstr = '<!DOCTYPE html>'.PHP_EOL; | |
72 | $outstr .= '<html>'.PHP_EOL; | |
73 | $outstr .= ' <head>'.PHP_EOL; | |
74 | $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; | |
75 | $outstr .= ' <title>Archive View '.$name.'</title>'.PHP_EOL; | |
76 | $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; | |
77 | $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />'.PHP_EOL; | |
78 | $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.'.$my_style.'.css" rel="stylesheet" />'.PHP_EOL; | |
79 | $outstr .= ' <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>'.PHP_EOL; | |
80 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxcore.js"></script>'.PHP_EOL; | |
81 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxwindow.js"></script>'.PHP_EOL; | |
82 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>'.PHP_EOL; | |
83 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxchart.core.js"></script>'.PHP_EOL; | |
84 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxdraw.js"></script>'.PHP_EOL; | |
85 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxdata.js"></script>'.PHP_EOL; | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
86 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxdata.export.js"></script>'.PHP_EOL; |
357 | 87 | $outstr .= ' </head>'.PHP_EOL; |
88 | ||
89 | $outstr .= ' <body class="default">'.PHP_EOL; | |
90 | $outstr .= ' <div id="jqxWidget">'.PHP_EOL; | |
91 | $outstr .= ' <div id="header">'.PHP_EOL; | |
92 | $outstr .= ' <div id="title">'.PHP_EOL; | |
93 | $outstr .= ' ThermFerm '.$version.PHP_EOL; | |
94 | $outstr .= ' </div>'.PHP_EOL; | |
95 | $outstr .= ' <form action="archives.php" style="margin:30px; float:right">'.PHP_EOL; | |
96 | $outstr .= ' <input type="submit" id="archives" value="Archives directory" />'.PHP_EOL; | |
97 | $outstr .= ' </form>'.PHP_EOL; | |
98 | $outstr .= ' </div> <!-- header -->'.PHP_EOL; | |
99 | $outstr .= ' <div id="content">'.PHP_EOL; | |
100 | ||
101 | $outstr .= ' <script type="text/javascript">'.PHP_EOL; | |
102 | $outstr .= ' $(document).ready(function () {'.PHP_EOL; | |
103 | ||
104 | $outstr .= ' function getExportServer() {'.PHP_EOL; | |
105 | $outstr .= ' return "http://www.jqwidgets.com/export_server/export.php";'.PHP_EOL; | |
106 | $outstr .= ' }'.PHP_EOL; | |
107 | ||
108 | $outstr .= ' var sourceA ='.PHP_EOL; | |
109 | $outstr .= ' {'.PHP_EOL; | |
110 | $outstr .= ' datatype: "json",'.PHP_EOL; | |
111 | $outstr .= ' datafields: ['.PHP_EOL; | |
374
20999ef6d487
Fixed php scripts for jqwidgets version 3.8.0
Michiel Broek <mbroek@mbse.eu>
parents:
359
diff
changeset
|
112 | $outstr .= ' { name: "Date", type: "date", format: "yyyy-MM-dd HH:mm" },'.PHP_EOL; |
357 | 113 | $outstr .= ' { name: "Mode" },'.PHP_EOL; |
114 | $outstr .= ' { name: "Air", type: "float" },'.PHP_EOL; | |
115 | $outstr .= ' { name: "Beer", type: "float" },'.PHP_EOL; | |
116 | $outstr .= ' { name: "Target", type: "float" },'.PHP_EOL; | |
117 | $outstr .= ' { name: "Heater", type: "int" },'.PHP_EOL; | |
118 | $outstr .= ' { name: "Cooler", type: "int" },'.PHP_EOL; | |
119 | $outstr .= ' { name: "HeatUse", type: "int" },'.PHP_EOL; | |
120 | $outstr .= ' { name: "CoolUse", type: "int" },'.PHP_EOL; | |
121 | $outstr .= ' { name: "Room", type: "float" }'.PHP_EOL; | |
122 | $outstr .= ' ],'.PHP_EOL; | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
123 | $outstr .= ' url: \'getalog.php?name='.urlencode($name).'.log\''.PHP_EOL; |
357 | 124 | $outstr .= ' };'.PHP_EOL; |
125 | ||
126 | $outstr .= ' var dataAdapter = new $.jqx.dataAdapter(sourceA,'.PHP_EOL; | |
127 | $outstr .= ' {'.PHP_EOL; | |
128 | $outstr .= ' autoBind: true,'.PHP_EOL; | |
129 | $outstr .= ' async: false,'.PHP_EOL; | |
130 | $outstr .= ' downloadComplete: function () { },'.PHP_EOL; | |
131 | $outstr .= ' loadComplete: function () { },'.PHP_EOL; | |
132 | $outstr .= ' loadError: function () { }'.PHP_EOL; | |
133 | $outstr .= ' });'.PHP_EOL; | |
134 | ||
135 | $outstr .= ' var settings = {'.PHP_EOL; | |
136 | $outstr .= ' title: "'.$name.'",'.PHP_EOL; | |
137 | $outstr .= ' description: "",'.PHP_EOL; | |
138 | $outstr .= ' padding: { left: 5, top: 5, right: 5, bottom: 5 },'.PHP_EOL; | |
139 | $outstr .= ' titlePadding: { left: 0, top: 0, right: 0, bottom: 10 },'.PHP_EOL; | |
140 | $outstr .= ' source: dataAdapter,'.PHP_EOL; | |
374
20999ef6d487
Fixed php scripts for jqwidgets version 3.8.0
Michiel Broek <mbroek@mbse.eu>
parents:
359
diff
changeset
|
141 | $outstr .= ' xAxis:'.PHP_EOL; |
357 | 142 | $outstr .= ' {'.PHP_EOL; |
143 | $outstr .= ' dataField: \'Date\','.PHP_EOL; | |
374
20999ef6d487
Fixed php scripts for jqwidgets version 3.8.0
Michiel Broek <mbroek@mbse.eu>
parents:
359
diff
changeset
|
144 | $outstr .= ' type: \'date\','.PHP_EOL; |
357 | 145 | $outstr .= ' textRotationAngle: 45,'.PHP_EOL; |
146 | $outstr .= ' showGridLines: false'.PHP_EOL; | |
147 | $outstr .= ' },'.PHP_EOL; | |
148 | $outstr .= ' colorScheme: \'scheme01\','.PHP_EOL; | |
149 | $outstr .= ' seriesGroups:'.PHP_EOL; | |
150 | $outstr .= ' [{'.PHP_EOL; | |
151 | $outstr .= ' type: "line",'.PHP_EOL; | |
152 | $outstr .= ' valueAxis:'.PHP_EOL; | |
153 | $outstr .= ' {'.PHP_EOL; | |
154 | $outstr .= ' minValue: 0,'.PHP_EOL; | |
155 | $outstr .= ' maxValue: 100,'.PHP_EOL; | |
156 | $outstr .= ' displayValueAxis: false,'.PHP_EOL; | |
157 | $outstr .= ' description: "Heat/Cool %"'.PHP_EOL; | |
158 | $outstr .= ' },'.PHP_EOL; | |
159 | $outstr .= ' series: ['.PHP_EOL; | |
160 | $outstr .= ' { dataField: "CoolUse", lineWidth: 1, displayText: "Cool %", opacity: 0.5 },'.PHP_EOL; | |
161 | $outstr .= ' { dataField: "HeatUse", lineWidth: 1, displayText: "Heat %", opacity: 0.5 }'.PHP_EOL; | |
162 | $outstr .= ' ]'.PHP_EOL; | |
163 | $outstr .= ' },'.PHP_EOL; | |
164 | $outstr .= ' {'.PHP_EOL; | |
165 | $outstr .= ' type: \'spline\','.PHP_EOL; | |
166 | $outstr .= ' valueAxis:'.PHP_EOL; | |
167 | $outstr .= ' {'.PHP_EOL; | |
168 | $outstr .= ' minValue: 0,'.PHP_EOL; | |
169 | $outstr .= ' description: \'Degrees C\''.PHP_EOL; | |
170 | $outstr .= ' },'.PHP_EOL; | |
171 | $outstr .= ' series: ['.PHP_EOL; | |
172 | $outstr .= ' { dataField: "Air", lineWidth: 1, displayText: "Air" },'.PHP_EOL; | |
173 | $outstr .= ' { dataField: "Beer", lineWidth: 2, displayText: "Beer" },'.PHP_EOL; | |
174 | $outstr .= ' { dataField: "Target", lineWidth: 1, displayText: "Target", opacity: 0.7 },'.PHP_EOL; | |
175 | $outstr .= ' { dataField: "Room", lineWidth: 1, displayText: "Room", opacity: 0.5 }'.PHP_EOL; | |
176 | $outstr .= ' ]'.PHP_EOL; | |
177 | $outstr .= ' }]'.PHP_EOL; | |
178 | $outstr .= ' };'.PHP_EOL; | |
179 | $outstr .= ' $("#fermentor_chart").jqxChart(settings);'.PHP_EOL; | |
180 | ||
181 | $outstr .= ' $("#print").click(function () {'.PHP_EOL; | |
182 | $outstr .= ' var content = $("#fermentor_chart")[0].outerHTML;'.PHP_EOL; | |
183 | $outstr .= ' var newWindow = window.open("", "", "width=750, height=400"),'.PHP_EOL; | |
184 | $outstr .= ' document = newWindow.document.open(),'.PHP_EOL; | |
185 | $outstr .= ' pageContent ='.PHP_EOL; | |
186 | $outstr .= ' \'<!DOCTYPE html>\' +'.PHP_EOL; | |
187 | $outstr .= ' \'<html>\' +'.PHP_EOL; | |
188 | $outstr .= ' \'<head>\' +'.PHP_EOL; | |
189 | $outstr .= ' \'<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />\' +'.PHP_EOL; | |
190 | $outstr .= ' \'<meta charset="utf-8" />\' +'.PHP_EOL; | |
191 | $outstr .= ' \'<title>jQWidgets Chart</title>\' +'.PHP_EOL; | |
192 | $outstr .= ' \'</head>\' +'.PHP_EOL; | |
193 | $outstr .= ' \'<body>\' + content + \'</body></html>\';'.PHP_EOL; | |
194 | $outstr .= ' document.write(pageContent);'.PHP_EOL; | |
195 | $outstr .= ' document.close();'.PHP_EOL; | |
196 | $outstr .= ' newWindow.print();'.PHP_EOL; | |
197 | $outstr .= ' });'.PHP_EOL; | |
198 | $outstr .= ' $("#print").jqxButton({ width: 100, height: 25, theme: "ui-redmond" });'.PHP_EOL; | |
199 | ||
200 | $outstr .= ' $("#pngButton").click(function () {'.PHP_EOL; | |
201 | $outstr .= ' $("#fermentor_chart").jqxChart("saveAsPNG", "Chart_'.$name.'.png", getExportServer());'.PHP_EOL; | |
202 | $outstr .= ' });'.PHP_EOL; | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
203 | $outstr .= ' $("#pdfButton").click(function () {'.PHP_EOL; |
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
204 | $outstr .= ' $("#fermentor_chart").jqxChart("saveAsPDF", "Chart_'.$name.'.pdf", getExportServer());'.PHP_EOL; |
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
205 | $outstr .= ' });'.PHP_EOL; |
357 | 206 | $outstr .= ' $("#pngButton").jqxButton({ width: 100, height: 25, theme: "ui-redmond" });'.PHP_EOL; |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
207 | $outstr .= ' $("#pdfButton").jqxButton({ width: 100, height: 25, theme: "ui-redmond" });'.PHP_EOL; |
357 | 208 | |
209 | $outstr .= ' });'.PHP_EOL; | |
210 | $outstr .= ' </script>'.PHP_EOL; | |
211 | $outstr .= ' <div id="fermentor">'.PHP_EOL; | |
212 | $outstr .= ' <div id="fermentor_chart" style="width:720px; height:377px; float:left"></div>'.PHP_EOL; | |
213 | $outstr .= ' <div style="margin-top: 2px; margin-left: 10px;">'.PHP_EOL; | |
214 | $outstr .= ' <input style="float: left; margin-left: 15px;" id="print" type="button" value="Print Graph" />'.PHP_EOL; | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
215 | $outstr .= ' <input style="float: left; margin-left: 15px;" id="pngButton" type="button" value="Save as PNG" />'.PHP_EOL; |
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
216 | $outstr .= ' <input style="float: left; margin-left: 15px;" id="pdfButton" type="button" value="Save as PDF" />'.PHP_EOL; |
357 | 217 | $outstr .= ' </div>'.PHP_EOL; |
218 | $outstr .= ' </div> <!-- fermentor -->'.PHP_EOL; | |
219 | ||
220 | $outstr .= ' <script type="text/javascript">'.PHP_EOL; | |
221 | $outstr .= ' $(document).ready(function () {'.PHP_EOL; | |
222 | $outstr .= ' $("#archives").jqxButton({ width: 150, height: 25, theme: \'ui-redmond\' });'.PHP_EOL; | |
223 | $outstr .= ' });'.PHP_EOL; | |
224 | $outstr .= ' </script>'.PHP_EOL; | |
225 | $outstr .= build_footer(); | |
226 | echo $outstr; | |
227 | } | |
333 | 228 | |
229 | ||
230 | ||
231 | /* | |
359
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
232 | * Download popup. The file contents is dynamic generated from |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
233 | * the thermferm server. |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
234 | */ |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
235 | function archive_dl() { |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
236 | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
237 | $name = urldecode($_GET['name']) . ".log"; |
359
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
238 | |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
239 | header('Content-Type: text/plain'); |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
240 | header('Content-Disposition: attachment; filename="'.$name.'"'); |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
241 | |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
242 | $answer = send_cmd('ARCHIVE GET '.$name); |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
243 | $arr = explode("\r\n", $answer); |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
244 | |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
245 | $outstr = ''; |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
246 | if (startsWith($arr[0], "212")) { |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
247 | $j = 1; |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
248 | while (1) { |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
249 | if (strcmp($arr[$j], ".") == 0) |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
250 | break; |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
251 | $outstr .= $arr[$j].PHP_EOL; |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
252 | $j++; |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
253 | } |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
254 | } |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
255 | echo $outstr; |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
256 | exit(); |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
257 | } |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
258 | |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
259 | |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
260 | |
12734a3774e8
Added ARCHIVE GET file download command.
Michiel Broek <mbroek@mbse.eu>
parents:
357
diff
changeset
|
261 | /* |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
262 | * Show directory |
333 | 263 | */ |
264 | function archive_dir() { | |
265 | ||
266 | $answer = send_cmd("ARCHIVE DIR"); | |
267 | $reply = explode("\r\n", $answer); | |
268 | ||
269 | $outstr = build_header("Archived logfiles"); | |
270 | $outstr .= ' <div id="errors">'.PHP_EOL; | |
271 | $outstr .= ' </div> <!-- errors -->'.PHP_EOL; | |
272 | $outstr .= ' <div id="etable">'.PHP_EOL; | |
273 | $outstr .= ' <table class="setup">'.PHP_EOL; | |
274 | $outstr .= ' <tr class="trhead">'.PHP_EOL; | |
275 | $outstr .= ' <td class="setup" style="width: 340px;">File name</td>'.PHP_EOL; | |
276 | $outstr .= ' <td class="setup" style="width: 90px;">Mode</td>'.PHP_EOL; | |
277 | $outstr .= ' <td class="setup" style="width: 100px;">Size</td>'.PHP_EOL; | |
278 | $outstr .= ' <td class="setup" style="width: 140px;">Date</td>'.PHP_EOL; | |
279 | $outstr .= ' <td class="setup" style="width: 110px;">Action</td>'.PHP_EOL; | |
280 | $outstr .= ' </tr>'.PHP_EOL; | |
281 | ||
282 | if (startsWith($reply[0], "212")) { | |
283 | $j = 1; | |
284 | while (1) { | |
285 | if (strcmp($reply[$j], ".") == 0) | |
286 | break; | |
287 | $f = explode(",", $reply[$j]); | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
288 | $name = urlencode(basename($f[0], ".log")); |
333 | 289 | $outstr .= ' <tr class="setup">'.PHP_EOL; |
290 | $outstr .= ' <td class="setup">'.$f[0].'</td>'.PHP_EOL; | |
291 | $outstr .= ' <td class="setup">'.$f[1].'</td>'.PHP_EOL; | |
292 | $outstr .= ' <td class="setup">'.$f[2].'</td>'.PHP_EOL; | |
293 | $outstr .= ' <td class="setup">'.$f[3].'</td>'.PHP_EOL; | |
375
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
294 | $outstr .= ' <td class="setup"><a href="archives.php?action=dl&name='.$name.'">Download</a>'; |
f707d22c72f8
In Archives, remove .log from download and view functions. Added new Save as PDF buttons.
Michiel Broek <mbroek@mbse.eu>
parents:
374
diff
changeset
|
295 | $outstr .= ' <a href="archives.php?action=view&name='.$name.'">View</a></td>'.PHP_EOL; |
333 | 296 | $outstr .= ' </tr>'.PHP_EOL; |
297 | $j++; | |
298 | } | |
299 | } | |
300 | ||
301 | $outstr .= ' </table>'.PHP_EOL; | |
302 | $outstr .= ' </div> <!-- etable -->'.PHP_EOL; | |
303 | $outstr .= build_footer(); | |
304 | echo $outstr; | |
305 | } | |
306 | ||
307 | ||
308 |