3
I use Full Calendar to display an agenda on my system, but I’m not able to send a id through the url of the file that mounts the json with the dates, and need this to filter the events that are linked only to this id. Follow my code below:
calendar page:
<script>
var id = '<?php echo '<a href="eventos?id=' . $id . '">'?>'
$(document).ready(function() {
//CARREGA CALENDÁRIO E EVENTOS DO BANCO
$('#calendario').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
eventLimit: true,
events: 'eventos.php',
eventColor: '#0277BD'
});
});
</script>
<section class="panel">
<header class="panelheading" id="locado">
Agenda
</header>
<div class="panel-body" id="panel">
<div class="panel-body table-responsive">
<div class="page">
<div id='calendario'>
</div>
</div>
</div>
</div>
</section>
php events.
$id = $_GET['id'];
$consulta = $conexao->query("SELECT id, title, start, ADDDATE(end, INTERVAL 1 DAY) as end FROM calendario where id = '$id'");
while ($linha = $consulta->fetch(PDO::FETCH_ASSOC)) {
$vetor[] = $linha;
}
echo json_encode($vetor);
If anyone knows how I can do it, I’d appreciate it!
And what is the value of
idwhich is passed this way?– Woss
That question I already solved, I will post the answer today if possible.
– R.Gasparin