Changeset 112
- Timestamp:
- 11/29/06 16:32:21 (16 years ago)
- Location:
- dev/common
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin.php
r89 r112 39 39 $config->checkCheckbox('comments_pw'); 40 40 $config->checkCheckbox('comments_count'); 41 41 $config->checkCheckbox('item_values'); 42 42 $config->setPostPassword($_POST['post_password']); 43 43 $config->setPostMailto($_POST['post_mailto']); … … 147 147 $html .= "></td></tr>"; 148 148 149 $html .= "<tr><td width=120><b>Enable Lost Item Values</b></td><td><input type=checkbox name=item_values id=item_values"; 150 if ($config->getConfig('item_values')) 151 { 152 $html .= " checked=\"checked\""; 153 } 154 $html .= "></td></tr>"; 155 $html .= "<tr><td width=120><b>Use custom shipvalues:</b></td><td><input type=checkbox name=ship_values id=ship_values"; 156 if ($config->getConfig('ship_values')) 157 { 158 $html .= " checked=\"checked\""; 159 } 160 $html .= "></td></tr>"; 149 161 // $html .= "<tr><td width=120><b>Display least active:</b></td><td><input type=checkbox name=least_active id=least_active"; 150 162 // if ( $config->getLeastActive() ) -
dev/common/kill_detail.php
r104 r112 5 5 require_once("class.corp.php"); 6 6 require_once("class.box.php"); 7 require_once("class.box.test.php"); 7 8 require_once("class.alliance.php"); 8 9 require_once("globals.php"); 9 10 $page = new Page("Kill details"); 10 global $config, $smarty; 11 12 13 $page = new Page("Kill details"); 14 if ($config->getConfig('item_values')) 15 { 16 $smarty->assign('item_values',"true"); 17 if($page->isAdmin()) { 18 $smarty->assign('admin',"true"); 19 if (isset($_POST['submit'])) { 20 // Send new value for item to the database 21 $IID = $_POST['IID']; 22 $Val = $_POST[$IID]; 23 //echo "UPDATE kb3_items SET itm_value ='" . $Val . "' WHERE itm_id='" . $IID . "'"; 24 $qry = new DBQuery(); 25 $qry->execute("UPDATE kb3_items SET itm_value ='" . $Val . "' WHERE itm_id='" . $IID . "'") or die($qry->getErrorMsg()); 26 27 } 28 } 29 } 30 31 11 32 12 33 if (!$kll_id = intval($_GET['kll_id'])) … … 26 47 } 27 48 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>"; 49 // victim $smarty->assign('',); 50 $smarty->assign('VictimPortrait',$kill->getVictimPortrait(64)); 51 $smarty->assign('VictimURL',"?a=pilot_detail&plt_id=".$kill->getVictimID()); 52 $smarty->assign('VictimName',$kill->getVictimName()); 53 $smarty->assign('VictimCorpURL',"?a=corp_detail&crp_id=".$kill->getVictimCorpID()); 54 $smarty->assign('VictimCorpName',$kill->getVictimCorpName()); 55 $smarty->assign('VictimAllianceURL',"?a=alliance_detail&all_id=".$kill->getVictimAllianceID()); 56 $smarty->assign('VictimAllianceName',$kill->getVictimAllianceName()); 57 42 58 43 59 // 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; 60 $i=1; 61 $involved = array(); 47 62 foreach ($kill->involvedparties_ as $inv) 48 63 { … … 53 68 $weapon = $inv->getWeapon(); 54 69 55 if ($odd) 56 { 57 $odd = false; 58 $rowclass = "kb-table-row-even"; 70 $involved[$i]['shipImage'] = $ship->getImage(64); 71 $involved[$i]['PilotURL'] = "?a=pilot_detail&plt_id=".$pilot->getID(); 72 $involved[$i]['PilotName'] = $pilot->getName(); 73 $involved[$i]['CorpURL'] = "?a=corp_detail&crp_id=".$corp->getID(); 74 $involved[$i]['CorpName'] = $corp->getName(); 75 $involved[$i]['AlliURL'] = "?a=alliance_detail&all_id=".$alliance->getID(); 76 $involved[$i]['AlliName'] = $alliance->getName(); 77 $involved[$i]['ShipName'] = $ship->getName(); 78 79 if ($pilot->getID() == $kill->getFBPilotID()) 80 { 81 $involved[$i]['FB'] = "true"; 59 82 } 60 83 else 61 84 { 62 $odd = true; 63 $rowclass = "kb-table-row-odd"; 64 } 65 66 if ($pilot->getID() == $kill->getFBPilotID()) 67 { 68 $imgclass = "class=finalblow "; 85 $involved[$i]['FB'] = "false"; 86 } 87 88 if ($corp->isNPCCorp()) 89 { 90 $involved[$i]['portrait'] = $corp->getPortraitURL(64); 69 91 } 70 92 else 71 93 { 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 } 94 $involved[$i]['portrait'] = $pilot->getPortraitURL(64); 95 } 96 97 if ($weapon->getName() != "Unknown" && $weapon->getName() != $ship->getName()) 98 $involved[$i]['weaponName'] = $weapon->getName(); 80 99 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>"; 100 $involved[$i]['weaponName'] = "Unknown"; 101 ++$i; 102 } 103 $smarty->assign('involved',$involved); 98 104 99 105 if ($config->getConfig('comments')) 100 106 { 101 include('comments.php'); 102 } 103 104 $html .= "</td><td width=50> </td>"; 107 include('comments.php'); 108 $smarty->assign('comments',"true"); 109 } 110 111 105 112 // ship, ship details 106 $html .= "<td align=left valign=top width=360>";107 108 $html .= "<table class=kb-table width=360 cellspacing=\"1\">";109 113 $ship = $kill->getVictimShip(); 110 114 $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 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>"; 116 117 $smarty->assign('VictimShip',$kill->getVictimShip()); 118 $smarty->assign('ShipClass',$ship->getClass()); 119 $smarty->assign('ShipImage',$ship->getImage(64)); 120 $smarty->assign('ShipName',$ship->getName()); 121 $smarty->assign('ClassName',$shipclass->getName()); 122 $smarty->assign('System',$system->getName()); 123 $smarty->assign('SystemURL',"?a=system_detail&sys_id=".$system->getID()); 124 $smarty->assign('SystemSecurity',$system->getSecurity(true)); 125 $smarty->assign('TimeStamp',$kill->getTimeStamp()); 126 $smarty->assign('VictimShipImg',$ship->getImage(64)); 127 122 128 123 129 // ship fitting 124 130 if (count($kill->destroyeditems_) > 0) 125 131 { 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) 132 $cargo = array(); 133 $drone = array(); 134 $high_slot = array(); 135 $mid_slot = array(); 136 $low_slot = array(); 137 138 foreach($kill->destroyeditems_ as $destroyed) 130 139 { 131 140 $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 } 187 else 188 $html .= "<div class=block-header>No ship details</div>"; 189 190 $html .= "</td></tr></table>"; 191 192 $menubox = new box("Menu"); 193 $menubox->setIcon("menu-item.gif"); 194 $menubox->addOption("Caption","View"); 195 $menubox->addOption("link","Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=".$kill->getID()."', null, 355, 430, '' );"); 196 if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1) 197 { 198 $menubox->addOption("link","Related kills (".$kill->relatedKillCount()."/".$kill->relatedLossCount().")", "?a=kill_related&kll_id=".$kill->getID()); 199 } 200 if ($page->isAdmin()) 201 { 202 $menubox->addOption("caption","Admin"); 203 $menubox->addOption("link","Delete", "javascript:openWindow('?a=kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); 204 } 205 $page->addContext($menubox->generate()); 206 207 if ($config->getKillPoints()) 208 { 209 $scorebox = new Box("Points awarded"); 210 $scorebox->addOption("points",$kill->getKillPoints()); 211 $page->addContext($scorebox->generate()); 212 } 213 214 $mapbox = new Box("Map"); 215 $mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=map&size=145"); 216 $mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=region&size=145"); 217 $mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=cons&size=145"); 218 219 $page->addContext($mapbox->generate()); 220 141 if ($config->getConfig('item_values')) 142 { 143 144 $value = $destroyed->getValue(); 145 $value_single = $value; 146 if ($value > 0) 147 { 148 $value = $destroyed->getValue() * $destroyed->getQuantity(); 149 $TotalValue = $TotalValue + $value; 150 151 // Value Manipulation for prettyness. 152 153 if (strlen($value) >1) { // 1000's ? 154 $Formatted = number_format($value,2); 155 $Formatted = $Formatted . " isk"; 156 } 157 158 if (strlen($value) >3) { // 1000's ? 159 $Formatted = round($value / 1000,2); 160 161 $Formatted = number_format($Formatted,2); 162 $Formatted = $Formatted . " K"; 163 } 164 165 if (strlen($value) >6) { // Is this value in the millions? 166 $Formatted = round($value / 1000000,2); 167 $Formatted = number_format($Formatted,2); 168 $Formatted = $Formatted . " M"; 169 } 170 } 171 else 172 { 173 $value = 0; 174 $Formatted = "0 isk"; 175 } 176 } 177 $dest_array[$destroyed->getLocationID()][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value'=>$Formatted,'single_unit'=>$value_single,'itemID'=>$item->getID() ); 178 179 } 180 181 } 182 183 /* 184 echo count($mid_slot); 185 print_r($low_slot); 186 print_r($dest_array['1']);*/ 187 188 189 if ($TotalValue > 0) 190 { 191 $Formatted = number_format($TotalValue,2); 192 } 193 //Get Ship Value 194 $ShipValue = $ship->getPrice(); 195 196 $TotalLoss = number_format($TotalValue + $ShipValue,2); 197 $ShipValue = number_format($ShipValue,2); 198 199 $smarty->assign('high_slot',$dest_array['1']); 200 $smarty->assign('mid_slot',$dest_array['2']); 201 $smarty->assign('low_slot',$dest_array['3']); 202 $smarty->assign('cargo',$dest_array['4']); 203 $smarty->assign('drone',$dest_array['5']); 204 $smarty->assign('ItemValue',$Formatted); 205 $smarty->assign('ShipValue',$ShipValue); 206 $smarty->assign('TotalLoss',$TotalLoss); 207 208 209 $menubox = new box("Menu"); 210 $menubox->setIcon("menu-item.gif"); 211 $menubox->addOption("caption","View"); 212 $menubox->addOption("link","Killmail", "javascript:openWindow( '?a=kill_mail&kll_id=".$kill->getID()."', null, 355, 430, '' );"); 213 if ($kill->relatedKillCount() > 1 || $kill->relatedLossCount() > 1) 214 { 215 $menubox->addOption("link","Related kills (".$kill->relatedKillCount()."/".$kill->relatedLossCount().")", "?a=kill_related&kll_id=".$kill->getID()); 216 } 217 if ($page->isAdmin()) 218 { 219 $menubox->addOption("caption","Admin"); 220 $menubox->addOption("link","Delete", "javascript:openWindow('?a=kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); 221 } 222 $page->addContext($menubox->generate()); 223 224 225 if ($config->getKillPoints()) 226 { 227 $scorebox = new Box("Points"); 228 $scorebox->addOption("points",$kill->getKillPoints()); 229 $page->addContext($scorebox->generate()); 230 } 231 232 233 $mapbox = new Box("Map"); 234 $mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=map&size=145"); 235 $mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=region&size=145"); 236 $mapbox->addOption("img","?a=mapview&sys_id=".$system->getID()."&mode=cons&size=145"); 237 $page->addContext($mapbox->generate()); 238 239 240 $html = $smarty->fetch('kill_detail.tpl'); 221 241 $page->setContent($html); 222 242 $page->generate();