root/dev/common/kill_detail.php @ 92

Revision 92, 9.6 KB (checked in by exi, 16 years ago)

Updated about page for 1.2.
Made table bgcolor black for alliance images.
Made table bgcolor black for corp images.
The parser now reparsers dupes and deletes comments on killmail deletion.
Changed parser to output some error messages if he doesn't like the mail.
Added conversion code for those funny german mailheader.
Fixed bugs #3 and #4.
Included a fix from Coni to class.ship.php.
Removed the error for unknown solar systems, this is now covered by the parser itself.
Now ordering comments by date.
Fixed db.php:getRow to return false in case of a non valid mysql resource id.
Added the sql killmail limit for home.php.
Added default width/heigth for pictures in kill details.
The searchpage will now redirect you to your hit if it only gets one serach result.

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