forked from Gabisonfire/dashboard-q
-
Notifications
You must be signed in to change notification settings - Fork 0
/
torrents_listing.php
30 lines (30 loc) · 1.31 KB
/
torrents_listing.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
<div class="row">
<div class="col-lg-12 col-md-3 col-sm-12 col-xs-12">
<div class="info-box all-bg">
<h3>All</h3>
<?php
if($torrents == null){
echo "There was a problem fetching torrents.";
} else {
if ($client == "qbittorrent"){
foreach($torrents as $torrent){
$ratio = $torrent['ratio'];
if(strlen($ratio) > 4){
$ratio = substr($ratio, 0, 4);
}
echo $torrent['name'] . "<span style=\"color: orange; font-weight: bold;\"> | Ratio: " . $ratio . "</span><br>";
}
} elseif ($client == "transmission"){
foreach($torrents['torrents'] as $torrent){
$ratio = $torrent['uploadRatio'];
if(strlen($ratio) > 4){
$ratio = substr($ratio, 0, 4);
}
echo $torrent['name'] . "<span style=\"color: orange; font-weight: bold;\"> | Ratio: " . $ratio . "</span><br>";
}
}
}
?>
</div>
</div>
</div>