'.PHP_EOL;
-
- $outstr .= ' '.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
-
- $outstr .= ' '.PHP_EOL;
- $outstr .= build_footer();
- echo $outstr;
-}
-
-
-
-/*
- * Download popup. The file contents is dynamic generated from
- * the thermferm server.
- */
-function archive_dl() {
-
- $name = urldecode($_GET['name']) . ".log";
-
- header('Content-Type: text/plain');
- header('Content-Disposition: attachment; filename="'.$name.'"');
-
- $answer = send_cmd('ARCHIVE GET '.$name);
- $arr = explode("\r\n", $answer);
-
- $outstr = '';
- if (startsWith($arr[0], "212")) {
- $j = 1;
- while (1) {
- if (strcmp($arr[$j], ".") == 0)
- break;
- $outstr .= $arr[$j].PHP_EOL;
- $j++;
- }
- }
- echo $outstr;
- exit();
-}
-
-
-
-/*
- * Show directory
- */
-function archive_dir() {
-
- $answer = send_cmd("ARCHIVE DIR");
- $reply = explode("\r\n", $answer);
-
- $outstr = build_header("Archived logfiles");
- $outstr .= '
'.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
- $outstr .= ' '.PHP_EOL;
- $outstr .= ' File name | '.PHP_EOL;
- $outstr .= ' Mode | '.PHP_EOL;
- $outstr .= ' Size | '.PHP_EOL;
- $outstr .= ' Date | '.PHP_EOL;
- $outstr .= ' Action | '.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
-
- if (startsWith($reply[0], "212")) {
- $j = 1;
- while (1) {
- if (strcmp($reply[$j], ".") == 0)
- break;
- $f = explode(",", $reply[$j]);
- $name = urlencode(basename($f[0], ".log"));
- $outstr .= ' '.PHP_EOL;
- $outstr .= ' '.$f[0].' | '.PHP_EOL;
- $outstr .= ' '.$f[1].' | '.PHP_EOL;
- $outstr .= ' '.$f[2].' | '.PHP_EOL;
- $outstr .= ' '.$f[3].' | '.PHP_EOL;
- $outstr .= ' Download';
- $outstr .= ' View | '.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
- $j++;
- }
- }
-
- $outstr .= '
'.PHP_EOL;
- $outstr .= '
'.PHP_EOL;
- $outstr .= ' '.PHP_EOL;
- $outstr .= build_footer();
- echo $outstr;
-}
-
-
-