Soshot/tpl/infos.php

151 lines
5.2 KiB
PHP
Raw Normal View History

2023-06-21 11:42:36 +02:00
<?php
use App\Utils\ConvertStatus;
use App\Utils\Domains;
?>
<div class="w3-row soshot-main w3-margin-bottom">
<div class="w3-container">
<h1 class="w3-text-teal">Infos</h1>
2023-06-29 11:57:38 +02:00
2023-06-29 10:08:37 +02:00
<ul>
<li>Total : <?= $total; ?></li>
<li>Queue : <?= $inQueue; ?></li>
<li>Error : <?= $inError; ?></li>
</ul>
2023-06-29 11:57:38 +02:00
2024-03-19 15:26:10 +01:00
<form>
<input type="text" name="search" value="<?= $search ;?>">
<input type="submit" value="Rechercher">
</form>
2023-06-21 11:42:36 +02:00
<table class="w3-table-all w3-hoverable">
<thead>
<tr>
<td>Domain</td>
<td>Created</td>
<td>Complete</td>
<td>Full</td>
<td>HD</td>
<td>nHD</td>
2023-06-21 11:42:36 +02:00
<td>Thumb</td>
<td>Favicon</td>
<td>Og</td>
<td>PDF</td>
</tr>
</thead>
<tbody>
<?php foreach ($genList as $value) : ?>
<tr>
<td><a href="#" class="linkDetail" data-hmac="<?= $value->id; ?>" data-href="<?= $value->url; ?>"><?= Domains::getDomain($value->url); ?></a></td>
<td><?= $value->created; ?></td>
<td><?= ConvertStatus::convertToIcon($value->complete); ?></td>
<td><?= ConvertStatus::convertToIcon($value->full); ?></td>
<td><?= ConvertStatus::convertToIcon($value->hd); ?></td>
<td><?= ConvertStatus::convertToIcon($value->nhd); ?></td>
2023-06-21 11:42:36 +02:00
<td><?= ConvertStatus::convertToIcon($value->thumb); ?></td>
<td><?= ConvertStatus::convertToIcon($value->fav); ?></td>
<td><?= ConvertStatus::convertToIcon($value->og); ?></td>
<td><?= ConvertStatus::convertToIcon($value->pdf); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
2023-06-29 11:57:38 +02:00
<div class="w3-center w3-margin-top">
2023-06-21 11:42:36 +02:00
<div class="w3-bar">
2024-03-19 16:59:01 +01:00
<?php if($start > 0) : ?>
<a href="?page=infos&start=<?= $previous; ?>" class="w3-teal w3-button">&laquo; Previous</a>
2024-03-19 16:59:01 +01:00
<?php endif; ?>
<?php if($next != $start): ;?>
<a href="?page=infos&start=<?= $next; ?>" class="w3-teal w3-button">Next &raquo; </a>
2024-03-19 16:59:01 +01:00
<?php endif; ?>
2023-06-21 11:42:36 +02:00
</div>
</div>
</div>
<div id="detail" class="w3-modal">
<div class="w3-modal-content w3-animate-opacity">
<div class="w3-container">
<span onclick="document.getElementById('detail').style.display='none'" class="w3-button w3-display-topright">&times;</span>
<p>
<img src="" id="fav" height="32px">
<a href="" id="titlePreview" target="_blanck"></a>
</p>
<img class="w3-border w3c-margin" src="" id="complete" width="45%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin" src="" id="full" width="35%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin" src="" id="hd" width="30%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin" src="" id="og" width="25%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin" src="" id="nhd" width="20%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin" src="" id="thumb" width="15%" onclick="fullNewtab(this.src);">
2023-06-21 11:42:36 +02:00
</div>
</div>
</div>
</div>
<!-- END MAIN -->
<script>
// Get the Sidebar
var mySidebar = document.getElementById("mySidebar");
// Get the DIV with overlay effect
var overlayBg = document.getElementById("myOverlay");
// Toggle between showing and hiding the sidebar, and add overlay effect
function w3_open() {
if (mySidebar.style.display === 'block') {
mySidebar.style.display = 'none';
overlayBg.style.display = "none";
} else {
mySidebar.style.display = 'block';
overlayBg.style.display = "block";
}
}
// Close the sidebar with the close button
function w3_close() {
mySidebar.style.display = "none";
overlayBg.style.display = "none";
}
const el = document.querySelectorAll('.linkDetail');
el.forEach(element => {
element.addEventListener("click", (el) => {
let $hmac = el.srcElement.dataset.hmac;
let $href = el.srcElement.dataset.href;
let $title = document.getElementById("titlePreview");
let $complete = document.getElementById("complete");
let $full = document.getElementById("full");
let $hd = document.getElementById("hd");
let $nhd = document.getElementById("nhd");
2023-06-21 11:42:36 +02:00
let $thumb = document.getElementById("thumb");
let $og = document.getElementById("og");
let $fav = document.getElementById("fav");
$title.href = $href;
$title.textContent = $href;
$complete.src = "?type=complete&showImg=" + $hmac;
$full.src = "?type=full&showImg=" + $hmac;
$hd.src = "?type=hd&showImg=" + $hmac;
$nhd.src = "?type=nhd&showImg=" + $hmac;
2023-06-21 11:42:36 +02:00
$thumb.src = "?type=thumb&showImg=" + $hmac;
$og.src = "?type=og&showImg=" + $hmac;
$fav.src = "?type=fav&showImg=" + $hmac;
document.getElementById('detail').style.display = 'block';
});
});
function fullNewtab(imgSrc) {
window.open(imgSrc);
2023-06-21 11:42:36 +02:00
}
// Get the modal
var modal = document.getElementById('detail');
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>