<?php
include 'header.php';
include 'erpc_gp_escala_toolbar.php'; //Nome da tabela _list.php
include 'connect.php';
require_once('inc/gp_escala.php');

require_once 'inc/usuario.php';

checkLogin('login.php');

$escala = new erpc_gp();

$escalas = $escala->escalas_getAll();


?>

<div class="block">
  <div class="header">
  <h2>Eventos</h2>
  </div>
  <div class="content">
    <div class="table-responsive">
      <table class="table table-bordered table-striped table-responsible sortable">
        <thead>
          <tr>
            <!--<th width=02%><input type="checkbox" class="checkall" /></th>-->
            <th width=0% hidden></th>
			<th width=05%>ID</th>
            <th width=50%>Evento</th>
            <th width=10%>Dt Inicio</th>
            <th width=10%>Dt Fim</th>
            <th width=05%>Editar</th>
			<th width=05%>Excluir</th>
          </tr>
        </thead>
        <tbody>

          <?php

          foreach($escalas as $evento){
              echo "<tr>";
              echo "<td hidden></td>";
              echo "<td>" . $evento['id'] . "</td>";
              echo "<td>" . $evento['ds_evento'] . "</td>";
              echo "<td>" . $evento['dt_inicio'] . "</td>";
              echo "<td>" . $evento['dt_fim'] . "</td>";
              echo "<td class='text-center'><a href='erpc_gp_escala_edit.php?id=" . $evento['id_crip'] . "'>  <i class='glyphicon glyphicon-pencil' title='Editar'><span class='sr-only'>Editar</span></i></a></td>";
              echo "<td class='text-center'><a href='erpc_gp_escala_remove.php?id=" . $evento['id_crip'] . "'><i class='glyphicon glyphicon-remove' title='Remover'><span class='sr-only'>Remover</span></i></a></td>";
              echo "</tr>";
          }
          
          ?>
        </tbody>
      </table>
    </div> <!-- table-responsive -->
  </div> <!-- content -->
</div> <!-- block -->
<?php include 'footer.php';?>
