Example #1
0
 public static function sessionCurrency()
 {
     global $CFG;
     API::add('Currencies', 'getMain');
     $query = API::send();
     $main = $query['Currencies']['getMain']['results'][0];
     if (empty($_REQUEST['currency']) && empty($_SESSION['currency']) && !empty(User::$info['default_currency'])) {
         $_SESSION['currency'] = User::$info['default_currency'];
     } elseif (empty($_REQUEST['currency']) && empty($_SESSION['currency']) && empty(User::$info['default_currency'])) {
         $_SESSION['currency'] = $main['fiat'];
     } elseif (!empty($_REQUEST['currency'])) {
         $_SESSION['currency'] = preg_replace("/[^0-9]/", "", $_REQUEST['currency']);
     }
     if (empty($_REQUEST['c_currency']) && empty($_SESSION['c_currency']) && !empty(User::$info['default_c_currency'])) {
         $_SESSION['c_currency'] = User::$info['default_c_currency'];
     } elseif (empty($_REQUEST['c_currency']) && empty($_SESSION['c_currency']) && empty(User::$info['default_c_currency'])) {
         $_SESSION['c_currency'] = $main['crypto'];
     } elseif (!empty($_REQUEST['c_currency'])) {
         $_SESSION['c_currency'] = preg_replace("/[^0-9]/", "", $_REQUEST['c_currency']);
     }
     if ($_SESSION['currency'] && !is_numeric($_SESSION['currency'])) {
         $_SESSION['currency'] = $CFG->currencies[strtoupper($_SESSION['currency'])]['id'];
     }
     if ($CFG->currencies[$_SESSION['c_currency']]['is_crypto'] != 'Y') {
         $_SESSION['c_currency'] = $main['crypto'];
     }
     if ($_SESSION['c_currency'] == $_SESSION['currency']) {
         $_SESSION['currency'] = $main['fiat'];
     }
     return array('currency' => $_SESSION['currency'], 'c_currency' => $_SESSION['c_currency']);
 }
Example #2
0
    $personal->errors[] = Lang::string('login-password-error');
}
if (!empty($_REQUEST['settings']) && !empty($personal->errors)) {
    $errors = array();
    foreach ($personal->errors as $key => $error) {
        if (stristr($error, 'login-required-error')) {
            $errors[] = Lang::string('settings-' . str_replace('_', '-', $key)) . ' ' . Lang::string('login-required-error');
        } elseif (strstr($error, '-')) {
            $errors[] = Lang::string($error);
        } else {
            $errors[] = $error;
        }
    }
    Errors::$errors = $errors;
} elseif (!empty($_REQUEST['settings']) && empty($personal->errors)) {
    API::add('User', 'disableNeverLoggedIn', array($personal->info['pass']));
    API::send();
    $_SESSION["firstlogin_uniq"] = md5(uniqid(mt_rand(), true));
    Link::redirect('account.php?message=settings-personal-message');
} else {
    $personal->info['pass'] = false;
}
$_SESSION["firstlogin_uniq"] = md5(uniqid(mt_rand(), true));
$page_title = Lang::string('first-login');
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
Example #3
0
$query = API::send();
if (empty($ajax)) {
    API::apiUpdateNonce();
}
/* Assign Settings To CFG */
Settings::assign($query['Settings']['get']['results'][0]);
/* Check Login */
User::verifyLogIn($query);
User::logOut(isset($_REQUEST['log_out']));
/* Set Timezone */
date_default_timezone_set($CFG->default_timezone);
$dtz = new DateTimeZone($CFG->default_timezone);
$dtz1 = new DateTime('now', $dtz);
$CFG->timezone_offset = $dtz->getOffset($dtz1);
/* Detect Language */
$CFG->lang_table = $query['Lang']['getTable']['results'][0];
$lang = !empty($_REQUEST['lang']) ? preg_replace("/[^a-z]/", "", strtolower($_REQUEST['lang'])) : false;
if ($lang && in_array($lang, array('en', 'es', 'ru', 'zh'))) {
    $CFG->language = $lang;
    $_SESSION['language'] = $lang;
    if (User::isLoggedIn()) {
        API::add('User', 'setLang', array($lang));
    }
} elseif (!empty($_SESSION['language'])) {
    $CFG->language = $_SESSION['language'];
} elseif (empty($_SESSION['language'])) {
    $_SESSION['language'] = 'en';
    $CFG->language = 'en';
}
/* Get Currencies */
$CFG->currencies = $query['Currencies']['get']['results'][0];
Example #4
0
<?php

