Changeset 292 for dev/common

Show
Ignore:
Timestamp:
12/17/07 13:31:57 (14 years ago)
Author:
ralle030583
Message:

- added option to change slot in kill_detail when logged in as admin

Location:
dev/common
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • dev/common/includes/globals.php

    r288 r292  
    11<?php 
    22// current subversion revision 
    3 preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 288 $', $match); 
     3preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 292 $', $match); 
    44define('SVN_REV', $match[1]); 
    55 
  • dev/common/kill_detail.php

    r282 r292  
    1313    { 
    1414        $smarty->assign('admin', 'true'); 
    15         if (isset($_POST['submit'])) 
     15        if (isset($_POST['submit']) == 'UpdateValue') 
    1616        { 
    1717            // Send new value for item to the database 
     
    2424} 
    2525 
     26if (isset($_GET['view']) == 'FixSlot'){ 
     27    $smarty->assign('fixSlot', 'true'); 
     28} 
     29 
     30if ($page->isAdmin()) 
     31{ 
     32    if (isset($_GET['view']) == 'FixSlot'){ 
     33        $smarty->assign('fixSlot', 'true'); 
     34    } 
     35 
     36 
     37         $smarty->assign('admin', 'true'); 
     38         if (isset($_POST['submit']) == 'UpdateSlot') 
     39     { 
     40         $IID = $_POST['IID']; 
     41         $KID = $_POST['KID']; 
     42         $Val = $_POST[$IID]; 
     43         $table = $_POST['TYPE']; 
     44         $old = $_POST['OLDSLOT']; 
     45         $qry = new DBQuery(); 
     46         $qry->execute("UPDATE kb3_items_".$table." SET itd_itl_id ='".$Val."' WHERE itd_itm_id=".$IID." AND itd_kll_id = ".$KID." AND itd_itl_id = ".$old); 
     47         //echo "UPDATE kb3_items_".$table." itd_itl_id ='".$Val."' WHERE itd_itm_id=".$IID." AND itd_kll_id = ".$KID." AND itd_itl_id = ".$old; 
     48     } 
     49} 
     50 
    2651if (!$kll_id = intval($_GET['kll_id'])) 
    2752{ 
     
    4267 
    4368// victim $smarty->assign('',); 
     69$smarty->assign('KillId', $kill->getID()); 
    4470$smarty->assign('VictimPortrait', $kill->getVictimPortrait(64)); 
    4571$smarty->assign('VictimURL', "?a=pilot_detail&plt_id=".$kill->getVictimID()); 
     
    161187            $formatted = $destroyed->getFormatttedValue(); 
    162188        } 
    163         $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 
     189        $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $destroyed->getLocationID()); 
    164190    } 
    165191} 
     
    184210            $formatted = $dropped->getFormatttedValue(); 
    185211        } 
    186         $drop_array[$dropped->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 
     212        $drop_array[$dropped->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $dropped->getLocationID()); 
    187213    } 
    188214} 
     
    223249    $menubox->addOption("caption", "Admin"); 
    224250    $menubox->addOption("link", "Delete", "javascript:openWindow('?a=admin_kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); 
     251    $menubox->addOption("link", "Fix Slots", "?a=kill_detail&kll_id=".$kill->getID()."&view=FixSlot"); 
     252     
    225253} 
    226254$page->addContext($menubox->generate());