| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,94 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+require ("config.php");
|
|
| 4 |
+require ("funcsv2.php");
|
|
| 5 |
+//Check session |
|
| 6 |
+session_start(); |
|
| 7 |
+ |
|
| 8 |
+if (!$_SESSION['admin_logged_in']) |
|
| 9 |
+{
|
|
| 10 |
+ //check fails |
|
| 11 |
+ header("Location: authenticate.php?status=session");
|
|
| 12 |
+ exit(); |
|
| 13 |
+} |
|
| 14 |
+?> |
|
| 15 |
+ |
|
| 16 |
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
|
| 17 |
+ |
|
| 18 |
+<html> |
|
| 19 |
+<head> |
|
| 20 |
+ <title>Upload Statistics</title> |
|
| 21 |
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
|
| 22 |
+ <link rel="stylesheet" href="./css/style.css" type="text/css" /> |
|
| 23 |
+</head> |
|
| 24 |
+<body> |
|
| 25 |
+<h1>Upload Statistics</h1> |
|
| 26 |
+<h2>This may be wildly inaccurate because when torrents are deleted, the bittorrent traffic is removed yet the HTTP traffic stays the same.</h2> |
|
| 27 |
+<?php |
|
| 28 |
+if ($GLOBALS["persist"]) |
|
| 29 |
+ $db = mysql_pconnect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Tracker error: can't connect to database - " . mysql_error() . "</p>"); |
|
| 30 |
+else |
|
| 31 |
+ $db = mysql_connect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Tracker error: can't connect to database - " . mysql_error() . "</p>"); |
|
| 32 |
+mysql_select_db($database) or die(errorMessage() . "Tracker error: can't open database $database - " . mysql_error() . "</p>"); |
|
| 33 |
+ |
|
| 34 |
+$query = "SELECT SUM(".$prefix."summary.dlbytes) FROM ".$prefix."summary";
|
|
| 35 |
+$results = mysql_query($query) or die(errorMessage() . "Can't do SQL query - " . mysql_error() . "</p>"); |
|
| 36 |
+$data = mysql_fetch_row($results); |
|
| 37 |
+if ($data[0] == null) |
|
| 38 |
+ $btuploaded = 0; |
|
| 39 |
+else |
|
| 40 |
+ $btuploaded = $data[0]; |
|
| 41 |
+ |
|
| 42 |
+$query = "SELECT total_uploaded FROM ".$prefix."speedlimit"; |
|
| 43 |
+$results = mysql_query($query) or die(errorMessage() . "Can't do SQL query - " . mysql_error() . "</p>"); |
|
| 44 |
+$data = mysql_fetch_row($results); |
|
| 45 |
+$httpuploaded = $data[0]; |
|
| 46 |
+?> |
|
| 47 |
+<br> |
|
| 48 |
+<center> |
|
| 49 |
+<table> |
|
| 50 |
+<tr><th>HTTP Seeding Uploaded<span class="notice">*</span></th> |
|
| 51 |
+<th>Bittorrent P2P Seeding Uploaded</th></tr> |
|
| 52 |
+<tr> |
|
| 53 |
+<td align="center"> |
|
| 54 |
+<?php |
|
| 55 |
+echo bytesToString($httpuploaded); |
|
| 56 |
+?> |
|
| 57 |
+</td> |
|
| 58 |
+<td align="center"> |
|
| 59 |
+<?php |
|
| 60 |
+echo bytesToString($btuploaded); |
|
| 61 |
+?> |
|
| 62 |
+</td> |
|
| 63 |
+</tr> |
|
| 64 |
+<tr> |
|
| 65 |
+<td align="center"> |
|
| 66 |
+<?php |
|
| 67 |
+if ($httpuploaded + $btuploaded != 0) |
|
| 68 |
+ echo round(($httpuploaded / ($httpuploaded + $btuploaded))*100, 2) . "%"; |
|
| 69 |
+else |
|
| 70 |
+ echo "0%"; |
|
| 71 |
+?> |
|
| 72 |
+</td> |
|
| 73 |
+<td align="center"> |
|
| 74 |
+<?php |
|
| 75 |
+if ($httpuploaded + $btuploaded != 0) |
|
| 76 |
+ echo round(($btuploaded / ($httpuploaded + $btuploaded))*100, 2) . "%"; |
|
| 77 |
+else |
|
| 78 |
+ echo "0%"; |
|
| 79 |
+?> |
|
| 80 |
+</td> |
|
| 81 |
+</tr> |
|
| 82 |
+</table> |
|
| 83 |
+</center> |
|
| 84 |
+<p align="center"> |
|
| 85 |
+<?php |
|
| 86 |
+echo "Total Uploaded: " . bytesToString($httpuploaded + $btuploaded); |
|
| 87 |
+?> |
|
| 88 |
+</p> |
|
| 89 |
+<br> |
|
| 90 |
+<span class="notice">* - This does not include the GetRight HTTP seeding format which links directly to files.</span> |
|
| 91 |
+<br><br> |
|
| 92 |
+<a href="admin.php"><img src="images/admin.png" border="0" class="icon" alt="Admin Page" title="Admin Page" /></a><a href="admin.php">Return to Admin Page</a> |
|
| 93 |
+</body> |
|
| 94 |
+</html> |
|
| 0 | 95 |
\ No newline at end of file |