Ejemplo n.º 1
0
 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();
         }
     }
 }
Ejemplo n.º 2
0
		<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>";
        echo "</tr>";
        $totalBalance = $totalBalance + $balance;
        $i++;