football analysis
This commit is contained in:
parent
1d590eb942
commit
9f998b1307
@ -1,29 +1,101 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Open+Sans&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--primary-color: #0d6efd;
|
||||||
|
--secondary-color: #6c757d;
|
||||||
|
--light-color: #f8f9fa;
|
||||||
|
--dark-color: #212529;
|
||||||
|
--body-gradient-start: #e0e5ff;
|
||||||
|
--body-gradient-end: #d9e2f3;
|
||||||
|
--card-bg-color: rgba(255, 255, 255, 0.75);
|
||||||
|
--card-bg-color-odd: rgba(233, 236, 239, 0.75);
|
||||||
|
--card-bg-color-even: rgba(204, 219, 255, 0.75);
|
||||||
|
--card-border-color: rgba(255, 255, 255, 0.2);
|
||||||
|
--shadow-color: rgba(0, 0, 0, 0.1);
|
||||||
|
--font-family: 'Poppins', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: #f8f9fa;
|
font-family: var(--font-family);
|
||||||
font-family: 'Open Sans', sans-serif;
|
background: linear-gradient(135deg, var(--body-gradient-start), var(--body-gradient-end));
|
||||||
|
color: var(--dark-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h5 {
|
header.bg-primary {
|
||||||
font-family: 'Roboto', sans-serif;
|
background: linear-gradient(135deg, #29375a 0%, #1a233f 100%) !important;
|
||||||
|
border-bottom: 3px solid var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
header h1 {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
|
||||||
|
|
||||||
.btn-primary {
|
|
||||||
background-color: #1a73e8;
|
|
||||||
border-color: #1a73e8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary:hover {
|
|
||||||
background-color: #1765c4;
|
|
||||||
border-color: #1765c4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
border-radius: 0.5rem;
|
border: 1px solid var(--card-border-color);
|
||||||
|
border-radius: 1rem;
|
||||||
|
box-shadow: 0 8px 32px 0 var(--shadow-color);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
|
-webkit-backdrop-filter: blur(12px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control, .btn {
|
#odds-section .card:nth-child(odd) {
|
||||||
border-radius: 0.25rem;
|
background-color: var(--card-bg-color-odd);
|
||||||
|
}
|
||||||
|
|
||||||
|
#odds-section .card:nth-child(even) {
|
||||||
|
background-color: var(--card-bg-color-even);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
border-bottom: 1px solid var(--card-border-color);
|
||||||
|
font-weight: 600 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
box-shadow: 0 4px 15px 0 rgba(13, 110, 253, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 6px 20px 0 rgba(13, 110, 253, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-striped > tbody > tr:nth-of-type(odd) > * {
|
||||||
|
background-color: rgba(0, 0, 0, 0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-light > thead > tr > th {
|
||||||
|
background-color: rgba(255,255,255,0.4);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--dark-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.bg-secondary {
|
||||||
|
background-color: #4a5568 !important;
|
||||||
|
font-size: 0.9em;
|
||||||
|
padding: 0.5em 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer.bg-light {
|
||||||
|
background-color: #29375a !important;
|
||||||
|
color: var(--light-color);
|
||||||
|
padding-top: 1.5rem !important;
|
||||||
|
padding-bottom: 1.5rem !important;
|
||||||
|
margin-top: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer p {
|
||||||
|
color: #a0aec0;
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
function get_odds($sport = 'soccer_epl', $regions = 'uk', $markets = 'h2h') {
|
function get_odds($sport = 'soccer_epl', $regions = 'uk,eu', $markets = 'h2h') {
|
||||||
$apiKey = '308deae256c9099c52e22bb4933a12b6';
|
$apiKey = '308deae256c9099c52e22bb4933a12b6';
|
||||||
$url = "https://api.the-odds-api.com/v4/sports/{$sport}/odds/?regions={$regions}&markets={$markets}&apiKey={$apiKey}";
|
$url = "https://api.the-odds-api.com/v4/sports/{$sport}/odds/?regions={$regions}&markets={$markets}&apiKey={$apiKey}";
|
||||||
|
|
||||||
|
|||||||
52
index.php
52
index.php
@ -40,35 +40,42 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow-sm mt-4">
|
<div class="card shadow-sm mt-4">
|
||||||
<div class="card-body">
|
<div class="card-body" id="odds-section">
|
||||||
<h5 class="card-title">Próximas Partidas e Odds (Premier League)</h5>
|
<h5 class="card-title">Próximas Partidas e Odds (Premier League)</h5>
|
||||||
<?php
|
<?php
|
||||||
require_once 'includes/odds_api.php';
|
require_once 'includes/odds_api.php';
|
||||||
$odds_data = get_odds('soccer_epl', 'uk', 'h2h');
|
$odds_data = get_odds('soccer_epl', 'uk', 'h2h');
|
||||||
|
|
||||||
if ($odds_data && !empty($odds_data)) {
|
if ($odds_data && !empty($odds_data)) {
|
||||||
|
// Set timezone to Brazil
|
||||||
|
date_default_timezone_set('America/Sao_Paulo');
|
||||||
|
|
||||||
|
foreach ($odds_data as $match) {
|
||||||
|
$match_time = strtotime($match['commence_time']);
|
||||||
?>
|
?>
|
||||||
<table class="table table-striped">
|
<div class="card mb-3">
|
||||||
<thead>
|
<div class="card-header fw-bold">
|
||||||
|
<?php echo htmlspecialchars($match['home_team']) . ' vs ' . htmlspecialchars($match['away_team']); ?>
|
||||||
|
<span class="float-end badge bg-secondary"><?php echo date('d/m/Y H:i', $match_time); ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<table class="table table-striped table-sm mb-0">
|
||||||
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Partida</th>
|
<th>Casa de Apostas</th>
|
||||||
<th>Casa</th>
|
<th class="text-center">1 (Casa)</th>
|
||||||
<th>Empate</th>
|
<th class="text-center">X (Empate)</th>
|
||||||
<th>Fora</th>
|
<th class="text-center">2 (Fora)</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($odds_data as $match): ?>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo htmlspecialchars($match['home_team']) . ' vs ' . htmlspecialchars($match['away_team']); ?></td>
|
|
||||||
<?php
|
<?php
|
||||||
|
if (!empty($match['bookmakers'])) {
|
||||||
|
foreach ($match['bookmakers'] as $bookmaker) {
|
||||||
$home_odd = 'N/A';
|
$home_odd = 'N/A';
|
||||||
$draw_odd = 'N/A';
|
$draw_odd = 'N/A';
|
||||||
$away_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) {
|
foreach ($bookmaker['markets'] as $market) {
|
||||||
if ($market['key'] === 'h2h') {
|
if ($market['key'] === 'h2h') {
|
||||||
foreach ($market['outcomes'] as $outcome) {
|
foreach ($market['outcomes'] as $outcome) {
|
||||||
@ -82,16 +89,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo htmlspecialchars($bookmaker['title']); ?></td>
|
||||||
|
<td class="text-center"><?php echo $home_odd; ?></td>
|
||||||
|
<td class="text-center"><?php echo $draw_odd; ?></td>
|
||||||
|
<td class="text-center"><?php echo $away_odd; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<tr><td colspan="4" class="text-center">Nenhuma casa de aposta disponível para esta partida.</td></tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td><?php echo $home_odd; ?></td>
|
|
||||||
<td><?php echo $draw_odd; ?></td>
|
|
||||||
<td><?php echo $away_odd; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
} else {
|
} 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>';
|
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>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user