/* Decoded by unphp.net */
defined('BASEPATH') or exit('No direct script access allowed');
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
function hashrate($realpower, $currate, $hashrate)
{
$real_power = ($realpower*$currate)*$hashrate;
$hs = $hashrate/1;
$khs = $hashrate/1000;
$mhs = $hashrate/1000000;
$ghs = $hashrate/1000000000;
$ths = $hashrate/1000000000000;
$phs = $hashrate/1000000000000000;
$ehs = $hashrate/1000000000000000000;
$zhs = $hashrate/1000000000000000000000;
$hs1 = ($real_power * $hs) / $hashrate;
$khs1 = ($real_power * $khs) / $hashrate;
$mhs1 = ($real_power * $mhs) / $hashrate;
$ghs1 = ($real_power * $ghs) / $hashrate;
$ths1 = ($real_power * $ths) / $hashrate;
$phs1 = ($real_power * $phs) / $hashrate;
$ehs1 = ($real_power * $ehs) / $hashrate;
$zhs1 = ($real_power * $zhs) / $hashrate;
if($hs1 <= 1000000) {
$pow = number_format(($real_power * $hs) / $hashrate,0);
$hash = 'H/s';
}else if($hs1 > 1000000 && $khs1 <= 1000000) {
$pow = number_format(($real_power * $khs) / $hashrate,0);
$hash = 'KH/s';
}else if($khs1 > 1000000 && $mhs1 <= 1000000) {
$pow = number_format(($real_power * $mhs) / $hashrate,0);
$hash = 'MH/s';
}else if($mhs1 > 1000000 && $ghs1 <= 1000000) {
$pow = number_format(($real_power * $ghs) / $hashrate,0);
$hash = 'GH/s';
}else if($ghs1 > 1000000 && $ths1 <= 1000000) {
$pow = number_format(($real_power * $ths) / $hashrate,0);
$hash = 'TH/s';
}else if($ths1 > 1000000 && $phs1 <= 1000000) {
$pow = number_format(($real_power * $phs) / $hashrate,0);
$hash = 'PH/s';
}else if($phs1 > 1000000 && $ehs1 <= 1000000) {
$pow = number_format(($real_power * $ehs) / $hashrate,0);
$hash = 'EH/s';
}else if($ehs1 > 1000000) {
$pow = number_format(($real_power * $zhs) / $hashrate,0);
$hash = 'ZH/s';
}
return ''.$pow.' '.$hash;
}
function level_progres($a){
function getSettings()
{
$ci=& get_instance();
$ci->load->database();
$settings = $ci->db->get_where('settings', array('name' => 'level_exp'))->result_array()[0];
return $settings;
}
$setting = getSettings();
return ($a / $setting['value']) * 100;
}
function ourantibot($uid)
{
function getSettings()
{
$ci=& get_instance();
$ci->load->database();
$settings = $ci->db->get_where('settings', array('name' => 'ourantibot'))->result_array()[0];
return $settings;
}
$setting = getSettings();
$my_array = explode(',',$setting['value']);
if (!is_dir('assets/images/captcha/'.$uid)) {
mkdir('./assets/images/captcha/'.$uid, 0777, TRUE);
}
foreach(glob('assets/images/captcha/'.$uid.'/'.'*.{jpg,JPG,jpeg,JPEG,png,PNG}',GLOB_BRACE) as $image){ $capimage[] = basename($image); }
if(isset($capimage[0])) {
unlink('assets/images/captcha/'.$uid.'/'.$capimage[0]);
}
$my_array_num = array("0","1","2","3","4");
shuffle($my_array);shuffle($my_array_num);
$words = str_replace(' ', '', $my_array[$my_array_num[0]]);
$vals = [
'word' => substr($words, 0, 15),
'img_path' => './assets/images/captcha/'.$uid.'/',
'img_url' => base_url('assets/images/captcha/'.$uid.'/'),
'img_width' => 200,
'img_height' => 50,
'expiration' => 7200,
'word_length' => 15,
'font_size' => 18,
'img_id' => 'Imageid',
'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'colors' => [
'background'=> [255, 255, 255],
'border' => [255, 255, 255],
'text' => [0, 0, 0, 1],
'grid' => [0, 0, 0, 0.5]
]
];
$antibot = create_captcha($vals);
return $antibot;
}
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
// 0.9k-850k
$n_format = number_format($n / 1000, $precision);
$suffix = 'K';
} else if ($n < 900000000) {
// 0.9m-850m
$n_format = number_format($n / 1000000, $precision);
$suffix = 'M';
} else if ($n < 900000000000) {
// 0.9b-850b
$n_format = number_format($n / 1000000000, $precision);
$suffix = 'B';
} else {
// 0.9t+
$n_format = number_format($n / 1000000000000, $precision);
$suffix = 'T';
}
if ( $precision > 0 ) {
$dotzero = '.' . str_repeat( '0', $precision );
$n_format = str_replace( $dotzero, '', $n_format );
}
return $n_format .' '. $suffix;
}
function sweet_alert($type, $content)
{
$title = ($type == 'success') ? 'Success!' : 'Failed!';
return "";
}
function basic_alert($type, $content)
{
return '
' . $content . '
';
}
function check_ip($ip, $useragent)
{
$url = 'http://blackbox.ipinfo.app/lookup/' . $ip;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_REFERER, "https://google.com");
$proxyresponse = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($proxyresponse == 'Y') {
return true;
}else{
function pscheck()
{
$ci=& get_instance();
$ci->load->database();
$settings = $ci->db->get_where('settings', array('name' => 'proxycheck_api_key'))->result_array()[0];
return $settings;
}
$setting1 = pscheck();
$proxycheckkey = $setting1['value'];
function proxycheck($ipAddress)
{
try {
$request = @json_decode(file_get_contents('http://proxycheck.io/v2/' . $ipAddress . '?key=' . $proxycheckkey . '&vpn=1&asn=1&time=1&inf=1&risk=1&tag=UserCheck'), TRUE);
if (!empty($request['status']) && $request['status'] == 'ok') {
$result['status'] = ($request[$ipAddress]['proxy'] == 'yes' ? 1 : 0);
}
return $result;
} catch (Exception $e) {
return $result;
}
}
if (!empty($proxycheckkey)){
$proxycheck = proxycheck($ip);
if ($proxycheck['status'] == 1) {
return true;
}
}
function iphcheck()
{
$ci=& get_instance();
$ci->load->database();
$settings = $ci->db->get_where('settings', array('name' => 'iphub_api_key'))->result_array()[0];
return $settings;
}
$setting2 = iphcheck();
$iphubkey = $setting2['value'];
if(!empty($iphubkey)){
try {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "http://v2.api.iphub.info/ip/{$ip}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Key: {$iphubkey}"]
]);
$request = json_decode(curl_exec($ch), TRUE);
$result['status'] = (isset($request['block']) ? $request['block'] : false);
} catch (Exception $e) {
$result['status'] = false;
}
if ($result['status'] == 1) {
return true;
}
}
}
return false;
}
function faucetpay($address, $ip_address, $amount, $api, $currency, $referral = false)
{
$param = array(
'api_key' => $api,
'amount' => $amount,
'to' => $address,
'currency' => $currency,
'referral' => $referral,
'ip_address' => $ip_address
);
$url = 'https://faucetpay.io/api/v1/send';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, count($param));
curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
return $result;
}
function get_captcha($config, $baseUrl, $slot)
{
$availableCaptcha = explode('|', $config[$slot]);
$captchaSelect = '';
return $captchaSelect . $captchaDisplay;
}
function verifyRecaptchaV3($response, $secretKeys)
{
$Captcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$Captcha_data = array('secret' => $secretKeys, 'response' => $response);
$Captcha_options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded
",
'method' => 'POST',
'content' => http_build_query($Captcha_data),
),
);
$Captcha_context = stream_context_create($Captcha_options);
$Captcha_result = file_get_contents($Captcha_url, false, $Captcha_context);
$result = json_decode($Captcha_result);
return ($result->success && $result->score >= 0.3);
}
function verifyRecaptchaV2($response, $secretKeys)
{
$Captcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$Captcha_data = array('secret' => $secretKeys, 'response' => $response);
$Captcha_options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded
",
'method' => 'POST',
'content' => http_build_query($Captcha_data),
),
);
$Captcha_context = stream_context_create($Captcha_options);
$Captcha_result = file_get_contents($Captcha_url, false, $Captcha_context);
return json_decode($Captcha_result)->success;
}
function verifyHcaptcha($response, $secretKeys, $ipAddress)
{
$Captcha_url = 'https://hcaptcha.com/siteverify';
$Captcha_data = array('secret' => $secretKeys, 'response' => $response, 'remoteip' => $ipAddress);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Captcha_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $Captcha_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
$result = @json_decode($result, true);
if ((!empty($result['success'])) && ($result['success'] == true)) {
return true;
}
return false;
}
function verifySolvemedia($v_key, $h_key, $ipAddress, $adcopyChallenge, $adcopyResponse)
{
include APPPATH . 'third_party/solvemedia.php';
$solvemedia_response = solvemedia_check_answer($v_key, $ipAddress, $adcopyChallenge, $adcopyResponse, $h_key);
return $solvemedia_response->is_valid;
}
function verifyTurnstile($response, $secretKeys, $ipAddress)
{
$Captcha_url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
$Captcha_data = array('secret' => $secretKeys, 'response' => $response, 'remoteip' => $ipAddress);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Captcha_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $Captcha_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
$result = @json_decode($result, true);
if ((!empty($result['success'])) && ($result['success'] == true)) {
return true;
}
return false;
}
if (!function_exists('smtpMailer')) {
function smtpMailer($email, $subject, $message, $settings)
{
require APPPATH . 'third_party/phpmailer/autoload.php';
$mail = new PHPMailer(true);
try {
//Server settings
$mail->isSMTP();
// $mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->Host = $settings['smtp_host'];
$mail->SMTPAuth = true;
$mail->Username = $settings['smtp_username'];
$mail->Password = $settings['smtp_password'];
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = $settings['smtp_port'];
$mail->setFrom($settings['site_email'], $settings['name']);
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = 'Active your account';
$mail->send();
return true;
} catch (Exception $e) {
error_log($mail->ErrorInfo);
return false;
}
}
}
if (!function_exists('ciMail')) {
function ciMail($email, $subject, $message, $settings)
{
$CI = &get_instance();
$CI->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$CI->email->initialize($config);
$CI->email->clear();
$CI->email->from($settings['site_email'], $settings['name']);
$CI->email->to($email);
$CI->email->subject($subject);
$CI->email->message($message);
if ($CI->email->send()) {
return true;
} else {
return false;
}
}
}
function sendMail($email, $subject, $message, $settings)
{
if ($settings['mail_service'] == 'mail') {
if (!ciMail($email, $subject, $message, $settings)) {
$headers = array(
'MIME-Version' => '1.0',
'Content-type' => 'text/html;charset=UTF-8',
'From' => $settings['name'] . ' <' . $settings['site_email'] . '>',
'Reply-To' => $settings['site_email'],
'X-Mailer' => 'PHP/' . phpversion()
);
if (!mail($email, $subject, $message, $headers)) {
return false;
}
}
return true;
} else {
return smtpMailer($email, $subject, $message, $settings);
}
}
function sortLinks($a, $b)
{
if ($a['rmnViews'] == 0) {
return 1;
}
if ($b['rmnViews'] == 0) {
return -1;
}
if ($a['reward'] > $b['reward']) {
return -1;
} else if ($a['reward'] < $b['reward']) {
return 1;
}
}
function get_data($url, $timeout = 15, $header = array(), $options = array())
{
if (!function_exists('curl_init')) {
return file_get_contents($url);
} elseif (!function_exists('file_get_contents')) {
return '';
}
if (empty($options)) {
$options = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_TIMEOUT => $timeout
);
}
if (empty($header)) {
$header = array(
"User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31",
"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*\/*;q=0.5",
"Accept-Language: en-us,en;q=0.5",
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
"Cache-Control: must-revalidate, max-age=0",
"Connection: keep-alive",
"Keep-Alive: 300",
"Pragma: public"
);
}
if ($header != 'NO_HEADER') {
$options[CURLOPT_HTTPHEADER] = $header;
}
$ch = curl_init();
curl_setopt_array($ch, $options);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function format_money($amount)
{
return rtrim(rtrim(number_format($amount, 6), '0'), '.');
}
function percentage($a, $b)
{
$result = 0;
if($a != 0) {
$result = (($b - $a) * 100) / $a;
}
return $result;
}
function fpbalance($api, $cur)
{
$param = array(
'api_key' => $api,
'currency' => $cur
);
$url = 'https://faucetpay.io/api/v1/getbalance';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, count($param));
curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
return $result;
}
function currency($amount, $rate, $name)
{
$token = $amount / $rate;
if ($token > 1) {
return $token . ' '.$name;
}
return $token . ' '.$name;
}
function currency2($amount, $rate)
{
$token = $amount / $rate;
if ($token > 1) {
return $token;
}
return $token;
}
function uagent($Uagent)
{
$useragent=$Uagent;
if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4))){
return true;
}else{
return false;
}
}