-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (26 loc) · 850 Bytes
/
index.php
File metadata and controls
29 lines (26 loc) · 850 Bytes
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
28
29
<?php
require_once "config/init.php";
require_once "lib/util.php";
require_once "lib/html.php";
require_once "lib/backlogApi.php";
require_once "lib/backlogControl.php";
require_once "lib/render.php";
// Main Logic
if (!isset($_POST['apiKey'])) {
render("form");
} else {
$span = (object)["start" => strtotime("-10 day"), "end" => strtotime("+40 day")];
$issues = BacklogControl::getIssues($_POST['apiKey'], $span);
render("issues", ["issues" => $issues, "span" => $span]);
}
function render($pageName, $params = [])
{
$html = Render::layout("header", ["title" => "backlog Checker for LearningWare"]);
try {
$html .= Render::view($pageName, $params);
} catch (\Exception $e) {
$html .= Html::tag("p", $e->getmessage(), "style='color:red'");
}
$html .= Render::layout("footer");
echo $html;
}