1 | <?php |
---|
2 | require_once("class.kill.php"); |
---|
3 | require_once("class.page.php"); |
---|
4 | require_once("class.pilot.php"); |
---|
5 | require_once("class.corp.php"); |
---|
6 | require_once("class.box.php"); |
---|
7 | require_once("class.alliance.php"); |
---|
8 | require_once("globals.php"); |
---|
9 | |
---|
10 | $page = new Page("Kill details"); |
---|
11 | |
---|
12 | $kill = new Kill($_GET['kll_id']); |
---|
13 | if (!$kill->exists()) |
---|
14 | { |
---|
15 | $html = "That kill doesn't exist."; |
---|
16 | $page->generate($html); |
---|
17 | exit; |
---|
18 | } |
---|
19 | |
---|
20 | $html .= "<table cellpadding=0 cellspacing=1 border=0><tr><td width=360 align=left valign=top>"; |
---|
21 | // victim |
---|
22 | $html .= "<table class=kb-table width=360 cellpadding=0 cellspacing=1 border=0>"; |
---|
23 | $html .= "<tr class=kb-table-row-odd><td rowspan=3 width=\"64\"><img src=\"" . $kill->getVictimPortrait(64) . "\" border=\"0\"></td>"; |
---|
24 | $html .= "<td class=kb-table-cell width=64><b>Victim:</b></td><td class=kb-table-cell><a href=\"?a=pilot_detail&plt_id=" . $kill->getVictimID() . "\">" . $kill->getVictimName() . "</a></td>"; |
---|
25 | $html .= "</tr>"; |
---|
26 | $html .= "<tr class=kb-table-row-odd>"; |
---|
27 | $html .= "<td class=kb-table-cell width=64><b>Corp:</b></td><td class=kb-table-cell><a href=\"?a=corp_detail&crp_id=" . $kill->getVictimCorpID() . "\">" . $kill->getVictimCorpName() . "</a></td>"; |
---|
28 | $html .= "</tr>"; |
---|
29 | $html .= "<tr class=kb-table-row-odd>"; |
---|
30 | $html .= "<td class=kb-table-cell width=64><b>Alliance:</b></td><td class=kb-table-cell><b>" . $kill->getVictimAllianceName() . "</b></td>"; |
---|
31 | $html .= "</tr>"; |
---|
32 | $html .= "</table>"; |
---|
33 | // involved |
---|
34 | $html .= "<div class=block-header>Involved parties</div>"; |
---|
35 | $html .= "<table class=kb-table width=360 border=0 cellspacing=\"1\">"; |
---|
36 | $odd = true; |
---|
37 | foreach($kill->involvedparties_ as $inv) |
---|
38 | { |
---|
39 | $pilot = new Pilot($inv->getPilotID()); |
---|
40 | $corp = new Corporation($inv->getCorpID()); |
---|
41 | $alliance = new Alliance($inv->getAllianceID()); |
---|
42 | $ship = $inv->getShip(); |
---|
43 | $weapon = $inv->getWeapon(); |
---|
44 | |
---|
45 | if ($odd) |
---|
46 | { |
---|
47 | $odd = false; |
---|
48 | $rowclass = "kb-table-row-even"; |
---|
49 | } |
---|
50 | else |
---|
51 | { |
---|
52 | $odd = true; |
---|
53 | $rowclass = "kb-table-row-odd"; |
---|
54 | } |
---|
55 | |
---|
56 | if ($pilot->getID() == $kill->getFBPilotID()) |
---|
57 | { |
---|
58 | $imgclass = "class=finalblow "; |
---|
59 | } |
---|
60 | else |
---|
61 | { |
---|
62 | $imgclass = ""; |
---|
63 | } |
---|
64 | |
---|
65 | $html .= "<tr class=kb-table-row-even>"; |
---|
66 | if ($corp->isNPCCorp()) |
---|
67 | { |
---|
68 | $html .= "<td rowspan=4 width=\"64\"><img " . $imgclass . "src=\"" . $corp->getPortraitURL(64) . "\" border=\"0\"></td>"; |
---|
69 | } |
---|
70 | else |
---|
71 | { |
---|
72 | $html .= "<td rowspan=4 width=\"64\"><img " . $imgclass . "src=\"" . $pilot->getPortraitURL(64) . "\" border=\"0\"></td>"; |
---|
73 | } |
---|
74 | $html .= "<td rowspan=4 width=\"64\"><img " . $imgclass . "src=\"" . $ship->getImage(64) . "\" border=\"0\"></td>"; |
---|
75 | $html .= "<td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=pilot_detail&plt_id=" . $pilot->getID() . "\">" . $pilot->getName() . "</a></td>"; |
---|
76 | $html .= "</tr>"; |
---|
77 | |
---|
78 | $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><a href=\"?a=corp_detail&crp_id=" . $corp->getID() . "\">" . $corp->getName() . "</a></td></tr>"; |
---|
79 | $html .= "<tr class=kb-table-row-even><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\"><b>" . $ship->getName() . "</b></td></tr>"; |
---|
80 | |
---|
81 | if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) |
---|
82 | $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\">" . $weapon->getName() . "</td></tr>"; |
---|
83 | else |
---|
84 | $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell style=\"padding-top: 1px; padding-bottom: 1px;\">Unknown</td></tr>"; |
---|
85 | } |
---|
86 | $html .= "</table>"; |
---|
87 | |
---|
88 | $html .= "</td><td width=50> </td>"; |
---|
89 | // ship, ship details |
---|
90 | $html .= "<td align=left valign=top width=360>"; |
---|
91 | |
---|
92 | $html .= "<table class=kb-table width=360 cellspacing=\"1\">"; |
---|
93 | $ship = $kill->getVictimShip(); |
---|
94 | $shipclass = $ship->getClass(); |
---|
95 | $html .= "<tr class=kb-table-row-odd><td width=\"64\" rowspan=3><img src=\"" . $ship->getImage(64) . "\"></td>"; |
---|
96 | $html .= "<td class=kb-table-cell><b>Ship:</b></td><td class=kb-table-cell><b>" . $ship->getName() . "</b> (" . $shipclass->getName() . ")</td>"; |
---|
97 | $html .= "</tr>"; |
---|
98 | // $html .= "<tr class=kb-table-row-odd><td><b>Location:</b></td><td><b>".$sys_name."</b> (".$sys_sec.")</td>"; |
---|
99 | $system = $kill->getSystem(); |
---|
100 | $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>Location:</b></td><td class=kb-table-cell><b><a href=\"javascript:openWindow( '?a=system_detail&sys_id=" . $system->getID() . "', '', 620, 260, '' );\">" . $system->getName() . "</a></b> (" . $system->getSecurity(true) . ")</td>"; |
---|
101 | |
---|
102 | $html .= "</tr>"; |
---|
103 | $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>Date:</b></td><td class=kb-table-cell>" . $kill->getTimeStamp() . "</td>"; |
---|
104 | $html .= "</tr>"; |
---|
105 | $html .= "</table>"; |
---|
106 | // ship fitting |
---|
107 | if (count($kill->destroyeditems_) > 0) |
---|
108 | { |
---|
109 | $html .= "<div class=block-header>Ship details</div>"; |
---|
110 | $html .= "<table class=kb-table width=360 border=\"0\" cellspacing=\"1\">"; |
---|
111 | $imgid = 0; |
---|
112 | foreach($kill->destroyeditems_ as $destroyed) |
---|
113 | { |
---|
114 | $item = $destroyed->getItem(); |
---|
115 | switch ($destroyed->getLocationID()) |
---|
116 | { |
---|
117 | case 4: |
---|
118 | $location = "Cargo"; |
---|
119 | break; |
---|
120 | case 6: // drone |
---|
121 | $location = "Drone Bay"; |
---|
122 | break; |
---|
123 | default: |
---|
124 | switch ($item->getSlot()) |
---|
125 | { |
---|
126 | case 1: // high |
---|
127 | $location = "Fitted - High slot"; |
---|
128 | break; |
---|
129 | case 2: // high |
---|
130 | $location = "Fitted - Medium slot"; |
---|
131 | break; |
---|
132 | case 3: // high |
---|
133 | $location = "Fitted - Low slot"; |
---|
134 | break; |
---|
135 | case 6: // drone |
---|
136 | $location = "Drone Bay"; |
---|
137 | break; |
---|
138 | } |
---|
139 | break; |
---|
140 | } |
---|
141 | |
---|
142 | if ($location != $lastlocation) |
---|
143 | { |
---|
144 | $lastlocation = $location; |
---|
145 | $html .= "<tr class=kb-table-row-odd>"; |
---|
146 | $html .= "<td width=\"32\"><img src=\"" . IMG_URL . "/" . strtolower(str_replace(' ', '_', $location)) . ".jpg\" alt=\"" . $location . "\" border=\"0\"></a></td>"; |
---|
147 | $html .= "<td class=kb-table-cell colspan=2><b>" . $location . "</b></td>"; |
---|
148 | $html .= "</tr>"; |
---|
149 | } |
---|
150 | // item detail |
---|
151 | // $html .= "<tr class=kb-table-row-even onclick=\"openWindow( '?a=item_detail&itm_id=".$row['itm_id']."', null, 225, 250, '' );\" onmouseover=\"document.getElementById('item_img".$imgid."').className='icon-hover'; this.style.cursor='pointer';\" onmouseout=\"document.getElementById('item_img".$imgid."').className='icon';\">"; |
---|
152 | $html .= "<tr class=kb-table-row-even>"; |
---|
153 | // $html .= "<td width=\"32\"><img id=item_img".$imgid." class=icon src=\"".IMG_URL."/items/32_32/".$row['itm_icon'].".png\"></td>"; |
---|
154 | // $html .= "<td class=icon width=\"32\" height=\"32\"></td>"; |
---|
155 | // $html .= "<td class=item-icon width=\"30\" height=\"34\" background=\"".$destroyed->getItem()->getIcon( 32 )."\" valign=top>"; |
---|
156 | // if ( substr( $destroyed->getItem()->getName(), strlen( $destroyed->getItem()->getName() ) - 2, 2 ) == "II" ) |
---|
157 | // $html .= "<img src=\"".IMG_URL."/items/32_32/t2.gif\" border=\"0\">"; |
---|
158 | // else |
---|
159 | // $html .= "<img src=\"".IMG_URL."/items/32_32/blank.gif\" border=\"0\">"; |
---|
160 | // $hmtl .= "</td>"; |
---|
161 | $html .= $item->getIcon(32); |
---|
162 | |
---|
163 | $html .= "<td class=kb-table-cell>" . $item->getName() . "</td>"; |
---|
164 | $html .= "<td width=\"30\" align=\"center\">" . $destroyed->getQuantity() . "</td>"; |
---|
165 | $html .= "</tr>"; |
---|
166 | $imgid++; |
---|
167 | } |
---|
168 | $html .= "</table>"; |
---|
169 | } |
---|
170 | else |
---|
171 | $html .= "<div class=block-header>No ship details</div>"; |
---|
172 | |
---|
173 | $html .= "</td></tr></table>"; |
---|
174 | |
---|
175 | $menubox = new MenuBox(); |
---|
176 | $menubox->addCaption("View"); |
---|
177 | $menubox->addOption("Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=" . $kill->getID() . "', null, 420, 550, '' );"); |
---|
178 | if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1) |
---|
179 | { |
---|
180 | $menubox->addOption("Related kills (" . $kill->relatedKillCount() . "/" . $kill->relatedLossCount() . ")", "?a=kill_related&kll_id=" . $kill->getID()); |
---|
181 | } |
---|
182 | if ($page->isSuperAdmin()) |
---|
183 | { |
---|
184 | $menubox->addCaption("Admin"); |
---|
185 | $menubox->addOption("Löschen", "javascript:openWindow('?a=kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); |
---|
186 | } |
---|
187 | $page->addContext($menubox->generate()); |
---|
188 | |
---|
189 | $config = $page->killboard_->getConfig(); |
---|
190 | if ($config->getKillPoints()) |
---|
191 | { |
---|
192 | $scorebox = new Box("Points awarded"); |
---|
193 | $scorebox->setHeight(64); |
---|
194 | $scorebox->setContent("<div class=kill-points>" . $kill->getKillPoints() . "</div>"); |
---|
195 | $page->addContext($scorebox->generate()); |
---|
196 | } |
---|
197 | |
---|
198 | $mapbox = new Box("Map"); |
---|
199 | $maphtml = "<img src=\"?a=mapview&sys_id=" . $system->getID() . "&mode=map&size=145\" border=0><br>"; |
---|
200 | $maphtml .= "<img src=\"?a=mapview&sys_id=" . $system->getID() . "&mode=region&size=145\" border=0><br>"; |
---|
201 | $maphtml .= "<img src=\"?a=mapview&sys_id=" . $system->getID() . "&mode=cons&size=145\" border=0>"; |
---|
202 | $mapbox->setContent($maphtml); |
---|
203 | $page->addContext($mapbox->generate()); |
---|
204 | |
---|
205 | $page->setContent($html); |
---|
206 | $page->generate(); |
---|
207 | ?> |
---|