Last active
June 15, 2021 14:25
-
-
Save jsstoni/9b189f6aa7a6d4266e6150fd1d8b9261 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
//@setcookie("user", "", time() - 3600); | |
//unset($_COOKIE); | |
//echo session_id(); | |
if (!session_id()) { | |
session_start(); | |
} | |
ini_set('display_errors', 0); | |
date_default_timezone_set('Asia/Kolkata'); | |
include_once 'set-language.php'; | |
//get meta data | |
include_once 'config/connection.php'; | |
$connection = new Connection(); | |
$curcode = $_SESSION['currency_code']; | |
$cur_rate = $connection->getRateByCurrency($curcode); | |
$isBlocked = false; | |
if (isset($_SESSION['user_id'])) { | |
$sessionUserId = $_SESSION['user_id']; | |
$tabel = 'user_registration'; | |
$fields = 'is_blocked'; | |
$where = "user_id='$sessionUserId' "; | |
$limit = '1'; | |
$result = $connection->getData($tabel, $fields, $where, '', '', $limit); | |
if ($result->num_rows) { | |
$row = $result->fetch_array(MYSQLI_ASSOC); | |
$isBlocked = $row['is_blocked']; | |
} | |
} | |
$aPageName = explode('/', $_SERVER['SCRIPT_NAME']); | |
$sPageName = $aPageName[(count($aPageName)-1)]; | |
$tabel = 'meta_data'; | |
$fields = 'meta_title,meta_description'; | |
$where = "page_name='$sPageName' "; | |
$limit = '1'; | |
$result = $connection->getData($tabel, $fields, $where, '', '', $limit); | |
if ($mysqli) { | |
$connection->closeConnection($mysqli); | |
} | |
$meta_title = 'Social Media Marketing/Promotion: Social Media Services: SocialBar'; | |
$meta_description = 'Social Bar provides social media marketing services globally. Buy social media followers, likes, traffic, comments, shares or social signals for social media promotion.'; | |
if ($result->num_rows) { | |
$row = $result->fetch_array(MYSQLI_ASSOC); | |
$meta_title = $row['meta_title']; | |
$meta_description = $row['meta_description']; | |
} | |
//by | |
if (isset($_GET['utm_source']) && isset($_GET['utm_medium'])) { | |
$a = htmlspecialchars($_GET['utm_source']); | |
$b = htmlspecialchars($_GET['utm_medium']); | |
$_SESSION['ga_utm'] = json_encode(array('utm_source' => $a, 'utm_medium' => $b)); | |
} | |
?> | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<?php if (isset($_SESSION['lang_id']) && $_SESSION['lang_id'] == 1) { ?> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<?php } else { ?> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" /> | |
<?php } ?> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | |
<meta name="google-site-verification" content="jOwmBVqNbNd5FarGH8G4OrD2biw6ouOKP1dp6-QK5os" /> | |
<title><?php echo $meta_title; ?> | |
</title> | |
<meta name="description" | |
content="<?php echo $meta_description; ?>" /> | |
<!--<meta name="google-site-verification" content="jFwOyE7ivbLNnigdS2dsPftpYRWxbl2tOhDf5PRDGJk" />--> | |
<meta name="google-site-verification" content="RyavYaVTmFvJ_cmzV_W-cQ96J57A-lasQIpCOdmpmro" /> | |
<meta property="og:url" | |
content="<?php echo BASE_URL.$sPageName;?>" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:title" content="<?php echo $meta_title; ?>" /> | |
<meta property="og:description" | |
content="<?php echo $meta_description; ?>" /> | |
<meta property="og:image" | |
content="<?php echo BASE_URL;?>images/sidebar-logo.png" /> | |
<link rel="canonical" | |
href="https://www.socialbar.net/<?php echo $sPageName;?>" /> | |
<script src="js/jquery.min.js"></script> | |
<?php | |
$css = array('css/bootstrap.min.css','css/font-awesome.min.css','css/slick.css','css/style.css','css/style-home-slider.css','css/style-amp.css'); | |
$css_content = ''; | |
foreach ($css as $css_file) { | |
$css_content .= file_get_contents($css_file); | |
} | |
?> | |
<?php //if ($sPageName != 'orders.php' && $sPageName != 'users.php') {?> | |
<style type="text/css"> | |
<?php | |
ob_start(); | |
echo $css_content; | |
ob_end_flush(); | |
?> | |
.service-box .service-title a::after { | |
content: ""; | |
} | |
</style> | |
<?php //} else {?> | |
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | |
<?php //}?> | |
<?php | |
if ($sPageName == BASE_URL) { | |
$LatoCSS = file_get_contents('https://fonts.googleapis.com/css?family=Lato:400,900&display=swap'); ?> | |
<style type="text/css"> | |
<?php echo $LatoCSS; ?> | |
</style> | |
<?php | |
} ?> | |
<?php | |
if (isset($_SESSION['user_id']) && $_SESSION['user_id'] > 0) {?> | |
<link rel="stylesheet" type="text/css" href="css/datatables.min.css" /> | |
<link rel="stylesheet" type="text/css" href="css/responsive.dataTables.min.css" /> | |
<?php } ?> | |
<link rel="icon" href="favicon.ico" type="image/x-icon" /> | |
<?php | |
$aNoindexPages = array('forgot-password.php', 'change-password.php', 'orders.php', 'order-detail.php', 'my-orders.php', 'my-order-detail.php', 'new-ticket.php', 'my-tickets.php', 'paypal-ipn.php', 'paypal.php', 'paypal_cancel.php', 'paypal_success.php', 'reset-password.php', 'server_processing.php', 'server_processing_users.php', 'tickets.php', 'users.php', 'view-ticket.php', 'insert-order.php', 'insert-cart-order.php', 'add-instant-services.php', 'add-to-cart.php', 'check-instant-orders.php', 'admin-login.php', 'coupon-codes.php', 'coupons.php', 'admin-social-services.php', 'paytm.php', 'paytm_success.php'); | |
if (in_array($sPageName, $aNoindexPages)) {?> | |
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> | |
<?php }?> | |
<?php | |
if ($sPageName != BASE_URL) {?> | |
<!--<script src="https://checkout.razorpay.com/v1/checkout.js"></script>--> | |
<?php } ?> | |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-146916359-1"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag() { | |
dataLayer.push(arguments); | |
} | |
gtag('js', new Date()); | |
gtag('config', 'UA-146916359-1'); | |
</script> | |
<!-- Google Tag Manager --> | |
<script> | |
(function(w, d, s, l, i) { | |
w[l] = w[l] || []; | |
w[l].push({ | |
'gtm.start': new Date().getTime(), | |
event: 'gtm.js' | |
}); | |
var f = d.getElementsByTagName(s)[0], | |
j = d.createElement(s), | |
dl = l != 'dataLayer' ? '&l=' + l : ''; | |
j.async = true; | |
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; | |
f.parentNode.insertBefore(j, f); | |
})(window, document, 'script', 'dataLayer', 'GTM-WWHLB8J'); | |
</script> | |
<!-- End Google Tag Manager --> | |
<!-- Google Tag Manager (noscript) --> | |
<noscript> | |
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WWHLB8J" height="0" width="0" | |
style="display:none;visibility:hidden"></iframe> | |
</noscript> | |
<!-- End Google Tag Manager (noscript) --> | |
<?php | |
$arrPage = explode('/', $_SERVER['SCRIPT_NAME']); | |
$page_name = $arrPage[count($arrPage)-1]; | |
if ($page_name == 'success.php' || $page_name == 'paypal_success.php') { | |
$order_id = $currency_code = ''; | |
if (isset($_SESSION['order_id']) && !empty($_SESSION['order_id'])) { | |
$order_id = $_SESSION['order_id']; | |
} | |
if (isset($_SESSION['currency_code']) && !empty($_SESSION['currency_code'])) { | |
$currency_code = $_SESSION['currency_code']; | |
} | |
} ob_start(); | |
?> | |
<!-- scheme --> | |
<script type='application/ld+json'> | |
{ | |
"@context": "http://www.schema.org", | |
"@type": "ProfessionalService", | |
"name": "Social Bar: Social Media Services Company", | |
"url": "https://www.socialbar.net/", | |
"logo": "https://www.socialbar.net/images/abstract-logo.png", | |
"image": "https://www.socialbar.net/images/abstract-logo.png", | |
"description": "Social Bar has several years of experience in providing effective social media marketing services. We help you to buy followers, likes, comments, shares etc for Instagram, Facebook, YouTube, LinkedIn, etc to build your profile & boost your brand online.", | |
"telephone": "+91-9561642424", | |
"address": { | |
"@type": "PostalAddress", | |
"streetAddress": "1/10, Kunj Society, Sadhu Vaswani, Sadhu Vaswani Road, Camp,", | |
"addressLocality": "Pune", | |
"addressRegion": "Maharashtra", | |
"postalCode": "411001", | |
"addressCountry": "India" | |
}, | |
"sameAs": [ | |
"https://www.facebook.com/socialbar.net/", | |
"https://www.instagram.com/socialbar_/" | |
] | |
} | |
</script> | |
<!-- scheme --> | |
<!-- Hotjar Tracking Code for https://www.socialbar.net/ --> | |
<script> | |
(function(h, o, t, j, a, r) { | |
h.hj = h.hj || function() { | |
(h.hj.q = h.hj.q || []).push(arguments) | |
}; | |
h._hjSettings = { | |
hjid: 2108005, | |
hjsv: 6 | |
}; | |
a = o.getElementsByTagName('head')[0]; | |
r = o.createElement('script'); | |
r.async = 1; | |
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv; | |
a.appendChild(r); | |
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv='); | |
</script> | |
<meta name='dmca-site-verification' content='dU9ZYzVwNWIvQUg0aXdPREM5eFNDREtrN1Vuc1NZQnczQzlQMVRmSENjUT01' /> | |
</head> |
This file contains hidden or 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 | |
@session_start(); | |
include_once 'lib/ga_event.php'; | |
$isBlocked = false; | |
if (isset($_SESSION['user_id'])) { | |
include_once 'config/connection.php'; | |
$connection = new Connection(); | |
$sessionUserId = $_SESSION['user_id']; | |
$tabel = 'user_registration'; | |
$fields = 'is_blocked'; | |
$where = "user_id='$sessionUserId' "; | |
$limit = '1'; | |
$result = $connection->getData($tabel, $fields, $where, '', '', $limit); | |
if ($result->num_rows) { | |
$row = $result->fetch_array(MYSQLI_ASSOC); | |
$isBlocked = $row['is_blocked']; | |
} | |
} | |
if (isset($_POST['paymentBtn']) && isset($_SESSION['user_id']) && false == $isBlocked) { | |
$mysqli = $connection->getConnection(); | |
$user_id = $_SESSION['user_id']; | |
$user_name = $_SESSION['user_name']; | |
//$total_amount = trim(mysqli_real_escape_string($mysqli,$_POST['amount'])); | |
$pay_gateway = trim(mysqli_real_escape_string($mysqli, $_POST['pay_gateway'])); | |
$currency_code = trim(mysqli_real_escape_string($mysqli, $_POST['currency_code'])); | |
#$coupon_codes = trim(implode(', ',$_POST['coupon_codes']),', '); | |
#$discounts = trim(implode(', ',$_POST['discounts']),', '); | |
#$order_amounts = trim(implode(', ',$_POST['order_amounts']),', '); | |
$transaction_charge = $_SESSION['TRANSACTION_CHARGE']; | |
/*if (isset($_POST['transaction_charge']) && $_POST['transaction_charge'] > '0') { | |
$transaction_charge = @$_POST['transaction_charge']; | |
}*/ | |
#$coupon_codes = trim(mysqli_real_escape_string($mysqli,$_POST['coupon_codes'])); | |
#$discounts = trim(mysqli_real_escape_string($mysqli,$_POST['discounts'])); | |
#$order_amounts = trim(mysqli_real_escape_string($mysqli,$_POST['order_amounts'])); | |
$user_data_array = explode('##', trim(mysqli_real_escape_string($mysqli, $_POST['custom']))); | |
if (count($user_data_array) == 1) { | |
$user_data = explode('|', $_REQUEST['custom']); | |
$invoice_id = $user_data[2]; | |
} elseif (count($user_data_array) > 1) { | |
foreach ($user_data_array as $key => $value) { | |
$user_data = explode('|', $value); | |
$invoice_id = $user_data[2]; | |
break; | |
} | |
} | |
//$invoice_id = trim(mysqli_real_escape_string($mysqli,$_POST['invoice_id'])); | |
$session_id = session_id(); | |
$item_number = $_POST['item_number']; | |
$total_amount = 0; | |
require_once 'lib/Cart.php'; | |
$cartObj = new Cart(); | |
$cart_items = $cartObj->contents(); | |
$total_amount = $cartObj->total(); | |
$dataItems = array(); | |
foreach ($cart_items as $key => $val) { | |
$quantity = $val['options']['count']; | |
$product_id = $val['id']; | |
$tbl = 'instant_fans_services'; | |
$flds = 'single_service_rate'; | |
$whr = "service = $product_id"; | |
$rslt = $connection->getData($tbl, $flds, $whr); | |
//if ($rslt->num_rows) { | |
// while ($rw = $rslt->fetch_array(MYSQLI_ASSOC)) { | |
// $total_amount += $quantity*$rw['single_service_rate']; | |
// if ('INR' != $currency_code) { | |
// $total_amount = $total_amount/$cur_rate; | |
// } | |
// } | |
//} | |
$dataItems[$key]['name'] = $val['name']; | |
$dataItems[$key]['id'] = $val['id']; | |
$dataItems[$key]['price'] = $val['price']; | |
$dataItems[$key]['quantity'] = $quantity; | |
} | |
//$total_amount = number_format(($total_amount), 2); | |
//echo json_encode($total_amount); | |
//die; | |
/*foreach ($item_number as $key => $value) { | |
$price = $_POST['price'][$key]; | |
$total_amount +=$price; | |
}*/ | |
$currency_code = trim(mysqli_real_escape_string($mysqli, $_POST['currency_code'])); | |
$cur_rate = trim(mysqli_real_escape_string($mysqli, $_POST['cur_rate'])); | |
if ($currency_code == 'INR' && $total_amount <= 100) { | |
$total_amount = $total_amount + $transaction_charge; | |
} elseif ($currency_code != 'INR' && $total_amount <= 50) { | |
$total_amount = $total_amount + $transaction_charge; | |
/*$total_amount = $total_amount/$cur_rate; | |
if ($total_amount <= 100) { | |
$total_amount = $total_amount+(75.00/2); | |
$total_amount = $total_amount*$cur_rate; | |
} else { | |
$total_amount = $total_amount*$cur_rate; | |
}*/ | |
} else { | |
$transaction_charge = 0; | |
} | |
//coupon discount code starts | |
$coupon_code = ''; | |
if (isset($_POST['coupon_code']) && !empty($_POST['coupon_code'])) { | |
$coupon_code = trim(mysqli_real_escape_string($mysqli, $_POST['coupon_code'])); | |
} | |
include_once 'validate-coupon-checkout.php'; | |
$coupon_data = validateCoupon($coupon_code, $connection, false); | |
$coupon_data = json_decode($coupon_data); | |
$discount=0; | |
if ($coupon_data->isValid) { | |
$coupon_type = $coupon_data->coupon_type; | |
$discount = $coupon_data->discount; | |
if ($coupon_type == 'Percentage') { | |
$dis_amt = ($total_amount * $discount) / 100; | |
$total_amount = $total_amount - $dis_amt; | |
} else { | |
if ($currency_code != 'INR') { | |
$total_amount = $total_amount - ($discount * $cur_rate); | |
} else { | |
$total_amount = $total_amount - $discount; | |
} | |
} | |
} | |
$total_amount = round($total_amount, 2); | |
$invoice_amount = 0; | |
$_SESSION['add-invoice'] = false; | |
if ($_POST['add-invoice'] == '') { | |
$_SESSION['add-invoice'] = false; | |
} elseif ('checked' == $_POST['add-invoice']) { | |
$invoice_amount = (($total_amount * 18) / 100); | |
$total_amount = number_format(($total_amount + $invoice_amount), 2); | |
$_SESSION['add-invoice'] = true; | |
} elseif ('un-checked' == $_POST['add-invoice']) { | |
$_SESSION['add-invoice'] = false; | |
} | |
$coupon_codes = $coupon_code; | |
$discounts = $discount; | |
$order_amounts = trim(implode(', ', $_POST['order_amounts']), ', '); | |
//coupon discount code ends | |
//insert order details | |
$tabel = 'order_information'; | |
$columns = 'user_id,coupon_code,discount,order_amount,session_id,invoice_id,customer_name,payment_gateway,currency,order_total_amount,transaction_charge,invoice_charge'; | |
$values = "$user_id,'$coupon_codes','$discounts','$order_amounts','$session_id','$invoice_id','$user_name','$pay_gateway','$currency_code','$total_amount','$transaction_charge','$invoice_amount'"; | |
$order_id = $connection->insertData($tabel, $columns, $values); | |
if ($order_id && '0' != $order_id) { | |
//insert order item details | |
$tabel = 'order_details'; | |
$columns = 'order_id,service_id,detail,quantity,custom_comments,price,url'; | |
foreach ($item_number as $key => $value) { | |
$quantity = $_POST['count'][$key]; | |
$service_id = $_POST['item_number'][$key]; | |
$item_name = $_POST['item_name'][$key]; | |
$url = $_POST['url'][$key]; | |
$price = $_POST['price'][$key]; | |
if (isset($_POST['custom_comments'][$key])) { | |
$custom_comments = $_POST['custom_comments'][$key]; | |
$values = "$order_id,$service_id,'$item_name',$quantity,'$custom_comments','$price','$url'"; | |
} else { | |
$custom_comments = ''; | |
$values = "$order_id,$service_id,'$item_name',$quantity,'$custom_comments','$price','$url'"; | |
} | |
$connection->insertData($tabel, $columns, $values); | |
} | |
} | |
if ($mysqli) { | |
$connection->closeConnection($mysqli); | |
} | |
// $amount = $cartObj->total(); | |
// if($currency_code == 'INR' && $amount <= 100){ | |
// $amount = $amount+10; | |
// } | |
$total_qty = count($cart_items); | |
/*if($currency_code != 'INR'){ | |
$_SESSION['notify_url'] = BASE_URL.'paypal-ipn-callback.php'; | |
$_SESSION['cmd'] = '_xclick'; | |
$_SESSION['business'] = '[email protected]'; | |
$_SESSION['user_name'] = @$_SESSION['user_name']; | |
$_SESSION['user_email'] = @$_SESSION['user_email']; | |
$_SESSION['base_url'] = BASE_URL; | |
$_SESSION['item_name'] = $item_name; | |
$_SESSION['item_number'] = $service_id; | |
$_SESSION['amount'] = $total_amount; | |
$_SESSION['currency_code'] = $currency_code; | |
$_SESSION['count'] = $total_qty; | |
$_SESSION['order_id'] = $order_id; | |
$_SESSION['cancel_return'] = BASE_URL.'paypal_cancel.php'; | |
$_SESSION['return'] = BASE_URL.'paypal_success.php'; | |
$custom_data = @$_SESSION['user_id'] . '|' . @session_id() . '|' . $order_id . '|' . $service_id; | |
$_SESSION['custom'] = $custom_data; | |
echo TRUE; | |
exit; | |
}else*/ | |
if ($pay_gateway == 'paypal') { | |
if ('checked' == $_POST["add-invoice"]) { | |
$addInvoice = 'true'; | |
} else { | |
$addInvoice = 'false'; | |
} | |
$_SESSION['notify_url'] = BASE_URL.'paypal-ipn-callback.php?paypal-success=1&add_invoice='.$addInvoice.'&invoice_id='.$_SESSION["invoice_id"]; | |
$_SESSION['cmd'] = '_xclick'; | |
$_SESSION['business'] = '[email protected]'; | |
//$_SESSION['business'] = '[email protected]'; | |
$_SESSION['user_name'] = @$_SESSION['user_name']; | |
$_SESSION['user_email'] = @$_SESSION['user_email']; | |
$_SESSION['base_url'] = BASE_URL; | |
$_SESSION['item_name'] = $item_name; | |
$_SESSION['item_number'] = $service_id; | |
$_SESSION['amount'] = $total_amount; | |
$_SESSION['currency_code'] = $currency_code; | |
$_SESSION['count'] = $total_qty; | |
$_SESSION['order_id'] = $order_id; | |
$_SESSION['invoice_id'] = $invoice_id; | |
$_SESSION['cancel_return'] = BASE_URL.'paypal_cancel.php'; | |
$_SESSION['return'] = BASE_URL.'paypal_success.php?paypal-success=1&add_invoice='.$addInvoice.'&invoice_id='.$_SESSION["invoice_id"]; | |
$custom_data = @$_SESSION['user_id'] . '|' . @session_id() . '|' . $order_id . '|' . $service_id; | |
$_SESSION['custom'] = $custom_data; | |
echo json_encode(array('add_invoice'=>$addInvoice)); | |
} elseif ($pay_gateway == 'paytm') { | |
$_SESSION['base_url'] = BASE_URL; | |
$_SESSION['currency_code'] = $currency_code; | |
$_SESSION['amount'] = $total_amount; | |
$_SESSION['order_id'] = $order_id; | |
$_SESSION['invoice_id'] = $invoice_id; | |
echo json_encode(array('add_invoice'=>$_SESSION['add-invoice'])); | |
} elseif ($pay_gateway == 'stripe' || $pay_gateway == 'openpay') { | |
$_SESSION['currency_code'] = $currency_code; | |
$_SESSION['amount'] = $total_amount; | |
$_SESSION['order_id'] = $order_id; | |
$_SESSION['invoice_id'] = $invoice_id; | |
$_SESSION['mobile_number'] = $_POST['mobile_number']; | |
echo json_encode(array("order_id"=>$order_id, 'invoice_id'=>$invoice_id, "total_amount"=>$total_amount, "add_invoice"=>$_SESSION['add-invoice'])); | |
} | |
$infoData = json_encode(array_values($dataItems)); | |
$amount = number_format($_SESSION['amount'], 2, ".", ""); | |
$order_id = $_SESSION['order_id']; | |
sendGoogleEvent('UA-199153759-1', $infoData, $order_id, $amount); | |
/* if($amount == $total_amount){ | |
// echo TRUE; | |
// exit(); | |
echo json_encode(array("order_id"=>$order_id, 'invoice_id'=>$invoice_id, "total_amount"=>$total_amount)); | |
exit; | |
} | |
else{ | |
echo FALSE; | |
exit(); | |
} | |
*/ | |
} else { | |
include_once 'config/constants.php'; | |
echo "<script>window.location.href='".BASE_URL."cart.php';</script>"; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment