<?php
// Enable CORS headers
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST");
header("Access-Control-Allow-Headers: Content-Type");
require_once 'db.php';
$recharge_id = $_GET['recharge_id'];
$payment_id = $_GET['payment_id'];
$payment_status = $_GET['payment_status'];
$payment_request_id = $_GET['payment_request_id'];
echo $recharge_id;
echo $payment_id;
echo $payment_status;
echo $payment_request_id;
if($payment_status == 'Credit'){
$status = 'Active';
}else{
$status = 'Inactive';
}
// Update the membership table to include the payment proof
$sql = "UPDATE membership SET membership_payment_proof = :payment_proof , status = :status
WHERE id = :recharge_id";
$pdo1 = $pdo->prepare($sql);
$pdo1->bindParam(':payment_proof', $payment_id);
$pdo1->bindParam(':status', $status);// Assuming $photo1 contains the filename
$pdo1->bindParam(':recharge_id', $recharge_id);
$pdo1->execute();
echo "Successful Upload";
header("Location: https://agriexpertt.com/mobile/Flutter/recharge.php?type=Thankyou");
?>