Exemple #1
0
function get_system_trades()
{
    global $cache_system_trades;
    if (!isset($cache_system_trades)) {
        require_once 'dirdb.php';
        $db = new SystemDB();
        $cache_system_trades = $db->RetrieveAll();
    }
    return $cache_system_trades;
}
Exemple #2
0
 public static function on($connection)
 {
     self::$currentConnection = $connection;
     return new self();
 }
Exemple #3
0
function _xSystemTradesEdit()
{
    require_once 'dirdb.php';
    $db = new SystemDB();
    $v = Validator::Get();
    if ($_REQUEST['send_method'] >= 2) {
        $v->Register($_REQUEST['traffic_url'], VT_VALID_HTTP_URL, 'The Traffic URL must be a valid HTTP URL');
    }
    if (!$v->Validate()) {
        return JSON::Warning(array(JSON_KEY_MESSAGE => 'System trade could not be edited; please fix the following items', JSON_KEY_WARNINGS => $v->GetErrors()));
    }
    $db->Update($_REQUEST['domain'], system_trade_prepare_data($_REQUEST));
    _xSystemTradesEditShow('System trade has been successfully updated');
}