fixed note userpanel

This commit is contained in:
Claudio 2025-10-02 13:51:33 +02:00
parent f1d9b8d31e
commit 8c3c3982ac

View File

@ -1,9 +1,12 @@
<?php require_once('include/headscript.php'); ?>
<?php // require_once('Connections/bkngstm.php'); ?>
<?php // require_once('webassist/mysqli/rsobj.php'); ?>
<?php // require_once('webassist/mysqli/queryobj.php'); ?>
<?php // require_once('Connections/bkngstm.php');
?>
<?php // require_once('webassist/mysqli/rsobj.php');
?>
<?php // require_once('webassist/mysqli/queryobj.php');
?>
<?php // optionquery
$optionquery = new WA_MySQLi_RS("optionquery",$bkngstm,0);
$optionquery = new WA_MySQLi_RS("optionquery", $bkngstm, 0);
$optionquery->setQuery("SELECT * FROM option");
$optionquery->execute();
?>
@ -14,7 +17,6 @@ $bookedclass = new WA_MySQLi_RS("bookedclass", $bkngstm, 0);
// Verifica se è stata specificata una richiesta per cambiare il mese
if (isset($_GET['prev_month'])) {
$currentMonthStart = $_GET['prev_month'] . '-01';
} elseif (isset($_GET['next_month'])) {
$currentMonthStart = $_GET['next_month'] . '-01';
} else {
@ -60,13 +62,12 @@ $result = $conn->query($query);
if (!$result) {
die("Query fallita: " . $conn->error);
}
}
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$idOrdine = $row["idorderbook"];
$totalTickets = $row["total_tickets"];
}
} else {
$totalTickets = 0; // Imposta a zero se non ci sono righe nella query
@ -108,10 +109,7 @@ if ($result) {
$passedRecords = $row['passed'];
$futureRecords = $row['future'];
$lost = $row['lost'];
$pending= $row['pending'];
$pending = $row['pending'];
}
// Chiusura della connessione
$conn->close();
@ -120,10 +118,10 @@ $conn->close();
<!doctype html>
<html lang="en">
<head>
<head>
<meta charset="utf-8" />
<title>YogiBook - Prenotazioni YogaSoul</title>
<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" />
@ -136,11 +134,11 @@ $conn->close();
<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">
<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>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<style>
<style>
.custom-card {
margin: 10px auto;
display: flex;
@ -228,7 +226,8 @@ $conn->close();
flex-direction: column;
}
.custom-date-box, .custom-event-details {
.custom-date-box,
.custom-event-details {
width: 100%;
border-radius: 0;
}
@ -237,34 +236,32 @@ $conn->close();
font-size: 24px;
}
}
</style>
<style>
</style>
<style>
.month-navigation {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
}
.month-nav-button {
.month-nav-button {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
}
}
.current-month {
.current-month {
font-size: 24px;
margin: 0 20px;
}
.card {
}
.card {
width: 100%;
}
</style>
<script>
}
</style>
<script>
function confirmDelete(id, idservice, deletePageUrl) {
Swal.fire({
title: "Sei sicuro?",
@ -282,41 +279,48 @@ $conn->close();
}
});
}
</script>
</script>
<style>
<style>
.pastel-color {
border: 1px solid #D1C4CC;
padding: 0px;
text-align: center;
border-radius: 10px;
margin-right: 20px; /* Spazio tra i box */
margin-right: 20px;
/* Spazio tra i box */
font-size: 18px;
}
.pastel-color.acquistate {
background-color: #E2C4FB; /* Azzurro pastello */
background-color: #E2C4FB;
/* Azzurro pastello */
}
.pastel-color.praticate {
background-color: #C4E1FB; /* Verde pastello */
background-color: #C4E1FB;
/* Verde pastello */
}
.pastel-color.prenotate {
background-color: #CDFBC4; /* Rosa pastello */
background-color: #CDFBC4;
/* Rosa pastello */
}
.pastel-color.conferma {
background-color: #FBFAC4; /* Arancio pastello */
background-color: #FBFAC4;
/* Arancio pastello */
}
.pastel-color.programmare {
background-color: #FBE4C4; /* Arancio pastello */
background-color: #FBE4C4;
/* Arancio pastello */
}
.pastel-color.perse {
background-color: #FBC7C4; /* Arancio pastello */
background-color: #FBC7C4;
/* Arancio pastello */
}
@ -324,14 +328,16 @@ $conn->close();
@media (max-width: 768px) {
.pastel-color {
margin-right: 0; /* Rimuovi lo spazio tra i box */
margin-bottom: 20px; /* Spazio tra i box */
margin-right: 0;
/* Rimuovi lo spazio tra i box */
margin-bottom: 20px;
/* Spazio tra i box */
}
}
</style>
</style>
<body>
<body>
<!-- <body data-layout="horizontal"> -->
@ -477,13 +483,13 @@ $conn->close();
</div>
</div>
</div>
</div>
<div class="alert alert-warning alert-dismissible fade show" role="alert" style="text-align: center;">
</div>
<div class="alert alert-warning alert-dismissible fade show" role="alert" style="text-align: center;">
<i class="mdi mdi-alert-outline me-2"></i>
Car* Yogi, ti ricordiamo che il pacchetto 4 lezioni ha validità entro le 5 settimane dall'acquisto e il pacchetto da 12 lezioni entro il <strong>24 aprile 2025</strong> 🙏
</div>
Car* Yogi, ti ricordiamo che il pacchetto 4 lezioni ha validità entro le 5 settimane dall'acquisto e il pacchetto da 12 lezioni entro il <strong>20 dicembre 2025</strong> 🙏
</div>
</div>
</div>
@ -535,12 +541,12 @@ $conn->close();
<i class="mdi mdi-plus me-1"></i> Programma lezioni rimanenti
</button>
</a>
<?php } ?>
<a href="https://yogasoul.it/shop-completo/">
<?php } ?>
<a href="https://yogasoul.it/shop-completo/">
<button type="button" class="btn btn-success btn-rounded waves-effect waves-light mb-2 me-2" data-bs-toggle="modal" data-bs-target=".create-task">
<i class="mdi mdi-plus me-1"></i> Acquista Pacchetto Lezioni
</button>
</a>
</a>
</div>
@ -565,8 +571,8 @@ $conn->close();
<!-- Aggiungi le frecce per la navigazione tra i mesi -->
<?php
<!-- Aggiungi le frecce per la navigazione tra i mesi -->
<?php
$italianMonths = [
"January" => "Gennaio",
"February" => "Febbraio",
@ -580,10 +586,10 @@ $conn->close();
"October" => "Ottobre",
"November" => "Novembre",
"December" => "Dicembre"
];
];
?>
<div class="month-navigation">
?>
<div class="month-navigation">
<a href="?prev_month=<?php echo date('Y-m', strtotime('-1 month', strtotime($currentMonthStart))); ?>" class="arrow-link">
<i class="fas fa-chevron-left fa-2x"></i>
</a>
@ -591,7 +597,7 @@ $conn->close();
<a href="?next_month=<?php echo date('Y-m', strtotime('+1 month', strtotime($currentMonthStart))); ?>" class="arrow-link">
<i class="fas fa-chevron-right fa-2x"></i>
</a>
</div>
</div>
<div class="row">
@ -600,28 +606,28 @@ $conn->close();
<div class="card-body">
<?php
$wa_startindex = 0;
<?php
$wa_startindex = 0;
if ($bookedclass->TotalRows == 0) {
if ($bookedclass->TotalRows == 0) {
echo "<p>Prenotazioni non presenti per questo mese</p>";
} else {
} else {
while (!$bookedclass->atEnd()) {
$wa_startindex = $bookedclass->Index;
?>
?>
<?php
// Data dalla variabile $bookedclass->getColumnVal("dateschedule")
$dateschedule = $bookedclass->getColumnVal("dateschedule");
// Data dalla variabile $bookedclass->getColumnVal("dateschedule")
$dateschedule = $bookedclass->getColumnVal("dateschedule");
// Converti la data in un oggetto DateTime
$dateObj = new DateTime($dateschedule);
// Converti la data in un oggetto DateTime
$dateObj = new DateTime($dateschedule);
// Estrai il giorno e il mese in italiano
$dayInItalian = $dateObj->format("d");
$monthInItalian = $dateObj->format("F");
// Estrai il giorno e il mese in italiano
$dayInItalian = $dateObj->format("d");
$monthInItalian = $dateObj->format("F");
// Mappa dei nomi dei mesi in italiano
$italianMonths = [
// Mappa dei nomi dei mesi in italiano
$italianMonths = [
"January" => "Gennaio",
"February" => "Febbraio",
"March" => "Marzo",
@ -634,20 +640,20 @@ $italianMonths = [
"October" => "Ottobre",
"November" => "Novembre",
"December" => "Dicembre"
];
];
// Sostituisci il nome del mese con la versione italiana
$monthInItalian = $italianMonths[$monthInItalian];
?>
<?php
// Data dalla variabile $bookedclass->getColumnVal("dateschedule")
$dateschedule = $bookedclass->getColumnVal("dateschedule");
// Sostituisci il nome del mese con la versione italiana
$monthInItalian = $italianMonths[$monthInItalian];
?>
<?php
// Data dalla variabile $bookedclass->getColumnVal("dateschedule")
$dateschedule = $bookedclass->getColumnVal("dateschedule");
// Converti la data in un oggetto DateTime
$dateObj = new DateTime($dateschedule);
// Converti la data in un oggetto DateTime
$dateObj = new DateTime($dateschedule);
// Formatta la data nel nuovo formato desiderato
$newDateFormat = $dateObj->format("d-m-Y H:i");
// Formatta la data nel nuovo formato desiderato
$newDateFormat = $dateObj->format("d-m-Y H:i");
// Calculate the time difference in hours
$currentTime = new DateTime();
@ -656,10 +662,10 @@ $newDateFormat = $dateObj->format("d-m-Y H:i");
$hoursDifference = $timeDifference->h + $timeDifference->days * 24;
// Check if the time difference is less than 6 hours
$timetocancel=$optionquery->getColumnVal("maxbeforetimecancell");
$timetocancel = $optionquery->getColumnVal("maxbeforetimecancell");
$canBeDeleted = ($hoursDifference > $timetocancel);
?>
?>
@ -668,24 +674,24 @@ $newDateFormat = $dateObj->format("d-m-Y H:i");
<div class="custom-day"><?php echo $dayInItalian; ?></div>
<div class="custom-month"><?php echo $monthInItalian; ?></div>
</div>
<div class="custom-event-details" style="background-color:<?php echo($bookedclass->getColumnVal("colorclass")); ?>">
<h2 class="custom-heading"><?php echo($bookedclass->getColumnVal("servicename")); ?></h2>
<div class="custom-event-details" style="background-color:<?php echo ($bookedclass->getColumnVal("colorclass")); ?>">
<h2 class="custom-heading"><?php echo ($bookedclass->getColumnVal("servicename")); ?></h2>
<p class="custom-paragraph">Quando: <?php echo $newDateFormat; ?></p>
<p class="custom-paragraph">Luogo: via Valassina 62/B Seregno - Sala Contesto Yoga</p>
<div class="custom-actions">
<button class="custom-action-button" onclick="addToCalendar(this)" data-eventname="<?php echo($bookedclass->getColumnVal("servicename")); ?>" data-eventdate="<?php echo $newDateFormat; ?>">
<button class="custom-action-button" onclick="addToCalendar(this)" data-eventname="<?php echo ($bookedclass->getColumnVal("servicename")); ?>" data-eventdate="<?php echo $newDateFormat; ?>">
<i class="far fa-calendar-plus"></i> Cal
</button>
</button>
<!-- <button class="custom-action-button"><i class="fas fa-edit"></i> Riprogramma</button> -->
<?php $idbookingclass=$bookedclass->getColumnVal("idbookingclass");
$idservice=$bookedclass->getColumnVal("idservice");
<?php $idbookingclass = $bookedclass->getColumnVal("idbookingclass");
$idservice = $bookedclass->getColumnVal("idservice");
?>
<?php if ($canBeDeleted) : ?>
<button class="custom-action-button" onclick="confirmDelete(<?php echo $idbookingclass; ?>, <?php echo $idservice; ?>, 'bookingpanel.php')">
<i class="fas fa-calendar-alt"></i> Riprogramma
</button>
</button>
<?php else : ?>
@ -699,12 +705,16 @@ $newDateFormat = $dateObj->format("d-m-Y H:i");
<?php
$bookedclass->moveNext();
}
}
}
$bookedclass->moveFirst(); // Ritorna all'inizio del recordset
unset($wa_startindex);
unset($wa_repeatcount);
?></div></div></div></div><br><br>
$bookedclass->moveFirst(); // Ritorna all'inizio del recordset
unset($wa_startindex);
unset($wa_repeatcount);
?>
</div>
</div>
</div>
</div><br><br>
<!-- Aggiungi altre card qui con le stesse classi -->
@ -734,8 +744,8 @@ unset($wa_repeatcount);
<!-- JAVASCRIPT -->
<script>
function addToCalendar(button) {
<script>
function addToCalendar(button) {
const eventName = button.getAttribute('data-eventname');
const eventDate = button.getAttribute('data-eventdate');
@ -749,8 +759,8 @@ function addToCalendar(button) {
// Esempio: Aggiunta a Outlook (il link potrebbe variare)
const outlookCalendarLink = `webcal://outlook.live.com/calendar/0/deeplink/compose?path=/calendar/action/compose&subject=${encodeURIComponent(eventName)}&startdt=${encodeURIComponent(eventDate)}`;
window.open(outlookCalendarLink, '_blank');
}
</script>
}
</script>
@ -762,6 +772,6 @@ function addToCalendar(button) {
<script src="assets/js/app.js"></script>
</body>
</body>
</html>