-
Notifications
You must be signed in to change notification settings - Fork 0
/
apps.php
49 lines (47 loc) · 1.34 KB
/
apps.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require 'inc/functions.php';
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>
<!doctype html>
<html lang="en">
<head>
<?php
require 'inc/header.php';
?>
</head>
<body>
<?php require 'inc/menu.php'; ?>
<main role="main" class="container">
<h1>Applications</h1>
<?php
$getApps = $db->query( "SELECT * FROM `applications` ORDER BY `name` ASC" );
?>
<div class="row">
<?php
while( $app = $getApps->fetchArray() ) {
echo "<div class='col-sm-6'>";
echo "<div class='card'>";
echo "<div class='card-body'>";
echo "<h5 class='card-title'>" . $app['name'] . "</h5>";
echo "<p class='card-text'>";
$machine = (int)$app['machine'];
$getMachine = $db->query( "SELECT `name`,`ip` FROM `machines` WHERE `id` ='$machine' LIMIT 1" );
while( $mac = $getMachine->fetchArray() ) {
$machineName = $mac['name'];
$ip = $mac['ip'];
}
echo "<em>on " . $machineName . " (<a href='index.php?parent=" . $machine . "'>Check Status</a>)</em> <br />";
echo "</p>";
echo "<a href='" . $app['URL'] . "' target='_blank' class='btn btn-primary'>Open Application</a>";
echo "</div>"; // Card body
echo "</div>"; // Card
echo "</div>"; // Col
}
?>
</div>
</main>
<?php require 'inc/footer.php'; ?>
</body>
</html>