hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
wjcvelqp
/
www
/
Upload FileeE
HOME
<?php include 'includes/header.php'; ?> <div class="max-w-7xl mx-auto px-4 py-12"> <div class="text-center mb-12"> <h1 class="text-5xl font-bold text-green-800">🎵 Bassa Infotainment Music Hub</h1> <p class="text-gray-600 mt-3 text-lg">Discover & Download Talented Artists Music</p> </div> <!-- Upload Button - Red --> <div class="text-center mb-16"> <a href="upload-music.php" class="inline-flex items-center gap-3 bg-red-600 hover:bg-red-700 text-white px-10 py-5 rounded-2xl text-lg font-semibold transition"> 📤 Upload Your Song </a> </div> <!-- Search Bar --> <div class="max-w-xl mx-auto mb-12"> <form action="music.php" method="GET" class="relative"> <input type="text" name="q" value="<?= htmlspecialchars($_GET['q'] ?? '') ?>" placeholder="Search songs or artists..." class="w-full px-6 py-4 border border-gray-300 rounded-2xl focus:outline-none focus:border-green-600"> <button type="submit" class="absolute right-3 top-1/2 -translate-y-1/2 bg-green-700 text-white px-6 py-3 rounded-xl"> <i class="fas fa-search"></i> </button> </form> </div> <!-- Download Songs --> <h2 class="text-2xl font-bold mb-8 flex items-center gap-3"> <span class="text-green-600">✅</span> Download Songs </h2> <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8"> <?php $search = isset($_GET['q']) ? trim($_GET['q']) : ''; $sql = "SELECT * FROM music WHERE status = 'approved'"; if ($search) { $sql .= " AND (title LIKE ? OR artist LIKE ?)"; } $sql .= " ORDER BY created_at DESC LIMIT 12"; $stmt = $pdo->prepare($sql); if ($search) { $search_term = "%$search%"; $stmt->execute([$search_term, $search_term]); } else { $stmt->execute(); } $songs = $stmt->fetchAll(PDO::FETCH_ASSOC); if (empty($songs)): ?> <div class="col-span-full text-center py-20 text-gray-500"> <?= $search ? 'No songs found for "' . htmlspecialchars($search) . '"' : 'No approved songs yet. Check back later!' ?> </div> <?php else: ?> <?php foreach($songs as $song): $file_path = 'uploads/' . $song['audio_file']; $file_size = file_exists($file_path) ? round(filesize($file_path) / 1024 / 1024, 2) . ' MB' : 'N/A'; ?> <div class="bg-white rounded-3xl shadow-md overflow-hidden hover:shadow-xl transition"> <?php if($song['cover_image']): ?> <img src="uploads/<?= htmlspecialchars($song['cover_image']) ?>" class="w-full h-56 object-cover"> <?php endif; ?> <div class="p-6"> <h3 class="font-bold text-lg"><?= htmlspecialchars($song['title']) ?></h3> <p class="text-green-700 font-medium"><?= htmlspecialchars($song['artist']) ?></p> <?php if($song['description']): ?> <p class="text-sm text-gray-600 mt-3 line-clamp-3"><?= htmlspecialchars($song['description']) ?></p> <?php endif; ?> <!-- Download Button + Stats --> <div class="mt-6 space-y-3"> <div class="flex items-center gap-4"> <a href="download-music.php?id=<?= $song['id'] ?>" class="flex-1 bg-green-700 hover:bg-green-800 text-white px-6 py-4 rounded-2xl flex items-center justify-center gap-2 font-medium"> <i class="fas fa-download"></i> Download </a> <span class="text-sm text-gray-500 whitespace-nowrap"><?= $file_size ?></span> </div> <!-- Download Count --> <div class="text-center text-sm text-gray-500"> <i class="fas fa-download"></i> <?= number_format($song['download_count'] ?? 0) ?> Downloads </div> </div> </div> </div> <?php endforeach; ?> <?php endif; ?> </div> </div> <?php include 'includes/footer.php'; ?>