111 lines
5.6 KiB
PHP
111 lines
5.6 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Football Match Analysis</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body>
|
|
<header class="bg-primary text-white text-center py-3">
|
|
<h1><i class="fas fa-futbol"></i> Football Match Analysis</h1>
|
|
</header>
|
|
|
|
<main class="container my-5">
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Análise de Partida</h5>
|
|
<form id="analysis-form">
|
|
<div class="mb-3">
|
|
<label for="home-team" class="form-label">Time da Casa</label>
|
|
<input type="text" class="form-control" id="home-team" placeholder="Digite o nome do time da casa" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="away-team" class="form-label">Time Visitante</label>
|
|
<input type="text" class="form-control" id="away-team" placeholder="Digite o nome do time visitante" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary w-100">Analisar Partida</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="analysis-result" class="mt-4" style="display: none;">
|
|
<div class="d-flex justify-content-center">
|
|
<div class="spinner-border text-primary" role="status">
|
|
<span class="visually-hidden">Loading...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm mt-4">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Próximas Partidas e Odds (Premier League)</h5>
|
|
<?php
|
|
require_once 'includes/odds_api.php';
|
|
$odds_data = get_odds('soccer_epl', 'uk', 'h2h');
|
|
|
|
if ($odds_data && !empty($odds_data)) {
|
|
?>
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Partida</th>
|
|
<th>Casa</th>
|
|
<th>Empate</th>
|
|
<th>Fora</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($odds_data as $match): ?>
|
|
<tr>
|
|
<td><?php echo htmlspecialchars($match['home_team']) . ' vs ' . htmlspecialchars($match['away_team']); ?></td>
|
|
<?php
|
|
$home_odd = 'N/A';
|
|
$draw_odd = 'N/A';
|
|
$away_odd = 'N/A';
|
|
|
|
// Find the bookmaker (assuming there is at least one)
|
|
if (!empty($match['bookmakers'])) {
|
|
$bookmaker = $match['bookmakers'][0]; // Take the first bookmaker
|
|
foreach ($bookmaker['markets'] as $market) {
|
|
if ($market['key'] === 'h2h') {
|
|
foreach ($market['outcomes'] as $outcome) {
|
|
if ($outcome['name'] === $match['home_team']) {
|
|
$home_odd = htmlspecialchars($outcome['price']);
|
|
} elseif ($outcome['name'] === $match['away_team']) {
|
|
$away_odd = htmlspecialchars($outcome['price']);
|
|
} elseif ($outcome['name'] === 'Draw') {
|
|
$draw_odd = htmlspecialchars($outcome['price']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
<td><?php echo $home_odd; ?></td>
|
|
<td><?php echo $draw_odd; ?></td>
|
|
<td><?php echo $away_odd; ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php
|
|
} else {
|
|
echo '<div class="alert alert-warning" role="alert">Não foi possível buscar as odds no momento. Verifique sua chave de API ou tente novamente mais tarde.</div>';
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="text-center py-3 bg-light">
|
|
<p class="mb-0">© 2025 Football Match Analysis. All Rights Reserved.</p>
|
|
<p class="mb-0 fst-italic">Note: Odds and bookmakers are estimates. Always consult the betting sites for real-time values.</p>
|
|
</footer>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
</body>
|
|
</html>
|