1 | <?php |
---|
2 | require_once('common/includes/class.kill.php'); |
---|
3 | |
---|
4 | $page = new Page('Kill details'); |
---|
5 | |
---|
6 | $kll_id = intval($_GET['kll_id']); |
---|
7 | $kll_external_id = intval($_GET['kll_external_id']); |
---|
8 | if (!$kll_id && !$kll_external_id) |
---|
9 | { |
---|
10 | $html = "No kill id specified."; |
---|
11 | $page->setContent($html); |
---|
12 | $page->generate($html); |
---|
13 | exit; |
---|
14 | } |
---|
15 | |
---|
16 | if($kll_id) |
---|
17 | { |
---|
18 | $kill = new Kill($kll_id); |
---|
19 | } |
---|
20 | else |
---|
21 | { |
---|
22 | $kill = new Kill($kll_external_id, true); |
---|
23 | $kll_id = $kill->getID(); |
---|
24 | } |
---|
25 | $kill->setDetailedInvolved(); |
---|
26 | |
---|
27 | if (!$kill->exists()) |
---|
28 | { |
---|
29 | $html="That kill doesn't exist."; |
---|
30 | $page->setContent($html); |
---|
31 | $page->generate($html); |
---|
32 | exit; |
---|
33 | } |
---|
34 | |
---|
35 | // If a comment is being posted then we don't exit this block. |
---|
36 | if(isset($_POST['comment']) && config::get('comments')) |
---|
37 | { |
---|
38 | include('common/comments.php'); |
---|
39 | } |
---|
40 | |
---|
41 | require_once('common/includes/class.killsummarytable.php'); |
---|
42 | require_once('common/includes/class.pilot.php'); |
---|
43 | require_once('common/includes/class.corp.php'); |
---|
44 | require_once('common/includes/class.alliance.php'); |
---|
45 | |
---|
46 | $page=new Page('Kill details'); |
---|
47 | $page->addHeader('<link rel="stylesheet" type="text/css" href="mods/apoc_fitting/style.css">'); |
---|
48 | |
---|
49 | // check apoc settings are set up. If not, put defaults in. |
---|
50 | if(!config::get('apocfitting_colour')) |
---|
51 | { |
---|
52 | config::set('apocfitting_colour', 'apoc'); |
---|
53 | config::set('apocfitting_themedir', 'panel'); |
---|
54 | } |
---|
55 | |
---|
56 | $smarty->assign('panel_colour', config::get('apocfitting_colour')); |
---|
57 | $smarty->assign('dropped_colour', config::get('apocfitting_dropped_colour')); |
---|
58 | $smarty->assign('themedir', config::get('apocfitting_themedir')); |
---|
59 | $smarty->assign('showammo', config::get('apocfitting_showammo')); |
---|
60 | $smarty->assign('showiskd', config::get('apocfitting_showiskd')); |
---|
61 | $smarty->assign('showext', config::get('apocfitting_showext')); |
---|
62 | $mapmod = config::get('apocfitting_mapmod'); |
---|
63 | $sidemap = config::get('apocfitting_sidemap'); |
---|
64 | $showbox = config::get('apocfitting_showbox'); |
---|
65 | |
---|
66 | if (config::get('item_values')) |
---|
67 | { |
---|
68 | $smarty->assign('item_values', 'true'); |
---|
69 | |
---|
70 | if ($page->isAdmin()) |
---|
71 | { |
---|
72 | $smarty->assign('admin', 'true'); |
---|
73 | |
---|
74 | if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') |
---|
75 | { |
---|
76 | // Send new value for item to the database |
---|
77 | $IID=$_POST['IID']; |
---|
78 | $Val=$_POST[$IID]; |
---|
79 | $qry=new DBQuery(); |
---|
80 | $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('" . $IID . "', '" . $Val |
---|
81 | . "') ON DUPLICATE KEY UPDATE price = '" . $Val . "'"); |
---|
82 | } |
---|
83 | } |
---|
84 | } |
---|
85 | |
---|
86 | if ($page->isAdmin()) |
---|
87 | { |
---|
88 | if (isset($_GET['view']) && $_GET['view'] == 'FixSlot') |
---|
89 | { |
---|
90 | $smarty->assign('fixSlot', 'true'); |
---|
91 | } |
---|
92 | |
---|
93 | $smarty->assign('admin', 'true'); |
---|
94 | |
---|
95 | if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateSlot') |
---|
96 | { |
---|
97 | $IID =$_POST['IID']; |
---|
98 | $KID =$_POST['KID']; |
---|
99 | $Val =$_POST[$IID]; |
---|
100 | $table=$_POST['TYPE']; |
---|
101 | $old =$_POST['OLDSLOT']; |
---|
102 | $qry =new DBQuery(); |
---|
103 | $qry->execute("UPDATE kb3_items_" . $table . " SET itd_itl_id ='" . $Val . "' WHERE itd_itm_id=" . $IID |
---|
104 | . " AND itd_kll_id = " . $KID . " AND itd_itl_id = " . $old); |
---|
105 | } |
---|
106 | } |
---|
107 | |
---|
108 | // Begin -- Sapyx 25-08-2008 |
---|
109 | |
---|
110 | $qry=new DBQuery(); |
---|
111 | |
---|
112 | if (ALLIANCE_ID <> '0') |
---|
113 | { |
---|
114 | $qry->execute("SELECT all_name FROM kb3_alliances WHERE all_id = " . ALLIANCE_ID) or die($qry->getErrorMsg()); |
---|
115 | |
---|
116 | $row=$qry->getRow(); |
---|
117 | $smarty->assign('IsAlly', true); |
---|
118 | $smarty->assign('HomeName', $row['all_name']); |
---|
119 | |
---|
120 | /* |
---|
121 | $qry->execute("SELECT `kb3_corps`.`crp_name` FROM kb3_corps WHERE (kb3_corps.crp_all_id=" . ALLIANCE_ID . ")") |
---|
122 | or die($qry->getErrorMsg()); |
---|
123 | |
---|
124 | $rosso=0x70; |
---|
125 | $verde=0; |
---|
126 | $blu =0x70; |
---|
127 | |
---|
128 | while ($row=$qry->getRow()) |
---|
129 | { |
---|
130 | $verde+=10; |
---|
131 | $blu-=10; |
---|
132 | $rosso-=15; |
---|
133 | $corps[$row['crp_name']]="RGB($rosso,$verde,$blu)"; |
---|
134 | } |
---|
135 | */ |
---|
136 | } |
---|
137 | else |
---|
138 | { |
---|
139 | $qry->execute("SELECT crp_name FROM kb3_corps WHERE crp_id = " . CORP_ID) or die($qry->getErrorMsg()); |
---|
140 | |
---|
141 | $row=$qry->getRow(); |
---|
142 | $smarty->assign('IsAlly', false); |
---|
143 | $smarty->assign('HomeName', $row['crp_name']); |
---|
144 | } |
---|
145 | |
---|
146 | // END -- |
---|
147 | |
---|
148 | // victim $smarty->assign('',); |
---|
149 | $smarty->assign('KillId', $kill->getID()); |
---|
150 | $smarty->assign('VictimPortrait', $kill->getVictimPortrait(64)); |
---|
151 | $smarty->assign('VictimURL', "?a=pilot_detail&plt_id=" . $kill->getVictimID()); |
---|
152 | $smarty->assign('VictimName', $kill->getVictimName()); |
---|
153 | $smarty->assign('VictimCorpURL', "?a=corp_detail&crp_id=" . $kill->getVictimCorpID()); |
---|
154 | $smarty->assign('VictimCorpName', $kill->getVictimCorpName()); |
---|
155 | $smarty->assign('VictimAllianceURL', "?a=alliance_detail&all_id=" . $kill->getVictimAllianceID()); |
---|
156 | $smarty->assign('VictimAllianceName', $kill->getVictimAllianceName()); |
---|
157 | $smarty->assign('VictimDamageTaken', $kill->VictimDamageTaken); |
---|
158 | $smarty->assign('InvolvedPartyCount', $kill->getInvolvedPartyCount()); // Anne Sapyx 07/05/2008 |
---|
159 | $smarty->assign('AllyCorps', $corps); |
---|
160 | |
---|
161 | // involved |
---|
162 | $i=1; |
---|
163 | |
---|
164 | $involved=array(); |
---|
165 | $ownKill= false; |
---|
166 | |
---|
167 | foreach ($kill->involvedparties_ as $inv) |
---|
168 | { |
---|
169 | $pilot =$inv->getPilot(); |
---|
170 | $corp =$inv->getCorp(); |
---|
171 | $alliance =$inv->getAlliance(); |
---|
172 | $ship =$inv->getShip(); |
---|
173 | $weapon =$inv->getWeapon(); |
---|
174 | |
---|
175 | $involved[$i]['shipImage'] =$ship->getImage(64); |
---|
176 | $involved[$i]['PilotURL'] ="?a=pilot_detail&plt_id=" . $pilot->getID(); |
---|
177 | $involved[$i]['PilotName'] =$pilot->getName(); |
---|
178 | $involved[$i]['CorpURL'] ="?a=corp_detail&crp_id=" . $corp->getID(); |
---|
179 | $involved[$i]['CorpName'] =$corp->getName(); |
---|
180 | $involved[$i]['AlliURL'] ="?a=alliance_detail&all_id=" . $alliance->getID(); |
---|
181 | $involved[$i]['AlliName'] =$alliance->getName(); |
---|
182 | $involved[$i]['ShipName'] =$ship->getName(); |
---|
183 | $involved[$i]['ShipID'] =$ship->externalid_; |
---|
184 | $involved[$i]['damageDone']=$inv->dmgdone_; |
---|
185 | $shipclass =$ship->getClass(); |
---|
186 | |
---|
187 | $involved[$i]['shipClass'] =$shipclass->getName(); |
---|
188 | |
---|
189 | if ($pilot->getID() == $kill->getFBPilotID()) |
---|
190 | { |
---|
191 | $involved[$i]['FB']="true"; |
---|
192 | } |
---|
193 | else |
---|
194 | { |
---|
195 | $involved[$i]['FB']="false"; |
---|
196 | } |
---|
197 | |
---|
198 | if ($corp->isNPCCorp()) |
---|
199 | { |
---|
200 | $involved[$i]['portrait']=$corp->getPortraitURL(64); |
---|
201 | } |
---|
202 | else |
---|
203 | { |
---|
204 | $involved[$i]['portrait']=$pilot->getPortraitURL(64); |
---|
205 | } |
---|
206 | |
---|
207 | if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) |
---|
208 | { |
---|
209 | $involved[$i]['weaponName']=$weapon->getName(); |
---|
210 | $involved[$i]['weaponID'] =$weapon->row_['itm_externalid']; |
---|
211 | } |
---|
212 | else |
---|
213 | $involved[$i]['weaponName']="Unknown"; |
---|
214 | |
---|
215 | // Sapyx 16/09/2008 -- from Rostik idea |
---|
216 | // Update by Rostik 19/08/2008 - Add Alliance logo |
---|
217 | //sapyx 29/10/2008 |
---|
218 | // Sapyx 16/09/2008 -- from Rostik idea |
---|
219 | // Update by Rostik 19/08/2008 - Add Alliance logo |
---|
220 | //sapyx 29/10/2008 |
---|
221 | // Rostik 11/03/2009 |
---|
222 | |
---|
223 | $handle=@fopen("mods/apoc_fitting/ItemsList", "r"); |
---|
224 | |
---|
225 | if ($handle) |
---|
226 | { |
---|
227 | while (!feof($handle)) |
---|
228 | { |
---|
229 | $ItemsArray = explode(",", fgets($handle)); |
---|
230 | if (strpos($involved[$i]['weaponName'], trim($ItemsArray[0])) !== FALSE) |
---|
231 | { |
---|
232 | $involved[$i]['shipImage']="img/ships/64_64/" . trim($ItemsArray[1]) . ".png"; |
---|
233 | |
---|
234 | if ($corp->isNPCCorp()) { |
---|
235 | } else { |
---|
236 | if ($involved[$i]['CorpName'] =="None") { |
---|
237 | $aliimg =ereg_replace(" ", "", $involved[$i]['AlliName']); |
---|
238 | $aliimg =ereg_replace("\.", "", $aliimg); |
---|
239 | $aliimg =ereg_replace("-", "", $aliimg); |
---|
240 | |
---|
241 | if (file_exists("img/alliances/".$aliimg.".png")) { |
---|
242 | $involved[$i]['portrait']="img/alliances/" . $aliimg . ".png"; |
---|
243 | } else { |
---|
244 | $involved[$i]['portrait']="img/alliances/default.png";} |
---|
245 | |
---|
246 | if ((($involved[$i]['AlliName'] == "None") || ($involved[$i]['AlliName'] == "Unknown"))) { |
---|
247 | $involved[$i]['portrait']="img/alliances/default.png"; |
---|
248 | } |
---|
249 | |
---|
250 | } else { |
---|
251 | $involved[$i]['portrait']="img/corps/" . $corp->getID() . ".jpg"; |
---|
252 | } |
---|
253 | } |
---|
254 | } |
---|
255 | } |
---|
256 | |
---|
257 | fclose($handle); |
---|
258 | } |
---|
259 | |
---|
260 | // END -- Sapyx Rostik & C |
---|
261 | |
---|
262 | // END -- Sapyx Rostik & C |
---|
263 | |
---|
264 | // Begin -- Sapyx 25-06-2008 |
---|
265 | $InvAllies[$involved[$i]['AlliName']]["quantity"]+=1; |
---|
266 | $InvAllies[$involved[$i]['AlliName']]["corps"][$involved[$i]['CorpName']]+=1; |
---|
267 | //HK $InvShips[$involved[$i]['ShipName'] ." (" .$involved[$i]['shipClass'] .")"] += 1; |
---|
268 | $InvShips[$involved[$i]['ShipName']] += 1; |
---|
269 | if(ALLIANCE_ID >0 && $alliance->getID()==ALLIANCE_ID) $ownKill=true; |
---|
270 | elseif(CORP_ID >0 && $corp->getID()==CORP_ID) $ownKill=true; |
---|
271 | // End -- Sapyx 25-06-2008 |
---|
272 | |
---|
273 | ++$i; |
---|
274 | } |
---|
275 | if($ownKill) $smarty->assign('kill',true); |
---|
276 | else $smarty->assign('kill',false); |
---|
277 | |
---|
278 | $smarty->assign_by_ref('involved', $involved); |
---|
279 | $smarty->assign_by_ref('AlliesCount', count($InvAllies)); |
---|
280 | $smarty->assign_by_ref('InvAllies', $InvAllies); |
---|
281 | $smarty->assign_by_ref('InvShips', $InvShips); |
---|
282 | |
---|
283 | if (config::get('comments')) |
---|
284 | { |
---|
285 | include('common/comments.php'); |
---|
286 | $smarty->assign('comments', $comment); |
---|
287 | } |
---|
288 | |
---|
289 | // ship, ship details |
---|
290 | $ship=$kill->getVictimShip(); |
---|
291 | $shipclass=$ship->getClass(); |
---|
292 | $system=$kill->getSystem(); |
---|
293 | |
---|
294 | $smarty->assign('VictimShip', $kill->getVictimShip()); |
---|
295 | $smarty->assign('ShipClass', $ship->getClass()); |
---|
296 | $smarty->assign('ShipImage', $ship->getImage(64)); |
---|
297 | $smarty->assign('ShipName', $ship->getName()); |
---|
298 | $smarty->assign('ShipID', $ship->externalid_); |
---|
299 | $smarty->assign('ClassName', $shipclass->getName()); |
---|
300 | |
---|
301 | include_once('common/includes/class.dogma.php'); |
---|
302 | |
---|
303 | $ssc=new dogma($ship->externalid_); |
---|
304 | |
---|
305 | $smarty->assign_by_ref('ssc', $ssc); |
---|
306 | |
---|
307 | if ($kill->isClassified()) |
---|
308 | { |
---|
309 | //Admin is able to see classified Systems |
---|
310 | if ($page->isAdmin()) |
---|
311 | { |
---|
312 | if ($mapmod) { |
---|
313 | $smarty->assign('SystemID', $system->getID()); |
---|
314 | } |
---|
315 | $smarty->assign('System', $system->getName() . ' (Classified)'); |
---|
316 | $smarty->assign('SystemURL', "?a=system_detail&sys_id=" . $system->getID()); |
---|
317 | $smarty->assign('SystemSecurity', $system->getSecurity(true)); |
---|
318 | } |
---|
319 | else |
---|
320 | { |
---|
321 | $smarty->assign('System', 'Classified'); |
---|
322 | $smarty->assign('SystemURL', ""); |
---|
323 | $smarty->assign('SystemSecurity', '0.0'); |
---|
324 | } |
---|
325 | } |
---|
326 | else |
---|
327 | { |
---|
328 | if ($mapmod) { |
---|
329 | $smarty->assign('SystemID', $system->getID()); |
---|
330 | } |
---|
331 | $smarty->assign('System', $system->getName()); |
---|
332 | $smarty->assign('SystemURL', "?a=system_detail&sys_id=" . $system->getID()); |
---|
333 | $smarty->assign('SystemSecurity', $system->getSecurity(true)); |
---|
334 | } |
---|
335 | |
---|
336 | $smarty->assign('TimeStamp', $kill->getTimeStamp()); |
---|
337 | $smarty->assign('VictimShipImg', $ship->getImage(64)); |
---|
338 | |
---|
339 | if ($mapmod) { |
---|
340 | if(strpos($config->get('mods_active'), 'map_mod') !== false) { |
---|
341 | |
---|
342 | $smarty->assign('loc_active', TRUE); |
---|
343 | } |
---|
344 | else { |
---|
345 | $smarty->assign('loc_active', FALSE); |
---|
346 | } |
---|
347 | } |
---|
348 | |
---|
349 | // preparing slot layout |
---|
350 | |
---|
351 | $slot_array=array(); |
---|
352 | |
---|
353 | $slot_array[1]=array |
---|
354 | ( |
---|
355 | 'img' => 'icon08_11.png', |
---|
356 | 'text' => 'Fitted - High slot', |
---|
357 | 'items' => array() |
---|
358 | ); |
---|
359 | |
---|
360 | $slot_array[2]=array |
---|
361 | ( |
---|
362 | 'img' => 'icon08_10.png', |
---|
363 | 'text' => 'Fitted - Mid slot', |
---|
364 | 'items' => array() |
---|
365 | ); |
---|
366 | |
---|
367 | $slot_array[3]=array |
---|
368 | ( |
---|
369 | 'img' => 'icon08_09.png', |
---|
370 | 'text' => 'Fitted - Low slot', |
---|
371 | 'items' => array() |
---|
372 | ); |
---|
373 | |
---|
374 | $slot_array[5]=array |
---|
375 | ( |
---|
376 | 'img' => 'icon68_01.png', |
---|
377 | 'text' => 'Fitted - Rig slot', |
---|
378 | 'items' => array() |
---|
379 | ); |
---|
380 | |
---|
381 | $slot_array[6]=array |
---|
382 | ( |
---|
383 | 'img' => 'icon02_10.png', |
---|
384 | 'text' => 'Drone bay', |
---|
385 | 'items' => array() |
---|
386 | ); |
---|
387 | |
---|
388 | $slot_array[4]=array |
---|
389 | ( |
---|
390 | 'img' => 'icon03_14.png', |
---|
391 | 'text' => 'Cargo Bay', |
---|
392 | 'items' => array() |
---|
393 | ); |
---|
394 | $slot_array[7]=array |
---|
395 | ( |
---|
396 | 'img' => 'icon76_04.png', |
---|
397 | 'text' => 'Fitted - Subsystems', |
---|
398 | 'items' => array() |
---|
399 | ); |
---|
400 | |
---|
401 | // ship fitting |
---|
402 | if (count($kill->destroyeditems_) > 0) |
---|
403 | { |
---|
404 | $dest_array=array(); |
---|
405 | |
---|
406 | foreach ($kill->destroyeditems_ as $destroyed) |
---|
407 | { |
---|
408 | $item = $destroyed->getItem(); |
---|
409 | $i_qty=$destroyed->getQuantity(); |
---|
410 | |
---|
411 | if (config::get('item_values')) |
---|
412 | { |
---|
413 | $value=$destroyed->getValue(); |
---|
414 | $TotalValue+=$value * $i_qty; |
---|
415 | $formatted=$destroyed->getFormattedValue(); |
---|
416 | } |
---|
417 | |
---|
418 | $i_name =$item->getName(); |
---|
419 | $i_location =$destroyed->getLocationID(); |
---|
420 | $i_id =$item->getID(); |
---|
421 | $i_usedgroup=$item->get_used_launcher_group(); |
---|
422 | |
---|
423 | $dest_array[$i_location][]=array |
---|
424 | ( |
---|
425 | 'Icon' => $item->getIcon(32), |
---|
426 | 'Name' => $i_name, |
---|
427 | 'Quantity' => $i_qty, |
---|
428 | 'Value' => $formatted, |
---|
429 | 'single_unit' => $value, |
---|
430 | 'itemID' => $i_id, |
---|
431 | 'slotID' => $i_location |
---|
432 | ); |
---|
433 | |
---|
434 | //Fitting, KE - add destroyed items to an array of all fitted items. |
---|
435 | if (($i_location != 4) && ($i_location != 5) && ($i_location != 6)) |
---|
436 | { |
---|
437 | if (($i_usedgroup != 0)) |
---|
438 | { |
---|
439 | if ($i_location == 1) |
---|
440 | { |
---|
441 | $i_ammo=$item->get_ammo_size($i_name); |
---|
442 | |
---|
443 | if ($i_usedgroup == 481) |
---|
444 | { |
---|
445 | $i_ammo=0; |
---|
446 | } |
---|
447 | } |
---|
448 | else |
---|
449 | { |
---|
450 | $i_ammo=0; |
---|
451 | } |
---|
452 | |
---|
453 | $ammo_array[$i_location][]=array |
---|
454 | ( |
---|
455 | 'Name' => $i_name, |
---|
456 | 'Icon' => $item->getIcon(24), |
---|
457 | 'itemID' => $i_id, |
---|
458 | 'usedgroupID' => $i_usedgroup, |
---|
459 | 'size' => $i_ammo |
---|
460 | ); |
---|
461 | } |
---|
462 | else |
---|
463 | { |
---|
464 | for ($count=0; $count < $i_qty; $count++) |
---|
465 | { |
---|
466 | if ($i_location == 1) |
---|
467 | { |
---|
468 | $i_charge=$item->get_used_charge_size(); |
---|
469 | } |
---|
470 | else |
---|
471 | { |
---|
472 | $i_charge=0; |
---|
473 | } |
---|
474 | |
---|
475 | $fitting_array[$i_location][]=array |
---|
476 | ( |
---|
477 | 'Name' => $i_name, |
---|
478 | 'Icon' => $item->getIcon(32), |
---|
479 | 'itemID' => $i_id, |
---|
480 | 'groupID' => $item->get_group_id(), |
---|
481 | 'chargeSize' => $i_charge |
---|
482 | ); |
---|
483 | } |
---|
484 | } |
---|
485 | } |
---|
486 | else if (($destroyed->getLocationID() == 5)) |
---|
487 | { |
---|
488 | for ($count=0; $count < $i_qty; $count++) |
---|
489 | { |
---|
490 | $fitting_array[$i_location][]=array |
---|
491 | ( |
---|
492 | 'Name' => $i_name, |
---|
493 | 'Icon' => $item->getIcon(32), |
---|
494 | 'itemID' => $i_id |
---|
495 | ); |
---|
496 | } |
---|
497 | } |
---|
498 | //fitting thing end |
---|
499 | } |
---|
500 | } |
---|
501 | |
---|
502 | if (count($kill->droppeditems_) > 0) |
---|
503 | { |
---|
504 | $drop_array=array(); |
---|
505 | |
---|
506 | foreach ($kill->droppeditems_ as $dropped) |
---|
507 | { |
---|
508 | $item = $dropped->getItem(); |
---|
509 | $i_qty=$dropped->getQuantity(); |
---|
510 | |
---|
511 | if (config::get('item_values')) |
---|
512 | { |
---|
513 | $value=$dropped->getValue(); |
---|
514 | $dropvalue+=$value * $i_qty; |
---|
515 | $formatted=$dropped->getFormattedValue(); |
---|
516 | } |
---|
517 | |
---|
518 | $i_name =$item->getName(); |
---|
519 | $i_location =$dropped->getLocationID(); |
---|
520 | $i_id =$item->getID(); |
---|
521 | $i_usedgroup=$item->get_used_launcher_group(); |
---|
522 | |
---|
523 | $drop_array[$i_location][]=array |
---|
524 | ( |
---|
525 | 'Icon' => $item->getIcon(32), |
---|
526 | 'Name' => $i_name, |
---|
527 | 'Quantity' => $i_qty, |
---|
528 | 'Value' => $formatted, |
---|
529 | 'single_unit' => $value, |
---|
530 | 'itemID' => $i_id, |
---|
531 | 'slotID' => $i_location |
---|
532 | ); |
---|
533 | |
---|
534 | //Fitting -KE, add dropped items to the list |
---|
535 | if (($i_location != 4) && ($i_location != 6)) |
---|
536 | { |
---|
537 | if (($i_usedgroup != 0)) |
---|
538 | { |
---|
539 | if ($i_location == 1) |
---|
540 | { |
---|
541 | $i_ammo=$item->get_ammo_size($i_name); |
---|
542 | |
---|
543 | if ($i_usedgroup == 481) |
---|
544 | { |
---|
545 | $i_ammo=0; |
---|
546 | } |
---|
547 | } |
---|
548 | else |
---|
549 | { |
---|
550 | $i_ammo=0; |
---|
551 | } |
---|
552 | |
---|
553 | $ammo_array[$i_location][]=array |
---|
554 | ( |
---|
555 | 'Name' => $i_name, |
---|
556 | 'Icon' => $item->getIcon(24), |
---|
557 | 'itemID' => $i_id, |
---|
558 | 'usedgroupID' => $i_usedgroup, |
---|
559 | 'size' => $i_ammo |
---|
560 | ); |
---|
561 | } |
---|
562 | else |
---|
563 | { |
---|
564 | for ($count=0; $count < $i_qty; $count++) |
---|
565 | { |
---|
566 | if ($i_location == 1) |
---|
567 | { |
---|
568 | $i_charge=$item->get_used_charge_size(); |
---|
569 | } |
---|
570 | else |
---|
571 | { |
---|
572 | $i_charge=0; |
---|
573 | } |
---|
574 | |
---|
575 | $fitting_array[$i_location][]=array |
---|
576 | ( |
---|
577 | 'Name' => $i_name, |
---|
578 | 'Icon' => $item->getIcon(32), |
---|
579 | 'itemID' => $i_id, |
---|
580 | 'groupID' => $item->get_group_id(), |
---|
581 | 'chargeSize' => $i_charge |
---|
582 | ); |
---|
583 | } |
---|
584 | } |
---|
585 | } |
---|
586 | //fitting thing end |
---|
587 | |
---|
588 | } |
---|
589 | } |
---|
590 | |
---|
591 | //Fitting - KE, sort the fitted items into groupID order, so that several of the same item apear next to each other. |
---|
592 | if (is_array($fitting_array[1])) |
---|
593 | { |
---|
594 | foreach ($fitting_array[1] as $array_rowh) |
---|
595 | { |
---|
596 | $sort_by_nameh["groupID"][]=$array_rowh["groupID"]; |
---|
597 | } |
---|
598 | |
---|
599 | array_multisort($sort_by_nameh["groupID"], SORT_ASC, $fitting_array[1]); |
---|
600 | } |
---|
601 | |
---|
602 | if (is_array($fitting_array[2])) |
---|
603 | { |
---|
604 | foreach ($fitting_array[2] as $array_rowm) |
---|
605 | { |
---|
606 | $sort_by_namem["groupID"][]=$array_rowm["groupID"]; |
---|
607 | } |
---|
608 | |
---|
609 | array_multisort($sort_by_namem["groupID"], SORT_ASC, $fitting_array[2]); |
---|
610 | } |
---|
611 | |
---|
612 | if (is_array($fitting_array[3])) |
---|
613 | { |
---|
614 | foreach ($fitting_array[3] as $array_rowl) |
---|
615 | { |
---|
616 | $sort_by_namel["groupID"][]=$array_rowl["Name"]; |
---|
617 | } |
---|
618 | |
---|
619 | array_multisort($sort_by_namel["groupID"], SORT_ASC, $fitting_array[3]); |
---|
620 | } |
---|
621 | |
---|
622 | if (is_array($fitting_array[5])) |
---|
623 | { |
---|
624 | foreach ($fitting_array[5] as $array_rowr) |
---|
625 | { |
---|
626 | $sort_by_namer["Name"][]=$array_rowr["Name"]; |
---|
627 | } |
---|
628 | |
---|
629 | array_multisort($sort_by_namer["Name"], SORT_ASC, $fitting_array[5]); |
---|
630 | } |
---|
631 | |
---|
632 | if (is_array($fitting_array[7])) |
---|
633 | { |
---|
634 | foreach ($fitting_array[7] as $array_rowr) |
---|
635 | { |
---|
636 | $sort_by_namer["groupID"][]=$array_rowr["groupID"]; |
---|
637 | } |
---|
638 | |
---|
639 | array_multisort($sort_by_namer["groupID"], SORT_ASC, $fitting_array[7]); |
---|
640 | } |
---|
641 | |
---|
642 | //Fitting - KE, sort the fitted items into name order, so that several of the same item apear next to each other. -end |
---|
643 | |
---|
644 | $length=count($ammo_array[1]); |
---|
645 | |
---|
646 | $temp=array(); |
---|
647 | |
---|
648 | if (is_array($fitting_array[1])) |
---|
649 | { |
---|
650 | $hiammo=array(); |
---|
651 | |
---|
652 | foreach ($fitting_array[1] as $highfit) |
---|
653 | { |
---|
654 | $group = $highfit["groupID"]; |
---|
655 | $size =$highfit["chargeSize"]; |
---|
656 | |
---|
657 | if ($group |
---|
658 | == 483 // Modulated Deep Core Miner II, Modulated Strip Miner II and Modulated Deep Core Strip Miner II |
---|
659 | || $group == 53 // Laser Turrets |
---|
660 | || $group == 55 // Projectile Turrets |
---|
661 | || $group == 74 // Hybrid Turrets |
---|
662 | || ($group >= 506 && $group <= 511) // Some Missile Lauchers |
---|
663 | || $group == 481 // Probe Launchers |
---|
664 | || $group == 899 // Warp Disruption Field Generator I |
---|
665 | || $group == 771 // Heavy Assault Missile Launchers |
---|
666 | || $group == 589 // Interdiction Sphere Lauchers |
---|
667 | || $group == 524 // Citadel Torpedo Launchers |
---|
668 | ) |
---|
669 | { |
---|
670 | $found=0; |
---|
671 | |
---|
672 | if ($group == 511) |
---|
673 | { |
---|
674 | $group=509; |
---|
675 | } // Assault Missile Lauchers uses same ammo as Standard Missile Lauchers |
---|
676 | |
---|
677 | if (is_array($ammo_array[1])) |
---|
678 | { |
---|
679 | $i=0; |
---|
680 | |
---|
681 | while (!($found) && $i < $length) |
---|
682 | { |
---|
683 | $temp = array_shift($ammo_array[1]); |
---|
684 | |
---|
685 | if (($temp["usedgroupID"] == $group) && ($temp["size"] == $size)) |
---|
686 | { |
---|
687 | $hiammo[]=array |
---|
688 | ( |
---|
689 | 'show' => $smarty->fetch(get_tpl('ammo')), |
---|
690 | 'type' => $temp["Icon"] |
---|
691 | ); |
---|
692 | |
---|
693 | $found=1; |
---|
694 | } |
---|
695 | |
---|
696 | array_push($ammo_array[1], $temp); |
---|
697 | $i++; |
---|
698 | } |
---|
699 | } |
---|
700 | |
---|
701 | if (!($found)) |
---|
702 | { |
---|
703 | $hiammo[]=array |
---|
704 | ( |
---|
705 | 'show' => $smarty->fetch(get_tpl('ammo')), |
---|
706 | 'type' => $smarty->fetch(get_tpl('noicon')) |
---|
707 | ); |
---|
708 | } |
---|
709 | } |
---|
710 | else |
---|
711 | { |
---|
712 | $hiammo[]=array |
---|
713 | ( |
---|
714 | 'show' => $smarty->fetch(get_tpl('blank')), |
---|
715 | 'type' => $smarty->fetch(get_tpl('blank')) |
---|
716 | ); |
---|
717 | } |
---|
718 | } |
---|
719 | } |
---|
720 | |
---|
721 | $length=count($ammo_array[2]); |
---|
722 | |
---|
723 | if (is_array($fitting_array[2])) |
---|
724 | { |
---|
725 | $midammo=array(); |
---|
726 | |
---|
727 | foreach ($fitting_array[2] as $midfit) |
---|
728 | { |
---|
729 | $group = $midfit["groupID"]; |
---|
730 | |
---|
731 | if ($group == 76 // Capacitor Boosters |
---|
732 | || $group == 208 // Remote Sensor Dampeners |
---|
733 | || $group == 212 // Sensor Boosters |
---|
734 | || $group == 291 // Tracking Disruptors |
---|
735 | || $group == 213 // Tracking Computers |
---|
736 | || $group == 209 // Tracking Links |
---|
737 | || $group == 290 // Remote Sensor Boosters |
---|
738 | ) |
---|
739 | { |
---|
740 | $found=0; |
---|
741 | |
---|
742 | if (is_array($ammo_array[2])) |
---|
743 | { |
---|
744 | $i=0; |
---|
745 | |
---|
746 | while (!($found) && $i < $length) |
---|
747 | { |
---|
748 | $temp = array_shift($ammo_array[2]); |
---|
749 | |
---|
750 | if ($temp["usedgroupID"] == $group) |
---|
751 | { |
---|
752 | $midammo[]=array |
---|
753 | ( |
---|
754 | 'show' => $smarty->fetch(get_tpl('ammo')), |
---|
755 | 'type' => $temp["Icon"] |
---|
756 | ); |
---|
757 | |
---|
758 | $found=1; |
---|
759 | } |
---|
760 | |
---|
761 | array_push($ammo_array[2], $temp); |
---|
762 | $i++; |
---|
763 | } |
---|
764 | } |
---|
765 | |
---|
766 | if (!($found)) |
---|
767 | { |
---|
768 | $midammo[]=array |
---|
769 | ( |
---|
770 | 'show' => $smarty->fetch(get_tpl('ammo')), |
---|
771 | 'type' => $smarty->fetch(get_tpl('noicon')) |
---|
772 | ); |
---|
773 | } |
---|
774 | } |
---|
775 | else |
---|
776 | { |
---|
777 | $midammo[]=array |
---|
778 | ( |
---|
779 | 'show' => $smarty->fetch(get_tpl('blank')), |
---|
780 | 'type' => $smarty->fetch(get_tpl('blank')) |
---|
781 | ); |
---|
782 | } |
---|
783 | } |
---|
784 | } |
---|
785 | |
---|
786 | if ($TotalValue >= 0) |
---|
787 | { |
---|
788 | $Formatted=number_format($TotalValue, 2); |
---|
789 | } |
---|
790 | |
---|
791 | // Get Ship Value |
---|
792 | $ShipValue=$ship->getPrice(); |
---|
793 | |
---|
794 | if (config::get('kd_droptototal')) |
---|
795 | { |
---|
796 | $TotalValue+=$dropvalue; |
---|
797 | } |
---|
798 | |
---|
799 | $TotalLoss=number_format($TotalValue + $ShipValue, 2); |
---|
800 | $ShipValue=number_format($ShipValue, 2); |
---|
801 | $dropvalue=number_format($dropvalue, 2); |
---|
802 | |
---|
803 | $smarty->assign_by_ref('destroyed', $dest_array); |
---|
804 | $smarty->assign_by_ref('dropped', $drop_array); |
---|
805 | $smarty->assign_by_ref('slots', $slot_array); |
---|
806 | $smarty->assign_by_ref('fitting_high', $fitting_array[1]); |
---|
807 | $smarty->assign_by_ref('fitting_med', $fitting_array[2]); |
---|
808 | $smarty->assign_by_ref('fitting_low', $fitting_array[3]); |
---|
809 | $smarty->assign_by_ref('fitting_rig', $fitting_array[5]); |
---|
810 | $smarty->assign_by_ref('fitting_sub', $fitting_array[7]); |
---|
811 | $smarty->assign_by_ref('fitting_ammo_high', $hiammo); |
---|
812 | $smarty->assign_by_ref('fitting_ammo_mid', $midammo); |
---|
813 | $smarty->assign('ItemValue', $Formatted); |
---|
814 | $smarty->assign('DropValue', $dropvalue); |
---|
815 | $smarty->assign('ShipValue', $ShipValue); |
---|
816 | $smarty->assign('TotalLoss', $TotalLoss); |
---|
817 | |
---|
818 | $hicount =count($fitting_array[1]); |
---|
819 | $medcount=count($fitting_array[2]); |
---|
820 | $lowcount=count($fitting_array[3]); |
---|
821 | |
---|
822 | $smarty->assign('hic', $hicount); |
---|
823 | $smarty->assign('medc', $medcount); |
---|
824 | $smarty->assign('lowc', $lowcount); |
---|
825 | |
---|
826 | $menubox=new Box("Menu"); |
---|
827 | $menubox->setIcon("menu-item.gif"); |
---|
828 | $menubox->addOption("caption", "View"); |
---|
829 | $menubox->addOption("link", |
---|
830 | "Killmail", |
---|
831 | "javascript:sndReq('index.php?a=kill_mail&kll_id=" . $kill->getID() |
---|
832 | . "');ReverseContentDisplay('popup')"); |
---|
833 | |
---|
834 | if (config::get('apocfitting_showeft')) { |
---|
835 | $menubox->addOption("link", |
---|
836 | "EFT Fitting", |
---|
837 | "javascript:sndReq('index.php?a=eft_fitting&kll_id=" . $kill->getID() |
---|
838 | . "');ReverseContentDisplay('popup')"); |
---|
839 | } |
---|
840 | |
---|
841 | if (config::get('apocfitting_showeft2eve')) { |
---|
842 | $menubox->addOption("link", "EFT To EVE", "javascript:sndReq('index.php?a=convertinkilldetail');ReverseContentDisplay('popup')"); |
---|
843 | } |
---|
844 | |
---|
845 | if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1 || |
---|
846 | ((ALLIANCE_ID || CORP_ID || PILOT_ID) && $kill->relatedKillCount() + $kill->relatedLossCount() > 1)) |
---|
847 | { |
---|
848 | $menubox->addOption("link", "Related kills (" . $kill->relatedKillCount() . "/" . $kill->relatedLossCount() . ")", |
---|
849 | "?a=kill_related&kll_id=" . $kill->getID()); |
---|
850 | } |
---|
851 | |
---|
852 | if ($page->isAdmin()) |
---|
853 | { |
---|
854 | $menubox->addOption("caption", "Admin"); |
---|
855 | $menubox->addOption("link", |
---|
856 | "Delete", |
---|
857 | "javascript:openWindow('?a=admin_kill_delete&kll_id=" . $kill->getID() |
---|
858 | . "', null, 420, 300, '' );"); |
---|
859 | |
---|
860 | if (isset($_GET['view']) && $_GET['view'] == 'FixSlot') |
---|
861 | { |
---|
862 | $menubox->addOption("link", "Adjust Values", "?a=kill_detail&kll_id=" . $kill->getID() . ""); |
---|
863 | } |
---|
864 | else |
---|
865 | { |
---|
866 | $menubox->addOption("link", "Fix Slots", "?a=kill_detail&kll_id=" . $kill->getID() . "&view=FixSlot"); |
---|
867 | } |
---|
868 | } |
---|
869 | |
---|
870 | $page->addContext($menubox->generate()); |
---|
871 | |
---|
872 | if (config::get('kill_points')) |
---|
873 | { |
---|
874 | $scorebox=new Box("Points"); |
---|
875 | $scorebox->addOption("points", $kill->getKillPoints()); |
---|
876 | $page->addContext($scorebox->generate()); |
---|
877 | } |
---|
878 | |
---|
879 | // Final Blow/Top Damage Dealer - Begin (Ben Thomas - 17/05/09) |
---|
880 | if ($showbox) { |
---|
881 | $topdamage = $involved; |
---|
882 | |
---|
883 | class FBlowBox |
---|
884 | { |
---|
885 | |
---|
886 | function generate() |
---|
887 | { |
---|
888 | global $smarty; |
---|
889 | return $smarty->fetch('../mods/apoc_fitting/damage_box.tpl'); |
---|
890 | } |
---|
891 | } |
---|
892 | |
---|
893 | function multi_sort(&$array, $key) { |
---|
894 | usort($array,create_function('$a,$b','if ($a["'.$key.'"] == $b["'.$key.'"]) return 0;' .'return ($a["'.$key.'"] > $b["'.$key.'"]) ? -1 : 1;')); |
---|
895 | } |
---|
896 | |
---|
897 | multi_sort($topdamage,"damageDone"); |
---|
898 | $topdamage = array_slice($topdamage, 0, 1); |
---|
899 | $smarty->assign('topdamage', $topdamage); |
---|
900 | |
---|
901 | $finalblow = new FBlowBox(); |
---|
902 | $page->addContext($finalblow->generate()); |
---|
903 | } |
---|
904 | // Final Blow/Top Damage Dealer - End |
---|
905 | |
---|
906 | //Admin is able to see classsified systems |
---|
907 | if ((!$kill->isClassified()) || ($page->isAdmin())) |
---|
908 | { |
---|
909 | if (!$sidemap) { |
---|
910 | $mapbox=new Box("Map"); |
---|
911 | $mapbox->addOption("img", "?a=mapview&sys_id=" . $system->getID() . "&mode=map&size=145"); |
---|
912 | $mapbox->addOption("img", "?a=mapview&sys_id=" . $system->getID() . "&mode=region&size=145"); |
---|
913 | $mapbox->addOption("img", "?a=mapview&sys_id=" . $system->getID() . "&mode=cons&size=145"); |
---|
914 | $page->addContext($mapbox->generate()); |
---|
915 | } |
---|
916 | } |
---|
917 | |
---|
918 | $html.=$smarty->fetch('../mods/apoc_fitting/kill_detail.tpl'); |
---|
919 | |
---|
920 | $html.='</br><hr><!-- <div style="font-size: 10px;"><b><a href="http://eve-id.net/forum/viewtopic.php?f=505&t=14696" style="color: lightgreen;" target="_blank">Apoc Fitting v2.0</a> (2009 - <a href="http://www.btcentral.org.uk/" style="color: lightgreen;" target="_blank">Ben Thomas</a>)</div> -->'; |
---|
921 | |
---|
922 | $page->setContent($html); |
---|
923 | $page->generate(); |
---|
924 | ?> |
---|