Ejemplo n.º 1
0
$dbMgr = new DatabaseManager(true);
$objectFactory = new ObjectFactory();
$formBuilder = new FormBuilder();
if (isset($argArray['re'])) {
    $reactionID = $argArray['re'];
    $reaction = $objectFactory->create(ObjectFactory::REACTION, $reactionID);
}
if (isset($argArray['c']) && $reaction->getReactionType() == 2) {
    $chain = 1;
    $chainStr = "Reaction Chain";
} else {
    $chain = 0;
    $chainStr = "Reaction";
}
if (isset($argArray['d'])) {
    $datetime = $dbMgr->getLastTimestamp($argArray['d'], 300);
    $dateChanged = 1;
} else {
    $datetime = $dbMgr->getLastTimestamp(time(), 300);
}
$options = array("r" => $_SESSION['params']['r'], "c" => $chain, "s" => $_SESSION['params']['s'], "g" => $_SESSION['params']['g'], "sy" => $_SESSION['params']['sy'], "i" => $_SESSION['params']['i'], "f" => $_SESSION['params']['f'], "o" => $_SESSION['params']['o'], "st" => $_SESSION['params']['st'], "b" => $_SESSION['params']['b'], "t" => $_SESSION['params']['t']);
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Reaction Scenario Drill-down</title>
		<link rel="stylesheet" type="text/css" href="include/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="include/css/toolkit.css">
<?php

chdir(__DIR__);
while (!file_exists('include/config/config.php')) {
    chdir('..');
}
include_once 'include/config/config.php';
$dbMgr = new DatabaseManager(false);
$twoDaysAgo = $dbMgr->getLastTimestamp(time() - 172800, 86400);
$yesterday = $dbMgr->getLastTimestamp(time() - 86400, 86400);
$dbMgr->processDailyHistoricalPrices($yesterday);
$dbMgr->deletePriceData($twoDaysAgo);
Ejemplo n.º 3
0
<?php

require_once 'include/session_setup.php';
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
$scriptName = basename($_SERVER['PHP_SELF']);
$options = array("r" => $_SESSION['params']['r'], "s" => $_SESSION['params']['s'], "g" => $_SESSION['params']['g'], "sy" => $_SESSION['params']['sy'], "i" => $_SESSION['params']['i'], "f" => $_SESSION['params']['f'], "o" => $_SESSION['params']['o'], "t" => $_SESSION['params']['t']);
$dbMgr = new DatabaseManager(true);
$objectFactory = new ObjectFactory();
$formBuilder = new FormBuilder();
$datetime = $dbMgr->getLastTimestamp(time(), 300);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?php 
if (isset($argArray['configure'])) {
    echo "<title>Reaction Toolkit Configuration</title>";
} else {
    echo "<title>Reaction Toolkit Dashboard</title>";
}
?>
        <link rel="stylesheet" type="text/css" href="include/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="include/css/toolkit.css">
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
        <script type="text/javascript">
<?php

chdir(__DIR__);
while (!file_exists('include/config/config.php')) {
    chdir('..');
}
require_once 'include/config/config.php';
$filePath = __DIR__;
$statusFile = "{$filePath}/../include/pages/price_update.txt";
$status = "";
$dbMgr = new DatabaseManager(false);
$api = new MarketAPI();
$source = $api->updatePrices();
if ($source !== false) {
    $status = "Prices updated successfully from {$source} as of " . $dbMgr->getLastTimestamp(time()) . " EVE time (UTC).";
} else {
    $status = "Last price update failed.  Oops.";
}
file_put_contents($statusFile, $status);
Ejemplo n.º 5
0
         $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
         break;
     case "w":
         $timeframeStr = "Weekly";
         $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
         break;
     case "m":
         $timeframeStr = "Monthly";
         $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
         break;
 }
 $numCycles = $dbMgr->getNumCycles($_SESSION['params']['t']);
 $graphTitle = "{$itemName} {$chainStr} Historical {$timeframeStr} Net Income";
 $historicalData = array();
 for ($x = 0; $x < $numResults; $x++) {
     $datetime = $dbMgr->getLastTimestamp(time() - $modulo * $x, $modulo);
     switch ($_SESSION['params']['rn']) {
         case "d":
             $datetime = $dbMgr->getLastTimestamp(time() - $modulo * $x, $modulo);
             break;
         case "m":
             $datetime = date("Y-m-d", strtotime($datetime));
             break;
         case "y":
             $datetime = date("F Y", strtotime($datetime));
             break;
     }
     $calc = new Calculator($reactionID, $chain, $datetime);
     $netIncome = $calc->getHourlyNetIncome() * $numCycles;
     $historicalData[$datetime] = $netIncome;
 }