Browse Source

un peu de mise en page pour la page d'admin

master
jcabillot 6 years ago
parent
commit
22ced9581a
3 changed files with 161 additions and 91 deletions
  1. 33
      controller/status.php
  2. 20
      root/css/my.css
  3. 199
      templates/status.php

33
controller/status.php

@ -2,20 +2,29 @@
function getStatus()
{
$listAdded = [];
$listDownloading = [];
$listDownloaded = [];
$listDupp = [];
$db = DbMongo::get();
$coll = $db->download;
$listAdded = $coll->find(
['cstate' => 'added']
);
$listDownloading = $coll->find(
['cstate' => 'downloading']
);
$listDownloaded = $coll->find(
['cstate' => 'downloaded']
);
$listDupp = $coll->find(
['cstate' => 'dupp']
);
foreach ($coll->find(['cstate' => 'added']) as $element) {
$listAdded[] = $element;
}
foreach ($coll->find(['cstate' => 'downloading']) as $element) {
$listDownloading[] = $element;
}
foreach ($coll->find(['cstate' => 'downloaded']) as $element) {
$listDownloaded[] = $element;
}
foreach ($coll->find(['cstate' => 'dupp']) as $element) {
$listDupp[] = $element;
}
$infos = PremiumizeMe::getStatus();
include dirname(__FILE__).'/../templates/status.php';
}

20
root/css/my.css

@ -80,3 +80,23 @@ a.btn {
background: #fa963f;
padding: 10px 20px 10px 20px;
}
/* Page d'admin */
div.account {
background-color: #F2A965;
text-align: center;
margin-bottom: 1em;
}
div.addMulti {
margin-bottom: 1em;
text-align: center;
}
div.list {
background-color: #B9C1CC;
}
div.list div {
margin-bottom: 1em;
}

199
templates/status.php

@ -1,106 +1,147 @@
<!doctype html>
<html>
<head>
<script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/js/my.js"></script>
</script>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Admin</title>
<link rel="stylesheet" href="/css/my.css">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/js/my.js"></script>
</head>
<body>
Expiration : <?= $infos['expires']->format('H:i d.m.Y') ?><br>
Traffic Restant : <?= intval($infos['trafficleft_gigabytes']) ?>Go (<?= intval($infos['fairuse_left'] * 100) ?>%)<br>
<textarea id="urls" name="urls" style="margin: 0px; width: 985px; height: 401px;"></textarea><br>
<input type="button" id="sub" name="sub" value="submit" onclick="javascript:subURL();"><br>
Liste des fichiers a traiter :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<div class="account">
Expiration : <?= $infos['expires']->format('H:i d.m.Y') ?><br>
Traffic Restant : <?= intval($infos['trafficleft_gigabytes']) ?>Go (<?= intval($infos['fairuse_left'] * 100) ?>%)<br>
</div>
<div class="addMulti">
<textarea id="urls" name="urls" style="margin: 0px; width: 985px; height: 401px;"></textarea><br>
<input type="button" id="sub" name="sub" value="submit" onclick="javascript:subURL();"><br>
</div>
<div class="list">
<?php
foreach ($listAdded as $result) {
if (!empty($listAdded)) {
?>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
<div class="listAdded">
Liste des fichiers a traiter :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<?php
foreach ($listAdded as $result) {
?>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<input type="button" value="Wipe">
</div>
<?php
}
if (!empty($listDownloading)) {
?>
<div class="listDownloading">
Liste des fichiers en cours :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<?php
foreach ($listDownloading as $result) {
?>
</tbody>
</table>
Liste des fichiers en cours :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
<?php
foreach ($listDownloading as $result) {
}
?>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
</tbody>
</table>
</div>
<?php
}
if (!empty($listDownloaded)) {
?>
<div class="listDownloaded">
Liste des fichiers termin&eacute;s :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<?php
foreach ($listDownloaded as $result) {
?>
</tbody>
</table>
Liste des fichiers termin&eacute;s :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
<?php
foreach ($listDownloaded as $result) {
}
?>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
</tbody>
</table>
<input type="button" value="Wipe"><br>
</div>
<?php
}
if (!empty($listDupp)) {
?>
<div class="listDupp">
Liste des fichiers duppliqu&eacute;s :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<?php
foreach ($listDupp as $result) {
?>
</tbody>
</table>
Liste des fichiers duppliqu&eacute;s :<br>
<table>
<thead>
<tr>
<th>Date</td>
<th>Filename</td>
<th>IP</td>
</tr>
</thead>
<tbody>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
<?php
foreach ($listDupp as $result) {
}
?>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
</tbody>
</table>
<input type="button" value="Wipe"><br>
</div>
<?php
}
?>
</tbody>
</table>
</div>
</body>
</html>
Loading…
Cancel
Save