HEX
Server: Apache/2.4.18 (Ubuntu)
System: Linux ubuntu 7.0.5-x86_64-linode173 #1 SMP PREEMPT_DYNAMIC Fri May 8 10:12:05 EDT 2026 x86_64
User: root (0)
PHP: 7.2.28-1+ubuntu16.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //proc/self/root/opt/code/dist/api/grid/save_gas.php
<?php 
$dir = dirname(__FILE__);
include_once($dir.'/../util.php');
include_once($dir.'/../db.php');
include_once($dir.'/../token.php');

$stm_history = $_SERVER['DB']->prepare('INSERT INTO oil_user(user_id,datum,turnarounds,exports,extra_exports,pipe_barge,pipe,barge,padd_demand)
  VALUES(?,?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE turnarounds = VALUES(turnarounds), exports = VALUES(exports), extra_exports = VALUES(extra_exports), 
  pipe_barge = VALUES(pipe_barge), pipe = VALUES(pipe), barge = VALUES(barge), padd_demand = VALUES(padd_demand)');
$stm_forecast = $_SERVER['DB']->prepare('INSERT INTO oil_user(user_id,datum,turnarounds,yield,ethanol_blend,imports,exports,extra_exports,pipe_barge,pipe,barge,
  shipments,padd_demand,padd_demand_model,reported_us_demand,atl_stocks_over_padd)
  VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE turnarounds = VALUES(turnarounds), yield = VALUES(yield), ethanol_blend = VALUES(ethanol_blend),
  imports = VALUES(imports), exports = VALUES(exports), extra_exports = VALUES(extra_exports), pipe_barge = VALUES(pipe_barge), pipe = VALUES(pipe), barge = VALUES(barge),
  shipments = VALUES(shipments), padd_demand = VALUES(padd_demand), padd_demand_model = VALUES(padd_demand_model), reported_us_demand = VALUES(reported_us_demand),
  atl_stocks_over_padd = VALUES(atl_stocks_over_padd)');
$data = json_decode(file_get_contents('php://input'),TRUE,100,JSON_PARTIAL_OUTPUT_ON_ERROR);
if(is_array($data['history'])) foreach($data['history'] as &$row)
{
  $_SERVER['DB']->bind($stm_history,Array($_SESSION['uid'],substr($row['datum'],0,10),$row['turnarounds'],$row['exports'],$row['extra_exports'],$row['pipe_barge'],
    $row['pipe'],$row['barge'],$row['padd_demand']));
  $_SERVER['DB']->exec($stm_history);
}
if(is_array($data['forecast'])) foreach($data['forecast'] as &$row)
{
  $_SERVER['DB']->bind($stm_forecast,Array($_SESSION['uid'],substr($row['datum'],0,10),$row['turnarounds'],$row['yield'],$row['ethanol_blend'],
    $row['imports'],$row['exports'],$row['extra_exports'],$row['pipe_barge'],$row['pipe'],$row['barge'],$row['shipments'],$row['padd_demand'],
    $row['padd_demand_model'],$row['reported_us_demand'],$row['atl_stocks_over_padd']));
  $_SERVER['DB']->exec($stm_forecast);
}

echo '{"saved":true}';

?>