Changeset 81
- Timestamp:
- 11/23/06 23:50:29 (16 years ago)
- Location:
- dev/mods/item_values
- Files:
-
- 2 added
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/mods/item_values/kill_detail.php
r70 r81 1 <?php 1 <?php 2 //Version 1.3 of the item_values mod 3 // ChangeLog 4 //Last edit 11/23/2006 5 //Made change to class.ship.php to be pushed to core, rounding ship values is fucking retarded 6 //Using this change added ship value loss and total loss to the ItemValue. Probably need to change this to smarty now but beyond that it is done done done! 7 //Ship value is calculated using the base value in the kb3_ships, this is where the values need to be changed, the settings file will update the database to current 8 //values from eve-central, beware this will take a while and dont do it lots or they will ban your ass. 9 2 10 require_once("common/class.kill.php"); 3 11 require_once("common/class.page.php"); … … 6 14 require_once("common/class.box.php"); 7 15 require_once("common/class.alliance.php"); 16 require_once("common/class.ship.php"); 8 17 require_once("common/globals.php"); 9 18 … … 111 120 if ($config->getConfig('comments')) 112 121 { 113 include('comm ents.php');122 include('common/comments.php'); 114 123 } 115 124 … … 124 133 $html .= "<td class=kb-table-cell><b>Ship:</b></td><td class=kb-table-cell><b>" . $ship->getName() . "</b> (" . $shipclass->getName() . ")</td>"; 125 134 $html .= "</tr>"; 126 // $html .= "<tr class=kb-table-row-odd><td><b>Location:</b></td><td><b>".$sys_name."</b> (".$sys_sec.")</td>";127 135 $system = $kill->getSystem(); 128 136 $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>"; … … 179 187 $html .= "<td width=\"32\"><img src=\"" . IMG_URL . "/" . strtolower(str_replace(' ', '_', $location)) . ".jpg\" alt=\"" . $location . "\" border=\"0\"></a></td>"; 180 188 $html .= "<td class=kb-table-cell colspan=2><b>" . $location . "</b></td>"; 181 $html .= "<td class=kb-table-cell colspan=1 ><b>" . "Value" . "</b></td>";189 $html .= "<td class=kb-table-cell colspan=1 align='center'><b>" . "Value" . "</b></td>"; 182 190 $html .= "</tr>"; 183 191 } … … 193 201 $value = $destroyed->getValue() * $destroyed->getQuantity(); 194 202 $TotalValue = $TotalValue + $value; 195 $value = round($value / 1000000,5) . " M"; 203 204 // Value Manipulation for prettyness. 205 206 if (strlen($value) >1) { // 1000's ? 207 $Formatted = number_format($value,2); 208 $Formatted = $Formatted . " isk"; 209 } 210 211 if (strlen($value) >3) { // 1000's ? 212 $Formatted = round($value / 1000,2); 213 214 $Formatted = number_format($Formatted,2); 215 $Formatted = $Formatted . " K"; 216 } 217 218 if (strlen($value) >6) { // Is this value in the millions? 219 $Formatted = round($value / 1000000,2); 220 $Formatted = number_format($Formatted,2); 221 $Formatted = $Formatted . " M"; 222 } 223 196 224 } 197 225 if($page->isAdmin()) { 198 $html .="<form method=post id=".$value." name=". $value." action= >";226 $html .="<form method=post id=".$value." name=". $value ." action= >"; 199 227 $html .= "<td class=kb-table-cell colspan=1><b>$value</b>"; 200 228 $html .= "<input checked='checked' name='IID' value=" . $item->getID() . " type='hidden'></td>"; // Hidden Item Id Indicator … … 207 235 $html .="</form>"; 208 236 } else { 209 $html .= "<td class=kb-table-cell colspan=1><b>$ value</b>";237 $html .= "<td class=kb-table-cell colspan=1><b>$Formatted</b>"; 210 238 } 211 239 $html .= "</tr>"; … … 214 242 215 243 $html .= "<tr class=kb-table-row-odd>"; 216 $html .= "<td width=\"32\"></td>"; 217 $html .= "<td class=kb-table-cell colspan=2><b>" . "Total Module Loss" . "</b></td>"; 244 //$html .= "<td width=\"32\"></td>"; 245 $html .= "<td class=kb-table-cell colspan=2 align=right><b>" . "Total Module Loss:" . "</b></td>"; 246 218 247 if ($TotalValue > 0) { 219 $TotalValue = $TotalValue / 1000000 . " M"; 248 249 $Formatted = number_format($TotalValue,2); 250 220 251 } 221 $html .= "<td class=kb-table-cell colspan=1><b>" . $TotalValue . "</b>"; 252 //Get Ship Value 253 $qry = new DBQuery(); 254 $qry->execute("SELECT shp_baseprice FROM kb3_ships WHERE shp_id =" . $ship->getID()); 255 $row = $qry->getRow(); 256 $ShipValue = $row['shp_baseprice']; 257 258 259 $TotalLoss = number_format($TotalValue + $ShipValue,2); 260 261 $html .= "<td class=kb-table-cell colspan=2 align=right><b>" . $Formatted . " isk</b>"; 222 262 $html .="</td>"; 263 $html .= "</tr>"; 264 $html .= "<tr class=kb-table-row-odd>"; 265 $html .= "<td class=kb-table-cell colspan=2 align=right><b>" . "Ship Loss:" . "</b></td>"; 266 $html .= "<td class=kb-table-cell colspan=2 align=right><b>" . number_format($ShipValue,2) . " isk</b></td>"; 267 $html .= "</tr>"; 268 $html .= "<tr class=kb-table-row-even>"; 269 $html .= "<td class=kb-table-cell colspan=2 align=right><b>" . "Total Loss:" . "</b></td>"; 270 $html .= "<td class=kb-table-cell colspan=2 align=right><b>" . $TotalLoss . " isk</b></td>"; 223 271 $html .= "</tr>"; 224 272