public static function genTableList() { $sql = new \sql\Database(); $sql->selectDB(\util\Config::$database->tablesDB); $table_names = $sql->tableNames(); $list = ""; foreach ($table_names as $tname) { $list .= "<li><a href=\"run_report.php?table=" . $tname . "\">" . $tname . "</a></li>"; } return $list; }
public static function get($title) { $sql = new \sql\Database(); $sql->selectDB(\util\Config::$database->reportsDB); $table_names = $sql->tableNames(); if (empty($table_names)) { die("Invalid Report request."); } $table = $table_names[0]; $result = $sql->query("SELECT serial FROM {$table} WHERE title='{$title}'"); return \reports\Report::unserialize($result->records()[0][0]); }