Show
Ignore:
Timestamp:
10/14/06 23:14:11 (15 years ago)
Author:
andrewgunn
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/kill_delete.php

    r2 r3  
    11<? 
    2   require_once( "db.php" ); 
    3   require_once( "class.page.php" ); 
    4   require_once( "class.kill.php" ); 
    5    
    6   $page = new Page( "Delete kill" ); 
    7   $page->setSuperAdmin(); 
    8   $dbconn = new DBConnection(); 
     2require_once( "db.php" ); 
     3require_once( "class.page.php" ); 
     4require_once( "class.kill.php" ); 
     5require_once( "class.tabbedform.php" ); 
     6require_once( "admin_menu.php" ); 
    97 
    10   $kll_id = $_POST['kll_id']; 
     8$page = new Page( "Administration - Deletion of Kills" ); 
     9$page->setAdmin(); 
     10$dbconn = new DBConnection(); 
     11$kll_id = $_GET['kll_id']; 
    1112 
    12   $kill = new Kill( $kll_id ); 
    13   $kill->remove(); 
     13if ( $_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} 
     23if (!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'>&nbsp;"; 
     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 .= "&nbsp<button onClick=\"window.history.back();\">No</button>"; 
     34} 
    1435 
    15   $html .= "<br><br><a href=\"?a=superadmin\">[Back]</a>"; 
    16  
    17   $page->setContent( $html ); 
    18   $page->generate(); 
     36$page->setContent( $html ); 
     37$page->addContext( $menubox->generate() ); 
     38$page->generate(); 
    1939?>