/
home
/
u551664935
/
domains
/
mechfactory.in
/
public_html
/
Upload File
HOME
<?php include 'config.php'; $user_id = isset($_GET['user_id']) ? (int) $_GET['user_id'] : 0; if ($user_id <= 0) { die("Invalid request."); } // Initialize session array if not set if (!isset($_SESSION['paid_contacts'])) { $_SESSION['paid_contacts'] = []; } // PAYMENT SUCCESS HANDLER (simulate) if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Simulate payment success here (replace with real PhonePe integration) if (!in_array($user_id, $_SESSION['paid_contacts'])) { $_SESSION['paid_contacts'][] = $user_id; } // Redirect to GET page after payment success header("Location: show_contact.php?user_id=$user_id"); exit; } // SHOW CONTACT DETAILS only if user_id in paid_contacts session if (in_array($user_id, $_SESSION['paid_contacts'])) { // Fetch company and mobile $stmt = $conn->prepare("SELECT company_name, mobile FROM users1 WHERE id = ?"); $stmt->bind_param("i", $user_id); $stmt->execute(); $result = $stmt->get_result(); $user = $result->fetch_assoc(); if (!$user) { die("User not found."); } // Show contact details page ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Contact Details</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="bg-gray-100 flex items-center justify-center min-h-screen"> <?php include("header/head.php"); ?> <div class="bg-white p-8 rounded shadow max-w-md w-full text-center"> <h2 class="text-xl font-bold mb-4 text-green-700">Contact Details</h2> <p class="mb-2 text-lg"><strong>Company:</strong> <?= htmlspecialchars($user['company_name']) ?></p> <p class="mb-4 text-lg"><strong>Mobile:</strong> <?= htmlspecialchars($user['mobile']) ?></p> <a href="job-work.php" class="text-blue-600 hover:underline">← Back to Listings</a> </div> </body> <?php include("footer/footer.php");?> </html> <?php exit; } // ELSE show payment page ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Payment Required</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="bg-gray-100 flex items-center justify-center min-h-screen"> <div class="bg-white p-8 rounded shadow max-w-md w-full text-center"> <h1 class="text-2xl font-bold mb-4 text-red-600">Payment Required</h1> <p class="mb-6">To view the company name and contact number, please complete the payment of ₹100.</p> <form method="POST"> <button type="submit" class="bg-blue-600 text-white px-6 py-2 rounded hover:bg-blue-700"> Pay ₹100 with PhonePe (Simulated) </button> </form> <a href="job-work.php" class="block mt-6 text-blue-600 hover:underline">← Back to Listings</a> </div> </body> </html>