:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/soulmeetvivah.com/member/**
:: Editing File: recent-visitors.php
<?php include('header.php'); ?> <div style="height: 100px;"></div> <!-- ==========Recent Visitors 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-eye" style="margin-right: 10px;"></i>Recent Visitors </h3> <p style="color: rgba(255,255,255,0.9); margin: 10px 0 0 0; font-size: 16px;">People who viewed your profile</p> </div> </div> <!-- Visitors Container --> <div class="visitors-wrapper"> <div class="row g-4" id="fetchVisitors"> <!-- Visitors will be loaded here --> </div> </div> <!-- Empty State --> <div id="visitorsEmpty" class="text-center py-5" style="display: none;"> <div class="block-box user-about"> <div class="widget-heading text-center py-5"> <i class="icofont-eye-alt" style="font-size: 80px; color: #ddd; margin-bottom: 20px;"></i> <h4 style="color: #999; font-weight: 400;">No visitors yet</h4> <p style="color: #bbb; margin-top: 10px;">Your profile hasn't been viewed by anyone yet</p> </div> </div> </div> <!-- Loading Indicator --> <div id="loading" class="text-center py-4" style="display: none;"> <div class="spinner-border text-primary" role="status"> <span class="visually-hidden">Loading...</span> </div> </div> </div> </div> <!-- ==========Recent Visitors Section End Here========== --> <style type="text/css"> body { background-color: #f5f5f5; } .visitors-wrapper { margin-top: 20px; } .match-card { background: #fff; border-radius: 15px; box-shadow: 0 3px 15px rgba(0,0,0,0.08); overflow: hidden; transition: all 0.3s ease; height: 100%; } .match-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); } .match-card-content { padding: 25px; display: flex; flex-direction: column; align-items: center; text-align: center; } .match-avatar { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; margin-bottom: 20px; border: 4px solid #cd4252; box-shadow: 0 4px 15px rgba(205, 66, 82, 0.2); } .match-avatar img { width: 100%; height: 100%; object-fit: cover; } .match-info { width: 100%; } .match-name { color: #333; font-size: 22px; font-weight: 600; margin-bottom: 15px; } .match-details { margin-bottom: 20px; } .match-item { color: #666; font-size: 14px; margin: 8px 0; display: flex; align-items: center; justify-content: center; gap: 8px; } .match-item i { color: #cd4252; font-size: 16px; } .match-view-btn { display: inline-block; padding: 12px 30px; background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); color: #fff; text-decoration: none; border-radius: 25px; font-weight: 600; transition: all 0.3s ease; margin-top: 10px; } .match-view-btn:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(205, 66, 82, 0.3); color: #fff; } .visit-time { color: #999; font-size: 12px; margin-top: 10px; font-style: italic; } </style> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script type="text/javascript"> let offset = 0; const limit = 20; let loading = false; let endReached = false; function fetchVisitors(reset = false) { if (reset) { offset = 0; endReached = false; $('#fetchVisitors').html(''); $('#visitorsEmpty').hide(); } if (loading || endReached) return; loading = true; $('#loading').show(); $.ajax({ url: 'php/fetch_recent_visitors_list.php', method: 'POST', data: { offset: offset, limit: limit }, success: function (res) { loading = false; $('#loading').hide(); if (res.trim() === '') { if (offset === 0) { $('#visitorsEmpty').show(); } endReached = true; return; } $('#fetchVisitors').append(res); offset += limit; if ($('#fetchVisitors').children().length > 0) { $('#visitorsEmpty').hide(); } // Update button states for newly loaded profiles updateButtonStates(); }, error: function(xhr, status, error) { console.error('Error fetching visitors:', error); $('#loading').hide(); loading = false; if (offset === 0) { $('#visitorsEmpty').show(); } } }); } // Scroll detection for infinite scroll $(window).scroll(function () { if ($(window).scrollTop() + $(window).height() >= $(document).height() - 100) { fetchVisitors(); } }); // Initial load fetchVisitors(true); // Include button handlers (same as matches page) function updateButtonStates() { $('.match-interest-btn').each(function() { const $btn = $(this); const profileId = $btn.data('profile-id'); if (!profileId) return; $.ajax({ url: 'php/check_profile_status.php', method: 'POST', data: { profile_id: profileId }, dataType: 'json', success: function(response) { if ($btn.hasClass('match-interest-btn')) { if (response.interested) { $btn.addClass('interested').find('.interest-text').text('Interested'); } else { $btn.removeClass('interested').find('.interest-text').text('Interest'); } } } }); }); } $(document).on('click', '.match-interest-btn', function(e) { e.preventDefault(); const $btn = $(this); const profileId = $btn.data('profile-id'); const isInterested = $btn.hasClass('interested'); if ($btn.prop('disabled')) return; $btn.prop('disabled', true); $.ajax({ url: 'php/show_interest.php', method: 'POST', data: { profile_id: profileId, action: isInterested ? 'remove' : 'show' }, dataType: 'json', success: function(response) { if (response.status === 'success') { if (response.interested) { $btn.addClass('interested').find('.interest-text').text('Interested'); } else { $btn.removeClass('interested').find('.interest-text').text('Interest'); } } }, complete: function() { $btn.prop('disabled', false); } }); }); $(document).ready(function() { updateButtonStates(); }); </script> <?php include('footer.php'); ?>