Browse Source

ajout d'un lien pour dl direct les fichiers deja dl

master
Cabillot Julien 6 years ago
parent
commit
946215fe91
2 changed files with 12 additions and 3 deletions
  1. 7
      lib/Download.php
  2. 8
      templates/status.php

7
lib/Download.php

@ -178,8 +178,13 @@ class Download {
$coll = $db->download;
$retour = [];
// TODO : lister statut possible
foreach ($coll->find(['cstate' => $state]) as $element) {
if (file_exists(DOWNLOADEDDIR.DIRECTORY_SEPARATOR.$element['filename'])) {
$element['href'] = true;
} else {
$element['href'] = false;
}
$retour[] = $element;
}

8
templates/status.php

@ -10,7 +10,6 @@
</head>
<body>
<div class="account">
<!-- TODO : ajouter jour restant -->
Expiration : <?= $infos['expires']->format('H:i d/m/Y') ?> (<?= $restant ?>)<br>
Traffic Restant : <?= intval($infos['trafficleft_gigabytes']) ?>Go (<?= intval($infos['fairuse_left'] * 100) ?>%)<br>
</div>
@ -96,10 +95,15 @@ if (!empty($listDownloaded)) {
<tbody>
<?php
foreach ($listDownloaded as $result) {
if ($result['href']) {
$nameLink = '<a href="/downloaded/'.$result['filename'].'">'.$result['filename'].'</a>';
} else {
$nameLink = $result['filename'];
}
?>
<tr>
<td><?= $result['timestamp']; ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $nameLink; ?></td>
<td><?= $result['event'][0]['ip']; ?></td>
</tr>
<?php

Loading…
Cancel
Save