Changeset 432
- Timestamp:
- 07/21/09 04:18:45 (13 years ago)
- Location:
- dev
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin/option_config.php
r361 r432 16 16 17 17 options::cat('Advanced', 'Configuration', 'Corp/Alliance ID'); 18 options::fadd('CORP_ID', 'cfg_corpid', ' edit:size:5');19 options::fadd('ALLIANCE_ID', 'cfg_allianceid', ' edit:size:5');18 options::fadd('CORP_ID', 'cfg_corpid', 'custom', array('admin_config', 'createCorp')); 19 options::fadd('ALLIANCE_ID', 'cfg_allianceid', 'custom', array('admin_config', 'createAlliance')); 20 20 21 21 class admin_config … … 56 56 return $options; 57 57 } 58 function createCorp() 59 { 60 $qry = new DBQuery(); 61 if(isset($_POST['option']['cfg_corpid'])) $crp_id=intval($_POST['option']['cfg_corpid']); 62 else $crp_id = CORP_ID; 63 $qry->execute("SELECT crp_name FROM kb3_corps WHERE crp_id = ".$crp_id); 64 $html = '<input type="edit" id="option[cfg_corpid]" name="option[cfg_corpid]" value="'.$crp_id.'" size="5" maxlength="15">'; 65 if(!$qry->recordCount()) return $html; 66 $res = $qry->getRow(); 67 return $html . ' ('.$res['crp_name'].')'; 68 } 69 function createAlliance() 70 { 71 $qry = new DBQuery(); 72 if(isset($_POST['option']['cfg_corpid'])) $crp_id=intval($_POST['option']['cfg_corpid']); 73 else $crp_id = CORP_ID; 74 if($crp_id) $all_id=0; 75 elseif($_POST['option']['cfg_allianceid']) $all_id=intval($_POST['option']['cfg_allianceid']); 76 else $all_id = ALLIANCE_ID; 77 $qry->execute("SELECT all_name FROM kb3_alliances WHERE all_id = ".$all_id); 78 $html = '<input type="edit" id="option[cfg_allianceid]" name="option[cfg_allianceid]" value="'.$all_id.'" size="5" maxlength="15">'; 79 if(!$qry->recordCount()) return $html; 80 $res = $qry->getRow(); 81 return $html . ' ('.$res['all_name'].')'; 82 } 58 83 } 59 84 ?> -
dev/common/includes/globals.php
r430 r432 7 7 else 8 8 { 9 $svn_rev = '43 0';9 $svn_rev = '432'; 10 10 } 11 11 define('SVN_REV', $svn_rev); -
dev/common/kill_detail.php
r428 r432 75 75 if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') 76 76 { 77 // Send new value for item to the database 78 $IID = $_POST['IID']; 79 $Val = $_POST[$IID]; 80 $qry = new DBQuery(); 77 // Send new value for item to the database 78 $qry = new DBQuery(); 81 79 $qry->autocommit(false); 82 $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('".$IID."', '".$Val."') ON DUPLICATE KEY UPDATE price = '".$Val."'"); 83 foreach($kill->destroyeditems_ as $i => $ditem) 84 { 85 $item = $ditem->getItem(); 86 if($item->getID() == $IID) $kill->destroyeditems_[$i]->value = $Val; 87 } 88 foreach($kill->droppeditems_ as $i=> $ditem) 89 { 90 $item = $ditem->getItem(); 91 if($item->getID() == $IID) $kill->droppeditems_[$i]->value = $Val; 80 if(isset($_POST['SID'])) 81 { 82 $SID = intval($_POST['SID']); 83 $Val = intval($_POST[$SID]); 84 $qry->execute("INSERT INTO kb3_ships_values (shp_id, shp_value) VALUES ('".$SID."', '".$Val."') ON DUPLICATE KEY UPDATE shp_value = '".$Val."'"); 85 $victimship = $kill->getVictimShip(); 86 $kill->setVictimShip(new Ship($victimship->getID() )); 87 } 88 else 89 { 90 $IID = intval($_POST['IID']); 91 $Val = intval($_POST[$IID]); 92 $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('".$IID."', '".$Val."') ON DUPLICATE KEY UPDATE price = '".$Val."'"); 93 foreach($kill->destroyeditems_ as $i => $ditem) 94 { 95 $item = $ditem->getItem(); 96 if($item->getID() == $IID) $kill->destroyeditems_[$i]->value = $Val; 97 } 98 foreach($kill->droppeditems_ as $i=> $ditem) 99 { 100 $item = $ditem->getItem(); 101 if($item->getID() == $IID) $kill->droppeditems_[$i]->value = $Val; 102 } 92 103 } 93 104 $qry->execute("UPDATE kb3_kills SET kll_isk_loss = ".$kill->calculateISKLoss()." WHERE kll_id = ".$kill->getID()); 94 105 $qry->autocommit(true); 95 96 106 } 97 107 } … … 196 206 $smarty->assign('ShipID', $ship->externalid_); 197 207 $smarty->assign('ClassName', $shipclass->getName()); 198 208 if($page->isAdmin()) $smarty->assign('Ship', $ship); 199 209 include_once('common/includes/class.dogma.php'); 200 210 -
dev/mods/apoc_fitting/kill_detail.php
r428 r432 70 70 if ($page->isAdmin()) 71 71 { 72 $smarty->assign('admin', 'true'); 73 74 if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') 75 { 72 if (isset($_POST['submit']) && $_POST['submit'] == 'UpdateValue') 73 { 76 74 // Send new value for item to the database 77 $IID=$_POST['IID']; 78 $Val=$_POST[$IID]; 79 $qry=new DBQuery(); 75 $qry = new DBQuery(); 80 76 $qry->autocommit(false); 81 $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('" . $IID . "', '" . $Val 82 . "') ON DUPLICATE KEY UPDATE price = '" . $Val . "'"); 83 foreach($kill->destroyeditems_ as $i =>$ditem) 77 if(isset($_POST['SID'])) 84 78 { 85 //php4 86 $item = $ditem->getItem(); 87 if($item->getID() == $IID) $kill->destroyeditems_[$i]->value = $Val; 79 $SID = intval($_POST['SID']); 80 $Val = intval($_POST[$SID]); 81 $qry->execute("INSERT INTO kb3_ships_values (shp_id, shp_value) VALUES ('".$SID."', '".$Val."') ON DUPLICATE KEY UPDATE shp_value = '".$Val."'"); 82 $victimship = $kill->getVictimShip(); 83 $kill->setVictimShip(new Ship($victimship->getID() )); 88 84 } 89 foreach($kill->droppeditems_ as $i =>$ditem)85 else 90 86 { 91 //php4 92 $item = $ditem->getItem(); 93 if($item->getID() == $IID) $kill->droppeditems_[$i]->value = $Val; 87 $IID = intval($_POST['IID']); 88 $Val = intval($_POST[$IID]); 89 $qry->execute("INSERT INTO kb3_item_price (typeID, price) VALUES ('".$IID."', '".$Val."') ON DUPLICATE KEY UPDATE price = '".$Val."'"); 90 foreach($kill->destroyeditems_ as $i => $ditem) 91 { 92 $item = $ditem->getItem(); 93 if($item->getID() == $IID) $kill->destroyeditems_[$i]->value = $Val; 94 } 95 foreach($kill->droppeditems_ as $i=> $ditem) 96 { 97 $item = $ditem->getItem(); 98 if($item->getID() == $IID) $kill->droppeditems_[$i]->value = $Val; 99 } 94 100 } 95 101 $qry->execute("UPDATE kb3_kills SET kll_isk_loss = ".$kill->calculateISKLoss()." WHERE kll_id = ".$kill->getID()); 96 102 $qry->autocommit(true); 97 103 } 98 104 } 99 105 } … … 313 319 $smarty->assign('ShipID', $ship->externalid_); 314 320 $smarty->assign('ClassName', $shipclass->getName()); 321 if($page->isAdmin()) $smarty->assign('Ship', $ship); 315 322 316 323 include_once('common/includes/class.dogma.php'); -
dev/mods/apoc_fitting/kill_detail.tpl
r388 r432 302 302 Current single Item Value: 303 303 <input name="IID" value="{$i.itemID}" type="hidden"> 304 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size=" 6">304 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size="8"> 305 305 </div></td> 306 306 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> … … 344 344 <td align="right">{$ShipValue}</td> 345 345 </tr> 346 {if $admin and $config->get('item_values') and !$fixSlot} 347 <tr class="kb-table-row-even"> 348 <td height="34" colspan="4" valign="top" align="right"><form method="post" action=""><table><tr> 349 <td> 350 <div align="right"> 351 Current Ship Value: 352 <input name="SID" value="{$Ship->getID()}" type="hidden"> 353 <input name="{$Ship->getID()}" type="text" class="comment-button" value="{$Ship->getPrice()}" size="10"> 354 </div></td> 355 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> 356 </tr></table></form></td> 357 </tr> 358 {/if} 346 359 <tr class={cycle name=ccl} style="background-color: #600000;"> 347 360 <td style="border: 1px solid #600000;" colspan="3"><div align="right"><strong>Total Loss:</strong></div></td> -
dev/templates/kill_detail.tpl
r388 r432 216 216 Current single Item Value: 217 217 <input name="IID" value="{$i.itemID}" type="hidden"> 218 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size=" 6">218 <input name="{$i.itemID}" type="text" class="comment-button" value="{$i.single_unit}" size="8"> 219 219 </div></td> 220 220 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> … … 297 297 <td align="right">{$ShipValue}</td> 298 298 </tr> 299 {if $admin and $config->get('item_values') and !$fixSlot} 300 <tr class="kb-table-row-even"> 301 <td height="34" colspan="4" valign="top" align="right"><form method="post" action=""><table><tr> 302 <td> 303 <div align="right"> 304 Current Ship Value: 305 <input name="SID" value="{$Ship->getID()}" type="hidden"> 306 <input name="{$Ship->getID()}" type="text" class="comment-button" value="{$Ship->getPrice()}" size="10"> 307 </div></td> 308 <td height="34" valign="top"><input type="submit" name="submit" value="UpdateValue" class="comment-button"></td> 309 </tr></table></form></td> 310 </tr> 311 {/if} 299 312 <tr class="kb-table-row-dropped"> 300 313 <td colspan="3"><div align="right"><strong>Total Loss:</strong></div></td>