<?php

include_once "../../class/Carrega.class.php";
if (isset($_POST['enviar'])) {
    $object = new Monitorias();
    $object->curso = $_POST['curso'];
    $object->disciplina = $_POST['disciplina'];
    $object->semestre = $_POST['semestre'];
    $object->sala = $_POST['sala'];
    $object->info = $_POST['info'];
    $object->Inserir();
    header("Location:PreviewMonitoriasObj.php");
} else {
    if (isset($_POST['excluir'])) {
        $object = new Monitorias();
        $object->id = $_POST['id'];
        $object->Excluir();
        header("Location:PreviewMonitoriasObj.php");
    } else {
        if (isset($_POST['atualizar'])) {
            $object = new Monitorias();
            $object->id = $_POST['id'];
            $object->sala = $_POST['sala'];
            $object->semestre = $_POST['semestre'];
            $object->info = $_POST['info'];
            $object->Atualizar();
            header("Location:PreviewMonitoriasObj.php");
        }
    }
}
          <h1>Cardápios</h1>
        </section>
        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-lg-12">
              <!-- Horizontal Form -->
              <div class="box box-success">
                <div class="box-header with-border">
                  <h3 class="box-title">Cadastro de cardápios</h3>
                </div><!-- /.box-header -->
                <!-- form start -->
                <?php 
$id = $_POST["id"];
if (isset($_POST["editar"])) {
    $edit = new Monitorias();
    $comp = $edit->Editar($id);
    if ($edit != null) {
        ?>
                <form class="form-horizontal" name="cadcardapio" id="form" method="post" action="<?php 
        $SELF_PHP;
        ?>
">
                  <div class="box-body">
                      <div class="form-group">
                        <label class="col-sm-2 control-label" >Curso:</label>
                        <div class="col-sm-10">
                          <p class="form-control-static"><?php 
        echo $comp->curso;
        ?>
</p>
          <h1>Monitorias</h1>
        </section>
        <!-- Main content -->
        <section class="content">
          <div class="row">
            <div class="col-lg-12">
              <!-- Horizontal Form -->
              <div class="box box-info">
                <div class="box-header with-border">
                  <h3 class="box-title">Monitorias</h3>
                </div><!-- /.box-header -->
<?php 
$id = $_POST["id"];
$curso = $_POST['curso'];
if (isset($_POST["exibir"])) {
    $exib = new Monitorias();
    $comp = $exib->ShowMonitoria($id);
    if ($exib != null) {
        ?>
                <div class="box-body">
                  <div class="form-group">
                    <dl class="dl-horizontal">
                      <dt>Curso:</dt>
                      <dd><?php 
        echo $comp->curso;
        ?>
</dd>
                      <dt>Disciplina:</dt>
                      <dd><?php 
        echo $comp->disciplina;
        ?>
">
                    <button type="submit" name="recarregar" class="btn btn-info btn-flat pull-right" title="Atualizar resultados" data-toggle="tooltip" data-placement="left"><i class="fa fa-refresh"></i></button>
                  </form>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <table id="dataT" class="table table-bordered table-hover">
                    <thead>
                      <tr>
                        <th> Disciplina </th>
                        <th> Opções </th>
                      </tr>
                    </thead>
                    <tbody>
                    <?php 
if (isset($_POST['pesquisar']) || isset($_POST['retornar']) || isset($_POST['recarregar'])) {
    $listar = new Monitorias();
    $list = $listar->ListarEspecify($curso);
    if ($list != null) {
        foreach ($list as $line) {
            ?>
                      <tr class="odd gradeX">
                        <form name="view" action="EditMonitoriasObj.php" method="post">
                        <td><?php 
            echo $line->disciplina;
            ?>
</td>
                        <td>
                          <input type='hidden' name='id' value='<?php 
            echo $line->id;
            ?>
'>