require("./global.php");
$p_id= $_GET['pricing'];
$price = $pricing[$p_id]['price'];
if (!checkGlobalPermission('enableCustomerManagement')) {
header("Location: ./home.php?m=Oops! Error occured");
}
$primaryTableName = "Pricing";
$login_fields_hidden = "";
if (!checkGlobalPermission('enableCustomerToLogin')) {
$login_fields_hidden = "hidden";
}
if(isset($_GET['pricing'])){
$p_id= $_GET['pricing'];
$p_title= $pricing[$p_id]['title'];
// $stmt = $con->prepare("update ".$g_projectSlug."_users set subscription_id=? where id=?");
// $stmt->bind_param("ss",$p_id, $session_userId);
// if($stmt->execute()){header("Location: ./pricing.php?m=You Can Get ".$p_title." Subscription Plan");}
$price = $pricing[$p_id]['price'];
$_SESSION['buy_plan_number'] = $p_id;
$_SESSION['buy_plan_number_type'] = "month";
if(isset($_GET['yearly'])){
$price = $pricing[$p_id]['price_yearly'];
$_SESSION['buy_plan_number_type'] = "year";
}
if ($price != "") {
// $queryuser = "SELECT * FROM ".$g_projectSlug."_users WHERE id = '$session_id'";
// $userifo = getRow($con, $queryuser);
// $add = $userifo['token']+$price;
// $query = "update ".$g_projectSlug."_users set token='$add' where id='$session_id'";
// $stmt = $con->prepare($query);
// if(!$stmt){echo "err: $query";}
// if(!$stmt->execute()){echo "err: $query";}
header("Location: ?m=Data was saved successfully!".$rStr);
}
header("Location: ./payment.php?pay_amount=$price&invoiceId=buy_plan");
$p_title= $pricing[$p_]['title'];
exit();
}
?>