public static function getHistorys($where = null) { $dados = Database::ReadAll('history', '*', $where); if (!$dados) { return false; } foreach ($dados as $dado) { $history = new HistoryChurch(); $history->setId($dado['ID_HISTORY']); $history->setNamePastor($dado['NAME_PASTOR']); $church = Church::getChurch("WHERE id_church = " . $dado['ID_CHURCH']); $history->setChurch($church); $history->setDateInicial($dado['DATE_INICIAL']); $history->setDateFinal($dado['DATE_FINAL']); $historys[] = $history; } return $historys; }
</div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover dataTables-example"> <thead> <tr> <th>ID</th> <th>Igreja</th> <th>Pastor</th> <th>Data de Entrada</th> <th>Data de Saida</th> </tr> </thead> <tbody> <?php foreach (HistoryChurch::getHistorys() as $chur) { echo '<tr>'; echo '<td>' . $chur->getId() . '</td>'; echo '<td>' . '<a class="modalChurch" data-id="' . $chur->getChurch()->getId() . '" >' . $chur->getChurch()->getName() . '</a>' . '</td>'; echo '<td>' . $chur->getNamePastor() . '</td>'; echo '<td>' . $chur->getDateInicial() . '</td>'; echo '<td>' . $chur->getDateFinal() . '</td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div> </div> </div>