示例#1
0
 public function actionStoreValue()
 {
     $id = $_GET['id'];
     $asset = Assets::Model()->findByPk($id);
     $this->storeSingleAssetValue($asset->typeID);
     $this->renderPartial('storeValue');
 }
示例#2
0
 public function storeData($walletID)
 {
     $assets = $this->getEVEData($walletID);
     $character = Characters::model()->findByPk($walletID);
     Assets::Model()->deleteAll('characterID=:characterID', array(':characterID' => $character->characterID));
     //echo $assets->__toString();
     $this->parseAssets($assets->result->rowset->row, $character->characterID, 0);
 }
示例#3
0
					<td><img style='height: 18px; width: 18px; margin-right: 4px;' src='./images/items/<?php 
        echo $icon;
        ?>
'><?php 
        echo $baseAsset->typeName;
        ?>
</td>
					<td><?php 
        echo number_format($baseAsset->quantity, 0);
        $idx1++;
        ?>
</td>
				</tr>
			<?php 
        //Check the base assets for containership
        $contents = Assets::Model()->findAll('containerID=:containerID AND characterID IN ' . $groupMembersString . '', array(':containerID' => $baseAsset->itemID));
        if ($contents) {
            $idx = 1;
            foreach ($contents as $content) {
                ?>
					<?php 
                $icon = $this->getIcon($content->typeID);
                ?>

						<tr id="node-<?php 
                echo $assetLocation->locationID;
                ?>
-<?php 
                echo $baseAsset->itemID;
                ?>
-<?php 
示例#4
0
<div class="currentstats">
<table>
<tr class="header1">
<td style="text-align: left; width: 220px;">Blueprint</td>
<td style="text-align: right; width: 10px;">Stock</td>
<td style="text-align: right; width: 10px;">Value</td>
<td style="text-align: right; width: 50px;">Total</td>
</tr>

<?php 
$index = 0;
$criteria = new CDbCriteria();
$criteria->select = 'SUM(quantity) AS quantity, typeID';
$criteria->order = 'typeName ASC';
$criteria->condition = 'groupID IN (915,525,643) GROUP BY typeID';
$results = Assets::Model()->findAll($criteria);
foreach ($results as $row) {
    if ($index % 2) {
        echo "<tr class='odd'>";
    } else {
        echo "<tr>";
    }
    $itemInfo = new CDbCriteria();
    $itemInfo->condition = 'typeID=:typeID';
    $itemInfo->params = array(':typeID' => $row->typeID);
    $itemName = Invtypes::Model()->find($itemInfo);
    //TEMP
    // Need to figure out BPC value
    $value = 1.0;
    echo "<td><div class='textCenter'><img style='height: 20px; width: 20px;' src='http://image.eveonline.com/Type/" . $row->typeID . "_32.png'><a href='index.php?r=wallet/item&id={$row->typeID}'>{$itemName->typeName}</div></td>";
    echo "<td style='text-align: right;'>{$row->quantity}</td>";
示例#5
0
 function storeAssetValues($groupID)
 {
     $members = $this->getMembersAsCharIDArray($groupID);
     $sqlarray = '(' . implode(',', $members) . ')';
     $criteria = new CDbCriteria();
     $criteria->condition = 'characterID IN ' . $sqlarray;
     $criteria->group = 'typeID';
     $assetTypes = Assets::Model()->findAll($criteria);
     $i = 0;
     foreach ($assetTypes as $assetType) {
         $fullUrl = "http://api.eve-central.com/api/marketstat?typeid=" . $assetType->typeID . "&regionlimit=10000002";
         //Get the data and turn it into a SimpleXML object
         $dataFromHttp = @file_get_contents($fullUrl);
         try {
             $xml = new SimpleXMLElement($dataFromHttp);
         } catch (Exception $e) {
             return 0;
         }
         $assetValue = $xml->xpath('/evec_api/marketstat/type/sell/min');
         $exists = AssetValues::Model()->exists('typeID=:typeID', array(':typeID' => $assetType->typeID));
         if ($exists) {
             $valueTableRow = AssetValues::Model()->findByPk($assetType->typeID);
             $valueTableRow->value = (double) $assetValue[0];
             $valueTableRow->save();
         } else {
             $valueTableRow = new AssetValues();
             $valueTableRow->typeID = $assetType->typeID;
             $valueTableRow->value = (double) $assetValue[0];
             $valueTableRow->save();
         }
     }
 }