<!DOCTYPE html>
<html lang="it">
<head>
<link rel="icon" href="/icona.ico" />
<meta charset="UTF-8">
<title>Selezione Rosa</title>
<style>
body {
background-image: URL("Sfondo4.jpg");
background-size: cover;
background-repeat: no-repeat;
background-color: white;
}
table.a {
border: mediumsolid#7b7b7b;
border-collapse: collapse;
table-layout: auto;
empty-cells: show;
margin: auto;
min-width: 300px;
}
th, td {
border: mediumsolid#7b7b7b;
font-family: Arial,"Times New Roman",sans-serif;
font-size: 20px;
margin: auto;
text-align: center;
min-width: 100px;
width: 100px;
}
h1 {
text-align: center;
}
h3.c {
color: red;
}
</style>
</head>
<body>
<div>
<?php
$connection = new mysqli("localhost", "root", "", "my_dinasty");
if ($connection->connect_error) {
die("Connessione al database fallita: " . $connection->connect_error);
}
$name = $_POST['Rosa'] ?? '';
echo '<table class="a">';
date_default_timezone_set('Europe/Rome');
echo "<tr><td><h3>Sono le ore " . date("H:i:s") . " del giorno " . date("d/m/Y") . " </h3></td></tr>";
echo "<tr><td><h1>Club: " . htmlspecialchars($name) . "</h1></td></tr>";
echo "</table>";
?>
<br> <br> <br>
<table class="a">
<tr>
<th>Home Page</th>
<th>Nuova Selezione</th>
<th>Gestione Leghe Fantacalcio</th>
</tr>
<tr>
<td><button onclick="location.href = 'index.php'">Ritorno alla Home
Page!</button></td>
<td><button onclick="location.href = 'rose.php'">Nuova Selezione!</button></td>
<td><button
onclick="location.href = 'https://leghe.fantacalcio.it/dinasty'">
Login Fantacalcio.it !</button></td>
</tr>
</table>
<br>
<?php
$query1 = "SELECT sum(Stipendio_Quota) as Stipendio, sum(Costo) as Costo, sum(Indebitamento) as Indebitamento FROM Rose WHERE Fanta_Squadra = '$name' order by Calciatore";
$totale = $connection->query($query1);
$row1 = $totale->fetch_assoc();
$query2 = "SELECT * FROM Squadra WHERE nome_squadra = '$name'";
$albo = $connection->query($query2);
if (! $albo) {
die("Errore nella query $query2: " . $connection->error);
} else {
echo "<br>";
echo '<table class="a">';
echo "<tr><th>Nome Squadra</th><th>Crediti</th><th>Cognome</th><th>Nome</th><th>Cognome</th><th>Nome</th><th>Primo Posto</th><th>Secondo Posto</th><th>Terzo Posto</th><th>Quarto Posto</th><th>Storia</th></tr>";
while ($row = $albo->fetch_array()) {
echo "<tr><td>" . $row['nome_squadra'] . "</td><td>" . $row['Crediti'] . "</td><td>" . $row['nome1'] . "</td><td>" . $row['cognome1'] . "</td><td>" . $row['nome2'] . "</td><td>" . $row['cognome2'] . "</td><td>" . $row['primo_posto'] . "</td><td>" . $row['secondo_posto'] . "</td><td>" . $row['terzo_posto'] . "</td><td>" . $row['quarto_posto'] . "</td><td>" . $row['storia'] . "</td></tr>";
}
echo "</table>";
echo "<br>";
}
$query = "SELECT * FROM Rose WHERE Academy = '0' and Fanta_Squadra = '$name' order by Ruolo_Classico";
$result = $connection->query($query);
if (! $result) {
die("Errore nella query $query: " . mysql_error());
} else {
echo '<table class="a">';
echo "<tr><th>Fanta Squadra</th><th>Totale Stipendio</th><th>Valore Rosa</th><th>Totale Indebitamento</th></tr>";
echo "<tr><td>" . $name . "</td><td>" . $row1['Stipendio'] . "</td><td>" . $row1['Costo'] . "</td><td>" . $row1['Indebitamento'] . "</td></tr>";
echo "</table>";
echo "<br>";
echo "<table class='a'>";
echo "<tr><th>N</th><th>Ruolo</th><th>Calciatore</th><th>Squadra</th><th>Costo</th><th>Indebitamento Totale</th><th>Gennaio 2024</th><th>Giugno 2024</th><th>Gennaio 2025</th><th>Giugno 2025</th><th>Proprietario</th><th>Prestito</th><th>In prestito da</th><th>Anni contratto del prestito</th><th>Eventuali Clausole</th></tr>";
$index = 0;

Rispondi quotando