Revision 3, 1.3 KB
(checked in by andrewgunn, 15 years ago)
|
Added: Delete Killmail option in admin menu (common/admin_menu.php), and code to handle deletions of killmails (common/kill_delete.php).
Fixed: Added some code to fix a serious bug when the killboard tries to import a mail with a "final blow".
Note: All of these code sniplets were grabbed off the EVE-Online forums. So I take no credit for them, and no responsiblity if break something else.
|
Line | |
---|
1 | <? |
---|
2 | require_once( "db.php" ); |
---|
3 | require_once( "class.page.php" ); |
---|
4 | require_once( "class.kill.php" ); |
---|
5 | require_once( "class.tabbedform.php" ); |
---|
6 | require_once( "admin_menu.php" ); |
---|
7 | |
---|
8 | $page = new Page( "Administration - Deletion of Kills" ); |
---|
9 | $page->setAdmin(); |
---|
10 | $dbconn = new DBConnection(); |
---|
11 | $kll_id = $_GET['kll_id']; |
---|
12 | |
---|
13 | if ( $_GET['confirm'] ) { |
---|
14 | $kill = new Kill( $kll_id ); |
---|
15 | $kill->remove(); |
---|
16 | $html .= "Kill ID \"".$_GET['kll_id']."\" deleted!"; |
---|
17 | $html .= "<br><br><a href=\"javascript:window.history.go(-3);\">[go back]</a>"; |
---|
18 | $page->setContent( $html ); |
---|
19 | $page->addContext( $menubox->generate() ); |
---|
20 | $page->generate(); |
---|
21 | exit; |
---|
22 | } |
---|
23 | if (!isset($_POST['submit'])) { |
---|
24 | $html .= "<form method='post' action="; |
---|
25 | echo $PHP_SELF; |
---|
26 | $html .= ">"; |
---|
27 | $html .= "Kill ID: <input type='text' size='12' maxlength='12' name='killd'> "; |
---|
28 | $html .= "<input type='submit' value='Submit' name='submit'>"; |
---|
29 | $html .= "</form>"; |
---|
30 | } else { |
---|
31 | $html .= "Confirm deletion of Kill ID \"".$_POST["killd"]."\"? "; |
---|
32 | $html .= "<br /><br /><button onClick=\"window.location.href='?a=kill_delete&confirm=yes&kll_id=".$_POST["killd"]."'\">Yes</button> "; |
---|
33 | $html .= " <button onClick=\"window.history.back();\">No</button>"; |
---|
34 | } |
---|
35 | |
---|
36 | $page->setContent( $html ); |
---|
37 | $page->addContext( $menubox->generate() ); |
---|
38 | $page->generate(); |
---|
39 | ?> |
---|