We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need to load event data with AJAX for current month and when click on prev or next month to load data with ajax for those months.
The text was updated successfully, but these errors were encountered:
In PHP example:
if($_GET['json']){ header('Content-Type: application/json'); $dbc = new DataBase(); $stmt = $dbc->connect()->prepare("SELECT * FROM `calendar` ORDER BY `Date` ASC"); $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); $json = array(); if(!empty($result)){ foreach($result as $row){ $json[] = array( $row['Date'] => array( 'content' => $row['content'], 'repeat' => $row['repeats'], 'allDay' => $row['allDay'], 'endDate' => $row['endDate'], ), ); } } $dbc->disconnect(); echo json_encode($json); exit(); }
and JS example:
function ajaxCalendar(){ $.get('hand.php', {json:1}, function(data){ var result = {}; data.forEach(function(v,i){ result[Object.keys(v)] = Object.values(v); }); $('#calendar').calendario({ caldata: result, displayWeekAbbr: true, events: ['click', 'focus'] }); }); } ajaxCalendar();
Sorry, something went wrong.
No branches or pull requests
I need to load event data with AJAX for current month and when click on prev or next month to load data with ajax for those months.
The text was updated successfully, but these errors were encountered: