<?php require_once "maincore.php"; require_once "includes/dbconnector.class.php"; require_once "includes/AsmoneyAPI.php"; $db = new DbConnector(); $db->queryres("select * from tbl_config where header='currency'"); $currency = $db->res['value']; $db->queryres("select * from tbl_config where header='pusername'"); $pusername = $db->res['value']; $db->queryres("select * from tbl_config where header='papiname'"); $papiname = $db->res['value']; $db->queryres("select * from tbl_config where header='ppassword'"); $ppassword = $db->res['value']; $api = new AsmoneyAPI($pusername, $papiname, $ppassword); //Change to mili bitcoin because asmoney get currencies based on milicoinfunction ChangetoMili($amount,$currency) { switch ($currency) { case "BTC" : $amount = $amount * 1000; return $amount; case "mBTC" : return $amount; case "Satoshi" : $amount = $amount / 10000; return $amount; case "LTC" : $amount = $amount * 1000; return $amount; case "mLTC" : return $amount; case "DOGE" : $amount = $amount * 1000; return $amount; case "mDOGE" : return $amount; case "PPC" : $amount = $amount * 1000; return $amount; case "mPPC" : return $amount; case "DRK" : $amount = $amount * 1000; return $amount; case "mDRK" : return $amount; }} $db->query("select * from tbl_withdrawal where status=0"); while ($res = $db->fetchArray()) { if ($res['type'] == 0) { $amount = ChangetoMili($res['amount'], $currency); $r = $api->Transfer($res['wallet'], $amount, $currency, 'Withdrawal'); // Payment memo if ($r['result'] == APIerror::OK) { $batchno = $r['value']; $db2->query("update tbl_withdrawal set status=1,reccode='{$batchno}' where withdrawal_id='" . $res['withdrawal_id'] . "'"); echo "Withdrawal has been proceessed" . $res['withdrawal_id']; } } else { $db2->queryres("select * from tbl_user where user_id='" . $res['user_id'] . "'"); $address = $db2->res['address']; $amount = ChangetoMili($res['amount'], $currency);
case "mDRK": return $amount; } } $db = new DbConnector(); $db->queryres("select * from tbl_config where header='currency'"); $faucetcurrency = $db->res['value']; $db->queryres("select * from tbl_config where header='pusername'"); $pusername = $db->res['value']; $db->queryres("select * from tbl_config where header='papiname'"); $papiname = $db->res['value']; $db->queryres("select * from tbl_config where header='ppassword'"); $ppassword = $db->res['value']; $db->queryres("select * from tbl_config where header='requestcount'"); $requestcount = $db->res['value']; $api = new AsmoneyAPI($pusername, $papiname, $ppassword); //Change to mili bitcoin because asmoney get currencies based on milicoin $db->query("select * from tbl_withdrawal where status=0"); $btcaddresses = array(); $btcamounts = array(); $withdrawalid = array(); while ($res = $db->fetchArray()) { $currency = $faucetcurrency; if ($res['type'] == 0) { $db2->queryres("select * from tbl_user where user_id='" . $res['user_id'] . "'"); $ausername = $db2->res['ausername']; $amount = ChangetoMili($res['amount'], $currency); $r = $api->Transfer($ausername, $amount, $currency, 'Withdrawal'); // Payment memo echo $r['result']; if ($r['result'] == APIerror::OK) { $batchno = $r['value'];
break; case "DOGE": case "mDOGE": $currency = "mDOGE"; break; case "PPC": case "mPPC": $currency = "mPPC"; break; case "DRK": case "mDRK": $currency = "mDRK"; break; } } $api = new AsmoneyAPI($pusername, $papiname, $ppassword); changecur($currency); $r = $api->GetBalance($currency); // Possible values are 'EUR', 'mBTC', 'mLTC', 'GBP' echo $balance = $r['value']; ?> </h1> <p>Balance</p> </div> </section> </div>