-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcalendario.php
68 lines (55 loc) · 1.57 KB
/
calendario.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<body>
<?php include "header.php"; ?>
<link href='calendario/fullcalendar.min.css' rel='stylesheet' />
<link href='calendario/fullcalendar.print.min.css' rel='stylesheet' media='print' />
<script src='calendario/lib/moment.min.js'></script>
<script src='calendario/lib/jquery.min.js'></script>
<script src='calendario/fullcalendar.min.js'></script>
<script src='calendario/locale/pt-br.js'></script>
<script>
$(document).ready(function() {
var initialLocaleCode = 'pt-br';
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listWeek'
},
defaultDate: '<?php echo date('Y-m-d'); ?>',
navLinks: true, // can click day/week names to navigate views
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [
<?php
global $wpdb;
$sql_busca = "SELECT nomeEvento,data, hora FROM sc_agenda, sc_evento WHERE sc_evento.idEvento = sc_agenda.idEvento ";
$res = $wpdb->get_results($sql_busca,ARRAY_A);
for($i = 0; $i < count($res); $i++){
$title = $res[$i]['nomeEvento'];
$data = $res[$i]['data'];
$hora = $res[$i]['hora'];
echo "{title: '".$title."',";
echo "start: '".$data."T".$hora."'},";
}
?>
]
});
});
</script>
<style>
body {
margin: 40px 10px;
padding: 0;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
font-size: 14px;
font-color: white;
}
#calendar {
max-width: 900px;
margin: 0 auto;
}
</style>
<div id='calendar'></div>
<?php
include "footer.php";
?>