<div class="box box-info"> <div class="box-header"> <h3 class="box-title">Listagem de assistência estudantil</h3> <a class="btn btn-info btn-flat pull-right" href="ViewAssistenciasObj.php" title="Atualizar resultados" data-toggle="tooltip" data-placement="left"><i class="fa fa-refresh"></i></a> </div><!-- /.box-header --> <div class="box-body"> <table id="dataT" class="table table-bordered table-hover"> <thead> <tr> <th>Assistência</th> <th>Opções</th> </tr> </thead> <tbody> <?php $listar = new Assistencias(); $list = $listar->ListarAssistencias(); if ($list != null) { foreach ($list as $line) { ?> <tr class="odd gradeX"> <form name="view" action="EditAssistenciaObj.php" method="post"> <td><?php echo $line->assist; ?> </td> <td> <input type='hidden' name='id' value='<?php echo $line->id; ?> '>
<h1>Assistência Estudantil</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">Edição de assistência estudantil</h3> </div><!-- /.box-header --> <!-- form start --> <?php $id = $_POST["id"]; if (isset($_POST["editar"])) { $edit = new Assistencias(); $comp = $edit->EditarAssistencias($id); if ($edit != null) { ?> <form class="form-horizontal" id="form" method="post" action="CrudAssistencias.php"> <div class="box-body"> <div class="form-group"> <label for="nome" class="col-sm-2 control-label">Nome:</label> <div class="col-sm-10"> <input type="text" class="form-control" name="assist" id="nome" placeholder="Digite aqui" value="<?php echo $comp->assist; ?> " required> </div> </div> <div class="form-group">
<?php include_once "../../class/Carrega.class.php"; if (isset($_POST['enviar'])) { $object = new Assistencias(); $object->assist = $_POST['assist']; $object->texto = $_POST['texto']; $object->InserirAssistencias(); header("Location:ViewAssistenciasObj.php"); } else { if (isset($_POST['excluir'])) { $object = new Assistencias(); $object->id = $_POST['id']; $object->ExcluirAssistencias(); header("Location:ViewAssistenciasObj.php"); } else { if (isset($_POST['atualizar'])) { $object = new Assistencias(); $object->id = $_POST['id']; $object->assist = $_POST['assist']; $object->texto = $_POST['texto']; $object->AtualizarAssistencias(); header("Location:ViewAssistenciasObj.php"); } } }