| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp/htdocs-coblaa/Cinevaa/ |
Upload File : |
<?php
include 'db.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cinevaa | Premium Entertainment</title>
<link rel="stylesheet" type="text/css" href="main_css/index.css" />
<style>
/* Fixed: changed @importk to @import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
</style>
</head>
<body>
<!--?php
// Fetch the latest movie marked as trending
$featured_query = mysqli_query($con, "SELECT * FROM sn_moviestb WHERE is_trending = 1 ORDER BY id DESC LIMIT 1");
$featured = mysqli_fetch_assoc($featured_query);
// Fallback if no movie is marked trending
if (!$featured) {
$featured = mysqli_fetch_assoc(mysqli_query($con, "SELECT * FROM sn_moviestb ORDER BY id DESC LIMIT 1"));
}
?>
<style>
.hero-banner {
position: relative;
height: 80vh;
width: 100%;
background: linear-gradient(to bottom, rgba(0,0,0,0.1), #0a0a0a),
url('thumbnail/<?php echo $featured['thumbnail']; ?>');
background-size: cover;
background-position: center;
display: flex;
align-items: center;
padding: 0 5%;
overflow: hidden;
}
.hero-content {
max-width: 600px;
z-index: 2;
}
.hero-category {
color: #d4af37; /* Gold */
text-transform: uppercase;
letter-spacing: 2px;
font-weight: bold;
font-size: 0.9rem;
margin-bottom: 10px;
}
.hero-title {
font-size: 4rem;
font-weight: 800;
margin: 10px 0;
line-height: 1.1;
text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
.hero-btns {
margin-top: 30px;
display: flex;
gap: 15px;
}
.btn-play {
background: #e50914;
color: white;
padding: 12px 35px;
border-radius: 5px;
text-decoration: none;
font-weight: bold;
font-size: 1.1rem;
display: flex;
align-items: center;
gap: 10px;
transition: transform 0.2s;
}
.btn-play:hover {
transform: scale(1.05);
background: #f40a16;
}
.btn-info {
background: rgba(109, 109, 110, 0.7);
color: white;
padding: 12px 35px;
border-radius: 5px;
text-decoration: none;
font-weight: bold;
font-size: 1.1rem;
}
/* Mobile adjustments */
@media (max-width: 768px) {
.hero-title { font-size: 2.5rem; }
.hero-banner { height: 60vh; }
}
</style>
<section class="hero-banner">
<div class="hero-content">
<div class="hero-category">Featured in <?php echo $featured['movieCategory']; ?></div>
<h1 class="hero-title"><?php echo $featured['title']; ?></h1>
<p style="color: #ccc; font-size: 1.1rem; margin-bottom: 20px;">
Experience the latest blockbuster exclusively on CINEVAA. Unlimited streaming in 4K Ultra HD.
</p>
<div class="hero-btns">
<a href="watch.php?id=<?php echo $featured['id']; ?>" class="btn-play">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
Watch Now
</a>
<a href="details.php?id=<?php echo $featured['id']; ?>" class="btn-info">More Info</a>
</div>
</div>
</section-->
<!-- Navigation -->
<nav class="home_div">
<h1 id="logo_txtA" class="logo_txtA">
CINE<span class="logo_txtB">VAA</span>
</h1>
<div class="sub_home_div">
<!--a href="#" class="home_btn">MOVIES</a>
<a href="#" class="home_btn">SHOWS</a>
<a href="#" class="home_btn">KIDS</a-->
<?php if(!isset($_SESSION['my_id'])){ ?>
<a href="login" class="home_btn">LOGIN</a>
<?php }else{ ?>
<a href="profile" class="home_btn">SETTING</a>
<?php } ?>
<?PHP
// Check if this user is an admin
$checkSql_two = "SELECT my_id FROM admins WHERE my_id = ?";
$stmt_3 = $con->prepare($checkSql_two);
$stmt_3->bind_param("s", $_SESSION['my_id']);
$stmt_3->execute();
$res_3 = $stmt_3->get_result();
if ($res_3->num_rows > 0) { ?>
<a href="upnow" class="home_btn">UPLOAD</a>
<a href="admin_temp" class="home_btn">ADM TEMP</a>
<?php
$_SESSION['user_role'] = 'admin'; // They are an admin
}
?>
<?php if(isset($_SESSION['my_id'])){ ?>
<!--a href="admin_payments" class="home_btn">ADM P</a-->
<a href="logout" class="home_btn">LOGOUT</a>
<?php } ?>
</div>
<div id="search_div" class="search_div">
<input type="text" id="movieSearch" placeholder="Search..." class="search_input">
<span onclick="clear_search_area();" class="clear_search_input_btn" >x</span>
<span onclick="clear_search_area_mob();" class="clear_search_input_btn_mob" >x</span>
</div>
<?php if(isset($_SESSION['my_id'])){ ?>
<a href="plans" class="subscribe_btn"><button class="subscribe_btn">Subscribe</button></a>
<?php }else{ ?>
<a href="login" class="subscribe_btn"><button class="subscribe_btn">Subscribe</button></a>
<?php } ?>
<?php if(isset($_SESSION['my_id'])){ ?>
<a href="profile" ><div class="profile_div">
<img src="avatar_image/avatar2_small.jpg" class="profile_img" />
</div></a>
<?php } ?>
<!-- Search Icon -->
<div id="search_container" class="icon-row">
<div class="search-container" onclick="show_search_area();" >
<div class="search-circle"></div>
<div class="search-handle"></div>
</div>
</div>
<!-- 1. Animated Hamburger (Transforms to X) -->
<div id="menu_container" class="icon-row">
<div id="animatedIcon" class="hamb-container" onclick="toggleMenu(this)">
<div class="hamb-line"></div>
<div class="hamb-line"></div>
<div class="hamb-line"></div>
</div>
</div>
</nav>
<nav id="home_div_mob" class="home_div_mob">
<a href="plans" class="home_btn" Style="margin-top:10px;">SUBSCRIBE</a>
<a href="#" class="home_btn">MOVIES</a>
<a href="#" class="home_btn">SHOWS</a>
<a href="#" class="home_btn">KIDS</a>
<?php if(!isset($_SESSION['my_id'])){ ?>
<a href="login" class="home_btn">LOGIN</a>
<?php }else{ ?>
<a href="profile" class="home_btn">SETTING</a>
<a href="logout" class="home_btn">LOGOUT</a>
<?php } ?>
</nav>
<div class="position_div"></div>
<div id="search_result" class="search_result">
<!--a href="#" class="home_btn">LOGOUT</a-->
<span class="search_output" >Enter the death game</span>
</div>
<!-- Hero Banner (Shemaroo Style) -->
<header class="hero_banner" style="background-image: url('main_icon/banner.jpg?auto=format&fit=crop&q=80&w=2000');">
<div class="hero_overlay"></div>
<div class="sub_banner_div relative z-10 max-w-xl">
<h2 class="banner_txtA">THE RETURN OF <br><span class=" banner_txtB">LEGENDS</span></h2>
<p class="text-slate-300 mb-8 font-medium">Experience the classic blockbuster that defined a generation. Now streaming in Ultra HD with exclusive behind-the-scenes content.</p>
<div class="flex gap-4">
<a href="cine_player.php?mvTitle=The Legends&&mvSrc=movies/Mr.Tee🇰🇪,_Joshua_Baraka🇺🇬_and_TENORBOY🇳🇬_-_DIGII_IV__Official_Video_(1080p).mp4"><button onclickk="playMovie('The Legends', 'movies/movie1.mp4')" class="watch_now_btn">
<svg class="watch_now_btn_svg" fill="currentColor" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg> WATCH NOW
</button></a>
<button class="watch_list_btn">
+ WATCHLIST
</button>
</div>
</div>
</header>
<!-- Main Content Rows -->
<main classk="pb-20">
<!-- Trending Category -->
<section class="content-row">
<div class="row-header">
<h3 class="row-title">Trending Now</h3>
<a href="#" class="see_more">SEE ALL</a>
</div>
<div id="trendingContainer" class="movie_container">
</div>
</section>
<!-- Recommended Category -->
<section class="content-row">
<div class="row-header">
<h3 class="row-title">Recommended For You</h3>
<a href="#" class="see_more">SEE ALL</a>
</div>
<div id="recommendedGrid" class="movie_container2">
</div>
</section>
</main>
<!-- Footer -->
<footer class="footer_div">
<div class="sub_footer_div grid grid-cols-2 md:grid-cols-4 gap-8">
<div class="footer_option" >
<h4 style="color:#fff;font-weight:bold;">CINESTREAM</h4>
<p Style="font-size:0.8em;color:#8B8594;font-weight:500;">The ultimate destination for premium movies and shows from across the globe.</p>
</div>
<div class="footer_option" >
<h4 Style="margin-left:40px;">HELP</h4>
<ul class="text-slate-500 text-xs space-y-2">
<li><a href="about_us" class="hover:text-white">About Us</a></li>
<li><a href="faq_page" class="hover:text-white">Device FAQ</a></li>
<li><a href="contact_us" class="hover:text-white">Contact Us</a></li>
</ul>
</div>
<div class="footer_option" >
<h4 Style="margin-left:40px;">LEGAL</h4>
<ul class="text-slate-500 text-xs space-y-2">
<li><a href="privacy_policy" class="hover:text-white">Privacy Policy</a></li>
<li><a href="terms" class="hover:text-white">Terms of Use</a></li>
<li><a href="cookie" class="hover:text-white">Cookies</a></li>
</ul>
</div>
<div class="footer_option" >
<h4 Style="margin-left:40px;">SOCIAL</h4>
<div class="socail_med_div">
<div class="sub_socail_med_div"></div>
<div class="sub_socail_med_div"></div>
<div class="sub_socail_med_div"></div>
</div>
</div>
</div>
<div class="right_div">
© 2026 Cinevaa Entertainment - coblaa.com
</div>
</footer>
<script>
dispTrendMovies();
function dispTrendMovies()
{
xmlhpttp = new XMLHttpRequest();
xmlhpttp.open("GET","auto_page.php?status=dispTrendMovies",false);
xmlhpttp.send(null);
document.getElementById('trendingContainer').innerHTML =xmlhpttp.responseText;
}
let currentPage = 0;
let isLoading = false;
let hasMoreData = true;
let searchQuery = "";
let searchTimeout = null;
// Initial load
window.onload = () => {
dispRecommendMovies();
};
// Scroll listener to detect bottom of page
window.onscroll = function() {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 500) {
// If we are within 500px of the bottom, load more
dispRecommendMovies();
}
};
function dispRecommendMovies() {
if (isLoading || !hasMoreData) return;
isLoading = true;
// Create the URL with the status and current page
const url = `auto_page.php?status=dispRecommendMovies&page=${currentPage}`;
fetch(url)
.then(response => response.text())
.then(data => {
if (data.trim() === "NO_MORE_DATA") {
hasMoreData = false;
} else {
// Append the new items instead of replacing (innerHTML +=)
document.getElementById('recommendedGrid').innerHTML += data;
currentPage++;
}
isLoading = false;
})
.catch(error => {
console.error('Error loading movies:', error);
isLoading = false;
});
}
// Event listener for typing (Instant Search)
document.getElementById('movieSearch').addEventListener('input', function(e) {
const value = e.target.value;
clearTimeout(searchTimeout);
// Trigger search after 300ms of no typing
searchTimeout = setTimeout(() => {
searchMovies(value);
}, 300);
});
function searchMovies(newValue) {
// Reset state for a fresh search
searchQuery = newValue;
currentPage = 0;
hasMoreData = true;
document.getElementById('search_result').innerHTML = "";
dispSearchedMovies();
}
function dispSearchedMovies() {
// Ensure we don't fetch if loading or no more data
if (isLoading || !hasMoreData) return;
isLoading = true;
// 1. Re-enable the page parameter so PHP knows which offset to use
const url = `auto_page.php?status=dispSearchedMovies&page=${currentPage}&search=${encodeURIComponent(searchQuery)}`;
fetch(url)
.then(response => response.text())
.then(data => {
const grid = document.getElementById('search_result');
const trimmedData = data.trim();
if (trimmedData === "NO_MORE_DATA") {
hasMoreData = false;
if(currentPage === 0) {
grid.innerHTML = "<p style='color:#d4af37; text-align:center; grid-column: 1/-1; padding: 40px;'>No movies found matching your search.</p>";
}
} else { grid.style.display="block";
// 2. LOGIC FIX:
// If it's the first page (currentPage === 0), overwrite innerHTML to CLEAR old results.
// If it's a pagination scroll (currentPage > 0), append results.
if (currentPage === 0) {
grid.innerHTML = data;
} else {
grid.innerHTML += data;
}
currentPage++;
}
isLoading = false;
})
.catch(error => {
console.error('Error loading movies:', error);
isLoading = false;
});
}
mob_menu_status=1;
function toggleMenu(element) {
element.classList.toggle('active');
if(mob_menu_status ==1){
document.getElementById("home_div_mob").style.display="block";
mob_menu_status=2;
}else if(mob_menu_status ==2){document.getElementById("home_div_mob").style.display="none";mob_menu_status=1;}
}
// --- CONTINUOUS AUTO-SCROLL LOGIC ---
const trendingBox = document.getElementById('trendingContainer');
let isHovered = false;
let scrollPos = 0;
const speed = 0.8; // Adjust speed here
// Setup: Clone content for seamless looping
const originalContent = trendingBox.innerHTML;
trendingBox.innerHTML += originalContent; // Duplicate once
trendingBox.innerHTML += originalContent; // Duplicate twice to ensure coverage on large screens
trendingBox.addEventListener('mouseenter', () => isHovered = true);
trendingBox.addEventListener('mouseleave', () => isHovered = false);
function autoScroll() {
if (!isHovered) {
scrollPos += speed;
// One-third because we have 3 copies (Original + 2 Clones)
const limit = trendingBox.scrollWidth / 3;
if (scrollPos >= limit) {
scrollPos = 0;
}
trendingBox.scrollLeft = scrollPos;
} else {
// Sync internal scrollPos with manual scrolls if user drags
scrollPos = trendingBox.scrollLeft;
}
requestAnimationFrame(autoScroll);
}
// Start auto-scroll
autoScroll();
function show_search_area()
{
document.getElementById('search_div').style.display="flex";
document.getElementById('logo_txtA').style.display="none";
document.getElementById('search_container').style.display="none";
document.getElementById('menu_container').style.display="none";
document.getElementById("home_div_mob").style.display="none";mob_menu_status=2;
}
function clear_search_area()
{
document.getElementById('search_result').style.display="none";
document.getElementById('movieSearch').value="";
document.getElementById('logo_txtA').style.display="block";
document.getElementById('search_container').style.display="block";
//document.getElementById('menu_container').style.display="block";
}
function clear_search_area_mob()
{
document.getElementById('search_div').style.display="none";
document.getElementById('movieSearch').value="";
document.getElementById('logo_txtA').style.display="block";
document.getElementById('search_container').style.display="block";
document.getElementById('menu_container').style.display="block";
document.getElementById('search_result').style.display="none";
}
</script>
</body>
</html>