-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.php
105 lines (77 loc) · 2.55 KB
/
index.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
if(!isset($_SESSION)){
session_start();
}
$id_user = $_SESSION['idUsuario'];
if(!isset ($_SESSION['idUsuario'])) {
header('Location: login.php');
}
require_once('evento/action/conexao.php');
date_default_timezone_set('America/Sao_Paulo');
$database = new Database();
$db = $database->conectar();
$sql = "SELECT id_evento, titulo, descricao, inicio, termino, cor, fk_id_destinatario, fk_id_remetente, status FROM eventos as e
LEFT JOIN convites as c ON e.id_evento = c.fk_id_evento
Where fk_id_usuario = $id_user";
$req = $db->prepare($sql);
$req->execute();
$events = $req->fetchAll();
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Calendario - Home</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- FullCalendar -->
<link href='css/fullcalendar.css' rel='stylesheet' />
<link href='css/fullcalendar.print.min.css' rel='stylesheet' media='print' />
<!-- Custom CSS Calendario -->
<link href='css/calendar.css' rel='stylesheet' />
</head>
<body>
<!-- Menu Superior -->
<?php include ('menu/menuSuperior.php'); ?>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<p class="lead"></p>
<div id="calendar" class="col-centered">
</div>
</div>
</div>
<!-- /.row -->
<!-- Valida data dos Modals -->
<script type="text/javascript">
function validaForm(erro) {
if(erro.inicio.value>erro.termino.value){
alert('Data de Inicio deve ser menor ou igual a de termino.');
return false;
}else if(erro.inicio.value==erro.termino.value){
alert('Defina um horario de inicio e termino.(24h)');
return false;
}
}
</script>
<!-- Modal Adicionar Evento -->
<?php include ('evento/modal/modalAdd.php'); ?>
<!-- Modal Editar/Mostrar/Deletar Evento -->
<?php include ('evento/modal/modalEdit.php'); ?>
</div>
<!-- jQuery Version 1.11.1 -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- FullCalendar -->
<script src='js/moment.min.js'></script>
<script src='js/fullcalendar.min.js'></script>
<script src='locale/pt-br.js'></script>
<?php include ('calendario.php'); ?>
</body>
</html>