summaryrefslogtreecommitdiff
path: root/html/index.php
blob: 5021124735413d879dcd2891af378cd126c257bb (plain)
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
<?php

$db = new SQLite3('/srv/http/vhosts/eckner.net/colocation.eckner.net/backend/sqlite.db');

$columns = array('name', 'online', 'last_update');

$result = $db -> query('SELECT machines.name,machines.online,machines.last_update FROM machines;');

echo '<html>' . "\n";
echo '<body>' . "\n";
echo '<table>' . "\n";
echo '  <tr>' . "\n";
foreach ($columns as $column) {
  echo '    <th>' . $column . '</th>' . "\n";
}
echo '  </tr>' . "\n";

while ($row = $result -> fetchArray()) {
  echo '  <tr>' . "\n";
  foreach ($columns as $column) {
    echo '    <td>' . $row[$column] . '</td>' . "\n";
  }
  echo '  </tr>' . "\n";
}
echo '</table>' . "\n";
echo '</body>' . "\n";
echo '</html>' . "\n";