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