<div class="box box-info"> <div class="box-header"> <h3 class="box-title">Listagem de notificações</h3> <a class="btn btn-info btn-flat pull-right" href="ViewNotificacoesObj.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>Notificaçoes</th> <th>Opções</th> </tr> </thead> <tbody> <?php $listar = new Notificacoes(); $list = $listar->ListarNotificacoes(); if ($list != null) { foreach ($list as $line) { ?> <tr class="odd gradeX"> <form name="view" action="EditNotificacaoObj.php" method="post"> <td><?php echo $line->titulo; ?> </td> <td> <input type='hidden' name='id' value='<?php echo $line->id; ?> '>
<?php include_once "../../class/Carrega.class.php"; if (isset($_POST['enviar']) && !empty($_POST['titulo']) && !empty($_POST['texto'])) { $object = new Notificacoes(); $object->titulo = $_POST['titulo']; $object->texto = $_POST['texto']; if (isset($_POST['notificar'])) { $object->notificacao = 1; } else { $object->notificacao = 0; } $object->InserirNotificacoes(); /*if ($object->InserirNotificacoes()) { header("Location:ViewNotificacoesObj.php?success"); } else { header("Location:ViewNotificacoesObj.php?erro"); }*/ /*echo "<pre>"; var_dump($object); echo "</pre>";*/ } elseif (condition) { # code... } elseif (isset($_POST['atualizar']) && !empty($_POST['titulo']) && !empty($_POST['texto'])) { # code... }