You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.7 KiB
PHP

<?php
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
?>
<div class="row">
<div class="col-12 col-md-4">
<div class="card bg-green text-light">
<div class="card-body">
<h4 class="card-title"><?php $Strings->get("Upcoming"); ?></h4>
<h1><i class="fas fa-fw fa-calendar"></i> <?php echo $database->count('schedule', ["date[>]" => date("Y-m-d H:i:s")]); ?></h1>
</div>
<div class="card-footer">
<a href="app.php?page=schedule" class="text-light"><i class="fas fa-arrow-right"></i> <?php $Strings->get("View Schedule"); ?></a>
</div>
</div>
</div>
<div class="col-12 col-md-4">
<div class="card bg-blue text-light">
<div class="card-body">
<h4 class="card-title"><?php $Strings->get("Recently Updated"); ?></h4>
<h1><i class="fas fa-fw fa-history"></i> <?php
$machines = $database->query("SELECT COUNT(machines.machineid) as count FROM machines
LEFT OUTER JOIN events ON events.machineid = machines.machineid
WHERE date=(SELECT MAX(s2.date)
FROM events s2
WHERE machines.machineid = s2.machineid
)
AND events.date > NOW() - INTERVAL 1 week
LIMIT 100")->fetchAll();
echo $machines[0]["count"];
?></h1>
</div>
<div class="card-footer">
<a href="app.php?page=machines" class="text-light"><i class="fas fa-arrow-right"></i> <?php $Strings->get("View Machines"); ?></a>
</div>
</div>
</div>
</div>