<?php
require_once 'config.php';

// Fetch today's results from results table
date_default_timezone_set('Asia/Kolkata');
$today = date('Y-m-d');
$games = [
    'disawar'      => ['title' => 'DISAWAR',      'time' => '05:05 AM'],
    'jd_durga'     => ['title' => 'JD DURGA',     'time' => '02:15 PM'],
    'dl_bazaar'    => ['title' => 'DL BAZAAR',    'time' => '03:00 PM'],
    'shri_ganesh'  => ['title' => 'SHREE GANESH', 'time' => '04:30 PM'],
    'faridabad'    => ['title' => 'FARIDABAD',    'time' => '06:05 PM'],
    'ghaziabad'    => ['title' => 'GHAZIABAD',    'time' => '08:40 PM'],
    'radhey_radhey' => ['title' => 'RADHEY RADHEY',           'time' => '11:00 PM'],
    'gali'         => ['title' => 'GALI',         'time' => '11:55 PM'],
    
];

// Get results for today

$results_today = [];
$sql = "SELECT game, result_number FROM results WHERE result_date = ?";
if ($stmt = mysqli_prepare($link, $sql)) {
    mysqli_stmt_bind_param($stmt, 's', $today);
    mysqli_stmt_execute($stmt);
    $res = mysqli_stmt_get_result($stmt);
    while ($row = mysqli_fetch_assoc($res)) {
        $results_today[$row['game']] = $row['result_number'];
    }
    mysqli_stmt_close($stmt);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home- Join Us!</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    
  <!-- <section>
       <div class="container" style="text-align:center; padding:10px; background:#f3f4f6; color:#111827; font-size:0.9rem;">
           <h2>Welcome to Our Platform</h2>
           <p>Your gateway to exciting opportunities and experiences.</p>
      
       </div>
</section>-->

    <?php include 'header.php'; ?>

    <!-- Hero Section -->
<section class="hero-section">
   <div class="container hero-grid">
			<div>
				<span class="eyebrow">Unlock Your Numerology Brain! 🔢</span>
				<span class="eyebrow">Discover how accurate your guess really is!🧠</span>
				<h1 style="color: white;"> Shubank- A Trusted Space for Market Players ✨</h1>
				<p style="color: white; font-weight: bold;">Shubank is your one-stop online platform for enthusiasts of popular markets such as <b>Disawar, Delhi Bazaar, Shree Ganesh, Faridabad, Ghaziabad, Radhey-Radhey, and Gali.</b> Built for players who enjoy testing their intuition and spotting number patterns, Shubank provides a simple, secure, and convenient way to guess and win daily rewards.</p>
                <p style="color: white; font-weight: bold;">Shubank is created to bring all major markets under one reliable roof, so players don’t need to visit multiple sources. Our platform delivers a smooth and transparent experience from start to finish, making it easy for both newcomers and experienced participants to engage in their favourite markets with confidence.</p>
                <div class="hero-cta">
					<a href="login.php" class="cta-btn">👉 Start Now </a>
					<a href="users.php" class="cta-btn secondary">🆕 Create Account</a>
				</div>
				<div class="hero-bullets">
					<div class="bullet">
						<div>⚡</div>
						<div>
							<strong>Easy Access</strong>
							<br><small>Quick and hassle-free registration</small>
						</div>
					</div>
					<div class="bullet">
						<div>🌍</div>
						<div>
							<strong>Safe & Secure</strong>
							<small>Privacy and data protection</small>
						</div>
					</div>
					<div class="bullet">
						<div>✅</div>
						<div>
							<strong>Trusted by People</strong>
							<small>Thousands of satisfied users</small>
						</div>
					</div>
				</div>
			</div>
			<div class="hero-media">
				<div class="hero-card">
					<img src="images/numerology-brain.png" alt="numerology brain">
				</div>
			</div>
		</div>
</section>
    <!-- End Hero Section -->
     <section class="journey-section" style="margin:40px 0;">
        <h2 style="font-size:2rem;font-weight:700;color:#005c97; text-align:center;">Your Journey with Shubank</h2>
        <p style="text-align:center; color:#222;">Embark on a seamless journey with Shubank, where every step is designed to enhance your experience.</p>
    <div class="container journey-steps" style="display:flex;flex-wrap:wrap;justify-content:center;gap:32px;">
        <div class="journey-step" style="border-radius:16px;box-shadow:0 4px 24px rgba(23,162,184,0.10);padding:24px 18px;min-width:180px;max-width:220px;flex:1 1 180px;text-align:center;">
            <div class="journey-icon" style="font-size:2.2rem;margin-bottom:10px;">📝</div>
            <div class="journey-title" style="font-weight:700;color:#005c97;font-size:1.1rem;margin-bottom:6px;">Sign Up</div>
            <div class="journey-desc" style="color:#222;font-size:1rem;">Register with a few basic details to get started.</div>
        </div>
        <div class="journey-step" style="border-radius:16px;box-shadow:0 4px 24px rgba(23,162,184,0.10);padding:24px 18px;min-width:180px;max-width:220px;flex:1 1 180px;text-align:center;">
            <div class="journey-icon" style="font-size:2.2rem;margin-bottom:10px;">📊</div>
            <div class="journey-title" style="font-weight:700;color:#005c97;font-size:1.1rem;margin-bottom:6px;">Explore Markets</div>
            <div class="journey-desc" style="color:#222;font-size:1rem;">Browse and select your favorite market to play.</div>
        </div>
        <div class="journey-step" style="border-radius:16px;box-shadow:0 4px 24px rgba(23,162,184,0.10);padding:24px 18px;min-width:180px;max-width:220px;flex:1 1 180px;text-align:center;">
            <div class="journey-icon" style="font-size:2.2rem;margin-bottom:10px;">🔢</div>
            <div class="journey-title" style="font-weight:700;color:#005c97;font-size:1.1rem;margin-bottom:6px;">Guess & Track</div>
            <div class="journey-desc" style="color:#222;font-size:1rem;">Predict numbers and easily track your guesses.</div>
        </div>
        <div class="journey-step" style="border-radius:16px;box-shadow:0 4px 24px rgba(23,162,184,0.10);padding:24px 18px;min-width:180px;max-width:220px;flex:1 1 180px;text-align:center;">
            <div class="journey-icon" style="font-size:2.2rem;margin-bottom:10px;">🎁</div>
            <div class="journey-title" style="font-weight:700;color:#005c97;font-size:1.1rem;margin-bottom:6px;">Win Rewards</div>
            <div class="journey-desc" style="color:#222;font-size:1rem;">Earn daily rewards when your predictions are correct.</div>
        </div>
        <div class="journey-step" style="border-radius:16px;box-shadow:0 4px 24px rgba(23,162,184,0.10);padding:24px 18px;min-width:180px;max-width:220px;flex:1 1 180px;text-align:center;">
            <div class="journey-icon" style="font-size:2.2rem;margin-bottom:10px;">🚀</div>
            <div class="journey-title" style="font-weight:700;color:#005c97;font-size:1.1rem;margin-bottom:6px;">Seamless Experience</div>
            <div class="journey-desc" style="color:#222;font-size:1rem;">Enjoy a smooth, hassle-free journey focused on excitement.</div>
        </div>
    </div>
</section>

<!-- Chart Section -->
  <h2 style="text-align: center; color:#005c97; font-size:2rem;">Today's Results</h2>
       <p style="text-align: center; color:#005c97;">Check out the latest results from your favorite markets below!</p>
    <section class="chart-section">
    <div class="chart-grid">
        <?php foreach ($games as $key => $info): ?>
        <div class="chart-box">
            <div class="chart-hanger"></div>
            <div class="chart-time"><?php echo $info['time']; ?></div>
            <div class="chart-title"><?php echo $info['title']; ?></div>
            <div class="chart-result">
                <?php echo isset($results_today[$key]) ? htmlspecialchars($results_today[$key]) : '--'; ?>
            </div>
        </div>
        <?php endforeach; ?>
    </div>
</section>
<!-- End Chart Section -->
 <section class="features-section">
    <div class="features-grid">
        <div class="feature-item">
            <div class="feature-icon">🎯</div>
            <div class="feature-text">Fun, interactive numerology challenge</div>
        </div>
        <div class="feature-item">
            <div class="feature-icon">🧠</div>
            <div class="feature-text">Boost your intuitive thinking</div>
        </div>
        <div class="feature-item">
            <div class="feature-icon">⚡</div>
            <div class="feature-text">Learn about your personal number energy</div>
        </div>
        <div class="feature-item">
            <div class="feature-icon">🔮</div>
            <div class="feature-text">Unlock hidden insights into your life path and purpose</div>
        </div>
    </div>
</section>
<!-- End Features Section -->
 <!-- Why Choose Section -->
<section class="why-choose-section">
    <div class="container">
        <div class="why-choose-header">
            <h2>Why Choose to Play with Shubank?</h2>
            <p>Discover the unique advantages that make Shubank your perfect numerology companion.</p>
        </div>
        <div class="why-choose-grid">
            
            <div class="why-choose-item">
                <div class="why-icon">🔒</div>
                <h3>Safe & Secure</h3>
                <p>Your privacy and data protection are our top priorities. We use strong security measures to keep every transaction and interaction fully protected.</p>
            </div>
            <div class="why-choose-item">
                <div class="why-icon">⚡</div>
                <h3>Instant Results</h3>
                <p>Get real-time results and immediate feedback on your numerological insights and predictions.</p>
            </div>
            <div class="why-choose-item">
                <div class="why-icon">🎁</div>
                <h3>Daily Rewards & Regular Updates</h3>
                <p>We provide daily market updates and opportunities to win exciting rewards, keeping your experience fresh and engaging.</p>
            </div>
            <div class="why-choose-item">
                <div class="why-icon">📱</div>
                <h3>User-Friendly Interface</h3>
                <p>Shubank is designed to be easy to navigate, whether you’re playing on a mobile device or desktop. The simple layout makes guessing and checking results fast and hassle-free.</p>
            </div>
            <div class="why-choose-item">
                <div class="why-icon">🏆</div>
                <h3>Proven Track Record</h3>
                <p>Join thousands of satisfied users who have discovered their numerological potential with us.</p>
            </div>
            <div class="why-choose-item">
                <div class="why-icon">🎯</div>
                <h3>Markets You Trust</h3>
                <p>Focused only on Disawar, Delhi Bazaar, Shree Ganesh, Faridabad, Ghaziabad, Radhey-Radhey and Gali markets, Shubank ensures you have a specialized, market-specific platform you can rely on.</p>
            </div>
        </div>
    </div>
</section>
<!-- End Why Choose Section -->
<!-- Winners Ticker Section -->
<section class="winners-carousel">
    <div class="winners-ticker" id="winnersTicker">
        <!-- Winners will be populated by JavaScript -->
    </div>
</section>
<div class="disclaimer">
        <h3>Disclaimer</h3>
                <p>Purchase of lottery tickets through this website is strictly prohibited in any state or jurisdiction where lotteries are banned. It is the user’s responsibility to ensure compliance with all applicable local laws and regulations before participating.</p>
                   <p>You must be 18 years of age or older to play online lottery. By accessing and using this website, you confirm that you meet the minimum age requirement and that you are operating in a location where such participation is legal and permitted. The website and its operators assume no liability for any breach of local laws by users.</p>
      </div>
<?php include 'footer.php'; ?>

<!-- Add this JavaScript before closing </body> tag -->
<script>
// Random winners data
const winnerNames = [
    'Raj Kumar', 'Priya Sharma', 'Amit Singh', 'Neha Gupta', 'Rohit Verma',
    'Sunita Devi', 'Vikash Kumar', 'Pooja Rani', 'Sanjay Yadav', 'Rekha Kumari',
    'Deepak Jha', 'Kavita Singh', 'Manish Tiwari', 'Sushma Devi', 'Rahul Gupta'
];

const gameNames = ['DS', 'DL', 'SG', 'FD', 'GB', 'RR', 'GL'];

function generateRandomWinners() {
    const winners = [];
    for (let i = 0; i < 12; i++) {
        const name = winnerNames[Math.floor(Math.random() * winnerNames.length)];
        const game = gameNames[Math.floor(Math.random() * gameNames.length)];
        const amount = (Math.floor(Math.random() * 50) + 10) * 1000; // 10k-60k
        const shubank = Math.floor(Math.random() * 100);
        
        winners.push({
            name: name,
            game: game,
            amount: amount,
            shubank: shubank
        });
    }
    return winners;
}

function createWinnerHTML(winner) {
    return `
        <div class="winner-item">
            <div class="winner-icon">🏆</div>
            <div class="winner-details">
                <div class="winner-name">${winner.name}</div>
                <div class="winner-info">${winner.game} Game • Shubank: ${winner.shubank}</div>
            </div>
            <div class="winner-amount">₹${winner.amount.toLocaleString()}</div>
        </div>
    `;
}

function initWinnersCarousel() {
    const winners = generateRandomWinners();
    const ticker = document.getElementById('winnersTicker');
    
    // Create two sets for seamless loop
    const winnersHTML = winners.map(createWinnerHTML).join('');
    ticker.innerHTML = winnersHTML + winnersHTML;
}

// Initialize carousel on page load
document.addEventListener('DOMContentLoaded', function() {
    initWinnersCarousel();
    
    // Refresh winners every 60 seconds
    setInterval(initWinnersCarousel, 60000);
});
</script>
</body>
</html>