changed assegna proprietario
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
include('include/headscript.php');
|
||||
$conn = new mysqli($servername, $username, $password, $database);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die("Errore di connessione: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
$idhome = isset($_GET['idhome']) ? intval($_GET['idhome']) : 0;
|
||||
|
||||
$queryOwners = $conn->prepare("
|
||||
SELECT
|
||||
po.owner_id,
|
||||
po.first_name,
|
||||
po.last_name,
|
||||
po.company_name,
|
||||
po.tax_code,
|
||||
po.email,
|
||||
ho.ownership_percentage,
|
||||
ho.notes
|
||||
FROM
|
||||
home_owners AS ho
|
||||
INNER JOIN
|
||||
property_owners AS po ON ho.owner_id = po.owner_id
|
||||
WHERE
|
||||
ho.home_id = ?
|
||||
");
|
||||
$queryOwners->bind_param('i', $idhome);
|
||||
$queryOwners->execute();
|
||||
$resultOwners = $queryOwners->get_result();
|
||||
|
||||
$totalPercentage = 0;
|
||||
|
||||
echo '<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>Codice Fiscale</th>
|
||||
<th>%</th>
|
||||
<th>Note</th>
|
||||
<th>Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
while ($owner = $resultOwners->fetch_assoc()) {
|
||||
$totalPercentage += $owner['ownership_percentage'];
|
||||
echo "<tr>
|
||||
<td>" . htmlspecialchars($owner['first_name'] . ' ' . $owner['last_name']) . "</td>
|
||||
<td>" . htmlspecialchars($owner['tax_code']) . "</td>
|
||||
<td class='ownership-percentage'>" . htmlspecialchars($owner['ownership_percentage']) . "</td>
|
||||
<td>" . htmlspecialchars($owner['notes']) . "</td>
|
||||
<td>
|
||||
<button class='btn btn-danger btn-sm remove-owner-btn' data-id='" . $owner['owner_id'] . "'>
|
||||
<i class='fas fa-trash-alt'></i> Rimuovi
|
||||
</button>
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
echo '</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2"><strong>Totale % Proprietà:</strong></td>
|
||||
<td id="totalOwnership" class="font-weight-bold text-center">' . $totalPercentage . '%</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>';
|
||||
|
||||
$queryOwners->close();
|
||||
$conn->close();
|
||||
Reference in New Issue
Block a user