1 | <?php |
---|
2 | require_once('common/includes/class.kill.php'); |
---|
3 | require_once('common/includes/class.pilot.php'); |
---|
4 | require_once('common/includes/class.corp.php'); |
---|
5 | require_once('common/includes/class.alliance.php'); |
---|
6 | |
---|
7 | $page = new Page('Kill details'); |
---|
8 | $html .= '<link rel="stylesheet" type="text/css" href="mods/ext_fitting/style.css">'; |
---|
9 | |
---|
10 | $smarty->assign('panel_style', config::get('fittingxp_style')); |
---|
11 | $smarty->assign('panel_colour', config::get('fittingxp_colour')); |
---|
12 | $smarty->assign('dropped_colour', config::get('fittingxp_dropped_colour')); |
---|
13 | $smarty->assign('themedir', config::get('fittingxp_themedir')); |
---|
14 | |
---|
15 | if (config::get('item_values')) |
---|
16 | { |
---|
17 | $smarty->assign('item_values', 'true'); |
---|
18 | if ($page->isAdmin()) |
---|
19 | { |
---|
20 | $smarty->assign('admin', 'true'); |
---|
21 | if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') |
---|
22 | { |
---|
23 | // Send new value for item to the database |
---|
24 | $IID = $_POST['IID']; |
---|
25 | $Val = $_POST[$IID]; |
---|
26 | $qry = new DBQuery(); |
---|
27 | $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('".$IID."', '".$Val."') ON DUPLICATE KEY UPDATE price = '".$Val."'"); |
---|
28 | } |
---|
29 | } |
---|
30 | } |
---|
31 | |
---|
32 | if ($page->isAdmin()) |
---|
33 | { |
---|
34 | if (isset($_GET['view']) && $_GET['view']== 'FixSlot') |
---|
35 | { |
---|
36 | $smarty->assign('fixSlot', 'true'); |
---|
37 | } |
---|
38 | |
---|
39 | $smarty->assign('admin', 'true'); |
---|
40 | if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateSlot') |
---|
41 | { |
---|
42 | $IID = $_POST['IID']; |
---|
43 | $KID = $_POST['KID']; |
---|
44 | $Val = $_POST[$IID]; |
---|
45 | $table = $_POST['TYPE']; |
---|
46 | $old = $_POST['OLDSLOT']; |
---|
47 | $qry = new DBQuery(); |
---|
48 | $qry->execute("UPDATE kb3_items_".$table." SET itd_itl_id ='".$Val."' WHERE itd_itm_id=".$IID." AND itd_kll_id = ".$KID." AND itd_itl_id = ".$old); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | if (!$kll_id = intval($_GET['kll_id'])) |
---|
53 | { |
---|
54 | $html = "No kill id specified."; |
---|
55 | $page->setContent($html); |
---|
56 | $page->generate($html); |
---|
57 | exit; |
---|
58 | } |
---|
59 | |
---|
60 | $kill = new Kill($kll_id); |
---|
61 | if (!$kill->exists()) |
---|
62 | { |
---|
63 | $html = "That kill doesn't exist."; |
---|
64 | $page->setContent($html); |
---|
65 | $page->generate($html); |
---|
66 | exit; |
---|
67 | } |
---|
68 | |
---|
69 | // Begin -- Sapyx 25-08-2008 |
---|
70 | |
---|
71 | $qry = new DBQuery(); |
---|
72 | |
---|
73 | //echo ALLIANCE_ID; |
---|
74 | |
---|
75 | if (ALLIANCE_ID <> '0'){ |
---|
76 | $qry -> execute("SELECT all_name FROM kb3_alliances WHERE all_id = " .ALLIANCE_ID) |
---|
77 | or die($qry->getErrorMsg()); |
---|
78 | |
---|
79 | $row = $qry->getRow(); |
---|
80 | $smarty->assign('IsAlly', true); |
---|
81 | $smarty->assign('HomeName', $row['all_name']); |
---|
82 | |
---|
83 | $qry -> execute("SELECT `kb3_corps`.`crp_name` FROM kb3_corps WHERE (kb3_corps.crp_all_id=" .ALLIANCE_ID .")") |
---|
84 | or die($qry->getErrorMsg()); |
---|
85 | |
---|
86 | $rosso=0x70; |
---|
87 | $verde = 0; |
---|
88 | $blu = 0x70; |
---|
89 | while ($row = $qry->getRow()) |
---|
90 | { |
---|
91 | $verde += 10; $blu -= 10; $rosso -=15; |
---|
92 | $corps[$row['crp_name']] = "RGB($rosso,$verde,$blu)"; |
---|
93 | } |
---|
94 | } |
---|
95 | else |
---|
96 | { |
---|
97 | $qry -> execute("SELECT crp_name FROM kb3_corps WHERE crp_id = " .CORP_ID) |
---|
98 | or die($qry->getErrorMsg()); |
---|
99 | |
---|
100 | $row = $qry->getRow(); |
---|
101 | $smarty->assign('IsAlly', false); |
---|
102 | $smarty->assign('HomeName', $row['crp_name']); |
---|
103 | } |
---|
104 | |
---|
105 | // END -- |
---|
106 | |
---|
107 | // victim $smarty->assign('',); |
---|
108 | $smarty->assign('KillId', $kill->getID()); |
---|
109 | $smarty->assign('VictimPortrait', $kill->getVictimPortrait(64)); |
---|
110 | $smarty->assign('VictimURL', "?a=pilot_detail&plt_id=".$kill->getVictimID()); |
---|
111 | $smarty->assign('VictimName', $kill->getVictimName()); |
---|
112 | $smarty->assign('VictimCorpURL', "?a=corp_detail&crp_id=".$kill->getVictimCorpID()); |
---|
113 | $smarty->assign('VictimCorpName', $kill->getVictimCorpName()); |
---|
114 | $smarty->assign('VictimAllianceURL', "?a=alliance_detail&all_id=".$kill->getVictimAllianceID()); |
---|
115 | $smarty->assign('VictimAllianceName', $kill->getVictimAllianceName()); |
---|
116 | $smarty->assign('VictimDamageTaken', $kill->VictimDamageTaken); |
---|
117 | |
---|
118 | $smarty->assign('InvolvedPartyCount', $kill->getInvolvedPartyCount()); // Anne Sapyx 07/05/2008 |
---|
119 | $smarty->assign('AllyCorps',$corps); |
---|
120 | |
---|
121 | // involved |
---|
122 | $i = 1; |
---|
123 | $involved = array(); |
---|
124 | foreach ($kill->involvedparties_ as $inv) |
---|
125 | { |
---|
126 | $pilot = new Pilot($inv->getPilotID()); |
---|
127 | $corp = new Corporation($inv->getCorpID()); |
---|
128 | $alliance = new Alliance($inv->getAllianceID()); |
---|
129 | $ship = $inv->getShip(); |
---|
130 | $weapon = $inv->getWeapon(); |
---|
131 | |
---|
132 | $involved[$i]['shipImage'] = $ship->getImage(64); |
---|
133 | $involved[$i]['PilotURL'] = "?a=pilot_detail&plt_id=".$pilot->getID(); |
---|
134 | $involved[$i]['PilotName'] = $pilot->getName(); |
---|
135 | $involved[$i]['CorpURL'] = "?a=corp_detail&crp_id=".$corp->getID(); |
---|
136 | $involved[$i]['CorpName'] = $corp->getName(); |
---|
137 | $involved[$i]['AlliURL'] = "?a=alliance_detail&all_id=".$alliance->getID(); |
---|
138 | $involved[$i]['AlliName'] = $alliance->getName(); |
---|
139 | $involved[$i]['ShipName'] = $ship->getName(); |
---|
140 | $involved[$i]['ShipID'] = $ship->externalid_; |
---|
141 | $involved[$i]['damageDone'] = $inv->dmgdone_; |
---|
142 | $shipclass = $ship->getClass(); |
---|
143 | |
---|
144 | $involved[$i]['shipClass'] = $shipclass->getName(); |
---|
145 | |
---|
146 | if ($pilot->getID() == $kill->getFBPilotID()) |
---|
147 | { |
---|
148 | $involved[$i]['FB'] = "true"; |
---|
149 | } |
---|
150 | else |
---|
151 | { |
---|
152 | $involved[$i]['FB'] = "false"; |
---|
153 | } |
---|
154 | |
---|
155 | if ($corp->isNPCCorp()) |
---|
156 | { |
---|
157 | $involved[$i]['portrait'] = $corp->getPortraitURL(64); |
---|
158 | } |
---|
159 | else |
---|
160 | { |
---|
161 | $involved[$i]['portrait'] = $pilot->getPortraitURL(64); |
---|
162 | } |
---|
163 | |
---|
164 | if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) |
---|
165 | { |
---|
166 | $involved[$i]['weaponName'] = $weapon->getName(); |
---|
167 | $involved[$i]['weaponID'] = $weapon->row_['itm_externalid']; |
---|
168 | } |
---|
169 | else |
---|
170 | $involved[$i]['weaponName'] = "Unknown"; |
---|
171 | |
---|
172 | // Begin -- Sapyx 25-06-2008 |
---|
173 | $InvAllies[$involved[$i]['AlliName']]["quantity"] += 1; |
---|
174 | $InvAllies[$involved[$i]['AlliName']]["corps"][$involved[$i]['CorpName']] += 1; |
---|
175 | $InvShips[$involved[$i]['ShipName'] ." (" .$involved[$i]['shipClass'] .")"] += 1; |
---|
176 | // End -- Sapyx 25-06-2008 |
---|
177 | |
---|
178 | ++$i; |
---|
179 | } |
---|
180 | $smarty->assign_by_ref('involved', $involved); |
---|
181 | $smarty->assign_by_ref('AlliesCount', count($InvAllies)); |
---|
182 | $smarty->assign_by_ref('InvAllies', $InvAllies); |
---|
183 | $smarty->assign_by_ref('InvShips', $InvShips); |
---|
184 | |
---|
185 | |
---|
186 | if (config::get('comments')) |
---|
187 | { |
---|
188 | include('common/comments.php'); |
---|
189 | $smarty->assign('comments', $comment); |
---|
190 | } |
---|
191 | // ship, ship details |
---|
192 | $ship = $kill->getVictimShip(); |
---|
193 | $shipclass = $ship->getClass(); |
---|
194 | $system = $kill->getSystem(); |
---|
195 | |
---|
196 | $smarty->assign('VictimShip', $kill->getVictimShip()); |
---|
197 | $smarty->assign('ShipClass', $ship->getClass()); |
---|
198 | $smarty->assign('ShipImage', $ship->getImage(64)); |
---|
199 | $smarty->assign('ShipName', $ship->getName()); |
---|
200 | $smarty->assign('ShipID', $ship->externalid_); |
---|
201 | $smarty->assign('ClassName', $shipclass->getName()); |
---|
202 | |
---|
203 | include_once('common/includes/class.dogma.php'); |
---|
204 | |
---|
205 | $ssc = new dogma($ship->externalid_); |
---|
206 | |
---|
207 | $smarty->assign_by_ref('ssc', $ssc); |
---|
208 | |
---|
209 | if ($kill->isClassified()) |
---|
210 | { |
---|
211 | //Admin is able to see classified Systems |
---|
212 | if ($page->isAdmin()) |
---|
213 | { |
---|
214 | $smarty->assign('System', $system->getName().' (Classified)'); |
---|
215 | $smarty->assign('SystemURL', "?a=system_detail&sys_id=".$system->getID()); |
---|
216 | $smarty->assign('SystemSecurity', $system->getSecurity(true)); |
---|
217 | } |
---|
218 | else |
---|
219 | { |
---|
220 | $smarty->assign('System', 'Classified'); |
---|
221 | $smarty->assign('SystemURL', ""); |
---|
222 | $smarty->assign('SystemSecurity', '0.0'); |
---|
223 | } |
---|
224 | } |
---|
225 | else |
---|
226 | { |
---|
227 | $smarty->assign('System', $system->getName()); |
---|
228 | $smarty->assign('SystemURL', "?a=system_detail&sys_id=".$system->getID()); |
---|
229 | $smarty->assign('SystemSecurity', $system->getSecurity(true)); |
---|
230 | } |
---|
231 | $smarty->assign('TimeStamp', $kill->getTimeStamp()); |
---|
232 | $smarty->assign('VictimShipImg', $ship->getImage(64)); |
---|
233 | |
---|
234 | // preparing slot layout |
---|
235 | |
---|
236 | $slot_array = array(); |
---|
237 | $slot_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); |
---|
238 | $slot_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); |
---|
239 | $slot_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); |
---|
240 | $slot_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); |
---|
241 | $slot_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); |
---|
242 | $slot_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); |
---|
243 | |
---|
244 | // ship fitting |
---|
245 | if (count($kill->destroyeditems_) > 0) |
---|
246 | { |
---|
247 | $dest_array = array(); |
---|
248 | foreach($kill->destroyeditems_ as $destroyed) |
---|
249 | { |
---|
250 | $item = $destroyed->getItem(); |
---|
251 | $i_qty = $destroyed->getQuantity(); |
---|
252 | if (config::get('item_values')) |
---|
253 | { |
---|
254 | $value = $destroyed->getValue(); |
---|
255 | $TotalValue += $value*$i_qty; |
---|
256 | $formatted = $destroyed->getFormattedValue(); |
---|
257 | } |
---|
258 | $i_name = $item->getName(); |
---|
259 | $i_location = $destroyed->getLocationID(); |
---|
260 | $i_id = $item->getID(); |
---|
261 | $i_usedgroup = $item->get_used_launcher_group($i_name); |
---|
262 | $dest_array[$i_location][] = array('Icon' => $item->getIcon(32), 'Name' => $i_name, 'Quantity' => $i_qty, 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $i_id,'slotID' => $i_location); |
---|
263 | |
---|
264 | //Fitting, KE - add destroyed items to an array of all fitted items. |
---|
265 | if(($i_location != 4) && ($i_location != 5) && ($i_location != 6)) |
---|
266 | { |
---|
267 | if(($i_usedgroup != 0)) |
---|
268 | { |
---|
269 | if ($i_location == 1) |
---|
270 | { |
---|
271 | $i_ammo=$item->get_ammo_size($i_name); |
---|
272 | if ($i_usedgroup == 481) { $i_ammo = 0; } |
---|
273 | } |
---|
274 | else |
---|
275 | { |
---|
276 | $i_ammo = 0; |
---|
277 | } |
---|
278 | $ammo_array[$i_location][]=array('Name'=>$i_name, 'Icon' => $item->getIcon(24), 'itemID' => $i_id, 'usedgroupID' => $i_usedgroup, 'size' => $i_ammo); |
---|
279 | } else |
---|
280 | { |
---|
281 | for ($count = 0; $count < $i_qty; $count++) |
---|
282 | { |
---|
283 | if ($i_location == 1) |
---|
284 | { |
---|
285 | $i_charge=$item->get_used_charge_size($i_name); |
---|
286 | } |
---|
287 | else |
---|
288 | { |
---|
289 | $i_charge = 0; |
---|
290 | } |
---|
291 | $fitting_array[$i_location][]=array('Name'=>$i_name, 'Icon' => $item->getIcon(48), 'itemID' => $i_id, 'groupID' => $item->get_group_id($i_name), 'chargeSize' => $i_charge); |
---|
292 | } |
---|
293 | } |
---|
294 | } else if(($destroyed->getLocationID() == 5)) |
---|
295 | { |
---|
296 | for ($count = 0; $count < $i_qty; $count++) |
---|
297 | { |
---|
298 | $fitting_array[$i_location][]=array('Name'=>$i_name, 'Icon' => $item->getIcon(32), 'itemID' => $i_id); |
---|
299 | } |
---|
300 | } |
---|
301 | //fitting thing end |
---|
302 | } |
---|
303 | } |
---|
304 | |
---|
305 | if (count($kill->droppeditems_) > 0) |
---|
306 | { |
---|
307 | $drop_array = array(); |
---|
308 | foreach($kill->droppeditems_ as $dropped) |
---|
309 | { |
---|
310 | $item = $dropped->getItem(); |
---|
311 | $i_qty = $dropped->getQuantity(); |
---|
312 | if (config::get('item_values')) |
---|
313 | { |
---|
314 | $value = $dropped->getValue(); |
---|
315 | $dropvalue += $value*$i_qty; |
---|
316 | $formatted = $dropped->getFormattedValue(); |
---|
317 | } |
---|
318 | $i_name = $item->getName(); |
---|
319 | $i_location = $dropped->getLocationID(); |
---|
320 | $i_id = $item->getID(); |
---|
321 | $i_usedgroup = $item->get_used_launcher_group($i_name); |
---|
322 | $drop_array[$i_location][] = array('Icon' => $item->getIcon(32), 'Name' => $i_name, 'Quantity' => $i_qty, 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $i_id,'slotID' => $i_location); |
---|
323 | |
---|
324 | //Fitting -KE, add dropped items to the list |
---|
325 | if(($i_location != 4) && ($i_location != 6)) |
---|
326 | { |
---|
327 | if(($i_usedgroup != 0)) |
---|
328 | { |
---|
329 | if ($i_location == 1) |
---|
330 | { |
---|
331 | $i_ammo=$item->get_ammo_size($i_name); |
---|
332 | if ($i_usedgroup == 481) { $i_ammo = 0; } |
---|
333 | } |
---|
334 | else |
---|
335 | { |
---|
336 | $i_ammo = 0; |
---|
337 | } |
---|
338 | $ammo_array[$i_location][]=array('Name'=>$i_name, 'Icon' => $item->getIcon(24), 'itemID' => $i_id, 'usedgroupID' => $i_usedgroup, 'size' => $i_ammo); |
---|
339 | } else |
---|
340 | { |
---|
341 | for ($count = 0; $count < $i_qty; $count++) |
---|
342 | { |
---|
343 | if ($i_location == 1) |
---|
344 | { |
---|
345 | $i_charge=$item->get_used_charge_size($i_name); |
---|
346 | } |
---|
347 | else |
---|
348 | { |
---|
349 | $i_charge = 0; |
---|
350 | } |
---|
351 | $fitting_array[$i_location][]=array('Name'=>$i_name, 'Icon' => $item->getIcon(48), 'itemID' => $i_id, 'groupID' => $item->get_group_id($i_name), 'chargeSize' => $i_charge); |
---|
352 | } |
---|
353 | } |
---|
354 | } |
---|
355 | //fitting thing end |
---|
356 | |
---|
357 | |
---|
358 | } |
---|
359 | } |
---|
360 | |
---|
361 | //Fitting - KE, sort the fitted items into groupID order, so that several of the same item apear next to each other. |
---|
362 | if(is_array($fitting_array[1])) |
---|
363 | { |
---|
364 | foreach ($fitting_array[1] as $array_rowh) |
---|
365 | { |
---|
366 | $sort_by_nameh["groupID"][] = $array_rowh["groupID"]; |
---|
367 | } |
---|
368 | array_multisort($sort_by_nameh["groupID"],SORT_ASC,$fitting_array[1]); |
---|
369 | } |
---|
370 | |
---|
371 | if(is_array($fitting_array[2])) |
---|
372 | { |
---|
373 | foreach ($fitting_array[2] as $array_rowm) |
---|
374 | { |
---|
375 | $sort_by_namem["groupID"][] = $array_rowm["groupID"]; |
---|
376 | } |
---|
377 | array_multisort($sort_by_namem["groupID"],SORT_ASC,$fitting_array[2]); |
---|
378 | } |
---|
379 | |
---|
380 | if(is_array($fitting_array[3])) |
---|
381 | { |
---|
382 | foreach ($fitting_array[3] as $array_rowl) |
---|
383 | { |
---|
384 | $sort_by_namel["groupID"][] = $array_rowl["Name"]; |
---|
385 | } |
---|
386 | array_multisort($sort_by_namel["groupID"],SORT_ASC,$fitting_array[3]); |
---|
387 | } |
---|
388 | |
---|
389 | if(is_array($fitting_array[5])) |
---|
390 | { |
---|
391 | foreach ($fitting_array[5] as $array_rowr) |
---|
392 | { |
---|
393 | $sort_by_namer["Name"][] = $array_rowr["Name"]; |
---|
394 | } |
---|
395 | array_multisort($sort_by_namer["Name"],SORT_ASC,$fitting_array[5]); |
---|
396 | } |
---|
397 | |
---|
398 | //Fitting - KE, sort the fitted items into name order, so that several of the same item apear next to each other. -end |
---|
399 | |
---|
400 | $lenght = count($ammo_array[1]); |
---|
401 | $temp = array(); |
---|
402 | if(is_array($fitting_array[1])) |
---|
403 | { |
---|
404 | $hiammo = array(); |
---|
405 | foreach ($fitting_array[1] as $highfit) |
---|
406 | { |
---|
407 | $group = $highfit["groupID"]; |
---|
408 | $size = $highfit["chargeSize"]; |
---|
409 | if($group == 483 // Modulated Deep Core Miner II, Modulated Strip Miner II and Modulated Deep Core Strip Miner II |
---|
410 | || $group == 53 // Laser Turrets |
---|
411 | || $group == 55 // Projectile Turrets |
---|
412 | || $group == 74 // Hybrid Turrets |
---|
413 | || ($group >= 506 && $group <= 511) // Some Missile Lauchers |
---|
414 | || $group == 481 // Probe Launchers |
---|
415 | || $group == 899 // Warp Disruption Field Generator I |
---|
416 | || $group == 771 // Heavy Assault Missile Launchers |
---|
417 | || $group == 589 // Interdiction Sphere Lauchers |
---|
418 | || $group == 524 // Citadel Torpedo Launchers |
---|
419 | ) |
---|
420 | { |
---|
421 | $found = 0; |
---|
422 | if ($group == 511) { $group = 509; } // Assault Missile Lauchers uses same ammo as Standard Missile Lauchers |
---|
423 | if(is_array($ammo_array[1])) |
---|
424 | { |
---|
425 | $i = 0; |
---|
426 | while (!($found) && $i<$lenght) |
---|
427 | { |
---|
428 | $temp = array_shift($ammo_array[1]); |
---|
429 | if (($temp["usedgroupID"] == $group) && ($temp["size"] == $size)) |
---|
430 | { |
---|
431 | $hiammo[]=array('show'=>$smarty->fetch(get_tpl('ammo')), 'type'=>$temp["Icon"]); |
---|
432 | $found = 1; |
---|
433 | } |
---|
434 | array_push($ammo_array[1],$temp); |
---|
435 | $i++; |
---|
436 | } |
---|
437 | } |
---|
438 | if (!($found)) |
---|
439 | { |
---|
440 | $hiammo[]=array('show'=>$smarty->fetch(get_tpl('ammo')), 'type'=>$smarty->fetch(get_tpl('noicon'))); |
---|
441 | } |
---|
442 | } else { |
---|
443 | $hiammo[]=array('show'=>$smarty->fetch(get_tpl('blank')), 'type'=>$smarty->fetch(get_tpl('blank'))); |
---|
444 | } |
---|
445 | } |
---|
446 | } |
---|
447 | |
---|
448 | $lenght = count($ammo_array[2]); |
---|
449 | if(is_array($fitting_array[2])) |
---|
450 | { |
---|
451 | $midammo = array(); |
---|
452 | foreach ($fitting_array[2] as $midfit) |
---|
453 | { |
---|
454 | $group = $midfit["groupID"]; |
---|
455 | if($group == 76 // Capacitor Boosters |
---|
456 | || $group == 208 // Remote Sensor Dampeners |
---|
457 | || $group == 212 // Sensor Boosters |
---|
458 | || $group == 291 // Tracking Disruptors |
---|
459 | || $group == 213 // Tracking Computers |
---|
460 | || $group == 209 // Tracking Links |
---|
461 | || $group == 290 // Remote Sensor Boosters |
---|
462 | ) |
---|
463 | { |
---|
464 | $found = 0; |
---|
465 | if(is_array($ammo_array[2])) |
---|
466 | { |
---|
467 | $i = 0; |
---|
468 | while (!($found) && $i<$lenght) |
---|
469 | { |
---|
470 | $temp = array_shift($ammo_array[2]); |
---|
471 | if ($temp["usedgroupID"] == $group) |
---|
472 | { |
---|
473 | $midammo[]=array('show'=>$smarty->fetch(get_tpl('ammo')), 'type'=>$temp["Icon"]); |
---|
474 | $found = 1; |
---|
475 | } |
---|
476 | array_push($ammo_array[2],$temp); |
---|
477 | $i++; |
---|
478 | } |
---|
479 | } |
---|
480 | if (!($found)) |
---|
481 | { |
---|
482 | $midammo[]=array('show'=>$smarty->fetch(get_tpl('ammo')), 'type'=>$smarty->fetch(get_tpl('noicon'))); |
---|
483 | } |
---|
484 | } else { |
---|
485 | $midammo[]=array('show'=>$smarty->fetch(get_tpl('blank')), 'type'=>$smarty->fetch(get_tpl('blank'))); |
---|
486 | } |
---|
487 | } |
---|
488 | } |
---|
489 | |
---|
490 | |
---|
491 | if ($TotalValue >= 0) |
---|
492 | { |
---|
493 | $Formatted = number_format($TotalValue, 2); |
---|
494 | } |
---|
495 | |
---|
496 | // Get Ship Value |
---|
497 | $ShipValue = $ship->getPrice(); |
---|
498 | if (config::get('kd_droptototal')) |
---|
499 | { |
---|
500 | $TotalValue += $dropvalue; |
---|
501 | } |
---|
502 | $TotalLoss = number_format($TotalValue + $ShipValue, 2); |
---|
503 | $ShipValue = number_format($ShipValue, 2); |
---|
504 | $dropvalue = number_format($dropvalue, 2); |
---|
505 | |
---|
506 | $smarty->assign_by_ref('destroyed', $dest_array); |
---|
507 | $smarty->assign_by_ref('dropped', $drop_array); |
---|
508 | $smarty->assign_by_ref('slots', $slot_array); |
---|
509 | $smarty->assign_by_ref('fitting_high', $fitting_array[1]); |
---|
510 | $smarty->assign_by_ref('fitting_med', $fitting_array[2]); |
---|
511 | $smarty->assign_by_ref('fitting_low', $fitting_array[3]); |
---|
512 | $smarty->assign_by_ref('fitting_rig', $fitting_array[5]); |
---|
513 | $smarty->assign_by_ref('fitting_ammo_high', $hiammo); |
---|
514 | $smarty->assign_by_ref('fitting_ammo_mid', $midammo); |
---|
515 | $smarty->assign('ItemValue', $Formatted); |
---|
516 | $smarty->assign('DropValue', $dropvalue); |
---|
517 | $smarty->assign('ShipValue', $ShipValue); |
---|
518 | $smarty->assign('TotalLoss', $TotalLoss); |
---|
519 | |
---|
520 | $hicount = count($fitting_array[1]); |
---|
521 | $medcount = count($fitting_array[2]); |
---|
522 | $lowcount = count($fitting_array[3]); |
---|
523 | |
---|
524 | $smarty->assign('hic', $hicount); |
---|
525 | $smarty->assign('medc', $medcount); |
---|
526 | $smarty->assign('lowc', $lowcount); |
---|
527 | |
---|
528 | $menubox = new Box("Menu"); |
---|
529 | $menubox->setIcon("menu-item.gif"); |
---|
530 | $menubox->addOption("caption", "View"); |
---|
531 | $menubox->addOption("link", "Killmail", "javascript:sndReq('index.php?a=kill_mail&kll_id=".$kill->getID()."');ReverseContentDisplay('popup')"); |
---|
532 | $menubox->addOption("link", "EFT Fitting", "javascript:sndReq('index.php?a=eft_fitting&kll_id=".$kill->getID()."');ReverseContentDisplay('popup')"); |
---|
533 | if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1) |
---|
534 | { |
---|
535 | $menubox->addOption("link", "Related kills (".$kill->relatedKillCount()."/".$kill->relatedLossCount().")", "?a=kill_related&kll_id=".$kill->getID()); |
---|
536 | } |
---|
537 | if ($page->isAdmin()) |
---|
538 | { |
---|
539 | $menubox->addOption("caption", "Admin"); |
---|
540 | $menubox->addOption("link", "Delete", "javascript:openWindow('?a=admin_kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); |
---|
541 | if (isset($_GET['view']) && $_GET['view'] == 'FixSlot') |
---|
542 | { |
---|
543 | $menubox->addOption("link", "Adjust Values", "?a=kill_detail&kll_id=".$kill->getID().""); |
---|
544 | } |
---|
545 | else |
---|
546 | { |
---|
547 | $menubox->addOption("link", "Fix Slots", "?a=kill_detail&kll_id=".$kill->getID()."&view=FixSlot"); |
---|
548 | } |
---|
549 | } |
---|
550 | $page->addContext($menubox->generate()); |
---|
551 | |
---|
552 | if (config::get('kill_points')) |
---|
553 | { |
---|
554 | $scorebox = new Box("Points"); |
---|
555 | $scorebox->addOption("points", $kill->getKillPoints()); |
---|
556 | $page->addContext($scorebox->generate()); |
---|
557 | } |
---|
558 | |
---|
559 | //Admin is able to see classsiefied systems |
---|
560 | if ((!$kill->isClassified()) || ($page->isAdmin())) |
---|
561 | { |
---|
562 | $mapbox = new Box("Map"); |
---|
563 | $mapbox->addOption("img", "?a=mapview&sys_id=".$system->getID()."&mode=map&size=145"); |
---|
564 | $mapbox->addOption("img", "?a=mapview&sys_id=".$system->getID()."&mode=region&size=145"); |
---|
565 | $mapbox->addOption("img", "?a=mapview&sys_id=".$system->getID()."&mode=cons&size=145"); |
---|
566 | $page->addContext($mapbox->generate()); |
---|
567 | } |
---|
568 | |
---|
569 | |
---|
570 | $html .= $smarty->fetch('../mods/ext_fitting/kill_detail.tpl'); |
---|
571 | |
---|
572 | $html.='</br><hr><b>EXtended Fitting MOD v. 0.91 (2008 - Anne Sapyx)<b/></br>'; |
---|
573 | $page->setContent($html); |
---|
574 | $page->generate(); |
---|
575 | ?> |
---|