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
<?php

$this->breadcrumbs = array('Buy Orders');
$group = $this->getDefaultTrackingGroup(Yii::app()->user->trackingGroupID);
$groupMembers = $this->getTrackingGroupMembers($group->trackingGroupID);
//Check on our cache value
$orderInterface = new APIOrders();
if (!$orderInterface->getCacheExpiration($groupMembers[0]->characterID)) {
    ?>
		<script type="text/javascript">
			$(function() {
				$.gritter.add({
					title: 'Updating API',
					text: 'Your orders are being updated...',
					time: 4000,
					image: '<?php 
    echo Yii::app()->request->baseUrl;
    ?>
/images/repeat-icon.png'
				});
			});
		</script>
	<?php 
    $request = CHtml::ajax(array('url' => 'index.php?r=sellOrders/indexAjax', 'success' => 'js:function(){
			$.gritter.add({
				title: "Update Complete",
				text: "You may refresh the page.",
				time: 4000,
				image: "' . Yii::app()->request->baseUrl . '/images/repeat-icon.png"
			});
		}'));