From e80e64eb37d6a26382dbc3a37f5b0597a7a72154 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 28 Mar 2023 16:24:33 +0200 Subject: [PATCH] Aggiunti eventi in Dashboard --- assets/src/css/style.css | 4 +--- modules/dashboard/ajax.php | 34 ++++++++++++++++++++++++++++++++++ modules/dashboard/edit.php | 34 +++++++++++++++++++++++++++------- 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/assets/src/css/style.css b/assets/src/css/style.css index d9bd2b399..e8e0902fd 100755 --- a/assets/src/css/style.css +++ b/assets/src/css/style.css @@ -1223,6 +1223,4 @@ input[type="radio"] { */ .fc .fc-bg-event { background: rgba(255, 49, 21, .5) !important; -} - - +} \ No newline at end of file diff --git a/modules/dashboard/ajax.php b/modules/dashboard/ajax.php index eb588114c..421f7a97e 100644 --- a/modules/dashboard/ajax.php +++ b/modules/dashboard/ajax.php @@ -468,4 +468,38 @@ switch (filter('op')) { } break; + + case 'calendario_eventi': + + $start = filter('start'); + $end = filter('end'); + + $query = 'SELECT * FROM `zz_events` WHERE `zz_events`.`is_bank_holiday` = 1 AND `zz_events`.`data` >= '.prepare($start).' AND `zz_events`.`data` <= '.prepare($end); + + $eventi = $dbo->fetchArray($query); + + $results = []; + foreach ($eventi as $evento) { + $results[] = [ + 'id' => $evento['id'], + 'title' => $evento['nome'], + 'start' => $evento['data'], + 'end' => date('Y-m-d', strtotime($evento['data']. '+1 day')), + + //'initialDate' => $evento['data'], + //'startRecur' => (($evento['is_recurring']) ? $evento['data'] : ''), + //'endRecur' => (($evento['is_recurring']) ? date('Y-m-d', strtotime($evento['data']. '+1 day')) : ''), + + 'display' => "background", + 'allDay' => true, + 'overlap' => true, + ]; + } + + echo json_encode($results); + + + break; + + } diff --git a/modules/dashboard/edit.php b/modules/dashboard/edit.php index 187ba4d75..d92bc4118 100755 --- a/modules/dashboard/edit.php +++ b/modules/dashboard/edit.php @@ -363,7 +363,7 @@ echo '