<script>$("#depositOptions").change(function()
{
var method=$(this).val();
switch(method)
{
case"coinbase":$("#BTC").show();
$("#ETH").show();
$("#LTC").show();
$("#BCH").show();
$("#DAI").show();
$("#USDC").show();
$("#unselected_crypto").hide();
$("#DASH").hide();
$("#DOGE").hide();
$("#DGB").hide();
$("#TRX").hide();
$("#USDT").hide();
$("#unselected_deposit").hide();
break;
case"payeer":$("#USDT").show();
$("#DASH").hide();
$("#DOGE").hide();
$("#DGB").hide();
$("#TRX").hide();
$("#USDC").hide();
$("#BTC").hide();
$("#ETH").hide();
$("#LTC").hide();
$("#DAI").hide();
$("#BCH").hide();
$("#unselected_crypto").hide();
$("#unselected_deposit").hide();
break;
case"faucetpay":$("#BTC").show();
$("#ETH").show();
$("#LTC").show();
$("#TRX").show();
$("#DGB").show();
$("#DOGE").show();
$("#USDT").show();
$("#DAI").hide();
$("#USDC").hide();
$("#unselected_crypto").hide();
$("#unselected_deposit").hide();
break
}
}
);
$("#depositAmount").on("input",function()
{
var usdAmount=$("#depositAmount").val();
var cryptoOptions=$("#cryptoOptions").val();
$.get("system/ajax.php?a=equalizeUSD",
{
usd_amount:usdAmount,cryptoOptions:cryptoOptions
}
,function(a)
{
$("#displayingCrypto").html(a)
}
)
}
);
$("#cryptoOptions").on("change",function()
{
var usdAmount=$("#depositAmount").val();
var cryptoOptions=$("#cryptoOptions").val();
$.get("system/ajax.php?a=equalizeUSD",
{
usd_amount:usdAmount,cryptoOptions:cryptoOptions
}
,function(a)
{
$("#displayingCrypto").html(a)
}
)
}
);
var token="64f0d047c941bae6a887180756f08906614ebe5325437fa1acdfb4c3927c1b06";
var depositMin='<div class="alert alert-danger" role="alert"><i class="fa fa-exclamation-triangle fa-fw"></i> Minimum amount to deposit is 5 USD</div>';
var methodMsg='<div class="alert alert-danger" role="alert"><i class="fa fa-exclamation-triangle fa-fw"></i> Please select a valid payment method!</div>';
var waitMessage='<div class="alert alert-info" role="alert"><i class="fa fa-cog fa-spin fa-fw"></i> Please wait...</div>';
var minDepVal=5;
function initDeposit()
{
var amount=$("#depositAmount").val();
var cryptoOptions=$("#cryptoOptions").val();
var depositOptions=$("#depositOptions").val();
if(isNaN(amount)||amount<minDepVal)
{
$("#depositAlert").html(depositMin)
}
else
{
$("#depositAlert").html(waitMessage);
$("#depositForm").hide();
$.ajax(
{
type:"POST",url:"/system/ajax.php",data:
{
a:"initDeposit",token:token,amount:amount,depositOptions:depositOptions,cryptoOptions:cryptoOptions
}
,dataType:"json",success:function(data)
{
if(data.status==200)
{
$("#depositForm").html(data.message);
$("#depositAlert").hide();
$("#depositForm").show()
}
else
{
$("#depositAlert").html(data.message);
$("#depositForm").show()
}
}
}
)
}
}
function proccessDeposit(amount,cryptoAmount,cryptoOptions)
{
var method=$(".pay-check:checked").val();
if(isNaN(amount)||amount<minDepVal)
{
$("#depositAlert").html(depositMin).show()
}
else if(method!="coinbase"&&method!="payeer"&&method!="faucetpay")
{
$("#depositAlert").html(methodMsg).show()
}
else
{
$("#depositAlert").html(waitMessage).show();
$("#depositForm").hide();
$.ajax(
{
type:"POST",url:"/system/ajax.php",data:
{
a:"proccessDeposit",token:token,method:method,amount:amount,cryptoAmount:cryptoAmount,cryptoOptions:cryptoOptions
}
,dataType:"json",success:function(data)
{
if(data.status==200)
{
if(method=="payeer")
{
window.location.replace(data.redirect)
}
else if(method=="faucetpay")
{
window.location.replace(data.redirect)
}
else if(method=="coinbase")
{
window.location.replace(data.redirect)
}
}
else
{
$("#depositAlert").html(data.message);
$("#depositForm").show()
}
}
}
)
}
}
function depositCountdown(transaction,countTime)
{
var s=new Date().getTime()+countTime;
$("#deposit-countdown").countdown(s,
{
elapse:true
}
).on("update.countdown",function(event)
{
if(event.elapsed)
{
window.location.reload()
}
$(this).text(event.strftime("%H hours, %M minutes and %S seconds"))
}
);
var verify=setInterval(function()
{
$.ajax(
{
type:"POST",url:"/system/ajax.php",data:
{
a:"verifyDeposit",transaction:transaction
}
,dataType:"json",success:function(data)
{
if(data.status==200)
{
$("#depositForm").html(data.message);
clearInterval(verify)
}
else if(data.status==999)
{
clearInterval(verify)
}
}
}
)
}
,5000)
}
$(document).ready(function()
{
$("#USDT").hide();
$("#DASH").hide();
$("#DOGE").hide();
$("#DGB").hide();
$("#TRX").hide();
$("#USDC").hide();
$("#BTC").hide();
$("#ETH").hide();
$("#LTC").hide();
$("#DAI").hide();
$("#BCH").hide();
App.init()
}
);
© 2021 Quttera Ltd. All rights reserved.