<?php
    include_once('../../conexao.php');
    include_once('../../DAO/DAOgrupo.php');
    include_once('../../DAO/DAOempresa.php');
	
	$grupo  = new DAOgrupo();
	$empresa  = new DAOempresa();

       /* if (!isset($_SESSION)) {
           session_start();
       }*/
    $conn = new Conexao();
	
		
?>   
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/paper-css/0.4.1/paper.min.css" integrity="sha512-V+r0ugxPpGraMA2ubEWvqpfcZZAfMAbnSDPeu/6gYFfdxlgJGfCuNTNrZkrjQ0sJBoySdN6uoTVwJ+4P/BeTkg==" crossorigin="anonymous" />
 
 <link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600&display=swap" rel="stylesheet"> 
  <style>
    body   { font-family: calibri }
   /* body   { font-family: 'Open Sans', sans-serif; }*/
	
    h1     {font-size: 40pt; line-height: 18mm}
    h2, h3 { font-size: 20pt; line-height: 7mm }
    h4     { font-size: 32pt; line-height: 14mm }
    h2 + p { font-size: 18pt; line-height: 7mm;font-weight: normal; }
    h3 + p { font-size: 14pt; line-height: 7mm }
    li     { font-size: 11pt; line-height: 5mm; text-transform:uppercase; font-weight:bold;     list-style-type: none; }

    h1      { margin: 0 }
    h1 + ul { margin: 2mm 0 5mm }
    h2, h3  { margin: 0 3mm 3mm 0; float: left }
    h2 + p,
    h3 + p  { margin: 0 0 3mm 50mm }
    h4      { margin: 2mm 0 0 50mm; border-bottom: 2px solid black }
    h4 + ul { margin: 5mm 0 0 50mm }
    article { border: 4px double black; padding: 5mm 10mm; border-radius: 3mm }
    th, td {
  text-align: left;
  padding: 6px;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}
 
  @page {
    size: A4
  }

.table-responsive:{
height:95%;
}

.sheet {
  overflow: visible;
  height: auto !important;
}
</style>

<body class="A4">
 
 <?php 
   $result =  $empresa->Listarempresa();
   foreach($result as $rowempresa){
  ?>
 
  <section class="sheet padding-10mm">
  <h1 style="   font-size:10pt;margin-top: -38px;text-align: right;float: right;"><?php echo date('d/m/Y') ?></h1>
  <ul style="padding-left: 0px;margin-top: -4mm;">
     <li style="font-size: 18px;"><?php echo $rowempresa["emp_nm"];?> </li> 
	 <li style="font-size: 12px;">CNPJ: <?php echo $rowempresa["emp_cnpj"]; ?> <li>   
     <li style="font-size: 12px;"><?php echo $rowempresa["emp_endereco"]; ?> , <?php echo $rowempresa["emp_numero"]; ?>,  <?php echo $rowempresa["emp_bairro"]; ?> - <?php echo $rowempresa["emp_cep"]; ?>  </li>
      <li style="font-size: 12px;">Telefone: <?php echo $rowempresa["emp_telefone"]; ?> </li>
      <li style="font-size: 12px;"><?php echo $rowempresa["emp_email"]; ?></li>     
 
    </ul>
	 <div class="row">
	   <div class="col-md-6-auto" style="text-align: center;">
	  <img src="../../uploads/empresa/<?php echo $rowempresa["emp_imagem"] ; ?>" style="width: 28%;" >
	  </div>
	  </div>
	
   <?php } ?> <br><br><br>
    <h1 style="margin:0 auto; font-weight:bold; text-align:center; font-size:22pt;margin-top: -30px;">RELATÓRIO DE GRUPOS</h1>

<table  class="table table-striped table-responsive" style="width: 100%;margin-top: -13px;border-collapse: collapse;border-spacing: 0;">
  <thead style="text-align: left;">
    <tr>
      <th>Código</th>
      <th>Nome</th>
      <th>Data Cadastro</th>
      
    </tr>
  </thead>
  <tbody>
  <?php 
   $result =  $grupo->Listargrupo();
   foreach($result as $row){
  ?>
  <tr id="row-pol_id"> 
      <td style="font-size:13px" ><?php echo $row["grp_cd"];?></td>
      <td style="font-size:13px" ><?php echo $row["grp_ds"];?></td>                              
      <td style="font-size:13px" ><?php echo date("d/m/Y H:i", strtotime($row["grp_dt_cadastro"]));?></td>
  
      <?php } ?> 
   </tr>
  </tbody>
</table>


 

 
 

  </section>
  
 

</body> 