379 lines
12 KiB
PHP
379 lines
12 KiB
PHP
<?php require_once('include/headscript.php'); ?>
|
|
<?php // optionquery
|
|
$optionquery = new WA_MySQLi_RS("optionquery",$bkngstm,0);
|
|
$optionquery->setQuery("SELECT * FROM option");
|
|
$optionquery->execute();
|
|
?>
|
|
|
|
<?php
|
|
// Crea la connessione al database
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
// Verifica se il modulo è stato inviato
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
// Recupera i dati dal modulo
|
|
$iduserlogin = $_POST["iduser"];
|
|
$kind = $_POST["kind"];
|
|
$message = $_POST["message"];
|
|
$emailNotifications = isset($_POST["emailNotifications"]) ? $_POST["emailNotifications"] : 'N';
|
|
$orderNotifications = isset($_POST["orderNotifications"]) ? $_POST["orderNotifications"] : 'N';
|
|
|
|
// Aggiorna i dati nella tabella auth_users
|
|
$sqlUpdate = "UPDATE auth_users SET classnotification = '$emailNotifications', ordernotification = '$orderNotifications' WHERE id = '$iduserlogin'";
|
|
|
|
if ($conn->query($sqlUpdate) === TRUE) {
|
|
// L'aggiornamento è stato completato con successo
|
|
// Puoi aggiungere un messaggio di successo qui se lo desideri
|
|
} else {
|
|
// Gestisci l'errore in caso di errore nell'aggiornamento
|
|
echo "Errore nell'aggiornamento dei dati: " . $conn->error;
|
|
}
|
|
|
|
// Chiudi la connessione al database (assicurati di chiuderla correttamente)
|
|
$conn->close();
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
$iduser=$iduserlogin;
|
|
// Crea la connessione al database
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
|
|
// Verifica la connessione
|
|
if ($conn->connect_error) {
|
|
die("Connessione al database fallita: " . $conn->connect_error);
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ottieni i dati dal database in base all'id dell'utente
|
|
$sqldata = "SELECT * FROM auth_users WHERE id = '$iduserlogin'";
|
|
$resultdata = $conn->query($sqldata);
|
|
|
|
if ($resultdata->num_rows > 0) {
|
|
$rowdata = $resultdata->fetch_assoc();
|
|
$notificationmail=$rowdata['classnotification'];
|
|
$notificationorder = $rowdata['ordernotification'];
|
|
|
|
}
|
|
|
|
?>
|
|
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
|
<title>YogiBook - Prenotazioni YogaSoul</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta content="YogiBook - Prenotazione facile YogaSOul" name="description" />
|
|
<meta content="Advanced Creative Solutions" name="author" />
|
|
<!-- App favicon -->
|
|
<link rel="shortcut icon" href="assets/images/favicon.ico">
|
|
|
|
<!-- Bootstrap Css -->
|
|
<link href="assets/css/bootstrap.min.css" id="bootstrap-style" rel="stylesheet" type="text/css" />
|
|
<!-- Icons Css -->
|
|
<link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
|
<!-- App Css-->
|
|
<link href="assets/css/app.min.css" id="app-style" rel="stylesheet" type="text/css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
|
|
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
$(function() {
|
|
$("#expiryDate").datepicker({ dateFormat: "yy-mm-dd" });
|
|
});
|
|
</script>
|
|
<style>
|
|
.custom-card {
|
|
margin: 10px auto;
|
|
display: flex;
|
|
width: 90%;
|
|
max-width: 700px;
|
|
background-color: white;
|
|
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
cursor: pointer;
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.custom-card:hover {
|
|
transform: translateY(-5px);
|
|
}
|
|
|
|
.custom-date-box {
|
|
flex: 1;
|
|
background-color: red;
|
|
color: white;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 0;
|
|
font-size: 60px;
|
|
font-weight: bold;
|
|
border-top-left-radius: 8px;
|
|
border-bottom-left-radius: 8px;
|
|
}
|
|
|
|
.custom-day {
|
|
line-height: 1;
|
|
}
|
|
|
|
.custom-month {
|
|
font-size: 28px;
|
|
}
|
|
|
|
.custom-event-details {
|
|
flex: 2;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 10px 20px;
|
|
background-color: lightblue;
|
|
}
|
|
|
|
.custom-heading {
|
|
margin-top: 0;
|
|
font-size: 24px;
|
|
}
|
|
|
|
.custom-paragraph {
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.custom-actions {
|
|
display: none;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.custom-card.expanded .custom-actions {
|
|
display: flex;
|
|
}
|
|
|
|
.custom-action-button {
|
|
background-color: #f0f0f0;
|
|
border: none;
|
|
padding: 8px 12px;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.custom-action-button:hover {
|
|
background-color: #e0e0e0;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.custom-card {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.custom-date-box, .custom-event-details {
|
|
width: 100%;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.custom-event-time {
|
|
font-size: 24px;
|
|
}
|
|
}
|
|
</style>
|
|
<script>
|
|
function confirmDelete(id, deletePageUrl) {
|
|
Swal.fire({
|
|
title: "Sei sicuro?",
|
|
text: "Questa prenotazione verrà cancellata definitivamente! Ricordati poi di riprogrammare la tua lezione!",
|
|
icon: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonColor: "#d33",
|
|
cancelButtonColor: "#3085d6",
|
|
confirmButtonText: "Sì, cancella!",
|
|
cancelButtonText: "Annulla"
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
// Reindirizza direttamente alla pagina di cancellazione con l'ID come parametro.
|
|
window.location.href = `deleteclass.php?id=${id}`;
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<body>
|
|
|
|
<!-- <body data-layout="horizontal"> -->
|
|
|
|
<!-- Begin page -->
|
|
<div id="layout-wrapper">
|
|
|
|
<!-- Top Bar -->
|
|
<header id="page-topbar" class="isvertical-topbar">
|
|
<div class="navbar-header">
|
|
<div class="d-flex">
|
|
<!-- LOGO -->
|
|
<?php include('include/logoarea.php'); ?>
|
|
|
|
<button type="button" class="btn btn-sm px-3 font-size-24 header-item waves-effect vertical-menu-btn">
|
|
<i class="bx bx-menu align-middle"></i>
|
|
</button>
|
|
|
|
<!-- start page title -->
|
|
<div class="page-title-box align-self-center d-none d-md-block">
|
|
<h4 class="page-title mb-0">Notifiche</h4>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
</div>
|
|
|
|
<div class="d-flex">
|
|
|
|
<?php include('include/languageselection.php'); ?>
|
|
|
|
<div class="dropdown d-inline-block">
|
|
<button type="button" class="btn header-item noti-icon"
|
|
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<i class="bx bx-search icon-sm align-middle"></i>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-end p-0">
|
|
<form class="p-2">
|
|
<div class="search-box">
|
|
<div class="position-relative">
|
|
<input type="text" class="form-control rounded bg-light border-0" placeholder="Search...">
|
|
<i class="bx bx-search search-icon"></i>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<?php include('include/profiletopbar.php'); ?>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<?php include('include/sidebar.php'); ?>
|
|
|
|
<header class="ishorizontal-topbar">
|
|
<div class="navbar-header">
|
|
<div class="d-flex">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="topnav">
|
|
<div class="container-fluid">
|
|
<nav class="navbar navbar-light navbar-expand-lg topnav-menu">
|
|
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- ============================================================== -->
|
|
<!-- Start right Content here -->
|
|
<!-- ============================================================== -->
|
|
<div class="main-content">
|
|
<div class="page-content">
|
|
<div class="container-fluid">
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<?php if (isset($message)) { ?>
|
|
<div class="alert alert-success" role="alert">
|
|
Preferenze aggiornate con successo
|
|
</div><?php } ?>
|
|
<p>Di seguito puoi modificare le preferenze di notifiche del sistema prenotazione YogiBook</p>
|
|
<div class="table-responsive">
|
|
|
|
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
|
<div class="form-check form-switch mb-3" dir="ltr">
|
|
<input type="checkbox" class="form-check-input" id="emailNotifications" name="emailNotifications" value="Y" <?php echo $notificationmail === 'Y' ? 'checked' : ''; ?>>
|
|
<label class="form-check-label" for="emailNotifications">Notifiche prossime lezioni</label>
|
|
<p>Notifiche di reminder delle lezioni che hai prenotato</p>
|
|
</div>
|
|
<div class="form-check form-switch mb-3" dir="ltr">
|
|
<input type="checkbox" class="form-check-input" id="orderNotifications" name="orderNotifications" value="Y" <?php echo $notificationorder === 'Y' ? 'checked' : ''; ?>>
|
|
<label class="form-check-label" for="orderNotifications">Notifiche ordini inseriti</label>
|
|
<p>Notifiche di reminder degli ordini che hai effettuato</p>
|
|
</div>
|
|
|
|
<input type="hidden" class="form-control" name="iduser" value="<?php echo $iduserlogin; ?>">
|
|
<input type="hidden" class="form-control" name="kind" value="insert">
|
|
<input type="hidden" class="form-control" name="message" value="Y">
|
|
|
|
<input type="submit" class="btn btn-primary w-md" name="submit" value="Aggiorna">
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<!-- container-fluid -->
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php include('include/footer.php'); ?>
|
|
</div>
|
|
<!-- end main content-->
|
|
|
|
</div>
|
|
<!-- END layout-wrapper -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- JAVASCRIPT -->
|
|
<script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
|
|
<script src="assets/libs/metismenujs/metismenujs.min.js"></script>
|
|
<script src="assets/libs/simplebar/simplebar.min.js"></script>
|
|
<script src="assets/libs/eva-icons/eva.min.js"></script>
|
|
|
|
<script src="assets/js/app.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|