-
Notifications
You must be signed in to change notification settings - Fork 10
/
happylog.php
53 lines (53 loc) · 2.34 KB
/
happylog.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* ------- U-232 Codename Trinity ----------*
* ---------------------------------------------*
* -------- @authors U-232 Team --------------*
* ---------------------------------------------*
* ----- @site https://u-232.duckdns.org/ ----*
* ---------------------------------------------*
* ----- @copyright 2020 U-232 Team ----------*
* ---------------------------------------------*
* ------------ @version V6 ------------------*
*/
require_once(__DIR__.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
require_once(INCL_DIR.'pager_functions.php');
require_once(INCL_DIR.'html_functions.php');
dbconn();
loggedinorreturn();
$lang = array_merge(load_language('global'));
$HTMLOUT = '';
$id = (isset($_GET["id"]) ? 0 + $_GET["id"] : "0");
if ($id == "0") {
stderr("Err", "I dont think so!");
}
$ur = sql_query("SELECT username from users WHERE id=".sqlesc($id));
($user = $ur->fetch_array(MYSQLI_ASSOC)) || stderr("Error", "No user found");
$count = get_row_count("happylog", "WHERE userid=".sqlesc($id));
$perpage = 30;
$pager = pager($perpage, $count, "happylog.php?id=$id&");
($res = sql_query("SELECT h.userid, h.torrentid, h.date, h.multi, t.name FROM happylog as h LEFT JOIN torrents AS t on t.id=h.torrentid WHERE h.userid=".sqlesc($id)." ORDER BY h.date DESC ".$pager['limit'])) || sqlerr(__FILE__,
__LINE__);
$HTMLOUT .= begin_main_frame();
$HTMLOUT .= begin_frame("Happy hour log for ".htmlsafechars($user["username"])."");
if ($res->num_rows > 0) {
$HTMLOUT .= $pager['pagertop'];
$HTMLOUT .= "<table class='table table-bordered'>
<tr><td class='colhead' style='width:100%'>Torrent Name</td>
<td class='colhead'>Multiplier</td>
<td class='colhead' nowrap='nowrap'>Date started</td></tr>";
while ($arr = $res->fetch_assoc()) {
$HTMLOUT .= "<tr><td><a href='details.php?id=".(int)$arr["torrentid"]."'>".htmlsafechars($arr["name"])."</a></td>
<td>".(int)$arr["multi"]."</td>
<td nowrap='nowrap'>".get_date($arr["date"], 'LONG', 1, 0)."</td></tr>";
}
$HTMLOUT .= "</table>";
$HTMLOUT .= $pager['pagerbottom'];
} else {
$HTMLOUT .= "No torrents downloaded in happy hour!";
}
$HTMLOUT .= end_frame();
$HTMLOUT .= end_main_frame();
echo stdhead("Happy hour log for ".htmlsafechars($user["username"])."").$HTMLOUT.stdfoot();
?>