Lili Records Radio v.1.0.7
This commit is contained in:
parent
813ebdfe6d
commit
d41f4becb7
86
index.php
86
index.php
@ -4,6 +4,18 @@ require_once __DIR__ . '/db/config.php';
|
||||
@ini_set('display_errors', '0');
|
||||
@error_reporting(E_ALL);
|
||||
|
||||
session_start();
|
||||
|
||||
// Simple admin check: access via index.php?admin=lili
|
||||
if (isset($_GET['admin']) && $_GET['admin'] === 'lili') {
|
||||
$_SESSION['is_admin'] = true;
|
||||
}
|
||||
if (isset($_GET['logout'])) {
|
||||
unset($_SESSION['is_admin']);
|
||||
}
|
||||
|
||||
$isAdmin = !empty($_SESSION['is_admin']);
|
||||
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Lili Records Radio - La mejor música en vivo.';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
$streamUrl = "https://play.radioking.io/lili-record-s-radio";
|
||||
@ -453,6 +465,12 @@ try {
|
||||
</div>
|
||||
|
||||
<canvas id="visualizer"></canvas>
|
||||
|
||||
<?php if ($isAdmin): ?>
|
||||
<div class="mt-4">
|
||||
<a href="?logout=1" class="btn btn-sm btn-outline-light opacity-50">Cerrar Sesión Admin</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
|
||||
<!-- Right: Image + Comments -->
|
||||
@ -460,38 +478,46 @@ try {
|
||||
<img src="<?= $promoImage ?>" alt="Lili Records Promo" class="promo-image">
|
||||
|
||||
<div class="comments-window">
|
||||
<div class="comments-header">
|
||||
<h5 class="mb-0"><i class="fas fa-comments me-2"></i>Mensajes de la Audiencia</h5>
|
||||
<span class="badge bg-danger rounded-pill"><?= count($requests) ?></span>
|
||||
</div>
|
||||
|
||||
<div class="comments-list" id="commentsList">
|
||||
<?php if (empty($requests)): ?>
|
||||
<div class="text-center py-5 opacity-50">
|
||||
<i class="fas fa-comment-dots fa-3x mb-3"></i>
|
||||
<p>No hay mensajes todavía.<br>¡Conéctate con Lili Records!</p>
|
||||
<?php if ($isAdmin): ?>
|
||||
<div class="comments-header">
|
||||
<h5 class="mb-0"><i class="fas fa-comments me-2"></i>Mensajes de la Audiencia</h5>
|
||||
<span class="badge bg-danger rounded-pill"><?= count($requests) ?></span>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($requests as $req): ?>
|
||||
<div class="comment-item">
|
||||
<span class="comment-user"><?= htmlspecialchars($req['name']) ?></span>
|
||||
<p class="comment-text mb-0"><?= htmlspecialchars($req['message']) ?></p>
|
||||
<span class="comment-date"><?= date('d M, H:i', strtotime($req['created_at'])) ?></span>
|
||||
|
||||
<?php if (!empty($req['phone'])): ?>
|
||||
<div class="comment-actions">
|
||||
<a href="https://wa.me/<?= preg_replace('/[^0-9]/', '', $req['phone']) ?>" class="btn-wa-reply" title="Chatear por WhatsApp" target="_blank">
|
||||
<i class="fab fa-whatsapp"></i>
|
||||
</a>
|
||||
|
||||
<div class="comments-list" id="commentsList">
|
||||
<?php if (empty($requests)): ?>
|
||||
<div class="text-center py-5 opacity-50">
|
||||
<i class="fas fa-comment-dots fa-3x mb-3"></i>
|
||||
<p>No hay mensajes todavía.<br>¡Conéctate con Lili Records!</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($requests as $req): ?>
|
||||
<div class="comment-item">
|
||||
<span class="comment-user"><?= htmlspecialchars($req['name']) ?></span>
|
||||
<p class="comment-text mb-0"><?= htmlspecialchars($req['message']) ?></p>
|
||||
<span class="comment-date"><?= date('d M, H:i', strtotime($req['created_at'])) ?></span>
|
||||
|
||||
<?php if (!empty($req['phone'])): ?>
|
||||
<div class="comment-actions">
|
||||
<a href="https://wa.me/<?= preg_replace('/[^0-9]/', '', $req['phone']) ?>" class="btn-wa-reply" title="Chatear por WhatsApp: <?= htmlspecialchars($req['phone']) ?>" target="_blank">
|
||||
<i class="fab fa-whatsapp"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="comments-header border-0 mb-0">
|
||||
<h5 class="mb-0"><i class="fas fa-paper-plane me-2"></i>¡Envíanos tu mensaje!</h5>
|
||||
</div>
|
||||
<p class="small opacity-50 mb-3">Tus peticiones y saludos llegan directo a cabina.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="qr-section">
|
||||
<img src="<?= $qrImage ?>" alt="QR Pago" class="qr-image">
|
||||
<p class="small opacity-50 mt-1">Escanea para apoyar a la radio</p>
|
||||
</div>
|
||||
|
||||
<form action="submit_request.php" method="POST" class="request-form">
|
||||
@ -509,7 +535,7 @@ try {
|
||||
<i class="fas fa-paper-plane"></i>
|
||||
</button>
|
||||
</div>
|
||||
<small class="text-center opacity-50" style="font-size: 0.7rem;">Tu mensaje aparecerá aquí y se enviará por WhatsApp</small>
|
||||
<small class="text-center opacity-50" style="font-size: 0.7rem;">Tu mensaje se enviará de forma privada a los administradores.</small>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -600,7 +626,9 @@ try {
|
||||
|
||||
// Scroll to bottom of comments
|
||||
const commentsList = document.getElementById('commentsList');
|
||||
commentsList.scrollTop = 0; // Show latest first
|
||||
if (commentsList) {
|
||||
commentsList.scrollTop = 0; // Show latest first
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user