chdir('..');
$ajax = true;
include '../lib/common.php';
$currency1 = !empty($CFG->currencies[strtoupper($_REQUEST['currency'])]) ? $_REQUEST['currency'] : 'usd';
API::add('Stats', 'getCurrent', array(false, $currency1));
$query = API::send();
$stats = $query['Stats']['getCurrent']['results'][0];
echo json_encode($stats);
Example #5
0
            }
            if ($query['error'] == 'security-incorrect-token') {
                Errors::add(Lang::string('security-incorrect-token'));
            }
        }
        if ($_REQUEST['action'] == 'delete' && !$query['APIKeys']['delete']['results'][0]) {
            Link::redirect('api-access.php?error=delete');
        }
        if (!is_array(Errors::$errors)) {
            if ($_REQUEST['action'] == 'edit') {
                Link::redirect('api-access.php?message=edit');
            } elseif ($_REQUEST['action'] == 'add') {
                $secret = $query['APIKeys']['add']['results'][0];
                Messages::add(Lang::string('api-add-message'));
                $info_message = str_replace('[secret]', $secret, Lang::string('api-add-show-secret'));
                API::add('APIKeys', 'get');
                $query = API::send();
                $api_keys = $query['APIKeys']['get']['results'][0];
            } elseif ($_REQUEST['action'] == 'delete') {
                Link::redirect('api-access.php?message=delete');
            }
        } else {
            $request_2fa = true;
        }
    }
}
if (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'edit') {
    Messages::add(Lang::string('api-edit-message'));
} elseif (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'delete') {
    Messages::add(Lang::string('api-delete-message'));
} elseif (!empty($_REQUEST['error']) && $_REQUEST['error'] == 'delete') {
Example #6
0
 if ($passed_uniq) {
     if (!$confirmed) {
         API::add('Gateways', 'depositPreconditions', array($info));
         $query = API::send();
         $errors1 = $query['Gateways']['depositPreconditions']['results'][0];
         if (!empty($errors1['error'])) {
             Errors::add($errors1['error']['message']);
         } else {
             if (!empty($errors1['offsite'])) {
                 Link::redirect($errors1['offsite'], $errors1['offsite_vars']);
             } else {
                 $ask_confirm = true;
             }
         }
     } else {
         API::add('Gateways', 'processDeposit', array($info));
         $query = API::send();
         $operations = $query['Gateways']['processDeposit']['results'][0];
         if (!empty($operations['error'])) {
             Errors::add($operations['error']['message']);
         } else {
             if ($operations['new_order'] > 0) {
                 $_SESSION["deposit_uniq"][time()] = md5(uniqid(mt_rand(), true));
                 if (count($_SESSION["deposit_uniq"]) > 3) {
                     unset($_SESSION["deposit_uniq"][min(array_keys($_SESSION["deposit_uniq"]))]);
                 }
                 Link::redirect('deposit', array('transactions' => $operations['transactions'], 'new_order' => 1));
                 exit;
             }
         }
     }
Example #7
0
        if (stristr($error, 'login-required-error')) {
            $errors[] = Lang::string('settings-' . str_replace('_', '-', $key)) . ' ' . Lang::string('login-required-error');
        } elseif (strstr($error, '-')) {
            $errors[] = Lang::string($error);
        } else {
            $errors[] = $error;
        }
    }
    Errors::$errors = $errors;
} elseif (!empty($_REQUEST['settings']) && empty($personal->errors)) {
    if (empty($no_token) && !$request_2fa) {
        //$authcode2 = (User::$info['verified_authy'] == 'Y' || User::$info['verified_google'] == 'Y') ? false : $authcode1;
        //API::settingsChangeId($authcode2);
        //API::token($token1);
        API::settingsChangeId($authcode1);
        API::add('User', 'changePassword', array($personal->info['pass']));
        $query = API::send();
        if (!empty($query['error'])) {
            if ($query['error'] == 'security-com-error') {
                Errors::add(Lang::string('security-com-error'));
            }
            if ($query['error'] == 'authy-errors') {
                Errors::merge($query['authy_errors']);
            }
            if ($query['error'] == 'request-expired') {
                Errors::add(Lang::string('settings-request-expired'));
            }
            if ($query['error'] == 'security-incorrect-token') {
                Errors::add(Lang::string('security-incorrect-token'));
            }
        }
Example #8
0
<?php

include '../lib/common.php';
if (!$_REQUEST['log_out']) {
    Link::redirect('index.php');
}
API::add('Content', 'getRecord', array('logged-out'));
$query = API::send();
$page_title = Lang::string('log-out');
$content = $query['Content']['getRecord']['results'][0];
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="index.php"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="news.php"><?php 
echo $page_title;
?>
</a></div>
	</div>
</div>
<div class="container">
	<div class="content_right">
		<h2><?php 
echo $content['title'];
Example #9
0
include '../lib/common.php';
if (User::$info['locked'] == 'Y' || User::$info['deactivated'] == 'Y') {
    Link::redirect('settings.php');
} elseif (User::$awaiting_token) {
    Link::redirect('verify-token.php');
} elseif (!User::isLoggedIn()) {
    Link::redirect('login.php');
}
$page1 = !empty($_REQUEST['page']) ? preg_replace("/[^0-9]/", "", $_REQUEST['page']) : false;
API::add('BankAccounts', 'get');
API::add('BitcoinAddresses', 'get', array(false, false, 1, 1));
API::add('Requests', 'get', array(1));
API::add('Requests', 'get', array(false, $page1, 15));
API::add('Content', 'getRecord', array('deposit-bank-instructions'));
API::add('Content', 'getRecord', array('deposit-no-bank'));
$query = API::send();
$bank_accounts = $query['BankAccounts']['get']['results'][0];
$bitcoin_addresses = $query['BitcoinAddresses']['get']['results'][0];
$key = is_array($bank_accounts) ? key($bank_accounts) : false;
$bank_account = $bank_accounts[$key];
$total = $query['Requests']['get']['results'][0];
$requests = $query['Requests']['get']['results'][1];
$bank_instructions = $bank_account ? $query['Content']['getRecord']['results'][0] : $query['Content']['getRecord']['results'][1];
$bank_account_currency = $CFG->currencies[$bank_account['currency']];
$pagination = $pagination = Content::pagination('deposit.php', $page1, $total, 15, 5, false);
$page_title = Lang::string('deposit');
if (empty($_REQUEST['bypass'])) {
    include 'includes/head.php';
    ?>
<div class="page_title">
Example #10
0
<?php

include '../lib/common.php';
$currencies = Settings::sessionCurrency();
$page_title = Lang::string('order-book');
$currency1 = $currencies['currency'];
$c_currency1 = $currencies['c_currency'];
$currency_info = $CFG->currencies[$currency1];
$c_currency_info = $CFG->currencies[$c_currency1];
API::add('Orders', 'get', array(false, false, false, $c_currency1, $currency1, false, false, 1));
API::add('Orders', 'get', array(false, false, false, $c_currency1, $currency1, false, false, false, false, 1));
API::add('Transactions', 'get', array(false, false, 1, $c_currency1, $currency1));
$query = API::send();
$bids = $query['Orders']['get']['results'][0];
$asks = $query['Orders']['get']['results'][1];
$last_transaction = $query['Transactions']['get']['results'][0][0];
$last_trans_currency = $last_transaction['currency'] == $currency_info['id'] ? false : ($last_transaction['currency1'] == $currency_info['id'] ? false : ' (' . $CFG->currencies[$last_transaction['currency1']]['currency'] . ')');
$last_trans_symbol = $currency_info['fa_symbol'];
$last_trans_color = $last_transaction['maker_type'] == 'sell' ? 'price-green' : 'price-red';
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="index.php"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="order-book.php"><?php 
Example #11
0
<?php

include '../lib/common.php';
API::add('Content', 'getRecord', array('about'));
$query = API::send();
$content = $query['Content']['getRecord']['results'][0];
$page_title = $content['title'];
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="<?php 
echo Lang::url('index.php');
?>
"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="<?php 
echo Lang::url('about.php');
?>
"><?php 
echo Lang::string('about');
?>
</a></div>
	</div>
</div>
<div class="container">
Example #12
0
<?php

include '../lib/common.php';
$page1 = !empty($_REQUEST['page']) ? ereg_replace("[^0-9]", "", $_REQUEST['page']) : false;
$bypass = !empty($_REQUEST['bypass']);
API::add('News', 'get', array(1));
API::add('News', 'get', array(false, $page1, 10, 1));
$query = API::send();
$total = $query['News']['get']['results'][0];
$news = $query['News']['get']['results'][1];
$pagination = Content::pagination('press-releases.php', $page1, $total, 10, 5, false);
$page_title = Lang::string('news');
if (!$bypass) {
    include 'includes/head.php';
    ?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
    echo $page_title;
    ?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="<?php 
    echo Lang::url('index.php');
    ?>
"><?php 
    echo Lang::string('home');
    ?>
</a> <i>/</i> <a href="<?php 
    echo Lang::url('press-releases.php');
    ?>
"><?php 
Example #13
0
<?php

include '../lib/common.php';
if (User::$awaiting_token) {
    Link::redirect('verify-token.php');
} elseif (!User::isLoggedIn()) {
    Link::redirect('https://support.1btcxe.com/');
}
API::add('User', 'getInfo', array($_SESSION['session_id']));
$query = API::send();
$user_info = $query['User']['getInfo']['results'][0];
$remote_url = preg_replace("/[^a-z0-9\\/-]/", "", $_REQUEST['url']);
if ($remote_url) {
    $remote_url = '&redirect_to=' . urlencode('https://support.1btcxe.com/' . $remote_url);
}
Link::redirect('http://support.1btcxe.com/login/sso?name=' . urlencode(!empty($user_info['first_name']) ? $user_info['first_name'] . ' ' . $user_info['last_name'] : $user_info['user']) . '&email=' . urlencode($user_info['email']) . '&amp;timestamp=' . time() . '&hash=' . hash_hmac('md5', $user_info['first_name'] . ' ' . $user_info['last_name'] . $user_info['email'] . time(), $CFG->helpdesk_key) . $remote_url);
Example #14
0
    $contact->errors[] = 'Page expired.';
}
if (!empty($_REQUEST['contact']) && is_array($contact->errors)) {
    $errors = array();
    foreach ($contact->errors as $key => $error) {
        if (stristr($error, 'login-required-error')) {
            $errors[] = Lang::string('settings-' . str_replace('_', '-', $key)) . ' ' . Lang::string('login-required-error');
        } elseif (strstr($error, '-')) {
            $errors[] = Lang::string($error);
        } else {
            $errors[] = $error;
        }
    }
    Errors::$errors = $errors;
} elseif (!empty($_REQUEST['contact']) && !is_array($contact->errors)) {
    API::add('SiteEmail', 'contactForm', array($contact->info));
    $query = API::send();
    Messages::$messages = array(Lang::string('contact-message'));
    $show_message = true;
    $show_mask = true;
}
$_SESSION["contact_uniq"] = md5(uniqid(mt_rand(), true));
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="<?php 
Example #15
0
<?php

include '../lib/common.php';
API::add('Content', 'getRecord', array('anti-fraud'));
$query = API::send();
$content = $query['Content']['getRecord']['results'][0];
$page_title = $content['title'];
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="index.php"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="anti-fraud.php"><?php 
echo $content['title'];
?>
</a></div>
	</div>
</div>
<div class="container">
	<div class="content_right">
    <div class="text"><?php 
echo $content['content'];
?>
</div>
    </div>
Example #16
0
<?php

include '../lib/common.php';
API::add('Content', 'getRecord', array('reset-2fa'));
$query = API::send();
$content = $query['Content']['getRecord']['results'][0];
$page_title = $content['title'];
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="index.php"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="reset-2fa.php"><?php 
echo Lang::string('reset-2fa');
?>
</a></div>
	</div>
</div>
<div class="container">
	<div class="content_right">
    <div class="text"><?php 
echo $content['content'];
?>
</div>
    </div>
Example #17
0
if (!empty($_REQUEST['notice']) && $_REQUEST['notice'] == 'email') {
    $notice = Lang::string('settings-change-notice');
} elseif (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'security-disabled-message') {
    Messages::add(Lang::string('security-disabled-message'));
}
if (User::$info['verified_authy'] == 'Y' || $step2) {
    API::add('Content', 'getRecord', array('security-setup'));
} elseif (User::$info['verified_google'] == 'Y' || $step4) {
    API::add('Content', 'getRecord', array('security-setup-google'));
} elseif ($step1) {
    API::add('Content', 'getRecord', array('security-token'));
} elseif ($step3) {
    API::add('Content', 'getRecord', array('security-google'));
    API::add('User', 'getGoogleSecret');
} else {
    API::add('Content', 'getRecord', array('security-explain'));
}
$query = API::send();
$content = $query['Content']['getRecord']['results'][0];
$secret = !empty($query['User']['getGoogleSecret']) ? $query['User']['getGoogleSecret']['results'][0] : false;
$page_title = Lang::string('security');
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="index.php"><?php 
echo Lang::string('home');
<?php

chdir('..');
$ajax = true;
include '../lib/common.php';
$currency1 = array_key_exists($_REQUEST['currency'], $CFG->currencies) ? $_REQUEST['currency'] : false;
$c_currency1 = array_key_exists($_REQUEST['c_currency'], $CFG->currencies) ? $_REQUEST['c_currency'] : false;
$type1 = preg_replace("/[^0-9]/", "", $_REQUEST['type']);
$order_by1 = preg_replace("/[^a-z]/", "", $_REQUEST['order_by']);
$page1 = preg_replace("/[^0-9]/", "", $_REQUEST['page']);
API::add('Transactions', 'get', array(0, $page1, 30, $c_currency1, $currency1, 1, false, $type1, $order_by1, false));
$query = API::send();
$return = $query['Transactions']['get']['results'][0];
echo json_encode($return);
Example #19
0
            if (!is_array(Errors::$errors)) {
                $_SESSION["settings_uniq"] = md5(uniqid(mt_rand(), true));
                Link::redirect('settings.php?message=settings-account-deactivated');
            } else {
                $request_2fa = true;
            }
        }
    }
}
if (!empty($_REQUEST['reactivate_account'])) {
    if (!$email_auth && (empty($_SESSION["settings_uniq"]) || $_SESSION["settings_uniq"] != $_REQUEST['uniq'])) {
        Errors::add('Page expired.');
    } elseif (!$no_token && !$request_2fa) {
        API::settingsChangeId($authcode1);
        API::token($token1);
        API::add('User', 'reactivateAccount');
        $query = API::send();
        if (!empty($query['error'])) {
            if ($query['error'] == 'security-com-error') {
                Errors::add(Lang::string('security-com-error'));
            }
            if ($query['error'] == 'authy-errors') {
                Errors::merge($query['authy_errors']);
            }
            if ($query['error'] == 'request-expired') {
                Errors::add(Lang::string('settings-request-expired'));
            }
            if ($query['error'] == 'security-incorrect-token') {
                Errors::add(Lang::string('security-incorrect-token'));
            }
        }
Example #20
0
 static function sendSMS($authy_id = false)
 {
     global $CFG;
     API::add('User', 'sendSMS', array($authy_id));
     $query = API::send();
     $response = $query['User']['sendSMS']['results'][0];
     if (!$response || !is_array($response)) {
         Errors::add(Lang::string('security-com-error'));
     } elseif ($response['success'] == false) {
         Errors::merge($response['errors']);
     } else {
         return true;
     }
 }
Example #21
0
if ($_REQUEST['id'] && !($api = API::lookup($_REQUEST['id']))) {
    $errors['err'] = 'Unknown or invalid API key ID.';
}
if ($_POST) {
    switch (strtolower($_POST['do'])) {
        case 'update':
            if (!$api) {
                $errors['err'] = 'Unknown or invalid API key.';
            } elseif ($api->update($_POST, $errors)) {
                $msg = 'API key updated successfully';
            } elseif (!$errors['err']) {
                $errors['err'] = 'Error updating API key. Try again!';
            }
            break;
        case 'add':
            if ($id = API::add($_POST, $errors)) {
                $msg = 'API key added successfully';
                $_REQUEST['a'] = null;
            } elseif (!$errors['err']) {
                $errors['err'] = 'Unable to add an API key. Correct error(s) below and try again.';
            }
            break;
        case 'mass_process':
            if (!$_POST['ids'] || !is_array($_POST['ids']) || !count($_POST['ids'])) {
                $errors['err'] = 'You must select at least one API key';
            } else {
                $count = count($_POST['ids']);
                if ($_POST['enable']) {
                    $sql = 'UPDATE ' . API_KEY_TABLE . ' SET isactive=1 WHERE id IN (' . implode(',', $_POST['ids']) . ')';
                    if (db_query($sql) && ($num = db_affected_rows())) {
                        if ($num == $count) {
Example #22
0
<?php

include '../lib/common.php';
$_SESSION['currency'] = preg_replace("/[^a-z]/", "", $_REQUEST['currency']);
$currency1 = $_SESSION['currency'];
$currency_symbol = strtoupper($currency1);
$currency_info = $CFG->currencies[$currency_symbol];
API::add('Stats', 'getCurrent', array($currency_info['id']));
API::add('Transactions', 'get', array(false, false, 5, $currency1));
API::add('Orders', 'get', array(false, false, 5, $currency1, false, false, 1));
API::add('Orders', 'get', array(false, false, 5, $currency1, false, false, false, false, 1));
API::add('Currencies', 'getRecord', array('BTC'));
$query = API::send();
$stats = $query['Stats']['getCurrent']['results'][0];
$transactions = $query['Transactions']['get']['results'][0];
$bids = $query['Orders']['get']['results'][0];
$asks = $query['Orders']['get']['results'][1];
$btc_info = $query['Currencies']['getRecord']['results'][0];
$currencies = $CFG->currencies;
$page_title = strip_tags(str_replace('[currency]', $currency_symbol, Lang::string('home-landing-currency')));
$meta_desc = String::substring(strip_tags(str_replace('[currency]', '<strong>' . $currency_symbol . '</strong>', Lang::string('home-landing-currency-explain'))), 300);
include 'includes/head.php';
if ($stats['daily_change'] > 0) {
    $arrow = '<i id="up_or_down" class="fa fa-caret-up" style="color:#60FF51;"></i> ';
} elseif ($stats['daily_change'] < 0) {
    $arrow = '<i id="up_or_down" class="fa fa-caret-down" style="color:#FF5151;"></i> ';
} else {
    $arrow = '<i id="up_or_down" class="fa fa-minus"></i> ';
}
?>
<div class="fresh_projects global_stats">
Example #23
0
            if (count($_SESSION["editorder_uniq"]) > 3) {
                unset($_SESSION["editorder_uniq"][min(array_keys($_SESSION["editorder_uniq"]))]);
            }
            Link::redirect('transactions.php', array('transactions' => $operations['transactions']));
            exit;
        }
    }
}
if ($sell && !is_array(Errors::$errors)) {
    $sell_market_price1 = !empty($_REQUEST['sell_market_price']);
    $sell_stop = !empty($_REQUEST['sell_stop']);
    $sell_stop_price1 = $sell_stop ? $sell_stop_price1 : false;
    $sell_limit = !empty($_REQUEST['sell_limit']);
    $sell_limit = !$sell_stop && !$sell_market_price1 ? 1 : $sell_limit;
    $sell_price1 = $sell_market_price1 ? $current_bid : $sell_price1;
    API::add('Orders', 'executeOrder', array(0, $sell_stop && !$sell_limit ? $sell_stop_price1 : $sell_price1, $sell_amount1, $c_currency1, $currency1, $user_fee_ask, $sell_market_price1, $order_info['id'], false, false, $sell_stop_price1));
    $query = API::send();
    $operations = $query['Orders']['executeOrder']['results'][0];
    if (!empty($operations['error'])) {
        Errors::add($operations['error']['message']);
    } else {
        if ($operations['edit_order'] > 0) {
            $uniq_time = time();
            $_SESSION["editorder_uniq"][$uniq_time] = md5(uniqid(mt_rand(), true));
            if (count($_SESSION["editorder_uniq"]) > 3) {
                unset($_SESSION["editorder_uniq"][min(array_keys($_SESSION["editorder_uniq"]))]);
            }
            Link::redirect('open-orders.php', array('transactions' => $operations['transactions'], 'edit_order' => 1));
            exit;
        } else {
            $uniq_time = time();
Example #24
0
foreach ($currency_majors as $currency) {
    if (empty($curr_list[$currency])) {
        continue;
    }
    $curr_list1[$currency] = $curr_list[$currency];
    unset($curr_list[$currency]);
}
$curr_list = array_merge($curr_list1, $curr_list);
if (!User::isLoggedIn()) {
    API::add('Content', 'getRecord', array('home'));
}
API::add('Stats', 'getCurrent', array($currencies['c_currency'], $currencies['currency']));
API::add('Transactions', 'get', array(false, false, 5, $currencies['c_currency'], $currencies['currency']));
API::add('Orders', 'get', array(false, false, 5, $currencies['c_currency'], $currencies['currency'], false, false, 1));
API::add('Orders', 'get', array(false, false, 5, $currencies['c_currency'], $currencies['currency'], false, false, false, false, 1));
API::add('News', 'get', array(false, false, 3));
$query = API::send();
if (!User::isLoggedIn()) {
    $content = $query['Content']['getRecord']['results'][0];
}
$stats = $query['Stats']['getCurrent']['results'][0];
$transactions = $query['Transactions']['get']['results'][0];
$bids = $query['Orders']['get']['results'][0];
$asks = $query['Orders']['get']['results'][1];
$news = $query['News']['get']['results'][0];
if ($stats['daily_change'] > 0) {
    $arrow = '<i id="up_or_down" class="fa fa-caret-up price-green"></i> ';
} elseif ($stats['daily_change'] < 0) {
    $arrow = '<i id="up_or_down" class="fa fa-caret-down price-red"></i> ';
} else {
    $arrow = '<i id="up_or_down" class="fa fa-minus"></i> ';
Example #25
0
<?php

include '../lib/common.php';
API::add('Content', 'getRecord', array('securing-account'));
$query = API::send();
$content = $query['Content']['getRecord']['results'][0];
$page_title = $content['title'];
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="<?php 
echo Lang::url('index.php');
?>
"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="securing-account.php"><?php 
echo Lang::string('securing-account');
?>
</a></div>
	</div>
</div>
<div class="container">
	<div class="content_right">
    <div class="text"><?php 
echo $content['content'];
Example #26
0
$usd_field = 'usd_ask';
if (!$notrades) {
    API::add('Transactions', 'get', array(false, false, 5, $c_currency1, $currency1));
    API::add('Stats', 'getBTCTraded', array($c_currency1));
} elseif (empty($_REQUEST['get10'])) {
    $limit = !$user ? 30 : false;
}
if (!empty($_REQUEST['last_price']) && $notrades) {
    API::add('Transactions', 'get', array(false, false, 1, $c_currency1, $currency1));
    API::add('Stats', 'getCurrent', array($c_currency1, $currency1));
    if ($currency1) {
        API::add('User', 'getAvailable');
    }
}
API::add('Orders', 'get', array(false, false, $limit, $c_currency1, $currency1, $user, false, 1, false, false, $user));
API::add('Orders', 'get', array(false, false, $limit, $c_currency1, $currency1, $user, false, false, false, 1, $user));
$query = API::send();
$return['asks'][] = $query['Orders']['get']['results'][1];
$return['bids'][] = $query['Orders']['get']['results'][0];
if (!$notrades) {
    $return['transactions'][] = $query['Transactions']['get']['results'][0];
    $return['btc_traded'] = $query['Stats']['getBTCTraded']['results'][0][0]['total_btc_traded'];
}
if (!empty($_REQUEST['last_price'])) {
    $return['last_price'] = $query['Transactions']['get']['results'][0][0]['btc_price'];
    $return['last_price_curr'] = $query['Transactions']['get']['results'][0][0]['currency'] == $currency_info['id'] ? '' : ($query['Transactions']['get']['results'][0][0]['currency1'] == $currency_info['id'] ? '' : ' (' . $CFG->currencies[$query['Transactions']['get']['results'][0][0]['currency1']]['currency'] . ')');
    $return['fa_symbol'] = $currency_info['fa_symbol'];
    $return['last_trans_color'] = $query['Transactions']['get']['results'][0][0]['maker_type'] == 'sell' ? 'price-green' : 'price-red';
    if ($currency1) {
        $return['available_fiat'] = !empty($query['User']['getAvailable']['results'][0][$currency_info['currency']]) ? String::currency($query['User']['getAvailable']['results'][0][$currency_info['currency']], $currency_info['is_crypto'] == 'Y') : '0';
        $return['available_btc'] = !empty($query['User']['getAvailable']['results'][0][$c_currency_info['currency']]) ? String::currency($query['User']['getAvailable']['results'][0][$c_currency_info['currency']], true) : '0';
Example #27
0
    }
}
if (!empty($_REQUEST['order_by'])) {
    $_SESSION['oo_order_by'] = preg_replace("/[^a-z]/", "", $_REQUEST['order_by']);
} else {
    if (empty($_SESSION['oo_order_by'])) {
        $_SESSION['oo_order_by'] = false;
    }
}
$currency1 = $_SESSION['oo_currency'];
$order_by1 = $_SESSION['oo_order_by'];
$trans_realized1 = !empty($_REQUEST['transactions']) ? preg_replace("/[^0-9]/", "", $_REQUEST['transactions']) : false;
$id1 = !empty($_REQUEST['id']) ? preg_replace("/[^0-9]/", "", $_REQUEST['id']) : false;
$bypass = !empty($_REQUEST['bypass']);
API::add('Orders', 'get', array(false, false, false, $currency1, 1, false, 1, $order_by1, false, 1));
API::add('Orders', 'get', array(false, false, false, $currency1, 1, false, false, $order_by1, 1, 1));
$query = API::send();
$bids = $query['Orders']['get']['results'][0];
$asks = $query['Orders']['get']['results'][1];
$currency_info = $currency1 ? $CFG->currencies[strtoupper($currency1)] : false;
if (!empty($_REQUEST['new_order']) && !$trans_realized1) {
    Messages::add(Lang::string('transactions-orders-new-message'));
}
if (!empty($_REQUEST['edit_order']) && !$trans_realized1) {
    Messages::add(Lang::string('transactions-orders-edit-message'));
} elseif (!empty($_REQUEST['new_order']) && $trans_realized1 > 0) {
    Messages::add(str_replace('[transactions]', $trans_realized1, Lang::string('transactions-orders-done-message')));
} elseif (!empty($_REQUEST['edit_order']) && $trans_realized1 > 0) {
    Messages::add(str_replace('[transactions]', $trans_realized1, Lang::string('transactions-orders-done-edit-message')));
} elseif (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'order-doesnt-exist') {
    Errors::add(Lang::string('orders-order-doesnt-exist'));
Example #28
0
} elseif (!User::isLoggedIn()) {
    Link::redirect('login.php');
}
$currency1 = !empty($_REQUEST['currency']) ? preg_replace("/[^a-z]/", "", strtolower($_REQUEST['currency'])) : false;
$order_by1 = !empty($_REQUEST['order_by']) ? preg_replace("/[^a-z]/", "", $_REQUEST['order_by']) : false;
$order_desc1 = !empty($_REQUEST['order_desc']) ? preg_replace("/[^0-9]/", "", $_REQUEST['order_desc']) : false;
$start_date1 = false;
$type1 = !empty($_REQUEST['type']) ? preg_replace("/[^0-9]/", "", $_REQUEST['type']) : false;
$page1 = !empty($_REQUEST['page']) ? preg_replace("/[^0-9]/", "", $_REQUEST['page']) : false;
$trans_realized1 = !empty($_REQUEST['transactions']) ? preg_replace("/[^0-9]/", "", $_REQUEST['transactions']) : false;
$bypass = !empty($_REQUEST['bypass']);
API::add('Transactions', 'get', array(1, $page1, 30, $currency1, 1, $start_date1, $type1, $order_by1, $order_desc1));
$query = API::send();
$total = $query['Transactions']['get']['results'][0];
API::add('Transactions', 'get', array(false, $page1, 30, $currency1, 1, $start_date1, $type1, $order_by1, $order_desc1));
API::add('Transactions', 'getTypes');
$query = API::send();
$transactions = $query['Transactions']['get']['results'][0];
$transaction_types = $query['Transactions']['getTypes']['results'][0];
$pagination = Content::pagination('transactions.php', $page1, $total, 30, 5, false);
$currency_info = $currency1 ? $CFG->currencies[strtoupper($currency1)] : array();
if ($trans_realized1 > 0) {
    Messages::add(str_replace('[transactions]', $trans_realized1, Lang::string('transactions-done-message')));
}
$page_title = Lang::string('transactions');
if (!$bypass) {
    include 'includes/head.php';
    ?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
<?php

include '../lib/common.php';
if (User::$info['locked'] == 'Y' || User::$info['deactivated'] == 'Y') {
    Link::redirect('settings.php');
} elseif (User::$awaiting_token) {
    Link::redirect('verify-token.php');
} elseif (!User::isLoggedIn()) {
    Link::redirect('login.php');
}
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=transactions_' . date('Y-m-d') . '.csv');
API::add('Transactions', 'get', array(false, false, false, false, 1, false, false, false, false, false, 1));
$query = API::send();
$transactions = $query['Transactions']['get']['results'][0];
if ($transactions) {
    $output = fopen('php://output', 'w');
    fputcsv($output, array(' ' . Lang::string('transactions-type') . ' ', ' ' . Lang::string('transactions-time') . ' ', ' ' . Lang::string('transactions-btc') . ' ', ' ' . Lang::string('currency') . ' ', ' ' . Lang::string('transactions-fiat') . ' ', ' ' . Lang::string('transactions-price') . ' ', ' ' . Lang::string('transactions-fee') . ' '));
    foreach ($transactions as $transaction) {
        fputcsv($output, array(' ' . $transaction['type'] . ' ', ' ' . date('M j, Y, H:i', strtotime($transaction['date']) + $CFG->timezone_offset) . ' UTC ', ' ' . number_format($transaction['btc'], 8) . ' ', ' ' . $transaction['currency'] . ' ', ' ' . number_format($transaction['btc_net'] * $transaction['fiat_price'], 2) . ' ', ' ' . number_format($transaction['fiat_price'], 2) . ' ', ' ' . number_format($transaction['fee'] * $transaction['fiat_price'], 2) . ' '));
    }
}
Example #30
0
<?php

include '../lib/common.php';
API::add('Content', 'getRecord', array('our-security'));
$query = API::send();
$content = $query['Content']['getRecord']['results'][0];
$page_title = $content['title'];
include 'includes/head.php';
?>
<div class="page_title">
	<div class="container">
		<div class="title"><h1><?php 
echo $page_title;
?>
</h1></div>
        <div class="pagenation">&nbsp;<a href="<?php 
echo Lang::url('index.php');
?>
"><?php 
echo Lang::string('home');
?>
</a> <i>/</i> <a href="<?php 
echo Lang::url('our-security.php');
?>
"><?php 
echo Lang::string('our-security');
?>
</a></div>
	</div>
</div>
<div class="container">