root/dev/mods/monthly_views/losses.php @ 343

Revision 343, 2.6 KB (checked in by beans, 12 years ago)

A lot of updates done by Karbowiak (LaMaH).
See them here:  http://eve-id.net/forum/viewtopic.php?f=503&t=13204&p=15284#p15284

Highlights:
* Integrated feed fetcher & API Mod into the core
* memcached support in core

Line 
1<?php
2require_once('common/includes/class.corp.php');
3require_once('common/includes/class.alliance.php');
4require_once('common/includes/class.killlist.php');
5require_once('common/includes/class.killlisttable.php');
6require_once('common/includes/class.killsummarytable.php');
7require_once('common/includes/class.toplist.php');
8
9if (config::get('public_losses')){
10        die('Forbidden');
11}
12
13$week = $_GET['w'];
14$year = $_GET['y'];
15
16if ($week == '')
17    $week = kbdate('W');
18
19if ($year == '')
20    $year = kbdate('Y');
21
22if ($week == 52)
23{
24    $nweek = 1;
25    $nyear = $year + 1;
26}
27else
28{
29    $nweek = $week + 1;
30    $nyear = $year;
31}
32if ($week == "1")
33{
34    $pweek = 52;
35    $pyear = $year - 1;
36}
37else
38{
39    $pweek = $week - 1;
40    $pyear = $year;
41}
42
43$page = new Page("Losses - Week ".$week);
44
45$klist = new KillList();
46$klist->setWeek($week);
47$klist->setYear($year);
48involved::load($klist,'kill');
49
50$lslist = new KillList();
51$lslist->setWeek($week);
52$lslist->setYear($year);
53involved::load($lslist,'loss');
54
55if (config::get('summarytable')){
56        $summarytable = new KillSummaryTable($klist, $lslist);
57        $summarytable->setBreak(config::get('summarytable_rowcount'));
58        $html .= $summarytable->generate();
59}
60// $html .= "<table width=\"99%\" align=center><tr><td class=weeknav align=left>";
61// if ( $week != kbdate( "W" ) )
62// $html .= "[<a href=\"?a=losses&w=".$nweek."&y=".$nyear."\"><<</a>]";
63// $html .= "</td><td class=weeknav align=right>[<a href=\"?a=losses&w=".$pweek."&y=".$pyear."\">>></a>]</td></tr></table>";
64$llist = new KillList();
65$llist->setOrdered(true);
66$llist->setWeek($week);
67$llist->setYear($year);
68involved::load($llist,'loss');
69if ($_GET['scl_id'])
70    $llist->addVictimShipClass(new ShipClass($_GET['scl_id']));
71else
72    $llist->setPodsNoobShips(false);
73
74$pagesplitter = new PageSplitter($llist->getCount(), 30);   
75$llist->setPageSplitter($pagesplitter);
76$table = new KillListTable($llist);
77$html .= $table->generate();
78$html .= $pagesplitter->generate();
79
80$menubox = new box("Menu");
81$menubox->setIcon("menu-item.gif");
82$menubox->addOption("caption", "Navigation");
83$menubox->addOption("link", "Previous week", "?a=losses&w=".$pweek."&y=".$pyear);
84if ($week != kbdate("W"))
85{
86    $menubox->addOption("link", "Next week", "?a=losses&w=".$nweek."&y=".$nyear);
87}
88$page->addContext($menubox->generate());
89
90$tllist = new TopLossesList();
91$tllist->setWeek($week);
92$tllist->setYear($year);
93involved::load($tllist,'loss');
94
95$tllist->generate();
96$tlbox = new AwardBox($tllist, "Top losers", "losses in week ".$week, "losses", "moon");
97$page->addContext($tlbox->generate());
98
99$page->setContent($html);
100$page->generate();
101?>
Note: See TracBrowser for help on using the browser.