// Find Core Pathing
if (file_exists(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists("core.class.php")) {
    require_once "core.class.php";
} else {
}
$core = new Core();
$GLOBALS["core"] = $core;
// Prepares URL DATA to include price infomation for all items listed in the operational_items database.
$tempcount = 0;
$result = $core->SQL("SELECT EveTypeID FROM `production_items` WHERE Type = 2");
while ($row = mysql_fetch_assoc($result)) {
    ProcessItem($row['EveTypeID']);
}
$core->Log("CRON(Eve-Central Market Data - Production) Done. All operational items were process successfully.");
function ProcessItem($itemid)
{
    $core = $GLOBALS["core"];
    $evecentralsite = "http://api.eve-central.com/api/marketstat?typeid=" . $itemid . "&regionlimit=10000002";
    $raw = file_get_contents($evecentralsite);
    if ($raw !== FALSE) {
        $xml = new SimpleXMLElement($raw);
        foreach ($xml->marketstat->children() as $item) {
            $eveitemid = (int) $item["id"];
            $registered = $core->SQL("SELECT COUNT(*) FROM `operations_marketdata` WHERE EveTypeID =" . $eveitemid);
            $total_records = mysql_num_rows($registered);
Ejemplo n.º 2
0
// If we fail the check, the user will be redirected to an error page.
// Goto($url) is a method of the core object which is a shorthand for { header("Location: $url); exit; }
if ($core->CurrentUser()->AccessRight() < 1) {
    $core->Goto('../../php/access.php');
}
// User name
$username = $core->CurrentUser()->Name;
// Browser string
$browser = @$_SERVER["HTTP_USER_AGENT"];
if (empty($browser)) {
    $browser = "Unknown";
}
// Save username and browser string in our database
// SQL($query) is a method of the Core object that runs a SQL query on the plugin database
// SQLEscape($string) is also a Core method that is a shorthand for mysql_real_escape_string($string)
$core->SQL("INSERT INTO `browserstats` (`User`, `Browser`) VALUES ('" . $core->SQLEscape($username) . "', '" . $core->SQLEscape($browser) . "') ON DUPLICATE KEY UPDATE `Browser`='" . $core->SQLEscape($browser) . "'");
// Read the database
$result = $core->SQL("SELECT * FROM `browserstats`");
$browserstats = array();
while ($row = mysql_fetch_assoc($result)) {
    $br = new Browser($core->SQLUnEscape($row["Browser"]));
    $browsername = "{$br->Platform}, {$br->Name} {$br->Version}";
    if (isset($browserstats[$browsername])) {
        $browserstats[$browsername] += 1;
    } else {
        $browserstats[$browsername] = 1;
    }
}
// We have the browser stats in an array. Now assign it to a Smarty template variable
// So that it will be availabe in the Smarty template.
// You can assign any type of variable: numbers, strings, arrays, objects... all work
Ejemplo n.º 3
0
<?php

require_once '../../core/core.class.php';
$core = new Core();
//Access control
if ($core->CurrentUser()->AccessRight() < 2) {
    $core->Goto('../../php/access.php');
}
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
$names = $core->GetAllUserNames();
$core->assign("names", $names);
if ($action == "times" || @$_POST["submit"] == "Add Player" || substr(@$_POST["submit"], 0, 13) == "Remove Player") {
    $result = $core->SQL("SELECT Distinct `GroupID` FROM `operations_items` Order By `GroupID`");
    while ($row = mysql_fetch_assoc($result)) {
        $var = "group" . $row['GroupID'];
        $core->assign($var, @$_POST[$var]);
        $groupnumber[$row['GroupID']] = @$_POST["group" . $row['GroupID']];
    }
    $core->assign("groupnumber", $groupnumber);
    $opdate = @$_POST["opdate"];
    if (empty($opdate)) {
        $opdate = gmdate("Y-m-d");
    }
    $core->assign("opdate", $opdate);
    $count = @$_POST["count"];
    $players = array();
    if (empty($count)) {
        $count = 0;
Ejemplo n.º 4
0
require_once '../../core/core.class.php';
$core = new Core();
//Access control
if ($core->CurrentUser()->AccessRight() < 2) {
    $core->Goto('../../php/access.php');
}
$action = @$_GET["action"];
if (isset($_GET["edit"]) || isset($_GET["view"])) {
    if (isset($_GET["edit"])) {
        $id = $_GET["edit"];
        $action = "edit";
    } else {
        $id = $_GET["view"];
        $action = "view";
    }
    $result = $core->SQL("SELECT * FROM operations_submissions WHERE id=" . $id . " LIMIT 1");
    $row = mysql_fetch_assoc($result);
    $canedit = $row["Leader"] == $core->CurrentUser()->ID || in_array($core->CurrentUser()->ID, explode(",", $row["Players"]));
    // Op Status
    // 0 - New
    // 1 - Resubmitted
    // 2 - Canceled
    // 3 - Rejected
    // 4 - Paid
    if ($row["Status"] == 4) {
        $canedit = false;
    }
    if ($core->IsIGB()) {
        $canedit = false;
    }
    if ($core->CurrentUser()->AccessRight() < 3) {
Ejemplo n.º 5
0
//Access control
if ($core->CurrentUser()->AccessRight() < 4) {
    $core->Goto('../../php/access.php');
}
$action = @$_GET["action"];
if ($action == "payout") {
    $names = $core->GetAllUserNames();
    $opids = array();
    foreach ($_POST as $key => $value) {
        if (substr($key, 0, 2) == "op" && $value == "on") {
            $opids[] = substr($key, 2);
        }
    }
    if ($_POST["submit"] == "Reject") {
        // Reject selected ops
        $core->SQL("UPDATE operations_submissions SET Status=3, RejectReason='" . $core->SQLEscape($_POST["reject"]) . "' WHERE FIND_IN_SET(id, '" . implode(",", $opids) . "')");
        // Send messages to op leaders
        $result = $core->SQL("SELECT id, OpDate, Leader FROM operations_submissions WHERE FIND_IN_SET(id, '" . implode(",", $opids) . "')");
        while ($row = mysql_fetch_assoc($result)) {
            $id = $row["id"];
            $date = date("Y-m-d", strtotime($row["OpDate"]));
            $leader = $row["Leader"];
            $text = "<p>Following operation submitted by you was rejected by " . $core->CurrentUser()->Name . ".</p>";
            $text .= "<p><a href='../plugins/payoutview/index.php?view=" . $id . "'>View Rejected Operation</a></p>";
            $text .= "<p><b>REASON:</b><br />" . $_POST["reject"] . "</p>";
            $core->SendMail($date . " Operation Rejected", $text, $leader);
        }
        $core->Goto("index.php");
    } else {
        $corpcut = $_POST["corpcut"];
        $result = $core->SQL("SELECT * FROM operations_params");
Ejemplo n.º 6
0
}
if ($action == "home" || $action == "user" || $action == "recruitment") {
    $page = @$_GET["page"];
    if (empty($page)) {
        $page = 1;
    }
    $max = 25;
    $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . "images";
    if (!file_exists($path)) {
        mkdir($path);
    }
    $baseurl = "http://" . $_SERVER["SERVER_NAME"] . "/plugins/gallery/images/";
    $names = $core->GetAllUserNames();
    if ($action == "home") {
        if ($core->CurrentUser()->AccessRight() == 0) {
            $result = $core->SQL("SELECT COUNT(*) FROM gallery");
            $pagecount = ceil(mysql_result($result, 0) / $max);
            $result = $core->SQL("SELECT * FROM gallery WHERE Owner=" . $core->CurrentUser()->ID . " AND AccessRight=1 ORDER BY Date DESC LIMIT " . $max * ($page - 1) . "," . $max);
        } else {
            $result = $core->SQL("SELECT COUNT(*) FROM gallery");
            $pagecount = ceil(mysql_result($result, 0) / $max);
            $result = $core->SQL("SELECT * FROM gallery WHERE " . $core->CurrentUser()->AccessRight() . ">=AccessRight AND AccessRight!=-1 AND AccessRight!=1 ORDER BY Date DESC LIMIT " . $max * ($page - 1) . "," . $max);
        }
    } elseif ($action == "recruitment") {
        if ($core->CurrentUser()->AccessRight() < 3) {
            $core->Goto('../../php/access.php');
        }
        $recruitment = $_GET["recruitment"];
        if ($recruitment == "all") {
            $result = $core->SQL("SELECT COUNT(*) FROM gallery");
            $pagecount = ceil(mysql_result($result, 0) / $max);
Ejemplo n.º 7
0
    require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists("core.class.php")) {
    require_once "core.class.php";
} else {
}
$core = new Core();
$GLOBALS["core"] = $core;
$marketid = $core->GetSetting("MarketLocation");
$markethanger = $core->GetSetting("MarketHanger");
$CorpStorePrice = $core->GetSetting("CorpStorePrice");
$AllyStorePrice = $core->GetSetting("AllyStorePrice");
$result1 = $core->SQL("SELECT DISTINCT nameid, SUM(qty) as 'Totalqty' FROM info_assets WHERE itemidm = " . $marketid . " AND flag = " . $markethanger . " GROUP BY nameid");
//echo "SELECT DISTINCT nameid FROM info_assets WHERE itemidm = ".$marketid."<br>";
while ($row = mysql_fetch_assoc($result1)) {
    $nameid = $row['nameid'];
    $stock = $row['Totalqty'];
    //Production Items Database Update.
    $registered = $core->SQL("SELECT * FROM `production_items` WHERE EveTypeID = " . $nameid . " AND Type = 2");
    $total_records = mysql_num_rows($registered);
    if ($total_records == 0) {
        $result2 = $core->EVESQL("SELECT * FROM invTypes_expanded WHERE typeID = " . $nameid);
        while ($row2 = mysql_fetch_assoc($result2)) {
            $typeID = $row2['typeID'];
            $groupID = $row2['groupID'];
            $typeName = $core->SQLEscape($row2['typeName']);
            $graphicID = $row2['graphicID'];
            $marketGroupID = $row2['marketGroupID'];
Ejemplo n.º 8
0
<?php

require_once '../../core/core.class.php';
$core = new Core();
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . "images";
if (!file_exists($path)) {
    mkdir($path);
}
$baseurl = "http://" . $_SERVER["SERVER_NAME"] . "/plugins/gallery/images/";
$names = $core->GetAllUserNames();
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
if ($action == "home") {
    $result = $core->SQL("SELECT * FROM gallery WHERE \n" . $core->CurrentUser()->AccessRight() . ">=AccessRight AND AccessRight!=-1 \nAND AccessRight!=1 ORDER BY Date DESC");
} else {
    $result = $core->SQL("SELECT * FROM gallery WHERE Owner=" . $core->CurrentUser()->ID . " ORDER BY Date DESC");
}
$gallery = array();
while ($row = mysql_fetch_assoc($result)) {
    $name = $row["Owner"] . "_" . $row["id"] . "." . $row["Extension"];
    // Create thumbnail
    $thumb = $row["Owner"] . "_" . $row["id"] . "_thumb.jpg";
    if (file_exists($path . DIRECTORY_SEPARATOR . $name)) {
        if (!file_exists($path . DIRECTORY_SEPARATOR . $thumb)) {
            if ($row["Extension"] == "gif") {
                $im = @imagecreatefromgif($path . DIRECTORY_SEPARATOR . $name);
            } elseif ($row["Extension"] == "jpg") {
                $im = @imagecreatefromjpeg($path . DIRECTORY_SEPARATOR . $name);
            } elseif ($row["Extension"] == "png") {
<?php

require_once '../../core/core.class.php';
$core = new Core();
$item = $_GET["item"];
// Read material prices
$result = $core->SQL("SELECT EveTypeID,Price FROM operations_items");
$itemprices = array();
while ($row = mysql_fetch_assoc($result)) {
    $itemprices[$row["EveTypeID"]] = (double) $row["Price"];
}
mysql_free_result($result);
// Read material quantites from EVE DB
$query = "SELECT graphics.icon AS Icon, typeReq.typeName as Name, typeReq.typeID AS EveTypeID, IF(typeReq.groupID = 332, materials.quantity, CEIL(materials.quantity*(1+bluePrint.wasteFactor/100))) AS Quantity ";
$query .= "FROM TL2MaterialsForTypeWithActivity AS materials ";
$query .= "INNER JOIN invTypes AS typeReq ON materials.requiredtypeID = typeReq.typeID ";
$query .= "INNER JOIN invGroups AS typeGroup ON typeReq.groupID = typeGroup.groupID ";
$query .= "INNER JOIN invBlueprintTypes AS bluePrint ON materials.typeID = bluePrint.blueprintTypeID ";
$query .= "INNER JOIN eveGraphics AS graphics ON typeReq.graphicID = graphics.graphicID ";
$query .= "WHERE bluePrint.productTypeID=" . $item . " AND Quantity>0 AND materials.activity = 1 AND typeGroup.categoryID NOT IN (6, 7, 16) ORDER BY typeReq.marketGroupID, Name ASC";
$result = $core->EveSQL($query);
$eveprices = array();
$total = 0;
while ($row = mysql_fetch_assoc($result)) {
    if (isset($itemprices[$row["EveTypeID"]])) {
        $unit = $itemprices[$row["EveTypeID"]];
        $price = $itemprices[$row["EveTypeID"]] * (double) $row["Quantity"];
    } else {
        $unit = 0;
        $price = 0;
    }
Ejemplo n.º 10
0
if (empty($action)) {
    $action = "home";
}
if ($action == "summary") {
    $action = "summary";
}
if (isset($_GET["delete"])) {
    $action = "delete";
}
if (isset($_GET["result"])) {
    $core->assign('result', $_GET["result"]);
}
if ($action == "home") {
    $names = $core->GetAllUserNames();
    $names[0] = "-";
    $result = $core->SQL("SELECT t1.id,t1.Notes,t1.Owner,t1.Date,t1.Priority,t1.Count,t1.IsAlly,t2.Price,t2.AlliancePrice,t1.Manager,t1.Status,t2.EveGraphicID,t2.GroupName,t2.Race,t2.Name FROM production_orders AS t1 INNER JOIN production_items AS t2 ON t1.Item=t2.id WHERE t1.IsDeleted=0 ORDER BY t1.Priority DESC, t1.Date ASC");
    $orders = array();
    $total = 0;
    while ($row = mysql_fetch_assoc($result)) {
        $price = $row["IsAlly"] ? $row["AlliancePrice"] : $row["Price"];
        $orders[] = array("ID" => $row["id"], "Priority" => PriorityName($row["Priority"]), "Notes" => $core->SQLUnEscape($row["Notes"]), "Owner" => $names[$row["Owner"]], "IsAlly" => $row["IsAlly"], "Manager" => $names[$row["Manager"]], "Status" => StatusName($row["Status"]), "EveGraphicID" => $row["EveGraphicID"], "GroupName" => $core->SQLUnEscape($row["GroupName"]), "Race" => $core->SQLUnEscape($row["Race"]), "Name" => $core->SQLUnEscape($row["Name"]), "Count" => $row["Count"], "Price" => number_format($price, 0), "Cost" => number_format($row["Count"] * $price, 0), "Date" => $core->GMTToLocal($row["Date"]));
        $total += $row["Count"] * $price;
    }
    mysql_free_result($result);
    $core->assign("orders", $orders);
    $core->assign("total", number_format($total, 0));
    // Misc orders
    $result = $core->SQL("SELECT id,Owner,Date,Notes FROM production_orders WHERE IsDeleted=0 AND Item=0 ORDER BY Date DESC");
    $misc = array();
    $total = 0;
    while ($row = mysql_fetch_assoc($result)) {
// Find Core Pathing
if (file_exists(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists(dirname(__FILE__) . DIRECTORY_SEPARATOR . "core.class.php")) {
    require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "core.class.php";
} elseif (file_exists("core.class.php")) {
    require_once "core.class.php";
} else {
}
$core = new Core();
$GLOBALS["core"] = $core;
// Prepares URL DATA to include price infomation for all items listed in the operational_items database.
$tempcount = 0;
$result = $core->SQL("SELECT EveTypeID FROM `operations_items`");
while ($row = mysql_fetch_assoc($result)) {
    ProcessItem($row['EveTypeID']);
}
$core->Log("CRON(Eve-Central Market Data) Done. All operational items were process successfully.");
function ProcessItem($itemid)
{
    $core = $GLOBALS["core"];
    $evecentralsite = "http://api.eve-central.com/api/marketstat?typeid=" . $itemid . "&regionlimit=10000002";
    $raw = file_get_contents($evecentralsite);
    if ($raw !== FALSE) {
        $xml = new SimpleXMLElement($raw);
        foreach ($xml->marketstat->children() as $item) {
            $eveitemid = (int) $item["id"];
            $registered = $core->SQL("SELECT COUNT(*) FROM `operations_marketdata` WHERE EveTypeID =" . $eveitemid);
            $total_records = mysql_num_rows($registered);
Ejemplo n.º 12
0
}
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
if (isset($_GET["delete"])) {
    $action = "delete";
}
if (isset($_GET["edit"])) {
    $action = "edit";
}
if ($action == "home" || $action == "homeships" || $action == "homerigs") {
    $itemids = array();
    // Read ship prices
    if ($action == "homeships" || $action == "home") {
        $result = $core->SQL("SELECT * FROM production_items WHERE Type=0 ORDER BY GroupName ASC, Race ASC, `Name` ASC");
        $dbprices = array();
        while ($row = mysql_fetch_assoc($result)) {
            $dbprices[] = array("ID" => $row["id"], "EveTypeID" => $row["EveTypeID"], "EveGraphicID" => $row["EveGraphicID"], "GroupName" => $core->SQLUnEscape($row["GroupName"]), "Race" => $core->SQLUnEscape($row["Race"]), "Name" => $core->SQLUnEscape($row["Name"]), "Price" => number_format($row["Price"], 0), "AlliancePrice" => number_format($row["AlliancePrice"], 0));
            $itemids[] = $row["EveTypeID"];
        }
        mysql_free_result($result);
        $core->assign("shipprices", $dbprices);
    }
    // Read rig prices
    if ($action == "homerigs" || $action == "home") {
        $result = $core->SQL("SELECT * FROM production_items WHERE Type=1 ORDER BY GroupName ASC, `Name` ASC");
        $dbprices = array();
        while ($row = mysql_fetch_assoc($result)) {
            $dbprices[] = array("ID" => $row["id"], "EveTypeID" => $row["EveTypeID"], "EveGraphicID" => $row["EveGraphicID"], "GroupName" => $core->SQLUnEscape($row["GroupName"]), "Race" => $core->SQLUnEscape($row["Race"]), "Name" => $core->SQLUnEscape($row["Name"]), "Price" => number_format($row["Price"], 0), "AlliancePrice" => number_format($row["AlliancePrice"], 0));
            $itemids[] = $row["EveTypeID"];
Ejemplo n.º 13
0
    $action = "home";
}
if ($portalid == "" || empty($portalid) || $portalid < 0 || $core->CharacterIDExists($portalid) == "FALSE") {
    $portalid = $core->CurrentUser()->ID;
}
if ($template == "" || empty($template) || $template < 0) {
    $template = 0;
}
if ($templatepost == "" || empty($templatepost) || $templatepost < 0) {
    $templatepost = 0;
}
if ($return == "" || empty($return) || $return < 0) {
    $return = 0;
}
if ($action == "home") {
    $result = $core->SQL("SELECT * FROM operations_params");
    while ($row = mysql_fetch_assoc($result)) {
        if ($row["Name"] == "IndexDate") {
            $core->assign("indexdate", $row["Value"]);
        }
        if ($row["Name"] == "IndexTime") {
            $core->assign("indextime", $row["Value"]);
        }
    }
} elseif ($action == "qtc7" || $action == "qtc30") {
    $timeperiod = 7;
    if ($action == "qtc30") {
        $timeperiod = 30;
    }
    $raw = file_get_contents("http://www.starvingpoet.net/feeds/mmi.xml");
    if ($raw !== FALSE) {
Ejemplo n.º 14
0
}
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
if (isset($_GET["cancel"])) {
    $action = "cancel";
}
if (isset($_GET["resubmit"])) {
    $action = "resubmit";
}
if ($action == "home") {
    $names = $core->GetAllUserNames();
    $names[0] = "-";
    if ($core->CurrentUser()->IsAlly) {
        $result = $core->SQL("SELECT t1.id,t1.Date,t1.Count,t2.AlliancePrice AS Price,t1.Manager,t1.Status,t2.EveGraphicID,t2.GroupName,t2.Race,t2.Name FROM production_orders AS t1 INNER JOIN production_items AS t2 ON t1.Item=t2.id WHERE t1.Owner=" . $core->CurrentUser()->ID . " AND t1.IsDeleted=0 AND t1.Item!=0 AND t2.AlliancePrice!=0 ORDER BY t1.Date DESC LIMIT 50");
    } else {
        $result = $core->SQL("SELECT t1.id,t1.Date,t1.Count,t2.Price,t1.Manager,t1.Status,t2.EveGraphicID,t2.GroupName,t2.Race,t2.Name FROM production_orders AS t1 INNER JOIN production_items AS t2 ON t1.Item=t2.id WHERE t1.Owner=" . $core->CurrentUser()->ID . " AND t1.IsDeleted=0 AND t1.Item!=0 ORDER BY t1.Date DESC LIMIT 50");
    }
    $orders = array();
    while ($row = mysql_fetch_assoc($result)) {
        $orders[] = array("ID" => $row["id"], "Cost" => number_format($row["Count"] * $row["Price"], 0), "Manager" => $names[$row["Manager"]], "Status" => StatusName($row["Status"]), "StatusID" => $row["Status"], "Price" => $row["Price"], "EveGraphicID" => $row["EveGraphicID"], "GroupName" => $core->SQLUnEscape($row["GroupName"]), "Race" => $core->SQLUnEscape($row["Race"]), "Name" => $core->SQLUnEscape($row["Name"]), "Count" => $row["Count"], "Date" => $core->GMTToLocal($row["Date"]));
    }
    mysql_free_result($result);
    $core->assign("orders", $orders);
} elseif ($action == "queue") {
    $names = $core->GetAllUserNames();
    $names[0] = "-";
    $result = $core->SQL("SELECT t1.id,t1.Owner,t1.Date,t1.Count,t1.Manager,t1.Status,t2.EveGraphicID,t2.GroupName,t2.Race,t2.Name FROM production_orders AS t1 INNER JOIN production_items AS t2 ON t1.Item=t2.id WHERE t1.IsDeleted=0 AND t1.Item!=0 ORDER BY t1.Date DESC LIMIT 50");
    $orders = array();
    while ($row = mysql_fetch_assoc($result)) {