Created
August 21, 2018 05:10
-
-
Save JasvinderSingh1/84fea5cbc478194699b06310a7a9f1e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class functions | |
{ | |
function token_generate($length = 10) | |
{ | |
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
$charactersLength = strlen($characters); | |
$randomString = ''; | |
for ($i = 0; $i < $length; $i++) | |
{ | |
$randomString .= $characters[rand(0, $charactersLength - 1)]; | |
} | |
return $randomString; | |
} | |
function send_mail($to, $subject, $message, $headers) | |
{ | |
mail($to, $subject, $message, $headers); | |
} | |
function get_profile_name($id) | |
{ | |
global $conn; | |
$userName = ""; | |
$strQry = "SELECT user_name FROM boostuplikes_admins WHERE id = '".$id."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$userName = $row['user_name']; | |
} | |
return $userName; | |
} | |
function get_signup_user_name($id) | |
{ | |
global $conn; | |
$userName = ""; | |
$strQry = "SELECT user_name FROM boostuplikes_users WHERE id = '".$id."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$userName = $row['user_name']; | |
} | |
return $userName; | |
} | |
function get_signup_user_email($id) | |
{ | |
global $conn; | |
$userEmail = ""; | |
$strQry = "SELECT email_id FROM boostuplikes_users WHERE id = '".$id."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$userEmail = $row['email_id']; | |
} | |
return $userEmail; | |
} | |
function get_email_confirm($id) | |
{ | |
global $conn; | |
$user_id = ""; | |
$strQry = "SELECT id FROM boostuplikes_users WHERE email_confirm = '".$id."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$user_id = $row['id']; | |
} | |
return $user_id; | |
} | |
function get_signup_user() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_users WHERE id != '' AND status = 'Active' AND email_confirm = '' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_signup_user_home() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_users"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_signup_user_status($id) | |
{ | |
global $conn; | |
$status = ""; | |
$strQry = "SELECT status FROM boostuplikes_users WHERE id = '".$id."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$status = $row['status']; | |
} | |
return $status; | |
} | |
function get_autoround_user() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_vip_usernames WHERE vipuserID != '' AND status = 'Active' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_total_user($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_vip_usernames WHERE vipuserID!='' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function curlPost($paypalurl,$paypalreturnarr) | |
{ | |
$req = 'cmd=_notify-validate'; | |
foreach($paypalreturnarr as $key => $value) | |
{ | |
$value = urlencode(stripslashes($value)); | |
$req .= "&$key=$value"; | |
} | |
$ipnsiteurl=$paypalurl; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $ipnsiteurl); | |
curl_setopt($ch, CURLOPT_HEADER, false); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $req); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
return $result; | |
} | |
function get_expiry_date($id) | |
{ | |
global $conn; | |
$expiry_date = ""; | |
$strQry = "SELECT expiry_date FROM boostuplikes_subscribe_package WHERE id = '".$id."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$expiry_date = $row['expiry_date']; | |
} | |
return $expiry_date; | |
} | |
function get_1k_users($id) | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_10k_users WHERE id!='' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_10k_users($id) | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_50k_users WHERE id!='' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_network_size() | |
{ | |
global $conn; | |
$network_size = ""; | |
$strQry = "SELECT network_size FROM boostuplikes_settings WHERE id !=''"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$network_size = $row['network_size']; | |
} | |
return $network_size; | |
} | |
function get_1k_likes() | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT SUM(likes_to_receive) AS totalAttemped FROM boostuplikes_1k_users WHERE id!='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_10k_likes() | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT SUM(likes_to_receive) AS totalAttemped FROM boostuplikes_10k_users WHERE id!='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_without_group_likes() | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT SUM(likes_to_receive) AS totalAttemped FROM boostuplikes_without_account WHERE id!='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_api_url() | |
{ | |
global $conn; | |
$api_url = ""; | |
$strQry = "SELECT api_url FROM boostuplikes_settings WHERE id !='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$api_url = $row['api_url']; | |
} | |
return $api_url; | |
} | |
function get_api_key() | |
{ | |
global $conn; | |
$api_key = ""; | |
$strQry = "SELECT api_key FROM boostuplikes_settings WHERE id !='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$api_key = $row['api_key']; | |
} | |
return $api_key; | |
} | |
function get_powerlikes_user_without_giving() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_without_account WHERE id != '' AND status = 'Active' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_powerlikes_user_with_giving_1k() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_1k_users WHERE id != '' AND status = 'Active' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_powerlikes_user_with_giving_10k() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_10k_users WHERE id != '' AND status = 'Active' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_autoround_user_revenue() | |
{ | |
global $conn; | |
$totalAttemped = "0"; | |
$strQry = "SELECT SUM(amount1) AS totalAttemped FROM boostuplikes_paypal_sub WHERE id!='' AND txn_type = 'subscr_signup' AND payment_roll = 'Autoround' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_autoround_user_revenue2() | |
{ | |
global $conn; | |
$totalAttemped = "0"; | |
$strQry = "SELECT SUM(mc_gross) AS totalAttemped FROM boostuplikes_paypal_payment WHERE id!='' AND txn_type = 'subscr_payment' AND payment_roll = 'Autoround' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_powerlikes_user_revenue_with_giving() | |
{ | |
global $conn; | |
$totalAttemped = "0"; | |
$strQry = "SELECT SUM(amount3) AS totalAttemped FROM boostuplikes_paypal_sub WHERE id!='' AND txn_type = 'subscr_signup' AND payment_roll = 'PowerlikesWithGiving' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_powerlikes_user_revenue_without_giving() | |
{ | |
global $conn; | |
$totalAttemped = "0"; | |
$strQry = "SELECT SUM(amount3) AS totalAttemped FROM boostuplikes_paypal_sub WHERE id!='' AND txn_type = 'subscr_signup' AND payment_roll = 'PowerlikesWithoutGiving' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_top_biggest_customers() | |
{ | |
global $conn; | |
$email_id = "0"; | |
$strQry = "SELECT email_id, (SELECT SUM(amount3) FROM boostuplikes_paypal_sub WHERE user_id= boostuplikes_users.id) AS amount FROM boostuplikes_users ORDER BY amount DESC LIMIT 0,5"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$email_id = $row['email_id']; | |
} | |
return $email_id; | |
} | |
function get_total_referral($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_user_referral WHERE id != '' AND ref_user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_total_amount($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT SUM(amount) AS totalAttemped FROM boostuplikes_user_referral WHERE id != '' AND ref_user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_referral_percentage() | |
{ | |
global $conn; | |
$referral_amount = "0"; | |
$strQry = "SELECT referral_amount FROM boostuplikes_settings WHERE id !='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$referral_amount = $row['referral_amount']; | |
} | |
return $referral_amount; | |
} | |
function get_referral_amount($id) | |
{ | |
global $conn; | |
$amount = "0"; | |
$strQry = "SELECT amount FROM boostuplikes_user_referral WHERE id !='' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$amount = $row['amount']; | |
} | |
return $amount; | |
} | |
function get_checkout_amount($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT SUM(checkout_amout) AS totalAttemped FROM boostuplikes_user_checkout WHERE id != '' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_checked_val($id, $id2) | |
{ | |
global $conn; | |
$idd = ""; | |
$strQry = "SELECT time_setting_id FROM boostuplikes_api_interval WHERE user_id = '".$id."' AND time_setting_id = '".$id2."'"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$idd = $row['time_setting_id']; | |
} | |
return $idd; | |
} | |
function get_round_pause_info($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_api_interval WHERE user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_time_setting_info($id) | |
{ | |
global $conn; | |
$cron_start_time = ""; | |
$strQry = "SELECT cron_start_time FROM boostuplikes_time_setting WHERE id ='".$id."' ORDER BY id ASC "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$cron_start_time = $row['cron_start_time']; | |
} | |
return $cron_start_time; | |
} | |
function get_time_setting_info2($id, $u_id) | |
{ | |
global $conn; | |
$time_setting_id = ""; | |
$strQry = "SELECT time_setting_id FROM boostuplikes_api_interval WHERE time_setting_id ='".$id."' AND user_id ='".$u_id."' ORDER BY id ASC "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$time_setting_id = $row['time_setting_id']; | |
} | |
return $time_setting_id; | |
} | |
function check_liking_account_1k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT id FROM boostuplikes_1k_users WHERE id != '' AND liking_account = '".$account."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function check_likingAccount_10k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT * FROM boostuplikes_10k_users WHERE id != '' AND liking_account IN('".$account."')"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function get_setting_id($id) | |
{ | |
global $conn; | |
$setting_id = ""; | |
$strQry = "SELECT * FROM boostuplikes_network_settings WHERE id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$setting_id = $row['id']; | |
} | |
return $setting_id; | |
} | |
function check_likingAccount_50k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT * FROM boostuplikes_50k_users WHERE id != '' AND liking_account IN('".$account."')"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function check_likingAccount_100k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT * FROM boostuplikes_100k_users WHERE id != '' AND liking_account IN('".$account."')"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function check_liking_account_10k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT id FROM boostuplikes_10k_users WHERE id != '' AND liking_account = '".$account."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function check_liking_account_50k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT id FROM boostuplikes_50k_users WHERE id != '' AND liking_account = '".$account."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function check_liking_account_100k($account) | |
{ | |
global $conn; | |
$check_account = ""; | |
$strQry = "SELECT id FROM boostuplikes_100k_users WHERE id != '' AND liking_account = '".$account."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$check_account = $row['id']; | |
} | |
return $check_account; | |
} | |
function get_cancelled_subscription() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_subscribe_package WHERE id != '' AND cancellation_status = '1' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_website_users($id) | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_vip_usernames WHERE vipuserID IN ('".$id."')"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_drop_users() | |
{ | |
global $conn; | |
$totalAttemped = ""; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM drops WHERE dropID != '' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalAttemped = $row['totalAttemped']; | |
} | |
return $totalAttemped; | |
} | |
function get_likes_given() | |
{ | |
global $conn; | |
$likes_given = 0; | |
$strQry = "SELECT likes_given FROM boostuplikes_settings WHERE id != '' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$likes_given = $row['likes_given']; | |
} | |
return $likes_given; | |
} | |
function get_subscription_amount($id) | |
{ | |
global $conn; | |
$real_amount = 0; | |
$strQry = "SELECT real_amount FROM boostuplikes_user_subscription_info WHERE login_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$real_amount = $row['real_amount']; | |
} | |
return $real_amount; | |
} | |
function get_paypal_id($id, $sub_id) | |
{ | |
global $conn; | |
$paypal_id = ''; | |
$strQry = "SELECT id FROM boostuplikes_paypal_sub WHERE user_id = '".$id."' AND subscr_id = '".$sub_id."' AND txn_type = 'subscr_signup' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$paypal_id = $row['id']; | |
} | |
return $paypal_id; | |
} | |
function get_paypal_payment_id($id, $sub_id) | |
{ | |
global $conn; | |
$paypal_id = ''; | |
$strQry = "SELECT id FROM boostuplikes_paypal_payment WHERE user_id = '".$id."' AND subscr_id = '".$sub_id."' AND txn_type = 'subscr_payment' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$paypal_id = $row['id']; | |
} | |
return $paypal_id; | |
} | |
function get_paypal_subscription_id($id) | |
{ | |
global $conn; | |
$subscr_id = ''; | |
$strQry = "SELECT subscr_id FROM boostuplikes_paypal_sub WHERE user_id = '".$id."' AND txn_type = 'subscr_signup' ORDER BY id DESC"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$subscr_id = $row['subscr_id']; | |
} | |
return $subscr_id; | |
} | |
function get_discount_id($month_id) | |
{ | |
global $conn; | |
$id = 0; | |
$strQry = "SELECT id FROM boostuplikes_discounts WHERE months = '".$month_id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$id = $row['id']; | |
} | |
return $id; | |
} | |
function get_powerlikes_subscription_amount($id) | |
{ | |
global $conn; | |
$real_amount = 0; | |
$strQry = "SELECT real_amount FROM boostuplikes_powerlikes_woa_subscription_info WHERE login_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$real_amount = $row['real_amount']; | |
} | |
return $real_amount; | |
} | |
function get_powerlike_discount_id($month_id) | |
{ | |
global $conn; | |
$id = 0; | |
$strQry = "SELECT id FROM boostuplikes_powerlikes_discounts WHERE months = '".$month_id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$id = $row['id']; | |
} | |
return $id; | |
} | |
function get_powerlike_subscription_amount($id) | |
{ | |
global $conn; | |
$real_amount = 0; | |
$strQry = "SELECT real_amount FROM boostuplikes_powerlikes_woa_subscription_info WHERE login_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$real_amount = $row['real_amount']; | |
} | |
return $real_amount; | |
} | |
function get_powerlikes_without_giving($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_without_account WHERE id != '' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_powerlikes_1k_group($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_1k_users WHERE id != '' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_powerlikes_10k_group($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_10k_users WHERE id != '' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_powerlikes_50k_group($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_50k_users WHERE id != '' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_powerlikes_100k_group($id) | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_100k_users WHERE id != '' AND user_id = '".$id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function get_subscription_expiry($id, $user_id) | |
{ | |
global $conn; | |
$expiry_date = ''; | |
$strQry = "SELECT expiry_date FROM boostuplikes_subscribe_package WHERE id = '".$id."' AND user_id = '".$user_id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$expiry_date = $row['expiry_date']; | |
} | |
return $expiry_date; | |
} | |
function get_user_subscription_expiry($user_id) | |
{ | |
global $conn; | |
$expiry_date = ''; | |
$strQry = "SELECT expiry_date FROM boostuplikes_subscribe_package WHERE user_id = '".$user_id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$expiry_date = $row['expiry_date']; | |
} | |
return $expiry_date; | |
} | |
function get_default_autoround_commission() | |
{ | |
global $conn; | |
$referralAmount = "0"; | |
$strQry = "SELECT referral_amount FROM boostuplikes_settings WHERE id != ''"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$referralAmount = $row['referral_amount']; | |
} | |
return $referralAmount; | |
} | |
function get_default_powerlike_commission() | |
{ | |
global $conn; | |
$referralAmount = "0"; | |
$strQry = "SELECT referral_amount FROM boostuplikes_likes_setting WHERE id != ''"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$referralAmount = $row['referral_amount']; | |
} | |
return $referralAmount; | |
} | |
function get_default_comments_commission() | |
{ | |
global $conn; | |
$referralAmount = "0"; | |
$strQry = "SELECT referral_amount FROM boostuplikes_comment_settings WHERE id != ''"; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$referralAmount = $row['referral_amount']; | |
} | |
return $referralAmount; | |
} | |
function get_commission_by_user($uid, $utype) | |
{ | |
global $conn; | |
$commission = "0"; | |
$strQry = "SELECT commission FROM boostuplikes_commission_setting WHERE id !='' AND user_id = '".$uid."' AND roll = '".$utype."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$commission = $row['commission']; | |
} | |
return $commission; | |
} | |
///****************************** | |
function get_total_comment_user() | |
{ | |
global $conn; | |
$totalCount = "0"; | |
$strQry = "SELECT COUNT(*) AS totalAttemped FROM boostuplikes_user_slots WHERE id!='' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$totalCount = $row['totalAttemped']; | |
} | |
return $totalCount; | |
} | |
function getPreferredTime($uid) | |
{ | |
global $conn; | |
$positionTime = ""; | |
$strQry = "SELECT positionTime FROM boostuplikes_slot_position WHERE id = '".$uid."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$positionTime = $row['positionTime']; | |
} | |
return $positionTime; | |
} | |
function get_comment_discount_id($month_id) | |
{ | |
global $conn; | |
$id = 0; | |
$strQry = "SELECT id FROM boostuplikes_comments_discount WHERE months = '".$month_id."' "; | |
$result = mysqli_query($conn, $strQry); | |
if(mysqli_num_rows($result) > 0) | |
{ | |
$row = mysqli_fetch_array($result); | |
$id = $row['id']; | |
} | |
return $id; | |
} | |
///****************************** | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment