<div class="modal fade" id="cadastrarModal" tabindex="-1" aria-labelledby="cadastrarModal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-info">
<h5 class="modal-title" id="cadastrarModal">Cadastrar Agendamento</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="POST" id="formCadEvento">
<div class="row mb-3">
<label for="title" class="col-sm-2 col-form-label">TÍTULO:</label>
<div class="col-sm-10">
<input type="text" name="title" class="form-control" id="title">
</div>
</div>
<div class="row mb-3">
<label for="start" class="col-sm-2 col-form-label">INÍCIO:</label>
<div class="col-sm-10">
<input type="datetime-local" name="start" class="form-control" id="start">
</div>
</div>
<div class="row mb-3">
<label for="end" class="col-sm-2 col-form-label">FIM:</label>
<div class="col-sm-10">
<input type="datetime-local" name="end" class="form-control" id="end">
</div>
</div>
<button class="btn btn-info" id="btnRegistrar" type="submit">Agenda</button>
</form>
</div>
</div>
</div>
</div>
------------------------------------------------
controler
public function add() {
$data = array();
$u = new Users();
$u->setLoggedUser();
$company = new Companies($u->getCompany());
$data['company_name'] = $company->getName();
$data['user_email'] = $u->getEmail();
if($u->hasPermission('agenda_view')) {
$e = new agenda();
if(isset($_POST['title']) && !empty($_POST['title'])) {
$title = addslashes($_POST['title']);
$start = addslashes($_POST['start']);
$end = addslashes($_POST['end']);
$e->add($title, $start, $end, $u->getCompany());
header("Location: ".BASE_URL."/agenda");
}
$this->loadTemplate('home', $data);
}
}