Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
124
add_club.php
124
add_club.php
@ -1,124 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'auth_check.php'; // Protect this page
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
$success_message = '';
|
|
||||||
$error_message = '';
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$club_name = $_POST['club_name'] ?? '';
|
|
||||||
$address = $_POST['address'] ?? '';
|
|
||||||
$number = $_POST['number'] ?? '';
|
|
||||||
$neighborhood = $_POST['neighborhood'] ?? '';
|
|
||||||
$city = $_POST['city'] ?? '';
|
|
||||||
$phone = $_POST['phone'] ?? '';
|
|
||||||
$email = $_POST['email'] ?? '';
|
|
||||||
$description = $_POST['description'] ?? '';
|
|
||||||
|
|
||||||
if (empty($club_name) || empty($address) || empty($city)) {
|
|
||||||
$error_message = 'Please fill in all required fields (Club Name, Address, City).';
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$stmt = $pdo->prepare(
|
|
||||||
'INSERT INTO clubs (name, address, number, neighborhood, city, phone, email, description) VALUES (?, ?, ?, ?, ?, ?, ?, ?)'
|
|
||||||
);
|
|
||||||
$stmt->execute([$club_name, $address, $number, $neighborhood, $city, $phone, $email, $description]);
|
|
||||||
$success_message = 'Club \'' . htmlspecialchars($club_name) . '\' has been added successfully!';
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$error_message = 'Database error: ' . $e->getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Add New Club - PicklePRO</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<a class="navbar-brand" href="admin.php">PicklePRO Admin</a>
|
|
||||||
<div class="collapse navbar-collapse">
|
|
||||||
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="logout.php">Logout</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="container mt-4">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h4 class="mb-0">Add a New Club</h4>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<?php if ($success_message): ?>
|
|
||||||
<div class="alert alert-success"><?php echo $success_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($error_message): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<form action="add_club.php" method="POST">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="club_name" class="form-label">Nome do Clube</label>
|
|
||||||
<input type="text" class="form-control" id="club_name" name="club_name" required>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-9 mb-3">
|
|
||||||
<label for="address" class="form-label">Endereço</label>
|
|
||||||
<input type="text" class="form-control" id="address" name="address" required>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3 mb-3">
|
|
||||||
<label for="number" class="form-label">Número</label>
|
|
||||||
<input type="text" class="form-control" id="number" name="number">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 mb-3">
|
|
||||||
<label for="neighborhood" class="form-label">Bairro</label>
|
|
||||||
<input type="text" class="form-control" id="neighborhood" name="neighborhood">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 mb-3">
|
|
||||||
<label for="city" class="form-label">Cidade</label>
|
|
||||||
<input type="text" class="form-control" id="city" name="city" required>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 mb-3">
|
|
||||||
<label for="phone" class="form-label">Telefone</label>
|
|
||||||
<input type="text" class="form-control" id="phone" name="phone">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6 mb-3">
|
|
||||||
<label for="email" class="form-label">Email</label>
|
|
||||||
<input type="email" class="form-control" id="email" name="email">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="description" class="form-label">Descrição</label>
|
|
||||||
<textarea class="form-control" id="description" name="description" rows="3"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-between">
|
|
||||||
<button type="submit" class="btn btn-primary">Add Club</button>
|
|
||||||
<a href="clubs.php" class="btn btn-secondary">Back to Club List</a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,109 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'auth_check.php'; // Protect this page
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
$success_message = '';
|
|
||||||
$error_message = '';
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$tournament_name = $_POST['tournament_name'] ?? '';
|
|
||||||
$description = $_POST['description'] ?? '';
|
|
||||||
|
|
||||||
if (empty($tournament_name)) {
|
|
||||||
$error_message = 'Please fill in the tournament name.';
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$stmt = $pdo->prepare(
|
|
||||||
'INSERT INTO tournaments (name, description) VALUES (?, ?)'
|
|
||||||
);
|
|
||||||
$stmt->execute([$tournament_name, $description]);
|
|
||||||
$success_message = 'Tournament \''. htmlspecialchars($tournament_name) .'\' has been added successfully!';
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$error_message = 'Database error: ' . $e->getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="pt-BR">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Adicionar Novo Torneio - PicklePRO</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header class="navbar navbar-expand-lg navbar-light bg-white">
|
|
||||||
<div class="container">
|
|
||||||
<a class="navbar-brand" href="index.php">
|
|
||||||
<img src="https://www.svgrepo.com/show/494426/pickleball-paddle.svg" alt="PicklePRO Logo" width="30" height="30" class="d-inline-block align-text-top me-2">
|
|
||||||
Pickle<span class="text-primary">PRO</span>
|
|
||||||
</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
|
||||||
<ul class="navbar-nav mx-auto">
|
|
||||||
<li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Torneios</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Reservas</a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<?php
|
|
||||||
if (session_status() === PHP_SESSION_NONE) {
|
|
||||||
session_start();
|
|
||||||
}
|
|
||||||
if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<span class="navbar-text me-3">
|
|
||||||
Olá, <?php echo htmlspecialchars($_SESSION['username']); ?>
|
|
||||||
</span>
|
|
||||||
<a href="logout.php" class="btn btn-outline-primary">Sair</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="/login.php" class="btn btn-link text-decoration-none me-2">Entrar</a>
|
|
||||||
<a href="#" class="btn btn-primary">Cadastrar</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="container mt-4">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h4 class="mb-0">Adicionar um Novo Torneio</h4>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<?php if ($success_message): ?>
|
|
||||||
<div class="alert alert-success"><?php echo $success_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($error_message): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<form action="add_tournament.php" method="POST">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="tournament_name" class="form-label">Nome do Torneio</label>
|
|
||||||
<input type="text" class="form-control" id="tournament_name" name="tournament_name" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="description" class="form-label">Descrição</label>
|
|
||||||
<textarea class="form-control" id="description" name="description" rows="3"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex justify-content-between">
|
|
||||||
<button type="submit" class="btn btn-primary">Adicionar Torneio</button>
|
|
||||||
<a href="index.php" class="btn btn-secondary">Voltar</a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
133
admin.php
133
admin.php
@ -1,133 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'auth_check.php'; // Protect this page
|
|
||||||
require_once 'db/config.php'; // Database connection
|
|
||||||
|
|
||||||
// Fetch counts from the database
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
|
|
||||||
// Count clubs
|
|
||||||
$stmt_clubs = $pdo->query('SELECT COUNT(*) FROM clubs');
|
|
||||||
$count_clubs = $stmt_clubs->fetchColumn();
|
|
||||||
|
|
||||||
// Count tournaments
|
|
||||||
$stmt_tournaments = $pdo->query('SELECT COUNT(*) FROM tournaments');
|
|
||||||
$count_tournaments = $stmt_tournaments->fetchColumn();
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
// Handle DB connection error
|
|
||||||
$count_clubs = 0;
|
|
||||||
$count_tournaments = 0;
|
|
||||||
$error_message = "Database error: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="pt-BR">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Painel Administrativo - PicklePRO</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<!-- Header -->
|
|
||||||
<header class="navbar navbar-expand-lg navbar-light bg-white">
|
|
||||||
<div class="container">
|
|
||||||
<a class="navbar-brand" href="index.php">
|
|
||||||
<img src="https://www.svgrepo.com/show/494426/pickleball-paddle.svg" alt="PicklePRO Logo" width="30" height="30" class="d-inline-block align-text-top me-2">
|
|
||||||
Pickle<span class="text-primary">PRO</span>
|
|
||||||
</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
|
||||||
<ul class="navbar-nav mx-auto">
|
|
||||||
<li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Torneios</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Reservas</a></li>
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="admin.php">Administrativo</a>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
</ul>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<span class="navbar-text me-3">
|
|
||||||
Olá, <?php echo htmlspecialchars($_SESSION['username']); ?>
|
|
||||||
</span>
|
|
||||||
<a href="logout.php" class="btn btn-outline-primary">Sair</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="/login.php" class="btn btn-link text-decoration-none me-2">Entrar</a>
|
|
||||||
<a href="#" class="btn btn-primary">Cadastrar</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<main class="container my-5">
|
|
||||||
<div class="row mb-4">
|
|
||||||
<div class="col">
|
|
||||||
<h1 class="display-6 fw-bold">Painel Administrativo</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if (isset($error_message)): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="row g-4">
|
|
||||||
<!-- Card Clubes -->
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="card h-100 text-center">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title"><i class="bi bi-building me-2"></i>Clubes</h5>
|
|
||||||
<p class="display-4 fw-bold"><?php echo $count_clubs; ?></p>
|
|
||||||
<a href="clubs.php" class="btn btn-primary">Ver Clubes</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Card Torneios -->
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="card h-100 text-center">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title"><i class="bi bi-trophy me-2"></i>Torneios</h5>
|
|
||||||
<p class="display-4 fw-bold"><?php echo $count_tournaments; ?></p>
|
|
||||||
<a href="tournaments.php" class="btn btn-primary">Ver Torneios</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Card Configurações -->
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="card h-100 text-center">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title"><i class="bi bi-gear me-2"></i>Configurações</h5>
|
|
||||||
<p class="display-4"><i class="bi bi-gear-wide-connected"></i></p>
|
|
||||||
<a href="#" class="btn btn-secondary disabled">Acessar</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<footer class="footer mt-auto py-4 bg-light fixed-bottom">
|
|
||||||
<div class="container text-center">
|
|
||||||
<p class="mb-1 text-muted small">© <?php echo date("Y"); ?> PicklePRO. Todos os direitos reservados.</p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
/* PicklePRO Custom Styles */
|
|
||||||
body {
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
background-color: #f8f9fa; /* Light grey background */
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-brand {
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-brand .text-primary {
|
|
||||||
color: #0d6efd !important; /* Bootstrap Primary */
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-link {
|
|
||||||
color: #6c757d; /* Muted text for nav links */
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-link:hover, .nav-link.active {
|
|
||||||
color: #0d6efd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary {
|
|
||||||
background-color: #0d6efd;
|
|
||||||
border-color: #0d6efd;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 0.5rem 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary:hover {
|
|
||||||
background-color: #0b5ed7;
|
|
||||||
border-color: #0a58ca;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-primary {
|
|
||||||
border-color: #0d6efd;
|
|
||||||
color: #0d6efd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-primary:hover {
|
|
||||||
background-color: #0d6efd;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-link {
|
|
||||||
color: #333;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border: none;
|
|
||||||
border-radius: 0.75rem;
|
|
||||||
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-indicators-custom {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-indicators-custom button {
|
|
||||||
background-color: #d1d1d1;
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: none;
|
|
||||||
margin: 0 4px;
|
|
||||||
transition: background-color 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-indicators-custom button.active {
|
|
||||||
background-color: #0d6efd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tournament-item:not(:last-child) {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(7, 1fr);
|
|
||||||
gap: 0.5rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day-name {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: #6c757d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day {
|
|
||||||
padding: 0.5rem 0;
|
|
||||||
border-radius: 50%;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day.event {
|
|
||||||
background-color: #eaf2ff;
|
|
||||||
color: #0d6efd;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day.event::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
bottom: 4px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
width: 4px;
|
|
||||||
height: 4px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #0d6efd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day.empty {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.event-dot {
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
border-radius: 50%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 228 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 108 KiB |
@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
// If user is not logged in or is not a superadmin, redirect to login page
|
|
||||||
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'superadmin') {
|
|
||||||
header('Location: login.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
120
clubs.php
120
clubs.php
@ -1,120 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'auth_check.php'; // Protect this page
|
|
||||||
require_once 'db/config.php'; // Database connection
|
|
||||||
|
|
||||||
// Fetch all clubs from the database
|
|
||||||
$clubs = [];
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$stmt = $pdo->query('SELECT id, name, address, phone, email FROM clubs ORDER BY name');
|
|
||||||
$clubs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$error_message = "Database error: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="pt-BR">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Gerenciar Clubes - PicklePRO</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<!-- Header -->
|
|
||||||
<header class="navbar navbar-expand-lg navbar-light bg-white">
|
|
||||||
<div class="container">
|
|
||||||
<a class="navbar-brand" href="index.php">
|
|
||||||
<img src="https://www.svgrepo.com/show/494426/pickleball-paddle.svg" alt="PicklePRO Logo" width="30" height="30" class="d-inline-block align-text-top me-2">
|
|
||||||
Pickle<span class="text-primary">PRO</span>
|
|
||||||
</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
|
||||||
<ul class="navbar-nav mx-auto">
|
|
||||||
<li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Torneios</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Reservas</a></li>
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="admin.php">Administrativo</a>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
</ul>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<span class="navbar-text me-3">
|
|
||||||
Olá, <?php echo htmlspecialchars($_SESSION['username']); ?>
|
|
||||||
</span>
|
|
||||||
<a href="logout.php" class="btn btn-outline-primary">Sair</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="/login.php" class="btn btn-link text-decoration-none me-2">Entrar</a>
|
|
||||||
<a href="#" class="btn btn-primary">Cadastrar</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<main class="container my-5">
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
||||||
<h1 class="display-6 fw-bold">Gerenciar Clubes</h1>
|
|
||||||
<a href="add_club.php" class="btn btn-primary"><i class="bi bi-plus-circle me-2"></i>Cadastrar Novo Clube</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if (isset($error_message)): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
<?php if (empty($clubs) && !isset($error_message)): ?>
|
|
||||||
<div class="text-center p-4">
|
|
||||||
<p>Nenhum clube cadastrado ainda.</p>
|
|
||||||
</div>
|
|
||||||
<?php else:
|
|
||||||
if (!empty($clubs)) : ?>
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Nome</th>
|
|
||||||
<th>Endereço</th>
|
|
||||||
<th>Telefone</th>
|
|
||||||
<th>Email</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($clubs as $club): ?>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo htmlspecialchars($club['name']); ?></td>
|
|
||||||
<td><?php echo htmlspecialchars($club['address']); ?></td>
|
|
||||||
<td><?php echo htmlspecialchars($club['phone']); ?></td>
|
|
||||||
<td><?php echo htmlspecialchars($club['email']); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<?php endif; endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-4">
|
|
||||||
<a href="admin.php" class="btn btn-secondary">Voltar ao Painel</a>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<footer class="footer mt-auto py-4 bg-light">
|
|
||||||
<div class="container text-center">
|
|
||||||
<p class="mb-1 text-muted small">© <?php echo date("Y"); ?> PicklePRO. Todos os direitos reservados.</p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
81
db/setup.php
81
db/setup.php
@ -1,81 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Simple, one-time setup script
|
|
||||||
require_once 'config.php';
|
|
||||||
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
||||||
|
|
||||||
// Create users table
|
|
||||||
$pdo->exec("
|
|
||||||
CREATE TABLE IF NOT EXISTS `users` (
|
|
||||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
`username` VARCHAR(255) NOT NULL,
|
|
||||||
`email` VARCHAR(255) NOT NULL UNIQUE,
|
|
||||||
`password` VARCHAR(255) NOT NULL,
|
|
||||||
`role` VARCHAR(50) NOT NULL,
|
|
||||||
`birth_date` DATE,
|
|
||||||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
");
|
|
||||||
|
|
||||||
// Add columns if they don't exist
|
|
||||||
try { $pdo->exec("ALTER TABLE `users` ADD COLUMN `email` VARCHAR(255) NOT NULL UNIQUE AFTER `username`"); } catch (PDOException $e) { /* Ignore */ }
|
|
||||||
try { $pdo->exec("ALTER TABLE `users` ADD COLUMN `birth_date` DATE AFTER `role`"); } catch (PDOException $e) { /* Ignore */ }
|
|
||||||
// We can't easily remove the unique constraint in a single command that works on all versions, so we'll leave it for now.
|
|
||||||
// The signup logic will handle this by checking for existing usernames.
|
|
||||||
|
|
||||||
// Create clubs table
|
|
||||||
$pdo->exec("
|
|
||||||
CREATE TABLE IF NOT EXISTS `clubs` (
|
|
||||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
`name` VARCHAR(255) NOT NULL,
|
|
||||||
`address` VARCHAR(255) NOT NULL,
|
|
||||||
`number` VARCHAR(50),
|
|
||||||
`neighborhood` VARCHAR(100),
|
|
||||||
`city` VARCHAR(100) NOT NULL,
|
|
||||||
`phone` VARCHAR(100) NULL,
|
|
||||||
`email` VARCHAR(100) NULL,
|
|
||||||
`description` TEXT,
|
|
||||||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
");
|
|
||||||
|
|
||||||
// Create tournaments table
|
|
||||||
$pdo->exec("
|
|
||||||
CREATE TABLE IF NOT EXISTS `tournaments` (
|
|
||||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
`name` VARCHAR(255) NOT NULL,
|
|
||||||
`description` TEXT,
|
|
||||||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
||||||
");
|
|
||||||
|
|
||||||
// Check if superadmin exists
|
|
||||||
$stmt = $pdo->prepare("SELECT id FROM users WHERE username = 'superadmin'");
|
|
||||||
$stmt->execute();
|
|
||||||
if ($stmt->fetch()) {
|
|
||||||
echo "Superadmin user already exists.<br>";
|
|
||||||
} else {
|
|
||||||
// Insert default superadmin user
|
|
||||||
$username = 'superadmin';
|
|
||||||
$email = 'superadmin@picklepro.com';
|
|
||||||
$password = 'superadmin'; // Default password, you should change this
|
|
||||||
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
|
|
||||||
$role = 'superadmin';
|
|
||||||
|
|
||||||
$stmt = $pdo->prepare("INSERT INTO users (username, email, password, role) VALUES (:username, :email, :password, :role)");
|
|
||||||
$stmt->bindParam(':username', $username);
|
|
||||||
$stmt->bindParam(':email', $email);
|
|
||||||
$stmt->bindParam(':password', $hashed_password);
|
|
||||||
$stmt->bindParam(':role', $role);
|
|
||||||
$stmt->execute();
|
|
||||||
echo "Superadmin user created successfully with username 'superadmin' and password 'superadmin'.<br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Database setup completed successfully!<br>";
|
|
||||||
echo "You can now delete this file (db/setup.php) for security reasons.";
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
die("Database setup failed: " . $e->getMessage());
|
|
||||||
}
|
|
||||||
359
index.php
359
index.php
@ -1,231 +1,150 @@
|
|||||||
<?php session_start(); ?>
|
<?php
|
||||||
<!DOCTYPE html>
|
declare(strict_types=1);
|
||||||
<html lang="pt-BR">
|
@ini_set('display_errors', '1');
|
||||||
|
@error_reporting(E_ALL);
|
||||||
|
@date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
$phpVersion = PHP_VERSION;
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>New Style</title>
|
||||||
<!-- SEO & Meta Tags -->
|
<?php
|
||||||
<title>PicklePRO - Seu Portal Completo de Pickleball</title>
|
// Read project preview data from environment
|
||||||
<meta name="description" content="Gerencie e participe de torneios de pickleball. Agende quadras, aulas e mais com o PicklePRO.">
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||||
<meta name="keywords" content="pickleball, torneios de pickleball, agendamento de quadras, liga de pickleball, gerenciamento esportivo, aulas de pickleball">
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||||
|
?>
|
||||||
<!-- Open Graph / Facebook -->
|
<?php if ($projectDescription): ?>
|
||||||
<meta property="og:type" content="website">
|
<!-- Meta description -->
|
||||||
<meta property="og:title" content="PicklePRO - Seu Portal Completo de Pickleball">
|
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||||
<meta property="og:description" content="Gerencie e participe de torneios de pickleball. Agende quadras, aulas e mais com o PicklePRO.">
|
<!-- Open Graph meta tags -->
|
||||||
<meta property="og:image" content="https://flatlogic-blog-pictures.s3.us-east-1.amazonaws.com/misc/defult-thumbnail.png">
|
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
|
<!-- Twitter meta tags -->
|
||||||
<!-- Twitter -->
|
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
<meta property="twitter:card" content="summary_large_image">
|
<?php endif; ?>
|
||||||
<meta property="twitter:title" content="PicklePRO - Seu Portal Completo de Pickleball">
|
<?php if ($projectImageUrl): ?>
|
||||||
<meta property="twitter:description" content="Gerencie e participe de torneios de pickleball. Agende quadras, aulas e mais com o PicklePRO.">
|
<!-- Open Graph image -->
|
||||||
<meta property="twitter:image" content="https://flatlogic-blog-pictures.s3.us-east-1.amazonaws.com/misc/defult-thumbnail.png">
|
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
|
<!-- Twitter image -->
|
||||||
<!-- Stylesheets -->
|
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
<?php endif; ?>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-color-start: #6a11cb;
|
||||||
|
--bg-color-end: #2575fc;
|
||||||
|
--text-color: #ffffff;
|
||||||
|
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||||
|
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font-family: 'Inter', sans-serif;
|
||||||
|
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||||
|
color: var(--text-color);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
body::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||||
|
animation: bg-pan 20s linear infinite;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
@keyframes bg-pan {
|
||||||
|
0% { background-position: 0% 0%; }
|
||||||
|
100% { background-position: 100% 100%; }
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg-color);
|
||||||
|
border: 1px solid var(--card-border-color);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 2rem;
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.loader {
|
||||||
|
margin: 1.25rem auto 1.25rem;
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||||
|
border-top-color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
@keyframes spin {
|
||||||
|
from { transform: rotate(0deg); }
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
.hint {
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px; height: 1px;
|
||||||
|
padding: 0; margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
white-space: nowrap; border: 0;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
letter-spacing: -1px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<main>
|
||||||
<!-- Header -->
|
<div class="card">
|
||||||
<header class="navbar navbar-expand-lg navbar-light bg-white">
|
<h1>Analyzing your requirements and generating your website…</h1>
|
||||||
<div class="container">
|
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||||
<a class="navbar-brand" href="#">
|
<span class="sr-only">Loading…</span>
|
||||||
<img src="https://www.svgrepo.com/show/494426/pickleball-paddle.svg" alt="PicklePRO Logo" width="30" height="30" class="d-inline-block align-text-top me-2">
|
|
||||||
Pickle<span class="text-primary">PRO</span>
|
|
||||||
</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
|
||||||
<ul class="navbar-nav mx-auto">
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Home</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Torneios</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Reservas</a></li>
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="admin.php">Administrativo</a>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
</ul>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<span class="navbar-text me-3">
|
|
||||||
Olá, <?php echo htmlspecialchars($_SESSION['username']); ?>
|
|
||||||
</span>
|
|
||||||
<a href="logout.php" class="btn btn-outline-primary">Sair</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="/login.php" class="btn btn-link text-decoration-none me-2">Entrar</a>
|
|
||||||
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#signupModal">
|
|
||||||
Cadastrar
|
|
||||||
</button>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<main class="container my-4">
|
|
||||||
<?php if (isset($_SESSION['error_message'])): ?>
|
|
||||||
<div class="alert alert-danger" role="alert">
|
|
||||||
<?php echo $_SESSION['error_message']; unset($_SESSION['error_message']); ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if (isset($_SESSION['success_message'])): ?>
|
|
||||||
<div class="alert alert-success" role="alert">
|
|
||||||
<?php echo $_SESSION['success_message']; unset($_SESSION['success_message']); ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<div class="text-center mb-5">
|
|
||||||
<h1 class="display-5 fw-bold">Seu Portal Completo de <span class="text-primary">Pickleball</span></h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row g-4">
|
|
||||||
<!-- Coluna Clubes Parceiros -->
|
|
||||||
<div class="col-lg-4">
|
|
||||||
<h5 class="mb-3"><i class="bi bi-building me-2 text-primary"></i>Clubes Parceiros</h5>
|
|
||||||
<div class="card card-body">
|
|
||||||
<?php
|
|
||||||
require_once 'db/config.php';
|
|
||||||
$pdo = db();
|
|
||||||
$stmt = $pdo->query('SELECT name, description FROM clubs ORDER BY name');
|
|
||||||
$clubs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
?>
|
|
||||||
<?php if (count($clubs) > 0): ?>
|
|
||||||
<div id="clubsCarousel" class="carousel slide" data-bs-ride="carousel">
|
|
||||||
<div class="carousel-inner">
|
|
||||||
<?php foreach ($clubs as $index => $club): ?>
|
|
||||||
<div class="carousel-item <?php echo $index === 0 ? 'active' : ''; ?>">
|
|
||||||
<h6 class="fw-bold"><?php echo htmlspecialchars($club['name']); ?></h6>
|
|
||||||
<p class="small text-muted"><?php echo htmlspecialchars($club['description']); ?></p>
|
|
||||||
<a href="#" class="btn btn-primary mt-3">Ver Agendamentos Disponíveis</a>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php if (count($clubs) > 1): ?>
|
|
||||||
<div class="carousel-indicators-custom">
|
|
||||||
<?php foreach ($clubs as $index => $club): ?>
|
|
||||||
<button type="button" data-bs-target="#clubsCarousel" data-bs-slide-to="<?php echo $index; ?>" class="<?php echo $index === 0 ? 'active' : ''; ?>" aria-current="<?php echo $index === 0 ? 'true' : 'false'; ?>" aria-label="Slide <?php echo $index + 1; ?>"></button>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
|
||||||
<div class="text-center">
|
|
||||||
<p class="text-muted">Nenhum clube cadastrado ainda.</p>
|
|
||||||
<?php if (isset($_SESSION['user_id']) && $_SESSION['role'] === 'superadmin'): ?>
|
|
||||||
<a href="add_club.php" class="btn btn-primary">Cadastrar Clube</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Coluna Próximos Torneios -->
|
|
||||||
<div class="col-lg-4">
|
|
||||||
<h5 class="mb-3"><i class="bi bi-trophy me-2 text-primary"></i>Próximos Torneios</h5>
|
|
||||||
<div class="card card-body">
|
|
||||||
<div class="tournament-item">
|
|
||||||
<p class="fw-bold mb-1">1º COPA DINK DE PICKLEBALL</p>
|
|
||||||
<p class="small text-muted mb-1"><i class="bi bi-tag me-2"></i>Dink Pickleball</p>
|
|
||||||
<p class="small text-muted"><i class="bi bi-calendar-event me-2"></i>15/10/2025</p>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<div class="tournament-item">
|
|
||||||
<p class="fw-bold mb-1">1ª COPA DE PICKLEBALL</p>
|
|
||||||
<p class="small text-muted mb-1"><i class="bi bi-tag me-2"></i>Smash Pickleball</p>
|
|
||||||
<p class="small text-muted"><i class="bi bi-calendar-event me-2"></i>25/10/2025</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Coluna Calendário -->
|
|
||||||
<div class="col-lg-4">
|
|
||||||
<h5 class="mb-3"><i class="bi bi-calendar3 me-2 text-primary"></i>Calendário</h5>
|
|
||||||
<div class="card card-body">
|
|
||||||
<div class="calendar-header d-flex justify-content-between align-items-center mb-3">
|
|
||||||
<button class="btn btn-link text-decoration-none"><i class="bi bi-chevron-left"></i></button>
|
|
||||||
<h6 class="fw-bold mb-0">Outubro 2025</h6>
|
|
||||||
<button class="btn btn-link text-decoration-none"><i class="bi bi-chevron-right"></i></button>
|
|
||||||
</div>
|
|
||||||
<div class="calendar-grid">
|
|
||||||
<div class="day-name">Dom</div><div class="day-name">Seg</div><div class="day-name">Ter</div><div class="day-name">Qua</div><div class="day-name">Qui</div><div class="day-name">Sex</div><div class="day-name">Sáb</div>
|
|
||||||
<div class="day empty"></div><div class="day empty"></div><div class="day empty"></div><div class="day">1</div><div class="day">2</div><div class="day">3</div><div class="day">4</div>
|
|
||||||
<div class="day">5</div><div class="day">6</div><div class="day">7</div><div class="day">8</div><div class="day">9</div><div class="day">10</div><div class="day">11</div>
|
|
||||||
<div class="day">12</div><div class="day">13</div><div class="day">14</div><div class="day event">15</div><div class="day event">16</div><div class="day event">17</div><div class="day event">18</div>
|
|
||||||
<div class="day event">19</div><div class="day">20</div><div class="day">21</div><div class="day">22</div><div class="day">23</div><div class="day">24</div><div class="day event">25</div>
|
|
||||||
<div class="day event">26</div><div class="day">27</div><div class="day">28</div><div class="day">29</div><div class="day">30</div><div class="day">31</div>
|
|
||||||
</div>
|
|
||||||
<hr>
|
|
||||||
<div class="tournaments-of-month">
|
|
||||||
<p class="fw-bold small">Torneios do Mês</p>
|
|
||||||
<div class="d-flex align-items-center mb-2">
|
|
||||||
<span class="event-dot bg-primary me-2"></span>
|
|
||||||
<span class="small">1º COPA DINK DE PICKLEBALL • 14 de out. - 18 de out.</span>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<span class="event-dot bg-success me-2"></span>
|
|
||||||
<span class="small">1ª COPA DE PICKLEBALL • 24 de out. - 25 de out.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="btn btn-outline-primary mt-3">Ver Todos os Torneios</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||||
|
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||||
|
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
<footer>
|
||||||
<!-- Footer -->
|
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||||
<footer class="footer mt-5 py-4 bg-light">
|
|
||||||
<div class="container text-center">
|
|
||||||
<p class="mb-1 text-muted small">© <?php echo date("Y"); ?> PicklePRO. Todos os direitos reservados.</p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- Signup Modal -->
|
|
||||||
<div class="modal fade" id="signupModal" tabindex="-1" aria-labelledby="signupModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="signupModalLabel">Cadastro de Atleta</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<form action="signup.php" method="POST">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="fullName" class="form-label">Nome Completo</label>
|
|
||||||
<input type="text" class="form-control" id="fullName" name="fullName" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="birthDate" class="form-label">Data de Nascimento</label>
|
|
||||||
<input type="date" class="form-control" id="birthDate" name="birthDate" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="email" class="form-label">E-mail</label>
|
|
||||||
<input type="email" class="form-control" id="email" name="email" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="password" class="form-label">Senha</label>
|
|
||||||
<input type="password" class="form-control" id="password" name="password" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="confirmPassword" class="form-label">Confirmar Senha</label>
|
|
||||||
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" required>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-primary w-100">Cadastrar</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
74
login.php
74
login.php
@ -1,74 +0,0 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
$error = '';
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$username = $_POST['username'] ?? '';
|
|
||||||
$password = $_POST['password'] ?? '';
|
|
||||||
|
|
||||||
if (empty($username) || empty($password)) {
|
|
||||||
$error = 'Please enter both username and password.';
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = ?');
|
|
||||||
$stmt->execute([$username]);
|
|
||||||
$user = $stmt->fetch();
|
|
||||||
|
|
||||||
if ($user && password_verify($password, $user['password'])) {
|
|
||||||
$_SESSION['user_id'] = $user['id'];
|
|
||||||
$_SESSION['username'] = $user['username'];
|
|
||||||
$_SESSION['role'] = $user['role'];
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
} else {
|
|
||||||
$error = 'Nome de usuário ou senha inválidos.';
|
|
||||||
}
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$error = 'Database error: ' . $e->getMessage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Login - PicklePRO</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-md-6 col-lg-4">
|
|
||||||
<div class="card mt-5">
|
|
||||||
<div class="card-body">
|
|
||||||
<h3 class="card-title text-center mb-4">PicklePRO Login</h3>
|
|
||||||
<?php if ($error): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<form action="login.php" method="POST">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="username" class="form-label">Username</label>
|
|
||||||
<input type="text" class="form-control" id="username" name="username" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="password" class="form-label">Password</label>
|
|
||||||
<input type="password" class="form-control" id="password" name="password" required>
|
|
||||||
</div>
|
|
||||||
<div class="d-grid">
|
|
||||||
<button type="submit" class="btn btn-primary">Login</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
21
logout.php
21
logout.php
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
|
|
||||||
// Unset all of the session variables
|
|
||||||
$_SESSION = [];
|
|
||||||
|
|
||||||
// Destroy the session
|
|
||||||
if (ini_get("session.use_cookies")) {
|
|
||||||
$params = session_get_cookie_params();
|
|
||||||
setcookie(session_name(), '', time() - 42000,
|
|
||||||
$params["path"], $params["domain"],
|
|
||||||
$params["secure"], $params["httponly"]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
session_destroy();
|
|
||||||
|
|
||||||
// Redirect to login page
|
|
||||||
header('Location: login.php');
|
|
||||||
exit;
|
|
||||||
?>
|
|
||||||
58
signup.php
58
signup.php
@ -1,58 +0,0 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$fullName = $_POST['fullName'] ?? '';
|
|
||||||
$birthDate = $_POST['birthDate'] ?? '';
|
|
||||||
$email = $_POST['email'] ?? '';
|
|
||||||
$password = $_POST['password'] ?? '';
|
|
||||||
$confirmPassword = $_POST['confirmPassword'] ?? '';
|
|
||||||
|
|
||||||
// Validation
|
|
||||||
if (empty($fullName) || empty($birthDate) || empty($email) || empty($password) || empty($confirmPassword)) {
|
|
||||||
$_SESSION['error_message'] = 'Todos os campos são obrigatórios.';
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($password !== $confirmPassword) {
|
|
||||||
$_SESSION['error_message'] = 'As senhas não correspondem.';
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
|
||||||
$_SESSION['error_message'] = 'Formato de e-mail inválido.';
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
|
|
||||||
// Check if user already exists
|
|
||||||
$stmt = $pdo->prepare('SELECT id FROM users WHERE email = ?');
|
|
||||||
$stmt->execute([$email]);
|
|
||||||
if ($stmt->fetch()) {
|
|
||||||
$_SESSION['error_message'] = 'Este e-mail já está cadastrado.';
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert new user
|
|
||||||
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
|
||||||
$stmt = $pdo->prepare('INSERT INTO users (username, email, password, role, birth_date) VALUES (?, ?, ?, ?, ?)');
|
|
||||||
$stmt->execute([$fullName, $email, $hashedPassword, 'atleta', $birthDate]);
|
|
||||||
|
|
||||||
$_SESSION['success_message'] = 'Cadastro realizado com sucesso! Você já pode fazer o login.';
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$_SESSION['error_message'] = 'Erro no banco de dados. Tente novamente mais tarde.';
|
|
||||||
// In a real app, you would log this error: error_log($e->getMessage());
|
|
||||||
header('Location: index.php');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
118
tournaments.php
118
tournaments.php
@ -1,118 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once 'auth_check.php'; // Protect this page
|
|
||||||
require_once 'db/config.php'; // Database connection
|
|
||||||
|
|
||||||
// Fetch all tournaments from the database
|
|
||||||
$tournaments = [];
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$stmt = $pdo->query('SELECT id, name, description, created_at FROM tournaments ORDER BY created_at DESC');
|
|
||||||
$tournaments = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$error_message = "Database error: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="pt-BR">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Gerenciar Torneios - PicklePRO</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
||||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<!-- Header -->
|
|
||||||
<header class="navbar navbar-expand-lg navbar-light bg-white">
|
|
||||||
<div class="container">
|
|
||||||
<a class="navbar-brand" href="index.php">
|
|
||||||
<img src="https://www.svgrepo.com/show/494426/pickleball-paddle.svg" alt="PicklePRO Logo" width="30" height="30" class="d-inline-block align-text-top me-2">
|
|
||||||
Pickle<span class="text-primary">PRO</span>
|
|
||||||
</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
|
||||||
<ul class="navbar-nav mx-auto">
|
|
||||||
<li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Torneios</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="#">Reservas</a></li>
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="admin.php">Administrativo</a>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
</ul>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<?php if (isset($_SESSION['user_id'])): ?>
|
|
||||||
<span class="navbar-text me-3">
|
|
||||||
Olá, <?php echo htmlspecialchars($_SESSION['username']); ?>
|
|
||||||
</span>
|
|
||||||
<a href="logout.php" class="btn btn-outline-primary">Sair</a>
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="/login.php" class="btn btn-link text-decoration-none me-2">Entrar</a>
|
|
||||||
<a href="#" class="btn btn-primary">Cadastrar</a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- Main Content -->
|
|
||||||
<main class="container my-5">
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
||||||
<h1 class="display-6 fw-bold">Gerenciar Torneios</h1>
|
|
||||||
<a href="add_tournament.php" class="btn btn-primary"><i class="bi bi-plus-circle me-2"></i>Cadastrar Novo Torneio</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if (isset($error_message)): ?>
|
|
||||||
<div class="alert alert-danger"><?php echo $error_message; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
|
||||||
<?php if (empty($tournaments) && !isset($error_message)): ?>
|
|
||||||
<div class="text-center p-4">
|
|
||||||
<p>Nenhum torneio cadastrado ainda.</p>
|
|
||||||
</div>
|
|
||||||
<?php else:
|
|
||||||
if (!empty($tournaments)) : ?>
|
|
||||||
<table class="table table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Nome</th>
|
|
||||||
<th>Descrição</th>
|
|
||||||
<th>Data de Criação</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($tournaments as $tournament): ?>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo htmlspecialchars($tournament['name']); ?></td>
|
|
||||||
<td><?php echo htmlspecialchars($tournament['description']); ?></td>
|
|
||||||
<td><?php echo date("d/m/Y H:i", strtotime($tournament['created_at'])); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<?php endif; endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mt-4">
|
|
||||||
<a href="admin.php" class="btn btn-secondary">Voltar ao Painel</a>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<!-- Footer -->
|
|
||||||
<footer class="footer mt-auto py-4 bg-light">
|
|
||||||
<div class="container text-center">
|
|
||||||
<p class="mb-1 text-muted small">© <?php echo date("Y"); ?> PicklePRO. Todos os direitos reservados.</p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user