root/dev/common/pilot_detail.php @ 206

Revision 206, 7.0 KB (checked in by ralle030583, 15 years ago)

-bugfix in Known Member mod corp detail
-deleted includes(db.php/class.page.php/class.killboard.php) which arent needed anymore everywhere cause of the include in the common/index.php

Line 
1<?php
2require_once('common/includes/class.pilot.php');
3require_once('common/includes/class.corp.php');
4require_once('common/includes/class.alliance.php');
5require_once('common/includes/class.kill.php');
6require_once('common/includes/class.killlist.php');
7require_once('common/includes/class.killlisttable.php');
8require_once('common/includes/class.killsummarytable.php');
9require_once('common/includes/class.toplist.php');
10
11$pilot = new Pilot($_GET['plt_id']);
12$corp = $pilot->getCorp();
13$alliance = $corp->getAlliance();
14$page = new Page('Pilot details - '.$pilot->getName());
15
16if (!$pilot->exists())
17{
18    $html = 'That pilot doesn\'t exist.';
19    $page->generate($html);
20    exit;
21}
22
23$klist = new KillList();
24$tklist = new KillList();
25$llist = new KillList();
26$klist->addInvolvedPilot($pilot);
27$tklist->addInvolvedPilot($pilot);
28$llist->addVictimPilot($pilot);
29$klist->getAllKills();
30$llist->getAllKills();
31$tklist->setPodsNoobShips(false);
32
33$html .= "<table class=kb-table cellspacing=1 width=\"100%\">";
34
35$html .= "<tr class=kb-table-row-even>";
36$html .= "<td rowspan=8 width=128><img src=\"".$pilot->getPortraitURL(128)."\" border=\"0\" width=\"128\" heigth=\"128\"></td>";
37
38$html .= "<td class=kb-table-cell width=160><b>Corporation:</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=".$corp->getID()."\">".$corp->getName()."</a></td></tr>";
39$html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Alliance:</b></td><td class=kb-table-cell>";
40if ($alliance->getName() == "Unknown" || $alliance->getName() == "None")
41    $html .= "<b>".$alliance->getName()."</b>";
42else
43    $html .= "<a href=\"?a=alliance_detail&all_id=".$alliance->getID()."\">".$alliance->getName()."</a>";
44$html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Kills:</b></td><td class=kl-kill>".$klist->getCount()."</td></tr>";
45$html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Real kills:</b></td><td class=kl-kill>".$tklist->getCount()."</td></tr>";
46$html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Losses:</b></td><td class=kl-loss>".$llist->getCount()."</td></tr>";
47$html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Damage done (ISK):</b></td><td class=kl-kill>".round($klist->getISK()/1000000,2)."M</td></tr>";
48$html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Damage received (ISK):</b></td><td class=kl-loss>".round($llist->getISK()/1000000,2)."M</td></tr>";
49
50$html .= "</td></tr>";
51$html .= "</table>";
52
53$html .= "<br/>";
54
55$points = $klist->getPoints();
56$lpoints = $llist->getPoints();
57$summary = new KillSummaryTable($klist, $llist);
58$summary->setBreak(6);
59if ($_GET['view'] == "ships_weapons")
60{
61    $summary->setFilter(false);
62}
63$html .= $summary->generate();
64
65switch ($_GET['view'])
66{
67    case "kills":
68        $html .= "<div class=kb-kills-header>All kills</div>";
69
70        $list = new KillList();
71        $list->setOrdered(true);
72        $list->addInvolvedPilot($pilot);
73        if ($_GET['scl_id'])
74            $list->addVictimShipClass(new ShipClass($_GET['scl_id']));
75        $pagesplitter = new PageSplitter($list->getCount(), 30);
76        $list->setPageSplitter($pagesplitter);
77        $table = new KillListTable($list);
78        $table->setDayBreak(false);
79        $html .= $table->generate();
80        $html .= $pagesplitter->generate();
81
82        break;
83    case "losses":
84        $html .= "<div class=kb-losses-header>All losses</div>";
85
86        $list = new KillList();
87        $list->setOrdered(true);
88        $list->setPodsNoobships(true);
89        $list->addVictimPilot($pilot);
90        if ($_GET['scl_id'])
91            $list->addVictimShipClass(new ShipClass($_GET['scl_id']));
92        $pagesplitter = new PageSplitter($list->getCount(), 30);
93        $list->setPageSplitter($pagesplitter);
94
95        $table = new KillListTable($list);
96        $table->setDayBreak(false);
97        $html .= $table->generate();
98        $html .= $pagesplitter->generate();
99        break;
100    case "ships_weapons":
101        $html .= "<div class=block-header2>Ships & weapons used</div>";
102
103        $html .= "<table class=kb-subtable><tr><td valign=top width=400>";
104        $shiplist = new TopShipList();
105        $shiplist->addInvolvedPilot($pilot);
106        $shiplisttable = new TopShipListTable($shiplist);
107        $html .= $shiplisttable->generate();
108        $html .= "</td><td valign=top align=right width=400>";
109
110        $weaponlist = new TopWeaponList();
111        $weaponlist->addInvolvedPilot($pilot);
112        $weaponlisttable = new TopWeaponListTable($weaponlist);
113        $html .= $weaponlisttable->generate();
114        $html .= "</td></tr></table>";
115
116        break;
117    default:
118        $html .= "<div class=kb-kills-header>10 Most recent kills</div>";
119        $list = new KillList();
120        $list->setOrdered(true);
121        $list->setLimit(10);
122        $list->setPodsNoobships(true);
123        $list->addInvolvedPilot($pilot);
124        if ($_GET['scl_id'])
125            $list->addVictimShipClass(new ShipClass($_GET['scl_id']));
126
127        $table = new KillListTable($list);
128        $table->setDayBreak(false);
129        $html .= $table->generate();
130
131        $html .= "<div class=kb-losses-header>10 Most recent losses</div>";
132        $list = new KillList();
133        $list->setOrdered(true);
134        $list->setLimit(10);
135        $list->setPodsNoobships(true);
136        $list->addVictimPilot($pilot);
137        if ($_GET['scl_id'])
138            $list->addVictimShipClass(new ShipClass($_GET['scl_id']));
139
140        $table = new KillListTable($list);
141        $table->setDayBreak(false);
142        $table->setDayBreak(false);
143        $html .= $table->generate();
144        break;
145}
146
147$menubox = new box("Menu");
148$menubox->setIcon("menu-item.gif");
149$menubox->addOption("caption","Kills & losses");
150$menubox->addOption("link","Recent activity", "?a=pilot_detail&plt_id=".$pilot->getID()."&view=recent");
151$menubox->addOption("link","Kills", "?a=pilot_detail&plt_id=".$pilot->getID()."&view=kills");
152$menubox->addOption("link","Losses", "?a=pilot_detail&plt_id=".$pilot->getID()."&view=losses");
153$menubox->addOption("caption","Statistics");
154$menubox->addOption("link","Ships & weapons", "?a=pilot_detail&plt_id=".$pilot->getID()."&view=ships_weapons");
155if (strstr(config::get("mods_active"), 'signature_generator'))
156{
157    $menubox->addOption("caption","Signature");
158    $menubox->addOption("link","Link", "?a=sig_list&i=".$pilot->getID());
159}
160$page->addContext($menubox->generate());
161
162if (config::get('kill_points'))
163{
164    $scorebox = new Box("Kill points");
165    $scorebox->addOption("points", $points);
166    $page->addContext($scorebox->generate());
167}
168if (config::get('loss_points'))
169{
170    $scorebox = new Box("Loss points");
171    $scorebox->addOption("points", $lpoints);
172    $page->addContext($scorebox->generate());
173}
174if (config::get('total_points'))
175{
176    $scorebox = new Box("Total points");
177    $scorebox->addOption("points", $points-$lpoints);
178    $page->addContext($scorebox->generate());
179}
180
181$page->setContent($html);
182$page->generate();
183?>
Note: See TracBrowser for help on using the browser.