<div class="box-header box-info">
                  <h3 class="box-title">Listagem de eventos</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="dataT" class="table table-bordered table-hover">
                    <thead>
                      <tr>
                        <th>Evento</th>
                        <th>Data de inicio</th>
                        <th>Opções</th>
                      </tr>
                    </thead>
                    <tbody>
<?php 
include_once "../../class/Carrega.class.php";
$listar = new Programacao();
$list = $listar->listar();
if ($list != null) {
    foreach ($list as $line) {
        ?>
                      <tr class="odd gradeX">
                        <form name="view" action="EditLocalObj.php" method="post">
                        <td><?php 
        echo $line->evento;
        ?>
</td>
                        <td><?php 
        echo date('d/m/Y', strtotime($line->dataInicio));
        ?>
</td>
                        <td>
<?php

include_once "../../class/Carrega.class.php";
if (isset($_POST['enviar'])) {
    $object = new Programacao();
    $object->evento = $_POST['evento'];
    $object->dataInicio = $_POST['dataInicio'];
    $object->dataFim = $_POST['dataFim'];
    $object->Inserir();
    header("Location:ViewProgramacaoObj.php");
} else {
    if (isset($_POST['excluir'])) {
        $object = new Programacao();
        $object->id = $_POST['id'];
        $object->Excluir();
        header("Location:ViewProgramacaoObj.php");
    } else {
        if (isset($_POST['atualizar'])) {
            $object = new Programacao();
            $object->id = $_POST['id'];
            $object->evento = $_POST['evento'];
            $object->dataInicio = $_POST['dataInicio'];
            $object->dataFim = $_POST['dataFim'];
            $object->Atualizar();
            header("Location:ViewProgramacaoObj.php");
        }
    }
}