Witam,
korzystam z rozwiązania fullcalendar, chciałbym wprowadzić modyfikacje w zapytaniu o dodatkowe filtry, ale nie wiem jak to przesłać jedeno do drugiego.
Mam teraz poniższy kod:
fragment pliku wyświetlającego kalendarz
...........
<script>
$(document).ready(function() {
$('#bootstrapModalFullCalendar').fullCalendar({
left: 'today myCustomButton',
center: 'prev title next',
right:"month, agendaWeek, agendaDay"
},
eventClick: function(event, jsEvent, view) {
$('#modalTitle').html(event.description);
$('#modalBody').html(event.title);
$("#startTime").html((event.start).format('DD-MM-YYYY'));
$
("#endTime").html
(moment
(event
.end).format
('DD-MM-YYYY')); $('#eventUrl').attr('href',event.url);
$('#fullCalModal').modal();
return false;
},
events: 'events.php'
});
});
</script>
...........
plik events.php
<?php
$requete = "SELECT * FROM evenement where end >= NOW() ORDER BY id";
//chciałbym dodatkowo przesłać $requete = "SELECT * FROM evenement where id = '$id' and end >= NOW() ORDER BY id";
try {
$bdd = new PDO('mysql:host=*****l;dbname=*****charset=utf8', '****', '*****');
$bdd->exec("set names utf8");
} catch(Exception $e) {
exit('Błąd połączenie z Bazą Danych.'); }
$resultat = $bdd->query($requete) or
die(print_r($bdd->errorInfo()));
echo json_encode
($resultat->fetchAll(PDO
::FETCH_ASSOC));
?>