Soshot/tpl/infos.php

158 lines
5.6 KiB
PHP
Raw Permalink 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">
2024-09-18 10:02:32 +02:00
<h1 class="w3-text">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>
2024-09-18 10:02:32 +02:00
<input class="w3-input" type="text" name="search" value="<?= $search; ?>" placeholder="Search">
<input class="w3-button" type="submit" value="Rechercher">
2024-03-19 15:26:10 +01:00
</form>
2024-09-18 10:02:32 +02:00
<table class="w3-table-all w3-hoverable" data-theme="light">
2023-06-21 11:42:36 +02:00
<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>
<span class="w3-left ">
<a href="#" class="linkDetail" data-hmac="<?= $value->id; ?>" data-href="<?= $value->url; ?>"><?= Domains::getDomain($value->url); ?></a>
</span>
<span class="w3-right" style="width:40px">
2024-09-18 10:02:32 +02:00
<a href="?page=infos&deleteGen=<?= $value->id; ?>"><i class="fa fa-trash-o delete" aria-hidden="true"></i></a>
</span>
</td>
2023-06-21 11:42:36 +02:00
<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">
<?php if ($start > 0) : ?>
2024-09-18 10:02:32 +02:00
<a href="?page=infos&start=<?= $previous; ?>" class="w3 w3-button">&laquo; Previous</a>
2024-03-19 16:59:01 +01:00
<?php endif; ?>
<?php if ($next != $start) :; ?>
2024-09-18 10:02:32 +02:00
<a href="?page=infos&start=<?= $next; ?>" class="w3 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 w3-xxlarge">&times;</span>
2023-06-21 11:42:36 +02:00
<p>
<img src="" id="fav" height="32px">
<a href="" id="titlePreview" target="_blanck"></a>
</p>
<img class="w3-border w3c-margin zoom" src="" id="complete" width="45%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin zoom" src="" id="full" width="35%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin zoom" src="" id="hd" width="30%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin zoom" src="" id="og" width="25%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin zoom" src="" id="nhd" width="20%" onclick="fullNewtab(this.src);">
<img class="w3-border w3c-margin zoom" 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>