FreeSTAR-Status-Engine/index.php

60 lines
1.4 KiB
PHP
Raw Normal View History

2017-11-23 18:09:36 -05:00
<?php
require_once("template.php");
2017-11-23 18:09:36 -05:00
if (!file_exists("config.php"))
{
require_once("install.php");
2018-06-07 07:56:05 -04:00
} elseif(isset($_GET['do'])){ // we can add other actions with $_GET['do'] later.
if($_GET['do'] == "subscriptions"){
require_once("subscriptions.php");
}
2017-11-23 18:09:36 -05:00
}
else{
require_once("config.php");
require_once("classes/constellation.php");
2017-11-23 18:09:36 -05:00
$offset = 0;
if (isset($_GET['ajax']))
{
$constellation->render_incidents(false,$_GET['offset'],5);
exit();
}else if (isset($_GET['offset']))
{
$offset = $_GET['offset'];
}
2018-06-07 07:21:35 -04:00
if (isset($_GET['subscriber_logout'])){
setcookie('tg_user', '');
setcookie('referer', '', time() - 3600);
header('Location: index.php');
}
Template::render_header("Status");
2017-11-23 18:09:36 -05:00
?>
<div class="text-center">
<h2><?php echo _("Current status");?></h2>
2017-11-23 18:09:36 -05:00
</div>
<div id="current">
<?php $constellation->render_status();?>
</div>
<?php if ($mysqli->query("SELECT count(*) FROM status")->num_rows)
{
?>
<div id="timeline">
<div class="item">
<div class="timeline">
<div class="line text-muted"></div>
<?php
$constellation->render_incidents(true,$offset);
$constellation->render_incidents(false,$offset);
?>
</div>
</div>
</div>
<?php }
Template::render_footer();
2017-11-23 18:09:36 -05:00
}