new commit and update

This commit is contained in:
2025-01-25 21:37:42 +01:00
parent 5d64b2ed06
commit 2045c5e5a7
20 changed files with 733 additions and 175 deletions
+4 -3
View File
@@ -7,13 +7,13 @@ error_reporting(E_ALL);
$conn = new mysqli($servername, $username, $password, $database);
// Recupera l'id utente loggato
$iduserlogin = $_SESSION['iduserlogin'];
//echo $iduserlogin;
// Recupera l'id della casa dall'URL
$idhome = isset($_GET['idhome']) ? intval($_GET['idhome']) : 0;
// Recupera lo sharing_type e le sezioni condivise per questa casa
$querySharing = $conn->prepare("
SELECT sharing_type, shared_sections
SELECT sharing_type, shared_sections , iduser
FROM home_sharing
WHERE idhome = ? AND idshareduser = ? AND status = 'accepted'
");
@@ -29,6 +29,7 @@ if (!$sharingData) {
// Ottieni i dati di condivisione
$sharingType = $sharingData['sharing_type'];
$sharingIdUser = $sharingData['iduser'];
$sharedSections = json_decode($sharingData['shared_sections'], true); // Decodifica il JSON
?>
<?php
@@ -37,7 +38,7 @@ $sharedSections = json_decode($sharingData['shared_sections'], true); // Decodif
// Recupera i dettagli della casa
$queryHome = $conn->prepare("SELECT * FROM home WHERE idhome = ? AND iduser = ?");
$queryHome->bind_param('ii', $idhome, $iduserlogin);
$queryHome->bind_param('ii', $idhome, $sharingIdUser);
$queryHome->execute();
$resultHome = $queryHome->get_result();
$homeData = $resultHome->fetch_assoc();