1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
4 require_once 'MTrackWeb.php';
6 class MTrackWeb_Reports extends MTrackWeb
8 var $template = 'reports.html';
10 var $title = "Reports";
15 require_once 'MTrack/ACL.php';
16 MTrackACL::requireAllRights('Reports', 'read');
22 $q = MTrackDB::q("select rid, summary from reports order by rid");
23 $this->rows = $q->fetchAll(PDO::FETCH_OBJECT);
24 $this->canCreate = MTrackACL::hasAllRights('Reports', 'create');
31 <h1>Available Reports</h1>
34 The reports below are constructed using SQL. You may also
35 use the <a href="<?php echo $ABSWEB ?>query.php">Custom Query</a>
36 page to create a report on the fly.
45 foreach (MTrackDB::q("select rid, summary from reports order by rid"
46 )->fetchAll(PDO::FETCH_ASSOC) as $row)
48 $url = "${ABSWEB}report.php/$row[rid]";
49 $t = "<a href='$url'>{" . $row['rid'] . "}</a>";
50 $s = htmlentities($row['summary'], ENT_COMPAT, 'utf-8');
51 $s = "<a href='$url'>$s</a>";
54 <tr><td>$t</td><td>$s</td></tr>
60 if (MTrackACL::hasAllRights('Reports', 'create')) {
62 <form action="report.php" method="get">
63 <button type="submit" name="edit">Create Report</button>