Show
Ignore:
Timestamp:
12/31/07 14:30:49 (14 years ago)
Author:
ralle030583
Message:

- Fix:

merged the last few changes into kill_detail (slotfix) into fitting mod

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/mods/fitting/kill_detail.php

    r302 r307  
    55require_once('common/includes/class.alliance.php'); 
    66 
    7 $page = new Page('Kill details - MOD'); 
     7$page = new Page('Kill details with Fitting MOD'); 
    88 
    99if (config::get('item_values')) 
     
    1313    { 
    1414        $smarty->assign('admin', 'true'); 
    15         if (isset($_POST['submit'])) 
     15        if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') 
    1616        { 
    1717            // Send new value for item to the database 
     
    1919            $Val = $_POST[$IID]; 
    2020            $qry = new DBQuery(); 
    21             $qry->execute("UPDATE kb3_items SET itm_value ='".$Val."' WHERE itm_id='".$IID."'"); 
     21            $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('".$IID."', '".$Val."') ON DUPLICATE KEY UPDATE price = '".$Val."'"); 
    2222        } 
     23    } 
     24} 
     25 
     26if ($page->isAdmin()) 
     27{ 
     28    if (isset($_GET['view']) && $_GET['view']== 'FixSlot') 
     29    { 
     30            $smarty->assign('fixSlot', 'true'); 
     31    } 
     32 
     33    $smarty->assign('admin', 'true'); 
     34    if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateSlot') 
     35    { 
     36        $IID = $_POST['IID']; 
     37        $KID = $_POST['KID']; 
     38        $Val = $_POST[$IID]; 
     39        $table = $_POST['TYPE']; 
     40        $old = $_POST['OLDSLOT']; 
     41        $qry = new DBQuery(); 
     42        $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); 
    2343    } 
    2444} 
     
    4262 
    4363// victim $smarty->assign('',); 
     64$smarty->assign('KillId', $kill->getID()); 
    4465$smarty->assign('VictimPortrait', $kill->getVictimPortrait(64)); 
    4566$smarty->assign('VictimURL', "?a=pilot_detail&plt_id=".$kill->getVictimID()); 
     
    144165$smarty->assign('VictimShipImg', $ship->getImage(64)); 
    145166 
     167// preparing slot layout 
     168 
     169    $slot_array = array(); 
     170    $slot_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 
     171    $slot_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 
     172    $slot_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 
     173    $slot_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 
     174    $slot_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 
     175    $slot_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 
     176 
    146177// ship fitting 
    147178if (count($kill->destroyeditems_) > 0) 
    148179{ 
    149180    $dest_array = array(); 
    150     $dest_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 
    151     $dest_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 
    152     $dest_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 
    153     $dest_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 
    154     $dest_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 
    155     $dest_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 
    156  
    157181    foreach($kill->destroyeditems_ as $destroyed) 
    158182    { 
     
    164188            $formatted = $destroyed->getFormatttedValue(); 
    165189        } 
    166         $dest_array[$destroyed->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 
     190        $dest_array[$destroyed->getLocationID()][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $destroyed->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $destroyed->getLocationID()); 
    167191                 
    168192                //Fitting, KE - add destroyed items to an array of all fitted items. 
     
    181205{ 
    182206    $drop_array = array(); 
    183     $drop_array[1] = array('img' => 'icon08_11.png', 'text' => 'Fitted - High slot', 'items' => array()); 
    184     $drop_array[2] = array('img' => 'icon08_10.png', 'text' => 'Fitted - Mid slot', 'items' => array()); 
    185     $drop_array[3] = array('img' => 'icon08_09.png', 'text' => 'Fitted - Low slot', 'items' => array()); 
    186     $drop_array[5] = array('img' => 'icon68_01.png', 'text' => 'Fitted - Rig slot', 'items' => array()); 
    187     $drop_array[6] = array('img' => 'icon02_10.png', 'text' => 'Drone bay', 'items' => array()); 
    188     $drop_array[4] = array('img' => 'icon03_14.png', 'text' => 'Cargo Bay', 'items' => array()); 
    189  
    190207    foreach($kill->droppeditems_ as $dropped) 
    191208    { 
     
    197214            $formatted = $dropped->getFormatttedValue(); 
    198215        } 
    199         $drop_array[$dropped->getLocationID()]['items'][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID()); 
     216        $drop_array[$dropped->getLocationID()][] = array('Icon' => $item->getIcon(32), 'Name' => $item->getName(), 'Quantity' => $dropped->getQuantity(), 'Value' => $formatted, 'single_unit' => $value, 'itemID' => $item->getID(),'slotID' => $dropped->getLocationID()); 
    200217                 
    201218                //Fitting -KE, add dropped items to the list 
     
    269286$dropvalue = number_format($dropvalue, 2); 
    270287 
    271  
    272288$smarty->assign_by_ref('destroyed', $dest_array); 
    273289$smarty->assign_by_ref('dropped', $drop_array); 
     290$smarty->assign_by_ref('slots', $slot_array); 
    274291$smarty->assign_by_ref('fitting_high', $fitting_array[1]); 
    275292$smarty->assign_by_ref('fitting_med', $fitting_array[2]); 
     
    293310    $menubox->addOption("caption", "Admin"); 
    294311    $menubox->addOption("link", "Delete", "javascript:openWindow('?a=admin_kill_delete&kll_id=".$kill->getID()."', null, 420, 300, '' );"); 
     312    $menubox->addOption("link", "Fix Slots", "?a=kill_detail&kll_id=".$kill->getID()."&view=FixSlot"); 
     313 
    295314} 
    296315$page->addContext($menubox->generate());