Changeset 459
- Timestamp:
- 10/06/09 09:36:59 (13 years ago)
- Location:
- dev/common
- Files:
-
- 2 removed
- 13 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/alliance_detail.php
r448 r459 9 9 $all_id = intval($_GET['all_id']); 10 10 $all_external_id = intval($_GET['all_external_id']); 11 $scl_id = intval($_GET['scl_id']); 12 11 13 if (!$all_id && !$all_external_id) 12 14 { 13 14 15 16 17 18 19 20 21 15 if (ALLIANCE_ID) 16 { 17 $all_id = ALLIANCE_ID; 18 } 19 else 20 { 21 echo 'no valid alliance id specified<br/>'; 22 return; 23 } 22 24 } 23 25 … … 33 35 } 34 36 35 $month = $_GET['m'];36 $year = $_GET['y'];37 38 if ( $month == '')39 40 41 if ( $year == '')42 37 $month = intval($_GET['m']); 38 $year = intval($_GET['y']); 39 40 if (!$month) 41 $month = kbdate('m'); 42 43 if (!$year) 44 $year = kbdate('Y'); 43 45 44 46 if ($month == 12) 45 47 { 46 47 48 $nmonth = 1; 49 $nyear = $year + 1; 48 50 } 49 51 else 50 52 { 51 52 53 $nmonth = $month + 1; 54 $nyear = $year; 53 55 } 54 56 if ($month == 1) 55 57 { 56 57 58 $pmonth = 12; 59 $pyear = $year - 1; 58 60 } 59 61 else 60 62 { 61 62 63 $pmonth = $month - 1; 64 $pyear = $year; 63 65 } 64 66 $monthname = kbdate("F", strtotime("2000-".$month."-2")); … … 72 74 if (file_exists("img/alliances/".$alliance->getUnique().".png")) 73 75 { 74 76 $html .= "<img src=\"".IMG_URL."/alliances/".$alliance->getUnique().".png\" border=\"0\" alt=\"$alliance->getName()\"></td>"; 75 77 } 76 78 else 77 79 { 78 80 $html .= "<img src=\"".IMG_URL."/alliances/default.gif\" border=\"0\" alt=\"$alliance->getName()\"></td>"; 79 81 } 80 82 $kill_summary = new KillSummaryTable(); … … 89 91 if ($kill_summary->getTotalKillISK()) 90 92 { 91 93 $efficiency = round($kill_summary->getTotalKillISK() / ($kill_summary->getTotalKillISK() + $kill_summary->getTotalLossISK()) * 100, 2); 92 94 } 93 95 else 94 96 { 95 97 $efficiency = 0; 96 98 } 97 99 … … 103 105 if ($_GET['view'] == "" || $_GET['view'] == "kills" || $_GET['view'] == "losses") 104 106 { 105 107 $html .= $summary_html; 106 108 } 107 109 108 110 switch ($_GET['view']) 109 111 { 110 111 112 113 114 112 case "": 113 $html .= "<div class=kb-kills-header>10 Most recent kills in the last 30 days</div>"; 114 115 $list = new KillList(); 116 $list->setOrdered(true); 115 117 if (config::get('comments_count')) $list->setCountComments(true); 116 118 if (config::get('killlist_involved')) $list->setCountInvolved(true); 117 118 119 120 if ($_GET['scl_id'])121 $list->addVictimShipClass(new ShipClass($_GET['scl_id']));119 $list->setLimit(10); 120 $list->setPodsNoobships(true); 121 $list->addInvolvedAlliance($alliance); 122 if ($scl_id) 123 $list->addVictimShipClass($scl_id); 122 124 $list->setStartDate(date('Y-m-d H:i',strtotime('-30 days'))); 123 124 125 126 127 128 129 130 131 125 $ktab = new KillListTable($list); 126 $ktab->setLimit(10); 127 $ktab->setDayBreak(false); 128 $html .= $ktab->generate(); 129 130 $html .= "<div class=kb-losses-header>10 Most recent losses in the last 30 days</div>"; 131 132 $list = new KillList(); 133 $list->setOrdered(true); 132 134 if (config::get('comments_count')) $list->setCountComments(true); 133 135 if (config::get('killlist_involved')) $list->setCountInvolved(true); 134 135 136 137 if ($_GET['scl_id'])138 $list->addVictimShipClass(new ShipClass($_GET['scl_id']));136 $list->setLimit(10); 137 $list->setPodsNoobships(true); 138 $list->addVictimAlliance($alliance); 139 if ($scl_id) 140 $list->addVictimShipClass($scl_id); 139 141 $list->setStartDate(date('Y-m-d H:i',strtotime('-30 days'))); 140 142 141 142 143 144 145 146 147 148 149 150 151 152 $list->addInvolvedAlliance($alliance); 153 if ($_GET['scl_id'])154 $list->addVictimShipClass(new ShipClass($_GET['scl_id']));155 156 157 158 159 160 161 162 163 164 165 166 167 143 $ltab = new KillListTable($list); 144 $ltab->setLimit(10); 145 $ltab->setDayBreak(false); 146 $html .= $ltab->generate(); 147 148 break; 149 case "kills": 150 $html .= "<div class=kb-kills-header>All kills</div>"; 151 152 $list = new KillList(); 153 $list->setOrdered(true); 154 $list->addInvolvedAlliance($alliance); 155 if ($scl_id) 156 $list->addVictimShipClass($scl_id); 157 $pagesplitter = new PageSplitter($list->getCount(), 30); 158 $list->setPageSplitter($pagesplitter); 159 $table = new KillListTable($list); 160 $table->setDayBreak(false); 161 $html .= $table->generate(); 162 $html .= $pagesplitter->generate(); 163 164 break; 165 case "losses": 166 $html .= "<div class=kb-losses-header>All losses</div>"; 167 168 $list = new KillList(); 169 $list->setOrdered(true); 168 170 $list->setPodsNoobships(true); 169 170 if ($_GET['scl_id'])171 $list->addVictimShipClass(new ShipClass($_GET['scl_id']));172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 171 $list->addVictimAlliance($alliance); 172 if ($scl_id) 173 $list->addVictimShipClass($scl_id); 174 $pagesplitter = new PageSplitter($list->getCount(), 30); 175 $list->setPageSplitter($pagesplitter); 176 177 $table = new KillListTable($list); 178 $table->setDayBreak(false); 179 $html .= $table->generate(); 180 $html .= $pagesplitter->generate(); 181 182 break; 183 case "corp_kills": 184 $html .= "<div class=block-header2>Top killers</div>"; 185 186 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 187 $html .= "<div class=block-header>$monthname $year</div>"; 188 189 $list = new TopCorpKillsList(); 190 $list->addInvolvedAlliance($alliance); 191 $list->setPodsNoobShips(false); 192 $list->setMonth($month); 193 $list->setYear($year); 194 $table = new TopCorpTable($list, "Kills"); 195 $html .= $table->generate(); 196 195 197 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=alliance_detail&view=corp_kills&m=$pmonth&all_id=$all_id&y=$pyear'>previous</a></td>"; 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 198 $html .= "<td align='right'><a href='?a=alliance_detail&view=corp_kills&all_id=$all_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 199 200 $html .= "</td><td valign=top width=400>"; 201 $html .= "<div class=block-header>All time</div>"; 202 203 $list = new TopCorpKillsList(); 204 $list->addInvolvedAlliance($alliance); 205 $list->setPodsNoobShips(false); 206 $table = new TopCorpTable($list, "Kills"); 207 $html .= $table->generate(); 208 209 $html .= "</td></tr></table>"; 210 211 break; 212 case "corp_kills_class": 213 $html .= "<div class=block-header2>Destroyed ships</div>"; 214 215 // Get all ShipClasses 216 $sql = "select scl_id, scl_class from kb3_ship_classes 215 217 where scl_class not in ('Drone','Unknown') order by scl_class"; 216 218 217 $qry = new DBQuery(); 218 $qry->execute($sql); 219 while ($row = $qry->getRow()) 220 { 221 $shipclass[] = new Shipclass($row['scl_id']); 222 } 223 $html .= "<table class=kb-subtable>"; 224 $html .= "<tr>"; 225 $newrow = true; 226 227 foreach ($shipclass as $shp){ 228 if ($newrow){ 229 $html .= '</tr><tr>'; 230 } 231 $list = new TopCorpKillsList(); 232 $list->addInvolvedAlliance($alliance); 233 $list->addVictimShipClass($shp); 234 $table = new TopCorpTable($list, "Kills"); 235 $content = $table->generate(); 236 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center>#</td><td class=kb-table-cell align=center>Corporation</td><td class=kb-table-cell align=center width=60>Kills</td></tr></table>'){ 237 $html .= "<td valign=top width=440>"; 238 $html .= "<div class=block-header>".$shp->getName()."</div>"; 239 $html .= $content; 240 $html .= "</td>"; 241 $newrow = !$newrow; 242 } 243 244 } 245 $html .= "</tr></table>"; 246 break; 247 case "kills_class": 248 $html .= "<div class=block-header2>Destroyed ships</div>"; 249 250 // Get all ShipClasses 251 $sql = "select scl_id, scl_class from kb3_ship_classes 219 $qry = new DBQuery(); 220 $qry->execute($sql); 221 while ($row = $qry->getRow()) 222 { 223 $shipclass[] = new Shipclass($row['scl_id']); 224 } 225 $html .= "<table class=kb-subtable>"; 226 $html .= "<tr>"; 227 $newrow = true; 228 229 foreach ($shipclass as $shp) 230 { 231 if ($newrow) 232 { 233 $html .= '</tr><tr>'; 234 } 235 $list = new TopCorpKillsList(); 236 $list->addInvolvedAlliance($alliance); 237 $list->addVictimShipClass($shp); 238 $table = new TopCorpTable($list, "Kills"); 239 $content = $table->generate(); 240 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center>#</td><td class=kb-table-cell align=center>Corporation</td><td class=kb-table-cell align=center width=60>Kills</td></tr></table>') 241 { 242 $html .= "<td valign=top width=440>"; 243 $html .= "<div class=block-header>".$shp->getName()."</div>"; 244 $html .= $content; 245 $html .= "</td>"; 246 $newrow = !$newrow; 247 } 248 249 } 250 $html .= "</tr></table>"; 251 break; 252 case "kills_class": 253 $html .= "<div class=block-header2>Destroyed ships</div>"; 254 255 // Get all ShipClasses 256 $sql = "select scl_id, scl_class from kb3_ship_classes 252 257 where scl_class not in ('Drone','Unknown') order by scl_class"; 253 258 254 $qry = new DBQuery(); 255 $qry->execute($sql); 256 while ($row = $qry->getRow()) 257 { 258 $shipclass[] = new Shipclass($row['scl_id']); 259 } 260 $html .= "<table class=kb-subtable>"; 261 $html .= "<tr>"; 262 $newrow = true; 263 264 foreach ($shipclass as $shp){ 265 if ($newrow){ 266 $html .= '</tr><tr>'; 267 } 268 $list = new TopKillsList(); 269 $list->addInvolvedAlliance($alliance); 270 $list->addVictimShipClass($shp); 271 $table = new TopPilotTable($list, "Kills"); 272 $content = $table->generate(); 273 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center colspan=2>Pilot</td><td class=kb-table-cell align=center width=60>Kills</td></tr></table>'){ 274 $html .= "<td valign=top width=440>"; 275 $html .= "<div class=block-header>".$shp->getName()."</div>"; 276 $html .= $content; 277 $html .= "</td>"; 278 $newrow = !$newrow; 279 } 280 281 } 282 $html .= "</tr></table>"; 283 284 break; 285 case "corp_losses_class": 286 $html .= "<div class=block-header2>Lost ships</div>"; 287 288 // Get all ShipClasses 289 $sql = "select scl_id, scl_class from kb3_ship_classes 259 $qry = new DBQuery(); 260 $qry->execute($sql); 261 while ($row = $qry->getRow()) 262 { 263 $shipclass[] = new Shipclass($row['scl_id']); 264 } 265 $html .= "<table class=kb-subtable>"; 266 $html .= "<tr>"; 267 $newrow = true; 268 269 foreach ($shipclass as $shp) 270 { 271 if ($newrow) 272 { 273 $html .= '</tr><tr>'; 274 } 275 $list = new TopKillsList(); 276 $list->addInvolvedAlliance($alliance); 277 $list->addVictimShipClass($shp); 278 $table = new TopPilotTable($list, "Kills"); 279 $content = $table->generate(); 280 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center colspan=2>Pilot</td><td class=kb-table-cell align=center width=60>Kills</td></tr></table>') 281 { 282 $html .= "<td valign=top width=440>"; 283 $html .= "<div class=block-header>".$shp->getName()."</div>"; 284 $html .= $content; 285 $html .= "</td>"; 286 $newrow = !$newrow; 287 } 288 289 } 290 $html .= "</tr></table>"; 291 292 break; 293 case "corp_losses_class": 294 $html .= "<div class=block-header2>Lost ships</div>"; 295 296 // Get all ShipClasses 297 $sql = "select scl_id, scl_class from kb3_ship_classes 290 298 where scl_class not in ('Drone','Unknown') order by scl_class"; 291 299 292 $qry = new DBQuery(); 293 $qry->execute($sql); 294 while ($row = $qry->getRow()) 295 { 296 $shipclass[] = new Shipclass($row['scl_id']); 297 } 298 $html .= "<table class=kb-subtable>"; 299 $html .= "<tr>"; 300 $newrow = true; 301 302 foreach ($shipclass as $shp){ 303 if ($newrow){ 304 $html .= '</tr><tr>'; 305 } 306 $list = new TopCorpLossesList(); 307 $list->addVictimAlliance($alliance); 308 $list->addVictimShipClass($shp); 309 $table = new TopCorpTable($list, "Losses"); 310 $content = $table->generate(); 311 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center>#</td><td class=kb-table-cell align=center>Corporation</td><td class=kb-table-cell align=center width=60>Losses</td></tr></table>'){ 312 $html .= "<td valign=top width=440>"; 313 $html .= "<div class=block-header>".$shp->getName()."</div>"; 314 $html .= $content; 315 $html .= "</td>"; 316 $newrow = !$newrow; 317 } 318 } 319 $html .= "</tr></table>"; 320 321 break; 322 case "losses_class": 323 $html .= "<div class=block-header2>Lost ships</div>"; 324 325 // Get all ShipClasses 326 $sql = "select scl_id, scl_class from kb3_ship_classes 300 $qry = new DBQuery(); 301 $qry->execute($sql); 302 while ($row = $qry->getRow()) 303 { 304 $shipclass[] = new Shipclass($row['scl_id']); 305 } 306 $html .= "<table class=kb-subtable>"; 307 $html .= "<tr>"; 308 $newrow = true; 309 310 foreach ($shipclass as $shp) 311 { 312 if ($newrow) 313 { 314 $html .= '</tr><tr>'; 315 } 316 $list = new TopCorpLossesList(); 317 $list->addVictimAlliance($alliance); 318 $list->addVictimShipClass($shp); 319 $table = new TopCorpTable($list, "Losses"); 320 $content = $table->generate(); 321 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center>#</td><td class=kb-table-cell align=center>Corporation</td><td class=kb-table-cell align=center width=60>Losses</td></tr></table>') 322 { 323 $html .= "<td valign=top width=440>"; 324 $html .= "<div class=block-header>".$shp->getName()."</div>"; 325 $html .= $content; 326 $html .= "</td>"; 327 $newrow = !$newrow; 328 } 329 } 330 $html .= "</tr></table>"; 331 332 break; 333 case "losses_class": 334 $html .= "<div class=block-header2>Lost ships</div>"; 335 336 // Get all ShipClasses 337 $sql = "select scl_id, scl_class from kb3_ship_classes 327 338 where scl_class not in ('Drone','Unknown') order by scl_class"; 328 339 329 $qry = new DBQuery(); 330 $qry->execute($sql); 331 while ($row = $qry->getRow()) 332 { 333 $shipclass[] = new Shipclass($row['scl_id']); 334 } 335 $html .= "<table class=kb-subtable>"; 336 $html .= "<tr>"; 337 $newrow = true; 338 339 foreach ($shipclass as $shp){ 340 if ($newrow){ 341 $html .= '</tr><tr>'; 342 } 343 $list = new TopLossesList(); 344 $list->addVictimAlliance($alliance); 345 $list->addVictimShipClass($shp); 346 $table = new TopPilotTable($list, "Losses"); 347 $content = $table->generate(); 348 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center colspan=2>Pilot</td><td class=kb-table-cell align=center width=60>Losses</td></tr></table>'){ 349 $html .= "<td valign=top width=440>"; 350 $html .= "<div class=block-header>".$shp->getName()."</div>"; 351 $html .= $content; 352 $html .= "</td>"; 353 $newrow = !$newrow; 354 } 355 } 356 $html .= "</tr></table>"; 357 358 break; 359 case "corp_losses": 360 $html .= "<div class=block-header2>Top losers</div>"; 361 362 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 363 $html .= "<div class=block-header>$monthname $year</div>"; 364 365 $list = new TopCorpLossesList(); 366 $list->addVictimAlliance($alliance); 367 $list->setPodsNoobShips(false); 368 $list->setMonth($month); 369 $list->setYear($year); 370 $table = new TopCorpTable($list, "Losses"); 371 $html .= $table->generate(); 340 $qry = new DBQuery(); 341 $qry->execute($sql); 342 while ($row = $qry->getRow()) 343 { 344 $shipclass[] = new Shipclass($row['scl_id']); 345 } 346 $html .= "<table class=kb-subtable>"; 347 $html .= "<tr>"; 348 $newrow = true; 349 350 foreach ($shipclass as $shp) 351 { 352 if ($newrow) 353 { 354 $html .= '</tr><tr>'; 355 } 356 $list = new TopLossesList(); 357 $list->addVictimAlliance($alliance); 358 $list->addVictimShipClass($shp); 359 $table = new TopPilotTable($list, "Losses"); 360 $content = $table->generate(); 361 if ($content != '<table class=kb-table cellspacing=1><tr class=kb-table-header><td class=kb-table-cell align=center colspan=2>Pilot</td><td class=kb-table-cell align=center width=60>Losses</td></tr></table>') 362 { 363 $html .= "<td valign=top width=440>"; 364 $html .= "<div class=block-header>".$shp->getName()."</div>"; 365 $html .= $content; 366 $html .= "</td>"; 367 $newrow = !$newrow; 368 } 369 } 370 $html .= "</tr></table>"; 371 372 break; 373 case "corp_losses": 374 $html .= "<div class=block-header2>Top losers</div>"; 375 376 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 377 $html .= "<div class=block-header>$monthname $year</div>"; 378 379 $list = new TopCorpLossesList(); 380 $list->addVictimAlliance($alliance); 381 $list->setPodsNoobShips(false); 382 $list->setMonth($month); 383 $list->setYear($year); 384 $table = new TopCorpTable($list, "Losses"); 385 $html .= $table->generate(); 372 386 373 387 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=alliance_detail&view=corp_losses&m=$pmonth&all_id=$all_id&y=$pyear'>previous</a></td>"; 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 388 $html .= "<td align='right'><a href='?a=alliance_detail&view=corp_losses&all_id=$all_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 389 390 $html .= "</td><td valign=top width=400>"; 391 $html .= "<div class=block-header>All time</div>"; 392 393 $list = new TopCorpLossesList(); 394 $list->addVictimAlliance($alliance); 395 $list->setPodsNoobShips(false); 396 $table = new TopCorpTable($list, "Losses"); 397 $html .= $table->generate(); 398 399 $html .= "</td></tr></table>"; 400 401 break; 402 case "pilot_kills": 403 $html .= "<div class=block-header2>Top killers</div>"; 404 405 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 406 $html .= "<div class=block-header>$monthname $year</div>"; 407 408 $list = new TopKillsList(); 409 $list->addInvolvedAlliance($alliance); 410 $list->setPodsNoobShips(false); 411 $list->setMonth($month); 412 $list->setYear($year); 413 $table = new TopPilotTable($list, "Kills"); 414 $html .= $table->generate(); 401 415 402 416 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=alliance_detail&view=pilot_kills&m=$pmonth&all_id=$all_id&y=$pyear'>previous</a></td>"; 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 417 $html .= "<td align='right'><a href='?a=alliance_detail&view=pilot_kills&all_id=$all_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 418 419 $html .= "</td><td valign=top width=400>"; 420 $html .= "<div class=block-header>All time</div>"; 421 422 $list = new TopKillsList(); 423 $list->addInvolvedAlliance($alliance); 424 $list->setPodsNoobShips(false); 425 $table = new TopPilotTable($list, "Kills"); 426 $html .= $table->generate(); 427 428 $html .= "</td></tr></table>"; 429 430 break; 431 case "pilot_scores": 432 $html .= "<div class=block-header2>Top scorers</div>"; 433 434 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 435 $html .= "<div class=block-header>$monthname $year</div>"; 436 437 $list = new TopScoreList(); 438 $list->addInvolvedAlliance($alliance); 439 $list->setPodsNoobShips(true); 440 $list->setMonth($month); 441 $list->setYear($year); 442 $table = new TopPilotTable($list, "Points"); 443 $html .= $table->generate(); 430 444 431 445 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=alliance_detail&view=pilot_scores&m=$pmonth&all_id=$all_id&y=$pyear'>previous</a></td>"; 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 446 $html .= "<td align='right'><a href='?a=alliance_detail&view=pilot_scores&all_id=$all_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 447 448 $html .= "</td><td valign=top width=400>"; 449 $html .= "<div class=block-header>All time</div>"; 450 451 $list = new TopScoreList(); 452 $list->addInvolvedAlliance($alliance); 453 $list->setPodsNoobShips(true); 454 $table = new TopPilotTable($list, "Points"); 455 $html .= $table->generate(); 456 457 $html .= "</td></tr></table>"; 458 459 break; 460 case "pilot_losses": 461 $html .= "<div class=block-header2>Top losers</div>"; 462 463 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 464 $html .= "<div class=block-header>$monthname $year</div>"; 465 466 $list = new TopLossesList(); 467 $list->addVictimAlliance($alliance); 468 $list->setPodsNoobShips(false); 469 $list->setMonth($month); 470 $list->setYear($year); 471 $table = new TopPilotTable($list, "Losses"); 472 $html .= $table->generate(); 459 473 460 474 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=alliance_detail&view=pilot_losses&m=$pmonth&all_id=$all_id&y=$pyear'>previous</a></td>"; 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 475 $html .= "<td align='right'><a href='?a=alliance_detail&view=pilot_losses&all_id=$all_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 476 477 $html .= "</td><td valign=top width=400>"; 478 $html .= "<div class=block-header>All time</div>"; 479 480 $list = new TopLossesList(); 481 $list->addVictimAlliance($alliance); 482 $list->setPodsNoobShips(false); 483 $table = new TopPilotTable($list, "Losses"); 484 $html .= $table->generate(); 485 486 $html .= "</td></tr></table>"; 487 488 break; 489 case "ships_weapons": 490 $html .= "<div class=block-header2>Ships & weapons used</div>"; 491 492 $html .= "<table class=kb-subtable><tr><td valign=top width=400>"; 493 $shiplist = new TopShipList(); 494 $shiplist->addInvolvedAlliance($alliance); 495 $shiplisttable = new TopShipListTable($shiplist); 496 $html .= $shiplisttable->generate(); 497 $html .= "</td><td valign=top align=right width=400>"; 498 499 $weaponlist = new TopWeaponList(); 500 $weaponlist->addInvolvedAlliance($alliance); 501 $weaponlisttable = new TopWeaponListTable($weaponlist); 502 $html .= $weaponlisttable->generate(); 503 $html .= "</td></tr></table>"; 504 505 break; 506 case 'violent_systems': 507 $html .= "<div class=block-header2>Most violent systems</div>"; 508 $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; 509 510 $html .= "<div class=block-header>This month</div>"; 511 $html .= "<table class=kb-table>"; 512 $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center >Kills</td></tr>"; 513 514 $sql = "select sys.sys_name, sys.sys_sec, sys.sys_id, count(distinct kll.kll_id) as kills 501 515 from kb3_systems sys, kb3_kills kll, kb3_inv_detail inv 502 516 where kll.kll_system_id = sys.sys_id 503 517 and inv.ind_kll_id = kll.kll_id"; 504 518 505 506 507 508 509 510 519 if ($crp_id) 520 $sql .= " and inv.ind_crp_id in (".$crp_id.")"; 521 if ($all_id) 522 $sql .= " and inv.ind_all_id = ".$all_id; 523 524 $sql .= " and date_format( kll.kll_timestamp, \"%c\" ) = ".kbdate("m")." 511 525 and date_format( kll.kll_timestamp, \"%Y\" ) = ".kbdate("Y")." 512 526 group by sys.sys_name … … 514 528 limit 25"; 515 529 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 530 $qry = new DBQuery(); 531 $qry->execute($sql); 532 $odd = false; 533 $counter = 1; 534 while ($row = $qry->getRow()) 535 { 536 if (!$odd) 537 { 538 $odd = true; 539 $rowclass = 'kb-table-row-odd'; 540 } 541 else 542 { 543 $odd = false; 544 $rowclass = 'kb-table-row-even'; 545 } 546 547 $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b><a href=\"?a=system_detail&sys_id=".$row['sys_id']."\">".$row['sys_name']."</a></b> (".roundsec($row['sys_sec']).")</td><td align=center>".$row['kills']."</td></tr>"; 548 $counter++; 549 } 550 551 $html .= "</table>"; 552 553 $html .= "</td><td align=center valign=top>"; 554 $html .= "<div class=block-header>All-Time</div>"; 555 $html .= "<table class=kb-table>"; 556 $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center>Kills</td></tr>"; 557 558 $sql = "select sys.sys_name, sys.sys_id, sys.sys_sec, count(distinct kll.kll_id) as kills 545 559 from kb3_systems sys, kb3_kills kll, kb3_inv_detail inv 546 560 where kll.kll_system_id = sys.sys_id 547 561 and inv.ind_kll_id = kll.kll_id"; 548 562 549 550 551 552 553 554 563 if ($crp_id) 564 $sql .= " and inv.ind_crp_id in (".$crp_id.")"; 565 if ($all_id) 566 $sql .= " and inv.ind_all_id = ".$all_id; 567 568 $sql .= " group by sys.sys_name 555 569 order by kills desc 556 570 limit 25"; 557 571 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 572 $qry = new DBQuery(); 573 $qry->execute($sql); 574 $odd = false; 575 $counter = 1; 576 while ($row = $qry->getRow()) 577 { 578 if (!$odd) 579 { 580 $odd = true; 581 $rowclass = 'kb-table-row-odd'; 582 } 583 else 584 { 585 $odd = false; 586 $rowclass = 'kb-table-row-even'; 587 } 588 589 $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b><a href=\"?a=system_detail&sys_id=".$row['sys_id']."\">".$row['sys_name']."</a></b> (".roundsec($row['sys_sec']).")</td><td align=center>".$row['kills']."</td></tr>"; 590 $counter++; 591 } 592 $html .= "</table>"; 593 $html .= "</td></tr></table>"; 594 break; 581 595 } 582 596 … … 596 610 if (config::get('kill_points')) 597 611 { 598 612 $menubox->addOption('link', "Top scorers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=pilot_scores"); 599 613 } 600 614 $menubox->addOption("link","Top losers", "?a=alliance_detail&all_id=" . $alliance->getID() . "&view=pilot_losses"); -
dev/common/campaigns.php
r396 r459 6 6 switch ($_GET['view']) 7 7 { 8 9 10 11 12 13 14 $table->paginate(10, $_GET['page']);15 16 17 18 19 20 21 22 23 $table->paginate(10, $_GET['page']);24 25 8 case '': 9 $activelist = new ContractList(); 10 $activelist->setCampaigns(true); 11 $activelist->setActive('yes'); 12 $page->setTitle('Active campaigns'); 13 $table = new ContractListTable($activelist); 14 $table->paginate(10, intval($_GET['page'])); 15 $html .= $table->generate(); 16 break; 17 case 'past': 18 $pastlist = new ContractList(); 19 $pastlist->setCampaigns(true); 20 $pastlist->setActive('no'); 21 $page->setTitle('Past campaigns'); 22 $table = new ContractListTable($pastlist); 23 $table->paginate(10, intval($_GET['page'])); 24 $html .= $table->generate(); 25 break; 26 26 } 27 27 -
dev/common/cc_detail.php
r370 r459 6 6 require_once('common/includes/class.toplist.php'); 7 7 8 $ctr_id = $_GET['ctr_id']; 8 $ctr_id = intval($_GET['ctr_id']); 9 $scl_id = intval($_GET['scl_id']); 9 10 10 11 $contract = new Contract($ctr_id); 12 if(!$contract->validate()) 13 { 14 echo 'No valid contract ID specified<br />'; 15 return; 16 } 11 17 12 18 if ($contract->getCampaign()) 13 14 else 15 19 $title = 'Campaign details'; 20 else 21 $title = 'Contract details'; 16 22 17 23 $page = new Page($title.' - '.$contract->getName()); … … 20 26 // table class=kb-subtable cellspacing=0><tr class=kb-table-row-even><td width=80 height=80 align=center>"; 21 27 if ($contract->getCampaign()) 22 23 else 24 28 $html .= "<img src=\"".IMG_URL."/campaign-big.gif\" align=center>"; 29 else 30 $html .= "<img src=\"".IMG_URL."/contract-big.gif\" align=center>"; 25 31 26 32 $html .= "</td>"; … … 28 34 // $html .= "<table class=kb-subtable width=\"100%\" height=\"100%\" cellspacing=1 border=\"0\">"; 29 35 if ($contract->getEndDate() == "") 30 31 else 32 36 $ended = "Active"; 37 else 38 $ended = substr($contract->getEndDate(), 0, 10); 33 39 $html .= "<td class=kb-table-cell><b>Start date:</b></td><td class=kb-table-cell width=120><b>".substr($contract->getStartDate(), 0, 10)."</b></td><td class=kb-table-cell><b>End date:</b></td><td class=kb-table-cell width=120><b>".$ended."</b></td></tr>"; 34 40 $html .= "<tr class=kb-table-row-even><td class=kb-table-cell><b>Kills:</b></td><td class=kl-kill>".$contract->getKills()."</td><td class=kb-table-cell><b>Losses:</b></td><td class=kl-loss>".$contract->getLosses()."</td></tr>"; … … 42 48 $killsummary->setBreak(config::get('summarytable_rowcount')); 43 49 if ($_GET['view'] == "") 44 50 $killsummary->setFilter(false); 45 51 46 52 $html .= "<br>"; … … 49 55 switch ($_GET['view']) 50 56 { 51 52 53 54 55 56 57 57 case "": 58 while ($target = &$contract->getContractTarget()) 59 { 60 $kl = &$target->getKillList(); 61 $ll = &$target->getLossList(); 62 $summary = new KillSummaryTable($kl, $ll); 63 $summary->setVerbose(true); 58 64 $qrylength=new DBQuery(); 59 65 // set break at half of the number of valid classes - excludes noob ships, drones and unknown … … 65 71 } 66 72 else $summary->setBreak(15); 67 $summary->setView('combined'); 68 69 $html .= "<br><div class=kb-contract-target-header>Target ".$target->getType()." - "; 70 switch ($target->getType()) { 71 case "corp": 72 $html .= "<a class=kb-contract href=\"?a=".$target->getType()."_detail&crp_id=".$target->getID()."\">".$target->getName()."</a>"; 73 break; 74 case "alliance": 75 $html .= "<a class=kb-contract href=\"?a=".$target->getType()."_detail&all_id=".$target->getID()."\">".$target->getName()."</a>"; 76 break; 77 case "system": 78 $html .= "<a class=kb-contract href=\"?a=" .$target->getType()."_detail&sys_id=".$target->getID()."\">".$target->getName()."</a>"; 79 break; 80 case "region": 81 $html .= $target->getName(); 82 break; 83 } 84 $html .= "</div>"; 85 $html .= $summary->generate(); 86 87 $html .= "<br><table class=kb-subtable border=\"0\" cellspacing=0 width=\"100%\"><tr><td>"; 88 89 if ($summary->getTotalKillISK()) 90 $efficiency = round($summary->getTotalKillISK() / ($summary->getTotalKillISK() + $summary->getTotalLossISK()) * 100, 2); 91 else 92 $efficiency = 0; 93 94 $bar = new BarGraph($efficiency, 100, 120); 95 $html .= "<table class=kb-table cellspacing=1 border=\"0\" width=\"100%\"><tr class=kb-table-row-even>"; 96 $html .= "<td class=kb-table-cell width=108><b>Totals:</b></td><td class=kl-kill-bg width=60 align=center>".$summary->getTotalKills()."</td><td class=kl-kill-bg width=60 align=center>".round($summary->getTotalKillISK()/1000000000, 2)."B</td>"; 97 $html .= "<td class=kl-loss-bg width=64 align=center>".$summary->getTotalLosses()."</td><td class=kl-loss-bg width=60 align=center>".round($summary->getTotalLossISK()/1000000000, 2)."B</td></tr></table>"; 98 99 $html .= "</td><td align=left>"; 100 101 $html .= "<table class=kb-table cellspacing=1 border=\"0\"><tr class=kb-table-row-even>"; 102 $html .= "<td class=kb-table-cell width=108><b>Efficiency:</b></td><td class=kb-table-cell align=center colspan=2 width=120><b>".$efficiency."%</b></td>"; 103 $html .= "<td class=kb-table-cell colspan=2 width=120>".$bar->generate()."</td></tr>"; 104 $html .= "</tr></table>"; 105 106 $html .= "</td></tr></table>"; 107 } 108 109 break; 110 case "recent_activity": 111 $html .= "<div class=kb-kills-header>10 Most recent kills</div>"; 112 113 $contract = new Contract($ctr_id); 114 $klist = $contract->getKillList(); 115 $klist->setOrdered(true); 116 if ($_GET['scl_id']) 117 $klist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 118 else 119 $klist->setPodsNoobShips(false); 120 121 $table = new KillListTable($klist); 122 $table->setLimit(10); 123 $table->setDayBreak(false); 124 $html .= $table->generate(); 125 126 $html .= "<div class=kb-losses-header>10 Most recent losses</div>"; 127 $llist = $contract->getLossList(); 128 $llist->setOrdered(true); 129 if ($_GET['scl_id']) 130 $llist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 131 else 132 $llist->setPodsNoobShips(false); 133 134 $table = new KillListTable($llist); 135 $table->setLimit(10); 136 $table->setDayBreak(false); 137 $html .= $table->generate(); 138 break; 139 case "kills": 140 $html .= "<div class=kb-kills-header>All kills</div>"; 141 142 $contract = new Contract($ctr_id); 143 $list = $contract->getKillList(); 144 $list->setOrdered(true); 145 if ($_GET['scl_id']) 146 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 147 148 $pagesplitter = new PageSplitter($list->getCount(), 30); 149 $list->setPageSplitter($pagesplitter); 150 $table = new KillListTable($list); 151 $table->setDayBreak(false); 152 $html .= $table->generate(); 153 $html .= $pagesplitter->generate(); 154 break; 155 case "losses": 156 $html .= "<div class=kb-losses-header>All losses</div>"; 157 158 $contract = new Contract($ctr_id); 159 $llist = $contract->getLossList(); 160 $llist->setOrdered(true); 161 if ($_GET['scl_id']) 162 $llist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 163 164 $pagesplitter = new PageSplitter($llist->getCount(), 30); 165 $llist->setPageSplitter($pagesplitter); 166 $table = new KillListTable($llist); 167 $table->setDayBreak(false); 168 $html .= $table->generate(); 169 $html .= $pagesplitter->generate(); 170 break; 171 case "combined": 172 $html .= "<div class=kb-kills-header>All kills</div>"; 173 174 $contract = new Contract($ctr_id); 175 $list = $contract->getKillList(); 176 $list->setOrdered(true); 177 if ($_GET['scl_id']) 178 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 179 180 $pagesplitter = new PageSplitter($list->getCount(), 20); 181 $list->setPageSplitter($pagesplitter); 182 $table = new KillListTable($list); 183 $table->setDayBreak(false); 184 $html .= $table->generate(); 185 $html .= $pagesplitter->generate(); 186 187 $html .= "<div class=kb-losses-header>All losses</div>"; 188 189 $contract = new Contract($ctr_id); 190 $llist = $contract->getLossList(); 191 $llist->setOrdered(true); 192 if ($_GET['scl_id']) 193 $llist->addVictimShipClass(new ShipClass($_GET['scl_id'])); 194 195 $pagesplitter = new PageSplitter($llist->getCount(), 20); 196 $llist->setPageSplitter($pagesplitter); 197 $table = new KillListTable($llist); 198 $table->setDayBreak(false); 199 $html .= $table->generate(); 200 $html .= $pagesplitter->generate(); 201 break; 73 $summary->setView('combined'); 74 75 $html .= "<br><div class=kb-contract-target-header>Target ".$target->getType()." - "; 76 switch ($target->getType()) 77 { 78 case "corp": 79 $html .= "<a class=kb-contract href=\"?a=".$target->getType()."_detail&crp_id=".$target->getID()."\">".$target->getName()."</a>"; 80 break; 81 case "alliance": 82 $html .= "<a class=kb-contract href=\"?a=".$target->getType()."_detail&all_id=".$target->getID()."\">".$target->getName()."</a>"; 83 break; 84 case "system": 85 $html .= "<a class=kb-contract href=\"?a=" .$target->getType()."_detail&sys_id=".$target->getID()."\">".$target->getName()."</a>"; 86 break; 87 case "region": 88 $html .= $target->getName(); 89 break; 90 } 91 $html .= "</div>"; 92 $html .= $summary->generate(); 93 94 $html .= "<br><table class=kb-subtable border=\"0\" cellspacing=0 width=\"100%\"><tr><td>"; 95 96 if ($summary->getTotalKillISK()) 97 $efficiency = round($summary->getTotalKillISK() / ($summary->getTotalKillISK() + $summary->getTotalLossISK()) * 100, 2); 98 else 99 $efficiency = 0; 100 101 $bar = new BarGraph($efficiency, 100, 120); 102 $html .= "<table class=kb-table cellspacing=1 border=\"0\" width=\"100%\"><tr class=kb-table-row-even>"; 103 $html .= "<td class=kb-table-cell width=108><b>Totals:</b></td><td class=kl-kill-bg width=60 align=center>".$summary->getTotalKills()."</td><td class=kl-kill-bg width=60 align=center>".round($summary->getTotalKillISK()/1000000000, 2)."B</td>"; 104 $html .= "<td class=kl-loss-bg width=64 align=center>".$summary->getTotalLosses()."</td><td class=kl-loss-bg width=60 align=center>".round($summary->getTotalLossISK()/1000000000, 2)."B</td></tr></table>"; 105 106 $html .= "</td><td align=left>"; 107 108 $html .= "<table class=kb-table cellspacing=1 border=\"0\"><tr class=kb-table-row-even>"; 109 $html .= "<td class=kb-table-cell width=108><b>Efficiency:</b></td><td class=kb-table-cell align=center colspan=2 width=120><b>".$efficiency."%</b></td>"; 110 $html .= "<td class=kb-table-cell colspan=2 width=120>".$bar->generate()."</td></tr>"; 111 $html .= "</tr></table>"; 112 113 $html .= "</td></tr></table>"; 114 } 115 116 break; 117 case "recent_activity": 118 $html .= "<div class=kb-kills-header>10 Most recent kills</div>"; 119 120 $contract = new Contract($ctr_id); 121 $klist = $contract->getKillList(); 122 $klist->setOrdered(true); 123 if ($scl_id) 124 $klist->addVictimShipClass($scl_id); 125 else 126 $klist->setPodsNoobShips(false); 127 128 $table = new KillListTable($klist); 129 $table->setLimit(10); 130 $table->setDayBreak(false); 131 $html .= $table->generate(); 132 133 $html .= "<div class=kb-losses-header>10 Most recent losses</div>"; 134 $llist = $contract->getLossList(); 135 $llist->setOrdered(true); 136 if ($scl_id) 137 $llist->addVictimShipClass($scl_id); 138 else 139 $llist->setPodsNoobShips(false); 140 141 $table = new KillListTable($llist); 142 $table->setLimit(10); 143 $table->setDayBreak(false); 144 $html .= $table->generate(); 145 break; 146 case "kills": 147 $html .= "<div class=kb-kills-header>All kills</div>"; 148 149 $contract = new Contract($ctr_id); 150 $list = $contract->getKillList(); 151 $list->setOrdered(true); 152 if ($scl_id) 153 $list->addVictimShipClass($scl_id); 154 155 $pagesplitter = new PageSplitter($list->getCount(), 30); 156 $list->setPageSplitter($pagesplitter); 157 $table = new KillListTable($list); 158 $table->setDayBreak(false); 159 $html .= $table->generate(); 160 $html .= $pagesplitter->generate(); 161 break; 162 case "losses": 163 $html .= "<div class=kb-losses-header>All losses</div>"; 164 165 $contract = new Contract($ctr_id); 166 $llist = $contract->getLossList(); 167 $llist->setOrdered(true); 168 if ($scl_id) 169 $llist->addVictimShipClass($scl_id); 170 171 $pagesplitter = new PageSplitter($llist->getCount(), 30); 172 $llist->setPageSplitter($pagesplitter); 173 $table = new KillListTable($llist); 174 $table->setDayBreak(false); 175 $html .= $table->generate(); 176 $html .= $pagesplitter->generate(); 177 break; 178 case "combined": 179 $html .= "<div class=kb-kills-header>All kills</div>"; 180 181 $contract = new Contract($ctr_id); 182 $list = $contract->getKillList(); 183 $list->setOrdered(true); 184 if ($scl_id) 185 $list->addVictimShipClass($scl_id); 186 187 $pagesplitter = new PageSplitter($list->getCount(), 20); 188 $list->setPageSplitter($pagesplitter); 189 $table = new KillListTable($list); 190 $table->setDayBreak(false); 191 $html .= $table->generate(); 192 $html .= $pagesplitter->generate(); 193 194 $html .= "<div class=kb-losses-header>All losses</div>"; 195 196 $contract = new Contract($ctr_id); 197 $llist = $contract->getLossList(); 198 $llist->setOrdered(true); 199 if ($scl_id) 200 $llist->addVictimShipClass($scl_id); 201 202 $pagesplitter = new PageSplitter($llist->getCount(), 20); 203 $llist->setPageSplitter($pagesplitter); 204 $table = new KillListTable($llist); 205 $table->setDayBreak(false); 206 $html .= $table->generate(); 207 $html .= $pagesplitter->generate(); 208 break; 202 209 } 203 210 … … 205 212 $menubox->setIcon("menu-item.gif"); 206 213 $menubox->addOption("caption","Overview"); 207 $menubox->addOption("link","Target overview", "?a=cc_detail&ctr_id=".$ _GET['ctr_id']);214 $menubox->addOption("link","Target overview", "?a=cc_detail&ctr_id=".$ctr_id); 208 215 $menubox->addOption("caption","Kills & losses"); 209 $menubox->addOption("link","Recent activity", "?a=cc_detail&ctr_id=".$ _GET['ctr_id']."&view=recent_activity");210 $menubox->addOption("link","All kills", "?a=cc_detail&ctr_id=".$ _GET['ctr_id']."&view=kills");211 $menubox->addOption("link","All losses", "?a=cc_detail&ctr_id=".$ _GET['ctr_id']."&view=losses");216 $menubox->addOption("link","Recent activity", "?a=cc_detail&ctr_id=".$ctr_id."&view=recent_activity"); 217 $menubox->addOption("link","All kills", "?a=cc_detail&ctr_id=".$ctr_id."&view=kills"); 218 $menubox->addOption("link","All losses", "?a=cc_detail&ctr_id=".$ctr_id."&view=losses"); 212 219 213 220 $page->addContext($menubox->generate()); … … 219 226 $tklist->generate(); 220 227 if ($contract->getCampaign()) 221 222 else 223 228 $campaign = "campaign"; 229 else 230 $campaign = "contract"; 224 231 $tkbox = new AwardBox($tklist, "Top killers", "kills in this ".$campaign, "kills", "eagle"); 225 232 … … 228 235 if (config::get('kill_points')) 229 236 { 230 231 232 233 234 235 236 237 $tklist = new TopContractScoreList(); 238 $tklist->setContract(new Contract($ctr_id)); 239 involved::load($tklist,'kill'); 240 241 $tklist->generate(); 242 $tkbox = new AwardBox($tklist, "Top scorers", "points in this ".$campaign, "points", "redcross"); 243 $page->addContext($tkbox->generate()); 237 244 } 238 245 -
dev/common/corp_detail.php
r453 r459 11 11 $crp_id = intval($_GET['crp_id']); 12 12 $crp_external_id = intval($_GET['crp_external_id']); 13 13 14 if (!$crp_id && !$crp_external_id) 14 15 { 15 16 17 18 19 20 21 22 23 16 if (CORP_ID) 17 { 18 $crp_id = CORP_ID; 19 } 20 else 21 { 22 echo 'no valid corp id specified<br/>'; 23 return; 24 } 24 25 } 25 26 … … 35 36 } 36 37 37 $month = $_GET['m'];38 $year = $_GET['y'];38 $month = intval($_GET['m']); 39 $year = intval($_GET['y']); 39 40 40 41 if ($month == '') 41 42 $month = kbdate('m'); 42 43 43 44 if ($year == '') 44 45 $year = kbdate('Y'); 45 46 46 47 if ($month == 12) 47 48 { 48 49 49 $nmonth = 1; 50 $nyear = $year + 1; 50 51 } 51 52 else 52 53 { 53 54 54 $nmonth = $month + 1; 55 $nyear = $year; 55 56 } 56 57 if ($month == 1) 57 58 { 58 59 59 $pmonth = 12; 60 $pyear = $year - 1; 60 61 } 61 62 else 62 63 { 63 64 64 $pmonth = $month - 1; 65 $pyear = $year; 65 66 } 66 67 $monthname = kbdate("F", strtotime("2000-".$month."-2")); 67 68 68 $all_id = $_GET['all_id'];69 $all_id = intval($_GET['all_id']); 69 70 $corp = new Corporation($crp_id); 70 71 $alliance = $corp->getAlliance(); … … 80 81 $html .= $myID->fetchXML(); 81 82 $myNames = $myID->getNameData(); 82 83 83 84 $myAPI = new API_CorporationSheet(); 84 85 $myAPI->setCorpID($myNames[0]['characterID']); … … 89 90 { 90 91 $page = new Page('Corporation details - '.$corp->getName()); 91 } else { 92 } else 93 { 92 94 $page = new Page('Corporation details - '.$corp->getName() . " [" . $myAPI->getTicker() . "]"); 93 95 } … … 96 98 if (file_exists("img/corps/".$corp->getID().".jpg") || file_exists("img/corps/".$corp->getUnique().".jpg")) 97 99 { 98 100 $html .= "<img src=\"".$corp->getPortraitURL(128)."\" border=\"0\" alt=\"\"></td>"; 99 101 } 100 102 else 101 103 { 102 104 if ($alliance != 0) 103 { 105 { 104 106 $mylogo = $myAPI->getLogo(); 105 107 106 108 if ($result == "Corporation is not part of alliance.") 107 109 { 108 110 $html .= "<img src=\"".IMG_URL."/campaign-big.gif\" border=\"0\" alt=\"\"></td>"; 109 } elseif ($result == "") { 110 // create two sized logo's in 2 places - this allows checks already in place not to keep requesting corp logos each time page is viewed 111 // class.thumb.php cannot work with png (although saved as jpg these are actually pngs) therefore we have to create the 128 size for it 112 // doing this prevents the images being rendered each time the function is called and allows it to use one in the cache instead. 111 } elseif ($result == "") 112 { 113 // create two sized logo's in 2 places - this allows checks already in place not to keep requesting corp logos each time page is viewed 114 // class.thumb.php cannot work with png (although saved as jpg these are actually pngs) therefore we have to create the 128 size for it 115 // doing this prevents the images being rendered each time the function is called and allows it to use one in the cache instead. 113 116 CorporationLogo( $mylogo, 64, $corp->getID() ); 114 117 CorporationLogo( $mylogo, 128, $corp->getID() ); 115 118 116 119 $html .= "<img src=\"".$corp->getPortraitURL(128)."\" border=\"0\" alt=\"\"></td>"; 117 } else { 118 // some kind of error getting details from CCP so abort writing file(s) allowing us to try again later - in the meantime, lets print trusty default 119 // error text will also appear where the picture is, which is nice 120 } else 121 { 122 // some kind of error getting details from CCP so abort writing file(s) allowing us to try again later - in the meantime, lets print trusty default 123 // error text will also appear where the picture is, which is nice 120 124 $html .= "<img src=\"".IMG_URL."/campaign-big.gif\" border=\"0\" alt=\"\"></td>"; 121 } 122 } else { 125 } 126 } else 127 { 123 128 $html .= "<img src=\"".IMG_URL."/campaign-big.gif\" border=\"0\" alt=\"\"></td>"; 124 129 } … … 130 135 if ($alliance->getName() == "Unknown" || $alliance->getName() == "None") 131 136 { 132 137 $html .= "<b>".$alliance->getName()."</b>"; 133 138 } 134 139 else 135 140 { 136 141 $html .= "<a href=\"?a=alliance_detail&all_id=".$alliance->getID()."\">".$alliance->getName()."</a>"; 137 142 } 138 143 $html .= "</td></tr>"; … … 143 148 if ($kill_summary->getTotalKillISK()) 144 149 { 145 150 $efficiency = round($kill_summary->getTotalKillISK() / ($kill_summary->getTotalKillISK() + $kill_summary->getTotalLossISK()) * 100, 2); 146 151 } 147 152 else 148 153 { 149 154 $efficiency = 0; 150 155 } 151 156 … … 153 158 $html .= "</table>"; 154 159 $html .= "<br/>"; 155 } else { 160 } else 161 { 156 162 $html .= "<td class=kb-table-cell width=150><b>Alliance:</b></td><td class=kb-table-cell>"; 157 163 if ($alliance->getName() == "Unknown" || $alliance->getName() == "None") 158 164 { 159 165 $html .= "<b>".$alliance->getName()."</b>"; 160 166 } 161 167 else 162 168 { 163 169 $html .= "<a href=\"?a=alliance_detail&all_id=".$alliance->getID()."\">".$alliance->getName()."</a>"; 164 170 } 165 171 $html .= "</td><td class=kb-table-cell width=65><b>CEO:</b></td><td class=kb-table-cell><a href=\"?a=search&searchtype=pilot&searchphrase=" . urlencode($myAPI->getCeoName()) . "\">" . $myAPI->getCeoName() . "</a></td></tr>"; … … 174 180 if ($kill_summary->getTotalKillISK()) 175 181 { 176 182 $efficiency = round($kill_summary->getTotalKillISK() / ($kill_summary->getTotalKillISK() + $kill_summary->getTotalLossISK()) * 100, 2); 177 183 } 178 184 else 179 185 { 180 186 $efficiency = 0; 181 187 } 182 188 … … 193 199 if ($_GET['view'] == "" || $_GET['view'] == "kills" || $_GET['view'] == "losses") 194 200 { 195 201 $html .= $summary_html; 196 202 } 197 203 198 204 switch ($_GET['view']) 199 205 { 200 201 202 203 204 205 206 207 208 209 206 case "": 207 $html .= "<div class=kb-kills-header>10 Most recent kills in the last 30 days</div>"; 208 209 $list = new KillList(); 210 $list->setOrdered(true); 211 $list->setLimit(10); 212 $list->setPodsNoobships(true); 213 $list->addInvolvedCorp($corp); 214 if ($_GET['scl_id']) 215 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 210 216 $list->setStartDate(date('Y-m-d H:i',strtotime('-30 days'))); 211 217 212 213 214 215 216 217 218 219 220 221 222 223 224 225 218 $ktab = new KillListTable($list); 219 $ktab->setLimit(10); 220 $ktab->setDayBreak(false); 221 $html .= $ktab->generate(); 222 223 $html .= "<div class=kb-losses-header>10 Most recent losses in the last 30 days</div>"; 224 225 $list = new KillList(); 226 $list->setOrdered(true); 227 $list->setLimit(10); 228 $list->setPodsNoobships(true); 229 $list->addVictimCorp($corp); 230 if ($_GET['scl_id']) 231 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 226 232 $list->setStartDate(date('Y-m-d H:i',strtotime('-30 days'))); 227 233 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 234 $ltab = new KillListTable($list); 235 $ltab->setLimit(10); 236 $ltab->setDayBreak(false); 237 $html .= $ltab->generate(); 238 239 break; 240 case "kills": 241 $html .= "<div class=kb-kills-header>All kills</div>"; 242 243 $list = new KillList(); 244 $list->setOrdered(true); 245 $list->addInvolvedCorp($corp); 246 if ($_GET['scl_id']) 247 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 248 $pagesplitter = new PageSplitter($list->getCount(), 30); 249 $list->setPageSplitter($pagesplitter); 250 $table = new KillListTable($list); 251 $table->setDayBreak(false); 252 $html .= $table->generate(); 253 $html .= $pagesplitter->generate(); 254 255 break; 256 case "losses": 257 $html .= "<div class=kb-losses-header>All losses</div>"; 258 259 $list = new KillList(); 260 $list->setOrdered(true); 261 $list->setPodsNoobships(true); 262 $list->addVictimCorp($corp); 263 if ($_GET['scl_id']) 264 $list->addVictimShipClass(new ShipClass($_GET['scl_id'])); 265 $pagesplitter = new PageSplitter($list->getCount(), 30); 266 $list->setPageSplitter($pagesplitter); 267 268 $table = new KillListTable($list); 269 $table->setDayBreak(false); 270 $html .= $table->generate(); 271 $html .= $pagesplitter->generate(); 272 273 break; 274 case "pilot_kills": 275 $html .= "<div class=block-header2>Top killers</div>"; 276 277 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 278 $html .= "<div class=block-header>$monthname $year</div>"; 279 280 $list = new TopKillsList(); 281 $list->addInvolvedCorp($corp); 282 $list->setPodsNoobShips(false); 283 $list->setMonth($month); 284 $list->setYear($year); 285 $table = new TopPilotTable($list, "Kills"); 286 $html .= $table->generate(); 287 288 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=corp_detail&view=pilot_kills&m=$pmonth&crp_id=$crp_id&y=$pyear'>previous</a></td>"; 289 $html .= "<td align='right'><a href='?a=corp_detail&view=pilot_kills&crp_id=$crp_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 290 291 $html .= "</td><td valign=top width=400>"; 292 $html .= "<div class=block-header>All time</div>"; 293 294 $list = new TopKillsList(); 295 $list->addInvolvedCorp($corp); 296 $list->setPodsNoobShips(false); 297 $table = new TopPilotTable($list, "Kills"); 298 $html .= $table->generate(); 299 300 $html .= "</td></tr></table>"; 301 302 break; 303 case "pilot_scores": 304 $html .= "<div class=block-header2>Top scorers</div>"; 305 306 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 307 $html .= "<div class=block-header>$monthname $year</div>"; 308 309 $list = new TopScoreList(); 310 $list->addInvolvedCorp($corp); 311 $list->setPodsNoobShips(true); 312 $list->setMonth($month); 313 $list->setYear($year); 314 $table = new TopPilotTable($list, "Points"); 315 $html .= $table->generate(); 316 317 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=corp_detail&view=pilot_scores&m=$pmonth&crp_id=$crp_id&y=$pyear'>previous</a></td>"; 318 $html .= "<td align='right'><a href='?a=corp_detail&view=pilot_scores&crp_id=$crp_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 319 320 $html .= "</td><td valign=top width=400>"; 321 $html .= "<div class=block-header>All time</div>"; 322 323 $list = new TopScoreList(); 324 $list->addInvolvedCorp($corp); 325 $list->setPodsNoobShips(true); 326 $table = new TopPilotTable($list, "Points"); 327 $html .= $table->generate(); 328 329 $html .= "</td></tr></table>"; 330 331 break; 332 case "pilot_solo": 333 $html .= "<div class=block-header2>Top solokillers</div>"; 334 335 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 336 $html .= "<div class=block-header>$monthname $year</div>"; 337 338 $list = new TopSoloKillerList(); 339 $list->addInvolvedCorp($corp); 340 $list->setPodsNoobShips(false); 341 $list->setMonth($month); 342 $list->setYear($year); 343 $table = new TopPilotTable($list, "Solokills"); 344 $html .= $table->generate(); 345 346 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=corp_detail&view=pilot_solo&m=$pmonth&crp_id=$crp_id&y=$pyear'>previous</a></td>"; 347 $html .= "<td align='right'><a href='?a=corp_detail&view=pilot_solo&crp_id=$crp_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 348 349 $html .= "</td><td valign=top width=400>"; 350 $html .= "<div class=block-header>All time</div>"; 351 352 $list = new TopSoloKillerList(); 353 $list->addInvolvedCorp($corp); 354 $list->setPodsNoobShips(false); 355 $table = new TopPilotTable($list, "Solokills"); 356 $html .= $table->generate(); 357 358 $html .= "</td></tr></table>"; 359 360 break; 361 362 case "pilot_damage": 363 $html .= "<div class=block-header2>Top damagedealers</div>"; 364 365 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 366 $html .= "<div class=block-header>$monthname $year</div>"; 367 368 $list = new TopDamageDealerList(); 369 $list->addInvolvedCorp($corp); 370 $list->setPodsNoobShips(false); 371 $list->setMonth($month); 372 $list->setYear($year); 373 $table = new TopPilotTable($list, "Kills"); 374 $html .= $table->generate(); 375 376 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=corp_detail&view=pilot_damage&m=$pmonth&crp_id=$crp_id&y=$pyear'>previous</a></td>"; 377 $html .= "<td align='right'><a href='?a=corp_detail&view=pilot_damage&crp_id=$crp_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 378 379 $html .= "</td><td valign=top width=400>"; 380 $html .= "<div class=block-header>All time</div>"; 381 382 $list = new TopDamageDealerList(); 383 $list->addInvolvedCorp($corp); 384 $list->setPodsNoobShips(false); 385 $table = new TopPilotTable($list, "Kills"); 386 $html .= $table->generate(); 387 388 $html .= "</td></tr></table>"; 389 390 break; 391 392 case "pilot_griefer": 393 $html .= "<div class=block-header2>Top griefers</div>"; 394 395 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 396 $html .= "<div class=block-header>$monthname $year</div>"; 397 398 $list = new TopGrieferList(); 399 $list->addInvolvedCorp($corp); 400 $list->setMonth($month); 401 $list->setYear($year); 402 $table = new TopPilotTable($list, "Kills"); 403 $html .= $table->generate(); 404 405 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=corp_detail&view=pilot_griefer&m=$pmonth&crp_id=$crp_id&y=$pyear'>previous</a></td>"; 406 $html .= "<td align='right'><a href='?a=corp_detail&view=pilot_griefer&crp_id=$crp_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 407 408 $html .= "</td><td valign=top width=400>"; 409 $html .= "<div class=block-header>All time</div>"; 410 411 $list = new TopGrieferList(); 412 $list->addInvolvedCorp($corp); 413 $table = new TopPilotTable($list, "Kills"); 414 $html .= $table->generate(); 415 416 $html .= "</td></tr></table>"; 417 418 break; 419 420 case "pilot_losses": 421 $html .= "<div class=block-header2>Top losers</div>"; 422 423 $html .= "<table class=kb-subtable><tr><td valign=top width=440>"; 424 $html .= "<div class=block-header>$monthname $year</div>"; 425 426 $list = new TopLossesList(); 427 $list->addVictimCorp($corp); 428 $list->setPodsNoobShips(false); 429 $list->setMonth($month); 430 $list->setYear($year); 431 $table = new TopPilotTable($list, "Losses"); 432 $html .= $table->generate(); 433 434 $html .= "<table width=300 cellspacing=1><tr><td><a href='?a=corp_detail&view=pilot_losses&m=$pmonth&crp_id=$crp_id&y=$pyear'>previous</a></td>"; 435 $html .= "<td align='right'><a href='?a=corp_detail&view=pilot_losses&crp_id=$crp_id&m=$nmonth&y=$nyear'>next</a></p></td></tr></table>"; 436 437 $html .= "</td><td valign=top width=400>"; 438 $html .= "<div class=block-header>All time</div>"; 439 440 $list = new TopLossesList(); 441 $list->addVictimCorp($corp); 442 $list->setPodsNoobShips(false); 443 $table = new TopPilotTable($list, "Losses"); 444 $html .= $table->generate(); 445 446 $html .= "</td></tr></table>"; 447 448 break; 449 case "ships_weapons": 450 $html .= "<div class=block-header2>Ships & weapons used</div>"; 451 452 $html .= "<table class=kb-subtable><tr><td valign=top width=400>"; 453 $shiplist = new TopShipList(); 454 $shiplist->addInvolvedCorp($corp); 455 $shiplisttable = new TopShipListTable($shiplist); 456 $html .= $shiplisttable->generate(); 457 $html .= "</td><td valign=top align=right width=400>"; 458 459 $weaponlist = new TopWeaponList(); 460 $weaponlist->addInvolvedCorp($corp); 461 $weaponlisttable = new TopWeaponListTable($weaponlist); 462 $html .= $weaponlisttable->generate(); 463 $html .= "</td></tr></table>"; 464 465 break; 466 case 'violent_systems': 467 $html .= "<div class=block-header2>Most violent systems</div>"; 468 $html .= "<table width=\"99%\"><tr><td align=center valign=top>"; 469 470 $html .= "<div class=block-header>This month</div>"; 471 $html .= "<table class=kb-table>"; 472 $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center >Kills</td></tr>"; 473 474 $sql = "select sys.sys_name, sys.sys_sec, sys.sys_id, count(distinct kll.kll_id) as kills 469 475 from kb3_systems sys, kb3_kills kll, kb3_inv_detail inv 470 476 where kll.kll_system_id = sys.sys_id 471 477 and inv.ind_kll_id = kll.kll_id"; 472 478 473 474 475 476 477 478 479 if ($crp_id) 480 $sql .= " and inv.ind_crp_id in (".$crp_id.")"; 481 if ($all_id) 482 $sql .= " and inv.ind_all_id = ".$all_id; 483 484 $sql .= " and date_format( kll.kll_timestamp, \"%c\" ) = ".kbdate("m")." 479 485 and date_format( kll.kll_timestamp, \"%Y\" ) = ".kbdate("Y")." 480 486 group by sys.sys_name … … 482 488 limit 25"; 483 489 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 490 $qry = new DBQuery(); 491 $qry->execute($sql); 492 $odd = false; 493 $counter = 1; 494 while ($row = $qry->getRow()) 495 { 496 if (!$odd) 497 { 498 $odd = true; 499 $rowclass = 'kb-table-row-odd'; 500 } 501 else 502 { 503 $odd = false; 504 $rowclass = 'kb-table-row-even'; 505 } 506 507 $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell width=180><b><a href=\"?a=system_detail&sys_id=".$row['sys_id']."\">".$row['sys_name']."</a></b> (".roundsec($row['sys_sec']).")</td><td align=center>".$row['kills']."</td></tr>"; 508 $counter++; 509 } 510 511 $html .= "</table>"; 512 513 $html .= "</td><td align=center valign=top>"; 514 $html .= "<div class=block-header>All-Time</div>"; 515 $html .= "<table class=kb-table>"; 516 $html .= "<tr class=kb-table-header><td>#</td><td width=180>System</td><td width=40 align=center>Kills</td></tr>"; 517 518 $sql = "select sys.sys_name, sys.sys_id, sys.sys_sec, count(distinct kll.kll_id) as kills 513 519 from kb3_systems sys, kb3_kills kll, kb3_inv_detail inv 514 520 where kll.kll_system_id = sys.sys_id 515 521 and inv.ind_kll_id = kll.kll_id"; 516 522 517 518 519 520 521 522 523 if ($crp_id) 524 $sql .= " and inv.ind_crp_id in (".$crp_id.")"; 525 if ($all_id) 526 $sql .= " and inv.ind_all_id = ".$all_id; 527 528 $sql .= " group by sys.sys_name 523 529 order by kills desc 524 530 limit 25"; 525 531 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 532 $qry = new DBQuery(); 533 $qry->execute($sql); 534 $odd = false; 535 $counter = 1; 536 while ($row = $qry->getRow()) 537 { 538 if (!$odd) 539 { 540 $odd = true; 541 $rowclass = 'kb-table-row-odd'; 542 } 543 else 544 { 545 $odd = false; 546 $rowclass = 'kb-table-row-even'; 547 } 548 549 $html .= "<tr class=".$rowclass."><td><b>".$counter.".</b></td><td class=kb-table-cell><b><a href=\"?a=system_detail&sys_id=".$row['sys_id']."\">".$row['sys_name']."</a></b> (".roundsec($row['sys_sec']).")</td><td align=center>".$row['kills']."</td></tr>"; 550 $counter++; 551 } 552 $html .= "</table>"; 553 $html .= "</td></tr></table>"; 554 break; 549 555 } 550 556 … … 561 567 562 568 if (config::get('kill_points')) 563 569 $menubox->addOption("link","Top scorers", "?a=corp_detail&crp_id=" . $corp->getID() . "&view=pilot_scores"); 564 570 $menubox->addOption("link","Top solokillers", "?a=corp_detail&crp_id=" . $corp->getID() . "&view=pilot_solo"); 565 571 $menubox->addOption("link","Top damagedealers", "?a=corp_detail&crp_id=" . $corp->getID() . "&view=pilot_damage"); -
dev/common/includes/class.cache.php
r449 r459 60 60 function check($page) 61 61 { 62 $cachefile = cache::genCacheName(); 63 62 64 // If the cache doesn't exist then we don't need to check times. 63 65 if (cache::shouldCache($page) && file_exists(cache::genCacheName())) 64 66 { 65 $cachefile = cache::genCacheName(); 66 67 67 68 $times = explode(',', config::get('cache_times')); 68 69 foreach ($times as $string) -
dev/common/includes/class.session.php
r455 r459 3 3 class session 4 4 { 5 6 7 8 9 10 11 12 13 14 15 5 function init() 6 { 7 if (isset($_REQUEST[session_name()])) 8 { 9 session_start(); 10 if (isset($_SESSION['user'])) 11 { 12 user::loggedin(true); 13 } 14 } 15 } 16 16 17 18 19 return (bool)(isset($_SESSION['admin'])&& $_SESSION['rsite'] == $_SERVER["HTTP_HOST"] && md5(KB_SITE) == $_SESSION['site']);20 17 function isAdmin() 18 { 19 return (bool)($_SESSION['admin'] && $_SESSION['rsite'] == $_SERVER["HTTP_HOST"] && md5(KB_SITE) == $_SESSION['site']); 20 } 21 21 22 23 24 return (bool)(isset($_SESSION['admin_super'])&& $_SESSION['rsite'] == $_SERVER["HTTP_HOST"] && md5(KB_SITE) == $_SESSION['site']);25 22 function isSuperAdmin() 23 { 24 return (bool)($_SESSION['admin_super'] && $_SESSION['rsite'] == $_SERVER["HTTP_HOST"] && md5(KB_SITE) == $_SESSION['site']); 25 } 26 26 27 28 29 27 function create($admin = false) 28 { 29 session_start(); 30 30 session_regenerate_id(); 31 31 $_SESSION['admin'] = $admin; 32 32 $_SESSION['rsite'] = $_SERVER["HTTP_HOST"]; 33 33 $_SESSION['site'] = md5(KB_SITE); 34 34 } 35 35 36 37 38 39 36 function destroy() 37 { 38 session_destroy(); 39 } 40 40 } 41 41 ?> -
dev/common/includes/class.summary.php
r441 r459 150 150 foreach($kill->involvedparties_ as $inv) 151 151 { 152 if(i ntval($alls[$inv->getAllianceID()])) continue;152 if(isset($alls[$inv->getAllianceID()])) continue; 153 153 $alls[$inv->getAllianceID()] = 1; 154 154 $qry->execute("SELECT 1 FROM kb3_sum_alliance WHERE asm_all_id = ".$inv->getAllianceID()); … … 186 186 foreach($kill->involvedparties_ as $inv) 187 187 { 188 if(i ntval($alls[$inv->getAllianceID()])) continue;188 if(isset($alls[$inv->getAllianceID()])) continue; 189 189 $alls[$inv->getAllianceID()] = 1; 190 190 $qry->execute("SELECT 1 FROM kb3_sum_alliance WHERE asm_all_id = ".$inv->getAllianceID()); … … 219 219 foreach($kill->involvedparties_ as $inv) 220 220 { 221 if(i ntval($alls[$inv->getAllianceID()])) continue;221 if(isset($alls[$inv->getAllianceID()])) continue; 222 222 $alls[$inv->getAllianceID()] = 1; 223 223 $qry->execute("SELECT 1 FROM kb3_sum_alliance WHERE asm_all_id = ".$inv->getAllianceID()); … … 333 333 foreach($kill->involvedparties_ as $inv) 334 334 { 335 if(i ntval($alls[$inv->getcorpID()])) continue;335 if(isset($alls[$inv->getcorpID()])) continue; 336 336 $alls[$inv->getcorpID()] = 1; 337 337 $qry->execute("SELECT 1 FROM kb3_sum_corp WHERE csm_crp_id = ".$inv->getcorpID()); … … 369 369 foreach($kill->involvedparties_ as $inv) 370 370 { 371 if(i ntval($alls[$inv->getCorpID()])) continue;371 if(isset($alls[$inv->getCorpID()])) continue; 372 372 $alls[$inv->getCorpID()] = 1; 373 373 $qry->execute("SELECT 1 FROM kb3_sum_corp WHERE csm_crp_id = ".$inv->getCorpID()); … … 402 402 foreach($kill->involvedparties_ as $inv) 403 403 { 404 if(i ntval($alls[$inv->getCorpID()])) continue;404 if(isset($alls[$inv->getCorpID()])) continue; 405 405 $alls[$inv->getCorpID()] = 1; 406 406 $qry->execute("SELECT 1 FROM kb3_sum_corp WHERE csm_crp_id = ".$inv->getCorpID()); … … 516 516 foreach($kill->involvedparties_ as $inv) 517 517 { 518 if(i ntval($alls[$inv->getPilotID()])) continue;518 if(isset($alls[$inv->getPilotID()])) continue; 519 519 $alls[$inv->getPilotID()] = 1; 520 520 $qry->execute("SELECT 1 FROM kb3_sum_pilot WHERE psm_plt_id = ".$inv->getPilotID()); … … 552 552 foreach($kill->involvedparties_ as $inv) 553 553 { 554 if(i ntval($alls[$inv->getPilotID()])) continue;554 if(isset($alls[$inv->getPilotID()])) continue; 555 555 $alls[$inv->getPilotID()] = 1; 556 556 $qry->execute("SELECT 1 FROM kb3_sum_pilot WHERE psm_plt_id = ".$inv->getPilotID()); … … 585 585 foreach($kill->involvedparties_ as $inv) 586 586 { 587 if(i ntval($alls[$inv->getPilotID()])) continue;587 if(isset($alls[$inv->getPilotID()])) continue; 588 588 $alls[$inv->getPilotID()] = 1; 589 589 $qry->execute("SELECT 1 FROM kb3_sum_pilot WHERE psm_plt_id = ".$inv->getPilotID()); -
dev/common/includes/globals.php
r458 r459 7 7 else 8 8 { 9 $svn_rev = '45 8';9 $svn_rev = '459'; 10 10 } 11 11 define('SVN_REV', $svn_rev); … … 15 15 // current version: major.minor.sub 16 16 // unpair numbers for minor = development version 17 define('KB_VERSION', '2.0. 5');17 define('KB_VERSION', '2.0.6'); 18 18 define('KB_RELEASE', '(Apocrypha)'); 19 19 -
dev/common/kill_related.php
r430 r459 475 475 $menubox->setIcon("menu-item.gif"); 476 476 $menubox->addOption("caption", "View"); 477 $menubox->addOption("link", "Back to Killmail", "?a=kill_detail&kll_id=".$ _GET['kll_id']);478 $menubox->addOption("link", "Kills & losses", "?a=kill_related&kll_id=".$ _GET['kll_id']);477 $menubox->addOption("link", "Back to Killmail", "?a=kill_detail&kll_id=".$kll_id); 478 $menubox->addOption("link", "Kills & losses", "?a=kill_related&kll_id=".$kll_id); 479 479 $page->addContext($menubox->generate()); 480 480 -
dev/common/kills.php
r370 r459 10 10 require_once('common/includes/class.toplist.php'); 11 11 12 $week = $_GET['w'];13 $year = $_GET['y'];12 $week = intval($_GET['w']); 13 $year = intval($_GET['y']); 14 14 15 15 if ($week == '') -
dev/common/losses.php
r370 r459 13 13 } 14 14 15 $week = $_GET['w'];16 $year = $_GET['y'];15 $week = intval($_GET['w']); 16 $year = intval($_GET['y']); 17 17 18 18 if ($week == '') -
dev/common/pilot_detail.php
r399 r459 11 11 $plt_id = intval($_GET['plt_id']); 12 12 $plt_external_id = intval($_GET['plt_external_id']); 13 $scl_id = intval($_GET['scl_did']); 14 13 15 if(!$plt_id) 14 16 { … … 127 129 $list->setOrdered(true); 128 130 $list->addInvolvedPilot($pilot); 129 if ($ _GET['scl_id'])130 $list->addVictimShipClass( new ShipClass($_GET['scl_id']));131 if ($scl_id) 132 $list->addVictimShipClass($scl_id); 131 133 $pagesplitter = new PageSplitter($list->getCount(), 30); 132 134 $list->setPageSplitter($pagesplitter); … … 144 146 $list->setPodsNoobships(true); 145 147 $list->addVictimPilot($pilot); 146 if ($ _GET['scl_id'])147 $list->addVictimShipClass( new ShipClass($_GET['scl_id']));148 if ($scl_id) 149 $list->addVictimShipClass($scl_id); 148 150 $pagesplitter = new PageSplitter($list->getCount(), 30); 149 151 $list->setPageSplitter($pagesplitter); … … 180 182 $list->setPodsNoobships(true); 181 183 $list->addInvolvedPilot($pilot); 182 if ($ _GET['scl_id'])183 $list->addVictimShipClass( new ShipClass($_GET['scl_id']));184 if ($scl_id) 185 $list->addVictimShipClass($scl_id); 184 186 185 187 $table = new KillListTable($list); … … 195 197 $list->setPodsNoobships(true); 196 198 $list->addVictimPilot($pilot); 197 if ($ _GET['scl_id'])198 $list->addVictimShipClass( new ShipClass($_GET['scl_id']));199 if ($scl_id) 200 $list->addVictimShipClass($scl_id); 199 201 200 202 $table = new KillListTable($list); -
dev/common/system_detail.php
r370 r459 6 6 7 7 $sys_id = intval($_GET['sys_id']); 8 $scl_id = intval($_GET['scl_did']); 8 9 9 10 if (!$sys_id) … … 47 48 } 48 49 $klist->addSystem($system); 49 if ($ _GET['scl_id'])50 $klist->addVictimShipClass( new ShipClass($_GET['scl_id']));50 if ($scl_id) 51 $klist->addVictimShipClass($scl_id); 51 52 else 52 53 $klist->setPodsNoobShips(false);