:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/soulmeetvivah.com/member/**
:: Editing File: subscriptions.php
<?php include('header.php'); // Database connection is already included in header.php via fetch_logged_member_details.php $user_id = $_SESSION['user_id']; // Fetch current plan details $current_plan_name = "Free"; $current_plan_id = 0; $plan_expiry_date = ""; $plan_status = "Inactive"; $plans_type = "Free"; $sql_current_plan = "SELECT mcp.plans_type, cpd.*, sp.plan_name FROM members_current_plan mcp LEFT JOIN current_plan_details cpd ON mcp.user_id = cpd.user_id AND cpd.status = '1' LEFT JOIN sub_plans sp ON cpd.plan_id = sp.plan_id WHERE mcp.user_id = '$user_id' ORDER BY cpd.current_plan_details_id DESC LIMIT 1"; $result_current_plan = mysqli_query($conn, $sql_current_plan); if ($result_current_plan && mysqli_num_rows($result_current_plan) > 0) { $row = mysqli_fetch_assoc($result_current_plan); $plans_type = $row['plans_type'] ?? 'Free'; if (!empty($row['plan_name'])) { $current_plan_name = $row['plan_name']; $current_plan_id = $row['plan_id'] ?? 0; $plan_expiry_date = $row['plan_expiry_date'] ?? ''; $plan_status = ($row['status'] == '1' && (!empty($plan_expiry_date) && strtotime($plan_expiry_date) >= strtotime(date('Y-m-d')))) ? 'Active' : 'Expired'; } } // Fetch usage statistics $total_contact_viewed = 0; $remaining_contact_viewed = 0; $chat_request_total = 0; $chat_request_remaining = 0; $sql_usage = "SELECT * FROM plan_viewed_total_request WHERE user_id = '$user_id'"; $result_usage = mysqli_query($conn, $sql_usage); if ($result_usage && mysqli_num_rows($result_usage) > 0) { $row = mysqli_fetch_assoc($result_usage); $total_contact_viewed = $row['total_contact_viewed'] ?? 0; $remaining_contact_viewed = $row['remaining_contact_viewed'] ?? 0; $chat_request_total = $row['chat_request_total'] ?? 0; $chat_request_remaining = $row['chat_request_remaining'] ?? 0; } // Fetch all available plans $sql_plans = "SELECT * FROM sub_plans WHERE status = '1' ORDER BY new_price ASC"; $result_plans = mysqli_query($conn, $sql_plans); ?> <div style="height: 100px;"></div> <!-- ==========Subscription Section Start Here========== --> <div class="page-content"> <div class="container"> <!-- Header --> <div class="block-box user-about mb-4"> <div class="widget-heading" style="background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); padding: 25px; border-radius: 15px 15px 0 0;"> <h3 style="color: #fff; margin: 0; font-size: 28px; font-weight: 600;"> <i class="icofont-diamond" style="margin-right: 10px;"></i>My Subscription </h3> <p style="color: rgba(255,255,255,0.9); margin: 10px 0 0 0; font-size: 16px;">Manage your subscription and upgrade plans</p> </div> </div> <!-- Current Plan Details --> <div class="row mb-4"> <div class="col-lg-8"> <div class="block-box user-about"> <div class="widget-heading"> <h3 style="font-size: 20px; margin-bottom: 20px;"> <i class="icofont-info-circle" style="margin-right: 10px; color: #cd4252;"></i>Current Plan </h3> </div> <div class="subscription-details"> <div class="row"> <div class="col-md-6 mb-3"> <div class="detail-item"> <label>Plan Name:</label> <span class="plan-name <?=$plans_type == 'Paid' ? 'text-success' : 'text-muted'?>"> <?=$current_plan_name?> </span> </div> </div> <div class="col-md-6 mb-3"> <div class="detail-item"> <label>Plan Type:</label> <span class="plan-type <?=$plans_type == 'Paid' ? 'text-success' : 'text-muted'?>"> <?=$plans_type?> </span> </div> </div> <?php if ($plans_type == 'Paid' && !empty($plan_expiry_date)) { ?> <div class="col-md-6 mb-3"> <div class="detail-item"> <label>Expiry Date:</label> <span class="expiry-date <?=$plan_status == 'Active' ? 'text-success' : 'text-danger'?>"> <?=date('d M Y', strtotime($plan_expiry_date))?> </span> </div> </div> <div class="col-md-6 mb-3"> <div class="detail-item"> <label>Status:</label> <span class="status-badge <?=$plan_status == 'Active' ? 'badge-success' : 'badge-danger'?>"> <?=$plan_status?> </span> </div> </div> <?php } ?> </div> </div> </div> </div> <div class="col-lg-4"> <div class="block-box user-about"> <div class="widget-heading"> <h3 style="font-size: 20px; margin-bottom: 20px;"> <i class="icofont-chart-line" style="margin-right: 10px; color: #cd4252;"></i>Usage Statistics </h3> </div> <div class="usage-stats"> <div class="stat-item mb-3"> <label>Contact Views:</label> <div class="progress" style="height: 25px; margin-top: 5px;"> <?php $contact_used = $total_contact_viewed; $contact_total = $total_contact_viewed + $remaining_contact_viewed; $contact_percent = $contact_total > 0 ? ($contact_used / $contact_total) * 100 : 0; ?> <div class="progress-bar <?=$contact_percent >= 80 ? 'bg-danger' : ($contact_percent >= 50 ? 'bg-warning' : 'bg-success')?>" role="progressbar" style="width: <?=$contact_percent?>%" aria-valuenow="<?=$contact_percent?>" aria-valuemin="0" aria-valuemax="100"> <?=$contact_used?> / <?=$contact_total?> </div> </div> <small class="text-muted"><?=$remaining_contact_viewed?> remaining</small> </div> <div class="stat-item"> <label>Chat Requests:</label> <div class="progress" style="height: 25px; margin-top: 5px;"> <?php $chat_used = $chat_request_total; $chat_total = $chat_request_total + $chat_request_remaining; $chat_percent = $chat_total > 0 ? ($chat_used / $chat_total) * 100 : 0; ?> <div class="progress-bar <?=$chat_percent >= 80 ? 'bg-danger' : ($chat_percent >= 50 ? 'bg-warning' : 'bg-success')?>" role="progressbar" style="width: <?=$chat_percent?>%" aria-valuenow="<?=$chat_percent?>" aria-valuemin="0" aria-valuemax="100"> <?=$chat_used?> / <?=$chat_total?> </div> </div> <small class="text-muted"><?=$chat_request_remaining?> remaining</small> </div> </div> </div> </div> </div> <!-- Available Plans --> <div class="block-box user-about"> <div class="widget-heading"> <h3 style="font-size: 20px; margin-bottom: 20px;"> <i class="icofont-rocket" style="margin-right: 10px; color: #cd4252;"></i>Available Plans </h3> </div> <div class="row g-4"> <?php if ($result_plans && mysqli_num_rows($result_plans) > 0) { while ($plan = mysqli_fetch_assoc($result_plans)) { $plan_id = $plan['plan_id']; $plan_name = $plan['plan_name']; $plan_price = $plan['new_price']; $plan_month = $plan['month']; $chat_request = $plan['chat_request']; $contact_views = $plan['contact_views']; $formatted_price = number_format($plan_price); $is_current_plan = ($current_plan_id == $plan_id && $plan_status == 'Active'); ?> <div class="col-lg-4 col-md-6"> <div class="plan-card <?=$is_current_plan ? 'current-plan' : ''?>"> <div class="plan-header"> <?php if ($is_current_plan) { ?> <span class="current-badge">Current Plan</span> <?php } ?> <h4><?=htmlspecialchars($plan_name)?></h4> <div class="plan-price"> <span class="currency">₹</span> <span class="amount"><?=$formatted_price?></span> <?php if ($plan_month > 0) { ?> <span class="period">/ <?=$plan_month?> Month<?=$plan_month > 1 ? 's' : ''?></span> <?php } ?> </div> </div> <div class="plan-features"> <ul> <?php if ($contact_views > 0) { ?> <li><i class="icofont-check"></i> <?=$contact_views?> Contact Views</li> <?php } ?> <?php if ($chat_request > 0) { ?> <li><i class="icofont-check"></i> <?=$chat_request?> Chat Requests</li> <?php } ?> <li><i class="icofont-check"></i> Unlimited Profile Views</li> <li><i class="icofont-check"></i> Priority Support</li> </ul> </div> <div class="plan-action"> <?php if ($is_current_plan) { ?> <button class="btn btn-secondary" disabled>Current Plan</button> <?php } else { ?> <a href="../pay-now/pay.php?plan_id=<?=$plan_id?>&user_id=<?=$user_id?>" class="btn btn-primary"> <?=$plans_type == 'Free' ? 'Upgrade Now' : 'Change Plan'?> </a> <?php } ?> </div> </div> </div> <?php } } else { echo '<div class="col-12"><p class="text-center text-muted">No plans available at the moment.</p></div>'; } ?> </div> </div> </div> </div> <style type="text/css"> body { background-color: #f5f5f5; } .subscription-details .detail-item { padding: 10px 0; } .subscription-details label { display: block; font-weight: 600; color: #666; margin-bottom: 5px; font-size: 14px; } .subscription-details span { display: block; font-size: 16px; color: #333; } .plan-name, .plan-type { font-weight: 700; font-size: 18px; } .status-badge { display: inline-block; padding: 5px 15px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; } .badge-success { background: #28a745; color: #fff; } .badge-danger { background: #dc3545; color: #fff; } .usage-stats .stat-item label { font-weight: 600; color: #666; font-size: 14px; } .progress { background-color: #e9ecef; border-radius: 10px; overflow: hidden; } .progress-bar { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 12px; } .plan-card { background: #fff; border-radius: 15px; box-shadow: 0 3px 15px rgba(0,0,0,0.08); transition: all 0.3s ease; overflow: hidden; border: 2px solid transparent; height: 100%; display: flex; flex-direction: column; } .plan-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(205, 66, 82, 0.15); border-color: #cd4252; } .plan-card.current-plan { border-color: #cd4252; background: linear-gradient(135deg, #fff 0%, #fff5f5 100%); } .plan-header { background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); color: #fff; padding: 30px 20px; text-align: center; position: relative; } .current-badge { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.2); padding: 5px 15px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; } .plan-header h4 { margin: 0 0 15px 0; font-size: 24px; font-weight: 700; } .plan-price { display: flex; align-items: baseline; justify-content: center; gap: 5px; } .plan-price .currency { font-size: 20px; } .plan-price .amount { font-size: 40px; font-weight: 700; } .plan-price .period { font-size: 16px; opacity: 0.9; } .plan-features { padding: 25px 20px; flex: 1; } .plan-features ul { list-style: none; padding: 0; margin: 0; } .plan-features ul li { padding: 10px 0; display: flex; align-items: center; gap: 10px; color: #666; font-size: 14px; } .plan-features ul li i { color: #28a745; font-size: 18px; } .plan-action { padding: 20px; border-top: 1px solid #e9ecef; } .plan-action .btn { width: 100%; padding: 12px; border-radius: 8px; font-weight: 600; text-decoration: none; display: block; text-align: center; transition: all 0.3s ease; } .plan-action .btn-primary { background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); color: #fff; border: none; } .plan-action .btn-primary:hover { background: linear-gradient(135deg, #b83847 0%, #a83242 100%); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(205, 66, 82, 0.3); } .plan-action .btn-secondary { background: #6c757d; color: #fff; border: none; cursor: not-allowed; } @media (max-width: 768px) { .plan-card { margin-bottom: 20px; } } </style> <?php include('footer.php'); ?>