Example #1
0
     echo $eta . " Remaining... ";
 }
 if ($item['message'] != "") {
     echo $item['message'] . "\n";
 }
 echo "</div>\n";
 // Stop/start controls...
 echo "<div class='datacol'  style='width:89px;'>\n";
 echo "<a href='control.php?hash=" . $item['hash'] . "&amp;cmd=" . ($item['is_active'] == 1 ? "stop" : "start") . "'>" . ($item['is_active'] == 1 ? "<img alt='Stop torrent' border=0 src='images/stop.gif' width=16 height=16 />" : "<img alt='Start torrent' border=0 src='images/start.gif' width=16 height=16 />") . "</a> \n";
 echo "<a href='control.php?hash=" . $item['hash'] . "&amp;cmd=delete' onClick='return confirm(\"Delete torrent - are you sure? (This will not delete data from disk)\");'><img align='bottom' alt='Delete torrent' border=0 src='images/delete.gif' width=16 height=16 /></a> \n";
 echo "<a class='submodal-600-520' href='view.php?hash=" . $item['hash'] . "'><img alt='Torrent info' src='images/view.gif' width=16 height=16 /></a><br/>\n";
 echo "</div>\n";
 // Stats row...
 echo "<div class='datacol' style='width:89px;' id='t" . $item['hash'] . "status_string'><img src='images/" . $statusstyle . ".gif' width=10 height=9 alt='Status' />" . $item['status_string'] . "</div>\n";
 echo "<div class='datacol' style='width:89px;' id='t" . $item['hash'] . "percent_complete'>" . $item['percent_complete'] . " %<br/>" . percentbar(@round($item['percent_complete'] / 2)) . "</div>\n";
 echo "<div class='datacol' style='width:89px;' id='t" . $item['hash'] . "bytes_diff'>" . completed_bytes_diff($item['size_bytes'], $item['completed_bytes']) . "</div>\n";
 echo "<div class='datacol' style='width:89px;' id='t" . $item['hash'] . "size_bytes'>" . format_bytes($item['size_bytes']) . "</div>\n";
 echo "<div class='datacol download' style='width:89px;' id='t" . $item['hash'] . "down_rate'>" . format_bytes($item['down_rate']) . "</div>\n";
 echo "<div class='datacol upload' style='width:89px;' id='t" . $item['hash'] . "up_rate'>" . format_bytes($item['up_rate']) . "</div>\n";
 echo "<div class='datacol' style='width:89px;' id='t" . $item['hash'] . "up_total'>" . format_bytes($item['up_total']) . "</div>\n";
 $ratio = @round($item['ratio'] / 1000, 2);
 if ($ratio > 1) {
     $ratio = '<span class="ratio-green">' . $ratio . '</span>';
 }
 if ($ratio < 1) {
     $ratio = '<span class="ratio-red">' . $ratio . '</span>';
 }
 echo "<div class='datacol' style='width:70px;' id='t" . $item['hash'] . "ratio'>" . $ratio . "</div>\n";
 echo "<div class='datacol' style='width:105px;' id='t" . $item['hash'] . "peers'>" . $item['peers_connected'] . "/" . $item['peers_not_connected'] . " (" . $item['peers_complete'] . ")" . "</div>\n";
 echo "<div class='datacollast' style='width:70px;' id='t" . $item['hash'] . "priority_str'>" . $item['priority_str'] . "</div>\n";
 echo "<div class=spacer> </div>\n";
Example #2
0
            if ($subitem['down_rate'] > 0) {
                $eta = formateta(($subitem['size_bytes'] - $subitem['completed_bytes']) / $subitem['down_rate']) . " Remaining... ";
            }
            $subdata[$totcount]['name'] = "<input type='checkbox' name='select[]' value='" . $subitem['hash'] . "' style='checkbox'> <a class='submodal-600-500 {$statusstyle}' href='view.php?hash=" . $subitem['hash'] . "'>" . $subitem['name'] . "</a>";
            $subdata[$totcount]['message'] = $eta . $subitem['message'];
            $subdata[$totcount]['status_string'] = "<img src='images/" . $statusstyle . ".gif' width=10 height=9 alt='Status'>" . $subitem['status_string'];
            $subdata[$totcount]['percent_complete'] = $subitem['percent_complete'] . " %<br>" . percentbar(@round($subitem['percent_complete'] / 2));
            $subdata[$totcount]['size_bytes'] = format_bytes($subitem['size_bytes']);
            $subdata[$totcount]['down_rate'] = format_bytes($subitem['down_rate']);
            $subdata[$totcount]['up_rate'] = format_bytes($subitem['up_rate']);
            $subdata[$totcount]['up_total'] = format_bytes($subitem['up_total']);
            $subdata[$totcount]['peers'] = $subitem['peers_connected'] . "/" . $subitem['peers_not_connected'] . " (" . $subitem['peers_complete'] . ")";
            $subdata[$totcount]['ratio'] = @round($subitem['ratio'] / 1000, 2);
            $subdata[$totcount]['priority_str'] = $subitem['priority_str'];
            $subdata[$totcount]['hash'] = $subitem['hash'];
            $subdata[$totcount]['bytes_diff'] = completed_bytes_diff($subitem['size_bytes'], $subitem['completed_bytes']);
            $subdata[$totcount]['filemtime'] = age($subitem['filemtime']);
            $totcount++;
        }
    }
}
// Get overall download/upload speed...
$rates = get_global_rates();
$subdata[$totcount]['glob_down_rate'] = format_bytes($rates[0]['ratedown']) == "" ? "0 KB" : format_bytes($rates[0]['ratedown']) . "/sec";
$subdata[$totcount]['glob_up_rate'] = format_bytes($rates[0]['rateup']) == "" ? "0 KB" : format_bytes($rates[0]['rateup']) . "/sec";
//$subdata[$totcount]['glob_diskfree']=format_bytes($rates[0]['diskspace'])." / ".format_bytes(disk_total_space($downloaddir))." (".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)";
$subdata[$totcount]['glob_diskfree'] = "<div " . (round($rates[0]['diskspace'] / disk_total_space($downloaddir) * 100) <= $alertthresh ? "class=\"diskalert\"" : "") . ">";
$subdata[$totcount]['glob_diskfree'] .= "Disk Free: " . format_bytes($rates[0]['diskspace']) . " / " . format_bytes(disk_total_space($downloaddir)) . " (" . round($rates[0]['diskspace'] / disk_total_space($downloaddir) * 100) . "%)";
$subdata[$totcount]['glob_diskfree'] .= "</div>";
//   echo "Disk Free: ".format_bytes($rates[0]['diskspace'])." / ".format_bytes(disk_total_space($downloaddir))." (".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)\n";
//   echo "</div>\n";