function __construct($idIn) { $query = mysql_query("SELECT * FROM WA_Items WHERE id='{$idIn}'"); $itemRow = mysql_fetch_object($query); $this->id = $itemRow->id; $this->name = $itemRow->name; $this->damage = $itemRow->damage; $this->owner = $itemRow->player; $this->quantity = $itemRow->quantity; $this->marketprice = getMarketPrice($this->id, 0); $this->fullname = getItemName($this->name, $this->damage); $this->maxstack = getItemMaxStack($this->name); $queryEnchantLinks = mysql_query("SELECT * FROM WA_EnchantLinks WHERE itemId = '{$this->id}' AND itemTableId = '0'"); $itemEnchantsArray = array(); while (list($idt, $enchIdt, $itemTableIdt, $itemIdt) = mysql_fetch_row($queryEnchantLinks)) { $eArray = array(); $q = mysql_query("SELECT * FROM WA_Enchantments WHERE id = '{$enchIdt}'"); list($ide, $fullnamee, $namee, $levele) = mysql_fetch_row($q); $eArray["id"] = $ide; $eArray["name"] = $namee; $eArray["level"] = $levele; $itemEnchantsArray[] = $eArray; } $this->enchants = $itemEnchantsArray; }
function makeOreWorth() { // Get the globals. global $TIMEMARK; global $ORENAMES; global $DBORE; global $DB; global $OTYPENAME; global $PRICECRITERIA; // Where do I get Ore Values? $Market = getConfig("useMarket"); if ($Market) { // Update prices from Eve-Central and store. if ($Market == "eve-central") { $CURRENTTIME = date(U) - getConfig("timeOffset") * 60 * 60; $itemListDB = $DB->query("SELECT * FROM `itemList` ORDER BY `itemName` DESC"); $orderType = $OTYPENAME[getConfig("orderType")]; $priceCrit = $PRICECRITERIA[getConfig("priceCriteria")]; for ($i = 0; $i <= $itemListDB->numRows(); $i++) { $itemInfo = $itemListDB->fetchRow(); $quoteAge = $CURRENTTIME - $itemInfo['updateTime']; if ($quoteAge >= 3600) { $currentPrice = getMarketPrice($itemInfo['itemID'], $orderType, $priceCrit); $DB->query("UPDATE itemList SET `updateTime` = {$CURRENTTIME}, `value` = {$currentPrice} WHERE `itemID` = " . $itemInfo['itemID']); } } } else { if ($Market == "eve-marketdata") { } else { if ($Market == "eve-marketeer") { $regionID = getConfig("useRegion"); $url = "http://www.evemarketeer.com/api/info/{$itemID}/xml/{$regionID}/buy_highest5"; $xml = getXMLobj($url); echo $xml[row][buy_highest5]; } } } } else { // load the values. $orevaluesDS = $DB->query("select a.item, a.Worth, a.time, a.modifier from orevalues a where time = (select max(time) from orevalues b where a.item = b.item) group by item ORDER BY time DESC"); while ($row = $orevaluesDS->fetchRow()) { $orevalues[$row[item]] = $row; } } if ($Market) { $headerText = ">> Manage ore values<br><font color=\"#ff0000\"><b>Ore values are current market values.</b></font>"; } else { $headerText = ">> Manage ore values"; } // Create the table. $table = new table(8, true); $table->addHeader($headerText, array("bold" => true, "colspan" => 8)); $OPTYPE = isset($_REQUEST[optype]) ? $_REQUEST[optype] : ""; $table->addRow(); $table->addCol("Op Type:"); $ops = $DB->getAll("select opName from opTypes;"); if ($DB->isError($ops)) { die($ops->getMessage()); } $opSelect = "<select name='optype' onChange='window.location = \"?action=changeow&optype=\"+this.value'>\n"; $opSelect .= "<option value=''>Standard</option>\n"; foreach ($ops as $op) { $default = $op[opName] == $OPTYPE ? "selected" : ""; $opSelect .= "<option {$default} value='" . $op[opName] . "'>" . $op[opName] . "</option>\n"; } $opSelect .= "</select>"; $table->addCol($opSelect, array("colspan" => 7)); $table->addRow(); $table->addCol("Ore Name", array("colspan" => 2, "bold" => true)); $table->addCol("Enabled", array("bold" => true)); $table->addCol("Value", array("bold" => true)); $table->addCol("Ore Name", array("colspan" => 2, "bold" => true)); $table->addCol("Enabled", array("bold" => true)); $table->addCol("Value", array("bold" => true)); // How many ores are there in total? Ie, how long has the table to be? $tableLength = ceil(count($ORENAMES) / 2) - 1; for ($i = 0; $i <= $tableLength; $i++) { $right = 0; $table->addRow(); for ($side = 0; $side <= 1; $side++) { $ORE = $ORENAMES[$i + ($tableLength + 1) * $side]; // Fetch the right image for the ore. $ri_words = str_word_count($ORE, 1); $ri_max = count($ri_words); $ri = strtolower($ri_words[$ri_max - 1]); if ($ORE != "") { $table->addCol("<img width=\"32\" height=\"32\" src=\"./images/ores/" . $ORE . ".png\">"); $table->addCol($ORE); if (getOreSettings($DBORE[$ORE], $OPTYPE)) { $table->addCol("<input name=\"" . $DBORE[$ORE] . "Enabled\" value=\"true\" type=\"checkbox\" checked=\"checked\">"); } else { $table->addCol("<input name=\"" . $DBORE[$ORE] . "Enabled\" value=\"true\" type=\"checkbox\">"); } if ($Market == 1) { $thisPrice = getPriceCache($ORE); $table->addCol("<input type=\"text\" style=\"text-align: right\" name=\"{$DBORE[$ORE]}\"" . "size=\"10\" value=\"" . $thisPrice . "\">"); } else { $table->addCol("<input type=\"text\" style=\"text-align: right\" name=\"{$DBORE[$ORE]}\"" . "size=\"10\" value=\"" . $orevalues[$DBORE[$ORE]][Worth] . "\">"); } } else { $table->addCol(""); $table->addCol(""); $table->addCol(""); $table->addCol(""); } } } $form .= "<input type=\"hidden\" name=\"action\" value=\"changeore\">"; $form .= "<input type=\"hidden\" name=\"check\" value=\"check\">"; $form .= "<input type=\"hidden\" name=\"optype\" value=\"{$OPTYPE}\">"; $form .= "<input type=\"submit\" name=\"change\" value=\"Modify ore settings\">"; $table->addHeaderCentered($form, array("colspan" => 8, "align" => "center")); // return the page return "<h2>Modify ore settings</h2><form action=\"index.php\"method=\"post\">" . $table->flush(); }
?> </th> <th><?php echo $lang['myauctions']['th_marketprice']; ?> </th> <th><?php echo $lang['myauctions']['th_cancel']; ?> </th> </tr> </thead> <tbody> <?php while (list($id, $name, $damage, $player, $quantity, $price, $timeCreated) = mysql_fetch_row($queryAuctions)) { $marketPrice = getMarketPrice($id, 1); if ($marketPrice > 0) { $marketPercent = round($price / $marketPrice * 100, 1); } else { $marketPercent = "N/A"; } if ($marketPercent == "N/A") { $grade = "gradeU"; } else { if ($marketPercent <= 50) { $grade = "gradeA"; } else { if ($marketPercent <= 150) { $grade = "gradeC"; } else { $grade = "gradeX";
</th> <th><?php echo $lang['myitems']['th_marketpricetotal']; ?> </th> <th><?php echo $lang['myitems']['th_mailmeitem']; ?> </th> </tr> </thead> <tbody> <?php while (list($id, $name, $damage, $player, $quantity) = mysql_fetch_row($queryItems)) { $marketPrice = getMarketPrice($id, 0); $marketTotal = $marketPrice * $quantity; if ($marketPrice == 0) { $marketPrice = "0"; $marketTotal = "0"; } ?> <tr class="gradeC"> <td><a href="graph.php?name=<?php echo $name . "&damage=" . $damage; ?> "><img src="<?php echo getItemImage($name, $damage); ?> " alt="<?php echo getItemName($name, $damage);
?> </th> <th><?php echo $lang['transactionLog']['th_pricetotal']; ?> </th> <th><?php echo $lang['transactionLog']['th_marketprice']; ?> </th> </tr> </thead> <tbody> <?php while (list($id, $name, $damage, $time, $quantity, $price, $seller, $buyer) = mysql_fetch_row($queryMySales)) { $marketPrice = getMarketPrice($id, 3); $timeFormat = date($lang['tables']['dateformat'], $time); if ($marketPrice > 0) { $marketPercent = round($price / $marketPrice * 100, 1); } else { $marketPercent = "N/A"; } if ($marketPercent == "0") { $grade = "gradeU"; } else { if ($marketPercent <= 50) { $grade = "gradeA"; } else { if ($marketPercent <= 150) { $grade = "gradeC"; } else {
$iTotal = $aResultTotal[0]; /* * Output */ if (isset($_GET['sEcho'])) { $output = array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $iTotal, "iTotalDisplayRecords" => $iFilteredTotal, "aaData" => array()); } while ($aRow = mysql_fetch_array($rResult)) { $row = array(); $quantity = $aRow[$aColumns[3]]; $timeCreated = $aRow[$aColumns[6]]; if (time() < $timeCreated + $auctionDurationSec || $quantity == 0) { $itemName = $aRow[$aColumns[0]]; $fullItemName = getItemName($aRow[$aColumns[0]], $aRow[$aColumns[1]]); $itemDamage = $aRow[$aColumns[1]]; $marketPrice = getMarketPrice($aRow[$aColumns[5]], 1); if ($marketPrice > 0) { $marketPercent = round($aRow[$aColumns[4]] / $marketPrice * 100, 1); } else { $marketPercent = "N/A"; } if ($marketPercent == "N/A") { $marketPercent = 0; $grade = "gradeU"; } else { if ($marketPercent <= 50) { $grade = "gradeA"; } else { if ($marketPercent <= 150) { $grade = "gradeC"; } else {