public static function load($characterID, $className = __CLASS__) { if (!isset($characterID)) { return false; } $character = Characters::Model()->find('characterID = :characterID', array(':characterID' => $characterID)); $sheetObject = new APICharacterSheet(); $sheetObject->_charSheetXML = $sheetObject->getEVEData($character->walletID); if ($sheetObject->_charSheetXML != false) { return $sheetObject; } else { return false; } }
public function run($args) { $characters = Characters::model()->findAll(); foreach ($characters as $character) { echo "Found character {$character->characterName}\n"; $walletInterface = new APITransactions(); $journalInterface = new APIJournal(); $ordersInterface = new APIOrders(); $assetsInterface = new APIAssetList(); $sheetInterface = new APICharacterSheet(); //Wallet if (!$walletInterface->getCacheExpiration($character->walletID) && $character->walletEnabled) { echo "Updating transactions...\n"; $walletInterface->storeData($character->walletID); } //Journal if (!$journalInterface->getCacheExpiration($character->walletID) && $character->journalEnabled) { echo "Updating journal...\n"; $journalInterface->storeData($character->walletID); } //Orders if (!$ordersInterface->getCacheExpiration($character->walletID) && $character->ordersEnabled) { echo "Updating orders...\n"; $ordersInterface->storeData($character->walletID); } /* //Assets if(!($assetsInterface->getCacheExpiration($character->walletID))) { echo "Updating assets...\n"; $assetsInterface->storeData($character->walletID); } */ //Balance if (!$sheetInterface->getCacheExpiration($character->walletID) && $character->displayBalance) { echo "Updating balances...\n"; $sheet = $sheetInterface->getEveData($character->walletID); $sheetBalance = $sheet->result->balance[0][0]; $balance = (double) $sheetBalance; $balanceRow = new Balances(); $balanceRow->characterID = $character->characterID; $balanceRow->balanceDateTime = $this->getEveTimeSql(); $balanceRow->balance = $balance; $balanceRow->save(); } } }
public function getSkillLevel($characterID, $skillTypeID) { //Get the character information $character = Characters::Model()->find('characterID = :characterID', array(':characterID' => $characterID)); //Get the skill sheet $characterAPIInterface = new APICharacterSheet(); $characterSkillSheet = $characterAPIInterface->getEVEData($character->walletID); //Grab the specific skill data $skill = $characterSkillSheet->xpath("//rowset[@name='skills']/row[@typeID='" . $skillTypeID . "']"); if (!is_object($skill[0])) { return 0; } else { return $skill[0]->attributes()->level; } }
public function getBalance($character) { $characterInterface = new APICharacterSheet(); $character = $characterInterface->getEveData($character); return $character->result->balance[0][0]; }
$characterID = $this->phdGetCache("characterIDCache"); $sellPrice = $this->phdGetCache("priceSellCache"); $bpcPrice = $this->phdGetCache("priceBPCCache"); $partsPrice = $this->phdGetCache("priceCapitalPartsCache"); $slotPrice = $this->phdGetCache("priceSlotCache"); if ($characterID == 0) { $groupMembers = $this->getTrackingGroupMembers($group->trackingGroupID); $walletID = $groupMembers[0]->characterID; $characterID = Characters::Model()->findByPk($walletID)->characterID; $this->phdSetCache("characterIDCache", $characterID); } $invType = Invtypes::Model()->findByPk($typeID); //Find the blueprint typeID $bpTypeID = InvBlueprintTypes::Model()->find("productTypeID = :typeID", array(':typeID' => $invType->typeID)); //Load the skill sheet $skillSheet = APICharacterSheet::load($characterID); ?> <script type="text/javascript"> jQuery(function($) { $('.bpcme').phdInlineInput({ 'label' : 'Select', 'getUrl' : 'capitalProduction/getbpcme', 'submitUrl' : 'capitalProduction/submitbpcme' }); $('.pricesell').phdInlineInput({ 'label' : 'Select', 'getUrl' : 'capitalProduction/getpricesell', 'submitUrl' : 'capitalProduction/submitpricesell' }); $('.pricebpc').phdInlineInput({
<table> <tr class="header1"> <td><div class='textCenter'><img src="images/items/2_64_16.png" width="16" height="16">Character</div></td> <td style="text-align: right; width: 30px;">Balance</td> </tr> <?php $i = 0; $group = $this->getDefaultTrackingGroup(Yii::app()->user->trackingGroupID); $groupMembers = $this->getTrackingGroupMembers($group->trackingGroupID); foreach ($groupMembers as $member) { $character = Characters::Model()->findByPk($member->characterID); $sheetInterface = new APICharacterSheet(); if (!$sheetInterface->getCacheExpiration($member->characterID)) { $balance = (double) $this->getBalance($member->characterID); $balanceRow = new Balances(); $balanceRow->characterID = $character->characterID; $balanceRow->balanceDateTime = $this->getEveTimeSql(); $balanceRow->balance = $balance; $balanceRow->save(); } else { $balance = (double) $this->getBalance($member->characterID); } $balanceText = number_format($balance, 0); if ($character->displayBalance) { if ($i % 2) { echo "<tr class='odd'>"; } else { echo "<tr>"; } echo '<td><div style="float:left"><div class="textCenter"><img src="http://image.eveonline.com/Character/' . $character->characterID . '_200.jpg" height="16" width="16">' . $character->characterName . '</div></div></td>'; echo "<td style='text-align: right;'><font color='green'>+{$balanceText}</font></td>";