diff --git a/composer.json b/composer.json index b1f6636..bdb9ccc 100644 --- a/composer.json +++ b/composer.json @@ -37,15 +37,16 @@ "laravel/framework": "^10.0", "laravel/sanctum": "^3.2", "laravel/socialite": "^5.0", + "laravel/tinker": "^2.7", "laravel/ui": "^4.0", "laravelcollective/html": "^6.3", + "phpmailer/phpmailer": "^6.9", "proengsoft/laravel-jsvalidation": "^4.0.0", "spatie/laravel-query-builder": "^5.0", "vanguardapp/activity-log": "^5.0", "vanguardapp/announcements": "^5.0", "vanguardapp/plugins": "^5.0", - "webpatser/laravel-countries": "dev-master", - "laravel/tinker": "^2.7" + "webpatser/laravel-countries": "dev-master" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.5", diff --git a/composer.lock b/composer.lock index 14be15f..b67297b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1446e19ccb5a35288b8f09136f42c7f1", + "content-hash": "4aa12c72336d4694139400139378d75f", "packages": [ { "name": "akaunting/laravel-setting", @@ -2956,6 +2956,87 @@ ], "time": "2023-02-08T01:06:31+00:00" }, + { + "name": "phpmailer/phpmailer", + "version": "v6.9.3", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "2f5c94fe7493efc213f643c23b1b1c249d40f47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/2f5c94fe7493efc213f643c23b1b1c249d40f47e", + "reference": "2f5c94fe7493efc213f643c23b1b1c249d40f47e", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.2", + "yoast/phpunit-polyfills": "^1.0.4" + }, + "suggest": { + "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.3" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "time": "2024-11-24T18:04:13+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.1", @@ -10110,5 +10191,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/public/userportal/add-document.php b/public/userportal/add-document.php new file mode 100644 index 0000000..6ccdabf --- /dev/null +++ b/public/userportal/add-document.php @@ -0,0 +1,59 @@ +connect_error) { + die("Errore di connessione: " . $conn->connect_error); +} + +// Verifica se la richiesta è POST +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + // Recupera i dati dal form + $document_name = $conn->real_escape_string($_POST['document_name']); + $page_id = isset($_POST['page_id']) ? (int)$_POST['page_id'] : null; + $idsections = isset($_POST['idsections']) ? (int)$_POST['idsections'] : null; + $max_documents = isset($_POST['max_documents']) ? (int)$_POST['max_documents'] : 0; + $is_required = isset($_POST['is_required']) ? (int)$_POST['is_required'] : 0; + $notes = !empty($_POST['notes']) ? $conn->real_escape_string($_POST['notes']) : null; + + // Prepara la query di inserimento + $query = " + INSERT INTO documents (document_name, page_id, idsections, max_documents, is_required, notes) + VALUES (?, ?, ?, ?, ?, ?) + "; + + $stmt = $conn->prepare($query); + if ($stmt === false) { + die("Errore nella preparazione della query: " . $conn->error); + } + + // Associa i parametri alla query + $stmt->bind_param('siiiss', $document_name, $page_id, $idsections, $max_documents, $is_required, $notes); + + // Esegue la query e controlla il risultato + if ($stmt->execute()) { + // Reindirizza con messaggio di successo + header("Location: documents-settings.php?success=1"); + exit(); + } else { + // Reindirizza con messaggio di errore + header("Location: documents-settings.php?error=1"); + exit(); + } + + $stmt->close(); +} else { + // Metodo non consentito + header("HTTP/1.1 405 Method Not Allowed"); + echo "Metodo non consentito."; + exit(); +} + +$conn->close(); diff --git a/public/userportal/add-page.php b/public/userportal/add-page.php new file mode 100644 index 0000000..a055140 --- /dev/null +++ b/public/userportal/add-page.php @@ -0,0 +1,25 @@ +connect_error) { + die("Errore di connessione: " . $conn->connect_error); +} + +// Recupera i dati dal form +$namepages = $_POST['namepages']; +$slug = $_POST['slug']; +$descriptionpages = $_POST['descriptionpages']; + +// Inserisce la nuova pagina nel database +$query = $conn->prepare("INSERT INTO pages (namepages, slug, descriptionpages) VALUES (?, ?, ?)"); +$query->bind_param('sss', $namepages, $slug, $descriptionpages); + +if ($query->execute()) { + header("Location: page-settings.php?success=1"); +} else { + header("Location: page-settings.php?error=1"); +} + +$query->close(); +$conn->close(); diff --git a/public/userportal/add-role.php b/public/userportal/add-role.php new file mode 100644 index 0000000..f443f98 --- /dev/null +++ b/public/userportal/add-role.php @@ -0,0 +1,39 @@ +connect_error) { + die("Errore di connessione: " . $conn->connect_error); +} + +// Controlla il metodo della richiesta +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + // Recupera i dati dal form + $role_name = trim($_POST['role_name']); + $description = trim($_POST['description']); + $permissions = trim($_POST['permissions']); + + + + // Prepara e esegue la query + $stmt = $conn->prepare("INSERT INTO sharing_roles (`role_name`, `description`, `permissions`) VALUES (?, ?, ?)"); + if ($stmt) { + $stmt->bind_param('sss', $role_name, $description, $permissions); + if ($stmt->execute()) { + header("Location: sharing-roles.php?success=1"); + exit; + } else { + die("Errore di esecuzione: " . $stmt->error); + } + $stmt->close(); + } else { + die("Errore nella preparazione della query: " . $conn->error); + } +} +$conn->close(); diff --git a/public/userportal/add-section.php b/public/userportal/add-section.php new file mode 100644 index 0000000..533f31e --- /dev/null +++ b/public/userportal/add-section.php @@ -0,0 +1,52 @@ +connect_error) { + die("Errore di connessione: " . $conn->connect_error); +} + +// Controlla se il metodo della richiesta è POST +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + // Recupera i dati dal form + $section_name = $conn->real_escape_string($_POST['section_name']); + $description = $conn->real_escape_string($_POST['description']); + + // Prepara la query per l'inserimento + $query = "INSERT INTO sections (section_name, description) VALUES (?, ?)"; + $stmt = $conn->prepare($query); + + if ($stmt === false) { + die("Errore nella preparazione della query: " . $conn->error); + } + + // Associa i parametri alla query + $stmt->bind_param('ss', $section_name, $description); + + // Esegue la query + if ($stmt->execute()) { + // Reindirizza alla pagina sections.php con un messaggio di successo + header("Location: sections.php?success=1"); + exit(); + } else { + // Reindirizza alla pagina sections.php con un messaggio di errore + header("Location: sections.php?error=1"); + exit(); + } + + $stmt->close(); +} else { + // Metodo non consentito + header("HTTP/1.1 405 Method Not Allowed"); + echo "Metodo non consentito."; + exit(); +} + +$conn->close(); diff --git a/public/userportal/add-sharing.php b/public/userportal/add-sharing.php new file mode 100644 index 0000000..9cfb0c9 --- /dev/null +++ b/public/userportal/add-sharing.php @@ -0,0 +1,187 @@ + +connect_error) { + die("Errore di connessione: " . $conn->connect_error); +} + +// Recupera idhome +$idhome = isset($_GET['idhome']) ? (int)$_GET['idhome'] : 0; + +// Recupera le sezioni dalla tabella 'sections' +$querySections = "SELECT idsections, section_name FROM sections ORDER BY section_name ASC"; +$resultSections = $conn->query($querySections); +$sections = []; +if ($resultSections->num_rows > 0) { + while ($row = $resultSections->fetch_assoc()) { + $sections[] = $row; + } +} + +// Recupera tutti i ruoli per la dropdown +$queryRoles = "SELECT idrole, role_name FROM sharing_roles"; +$resultRoles = $conn->query($queryRoles); +$roles = []; +if ($resultRoles->num_rows > 0) { + while ($row = $resultRoles->fetch_assoc()) { + $roles[] = $row; + } +} +?> + + + +
+ + + +Immobili inseriti
+Proprietari registrati
+Documenti caricati
+Indirizzo:
- - (Obbligatorio)"; ?> - 0) echo " - Max: " . $document['max_documents']; ?> -
+