-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·96 lines (89 loc) · 2.92 KB
/
index.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php include 'init.php'; ?>
<?php
$templates = Templates::getList(5);
$guides = Guides::getList(5);
$checkConnection = Query::getInstance()->checkConnection();
?>
<?php include 'parts/head.php'; ?>
<main class="wrapper">
<div class="inner">
<h2><?= T::ranslate('Welcome') ?>, <?= Conf::get('radio_name') ?> !</h2>
<?= Conf::get('welcome_message') ?>
</div>
<div class="inner row">
<section class="col-6">
<div class="frame">
<h3><?= T::ranslate('Templates') ?></h3>
<div class="frame-contents">
<?php if (count($templates) > 0): ?>
<ul class="items">
<?php foreach ($templates as $key => $value): ?>
<li>
<span class="title"><?= $value['title'] ?></span>
<a class="action" href="guide_edit.php?tid=<?= $key ?>"><?= T::ranslate('Use') ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<a href="templates.php" class="btn action"><?= T::ranslate('See all templates') ?></a>
<div class="clearfix"></div>
</div>
</div>
</section>
<section class="col-6">
<div class="frame">
<h3><?= T::ranslate('Guides') ?></h3>
<div class="frame-contents">
<?php if (count($guides) > 0): ?>
<ul class="items">
<?php foreach ($guides as $key => $value): ?>
<li>
<span class="title"><?= $value['title'] ?> (<?= date('Y-m-d', $value['date']) ?> <?= date('H:i:s', strtotime($value['template']['start'])) ?>)</span>
<a href="guide_pdf.php?gid=<?= $key ?>" class="action">PDF</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<a href="guides.php" class="btn action"><?= T::ranslate('See all guides') ?></a>
<div class="clearfix"></div>
</div>
</div>
</section>
<section class="col-6">
<div class="frame">
<h3><?= T::ranslate('Database status') ?></h3>
<div class="frame-contents">
<dl>
<dt><?= T::ranslate('Connection status') ?></dt>
<dd><span class="led <?= $checkConnection ? 'success' : 'error' ?>"></span></dd>
<?php if ($checkConnection): ?>
<dt><?= T::ranslate('Musics') ?></dt>
<dd><?= Songs::countSongs() ?></dd>
<dt><?= T::ranslate('Artists') ?></dt>
<dd><?= Songs::countArtists() ?></dd>
<?php endif; ?>
</dl>
<a href="settings.php" class="btn action"><?= T::ranslate('Go to settings') ?></a>
<div class="clearfix"></div>
</div>
</div>
</section>
<section class="col-6">
<div class="frame">
<h3><?= T::ranslate('Stats') ?></h3>
<div class="frame-contents">
<dl>
<dt><?= T::ranslate('Queries presets') ?></dt>
<dd><?= count(Queries::load()) ?></dd>
<dt><?= T::ranslate('Existing templates') ?></dt>
<dd><?= count(Templates::getList()) ?></dd>
<dt><?= T::ranslate('Generated guides') ?></dt>
<dd><?= count(Guides::getList()) ?></dd>
</dl>
<div class="clearfix"></div>
</div>
</div>
</section>
</div>
</main>
<?php include 'parts/tail.php'; ?>