<?php
session_start();

require_once 'gerador/mysqlConsulta.php';
require_once 'script_php/conexao.php';
require_once 'script_php/ConexaoSQL.php';
require_once 'gerador/SqlServer.php';

//criando as instancias
$mysql = new MysqlConsulta();
$sql = new SqlServer;
?>

<!DOCTYPE html>
<html>
<head>

<?php include_once 'head.html' ?>

<title></title>
</head>

<body>

<?php include_once 'headerSEMLOAD.php'; ?>

<section>
<h3>

<?php require_once 'BuscarAvaria.php'; ?>


<p></p>

<a href="adicionarProdutoAvaria.php">
<button type="button" class="btn btn-success text-light">
    
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-database-add" viewBox="0 0 16 16">
  <path d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7m.5-5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/>
  <path d="M12.096 6.223A5 5 0 0 0 13 5.698V7c0 .289-.213.654-.753 1.007a4.5 4.5 0 0 1 1.753.25V4c0-1.007-.875-1.755-1.904-2.223C11.022 1.289 9.573 1 8 1s-3.022.289-4.096.777C2.875 2.245 2 2.993 2 4v9c0 1.007.875 1.755 1.904 2.223C4.978 15.71 6.427 16 8 16c.536 0 1.058-.034 1.555-.097a4.5 4.5 0 0 1-.813-.927Q8.378 15 8 15c-1.464 0-2.766-.27-3.682-.687C3.356 13.875 3 13.373 3 13v-1.302c.271.202.58.378.904.525C4.978 12.71 6.427 13 8 13h.027a4.6 4.6 0 0 1 0-1H8c-1.464 0-2.766-.27-3.682-.687C3.356 10.875 3 10.373 3 10V8.698c.271.202.58.378.904.525C4.978 9.71 6.427 10 8 10q.393 0 .774-.024a4.5 4.5 0 0 1 1.102-1.132C9.298 8.944 8.666 9 8 9c-1.464 0-2.766-.27-3.682-.687C3.356 7.875 3 7.373 3 7V5.698c.271.202.58.378.904.525C4.978 6.711 6.427 7 8 7s3.022-.289 4.096-.777M3 4c0-.374.356-.875 1.318-1.313C5.234 2.271 6.536 2 8 2s2.766.27 3.682.687C12.644 3.125 13 3.627 13 4c0 .374-.356.875-1.318 1.313C10.766 5.729 9.464 6 8 6s-2.766-.27-3.682-.687C3.356 4.875 3 4.373 3 4"/>
</svg>

Adicionar/Retirar</button>
</a>

<a href="avariasFiltro.php">

<button type="button" class="btn btn-warning">
    
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-database-fill-check" viewBox="0 0 16 16">
  <path d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7m1.679-4.493-1.335 2.226a.75.75 0 0 1-1.174.144l-.774-.773a.5.5 0 0 1 .708-.708l.547.548 1.17-1.951a.5.5 0 1 1 .858.514M8 1c-1.573 0-3.022.289-4.096.777C2.875 2.245 2 2.993 2 4s.875 1.755 1.904 2.223C4.978 6.711 6.427 7 8 7s3.022-.289 4.096-.777C13.125 5.755 14 5.007 14 4s-.875-1.755-1.904-2.223C11.022 1.289 9.573 1 8 1"/>
  <path d="M2 7v-.839c.457.432 1.004.751 1.49.972C4.722 7.693 6.318 8 8 8s3.278-.307 4.51-.867c.486-.22 1.033-.54 1.49-.972V7c0 .424-.155.802-.411 1.133a4.51 4.51 0 0 0-4.815 1.843A12 12 0 0 1 8 10c-1.573 0-3.022-.289-4.096-.777C2.875 8.755 2 8.007 2 7m6.257 3.998L8 11c-1.682 0-3.278-.307-4.51-.867-.486-.22-1.033-.54-1.49-.972V10c0 1.007.875 1.755 1.904 2.223C4.978 12.711 6.427 13 8 13h.027a4.55 4.55 0 0 1 .23-2.002m-.002 3L8 14c-1.682 0-3.278-.307-4.51-.867-.486-.22-1.033-.54-1.49-.972V13c0 1.007.875 1.755 1.904 2.223C4.978 15.711 6.427 16 8 16c.536 0 1.058-.034 1.555-.097a4.5 4.5 0 0 1-1.3-1.905"/>
</svg>

Buscar produtos</button>
</a>




<a href="script_php/inserirAvariaArquivo.php">

<button type="button" class="btn btn-danger" title="O arquivo está na pasta arquivos na raiz do projeto com o nome [ importar.txt ] ">SUBIR ARQUIVO [ ATENÇÃO LOJA LOGADA ] </button>


<a/>


</h3>

<small>O arquivo está na pasta arquivos na raiz do projeto com o nome [ importar.txt ] [recebimento/arquivos/importar.txt] <br>
layout do arquivo - > 7896509956282;5;TINT BEAUTYCOLOR S/AMONIA 7.1 125GR 
</small>





















<h4  class="margin_top_avarias">
<p></p>
<p></p>

<div class="accordion accordion-flush tabelaindex" id="accordionFlushExample">
  <div class="accordion-item">
    <h2 class="accordion-header" id="flush-headingOne">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
        PRODUTOS PENDÊNTES EM AVARIA
      </button>
    </h2>
    <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">


      <table border="1" class="table tabelaindex float table-striped">
		
    <tr align="center" class="pedidoscbc table-dark " >
    
    <th>FABRICANTE</th>

<?php for($i=1;$i <= 6;$i++){ ?>
    <th>LOJA 0<?=$i?></th>
<?php } ?>
    </tr>

<?php
    //laco dos dados
    foreach ($dados as $avarias){ ?>
    
    <tr align='center'>
        <td><?php echo $avarias['fabricante']; ?></td>            
        <td><?php echo $avarias['LOJA 01']; ?></td>
        <td><?php echo $avarias['LOJA 02']; ?></td>
        <td><?php echo $avarias['LOJA 03']; ?></td>
        <td><?php echo $avarias['LOJA 04']; ?></td>
        <td><?php echo $avarias['LOJA 05']; ?></td>
        <td><?php echo $avarias['LOJA 06']; ?></td>
    </tr>

<?php } ?> 

</section>
</table>

</div>
    </div>
  </div>
  <div class="accordion-item">
    <h2 class="accordion-header" id="flush-headingTwo">
      <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwo" aria-expanded="false" aria-controls="flush-collapseTwo">
      PRODUTOS EM ANDAMENTO COM FORNECEDOR
      </button>
    </h2>
    <div id="flush-collapseTwo" class="accordion-collapse collapse" aria-labelledby="flush-headingTwo" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">

      <table border="1" class="table tabelaindex float table-striped">
		
        <tr align="center" class="pedidoscbc table-dark " >
        
        <th>FABRICANTE</th>

        <?php for($i=1;$i <= 6;$i++){ ?>
        <th>LOJA 0<?=$i?></th>
        <?php } ?>
        </tr>

        <?php
        //laco dos dados
        foreach ($dados2 as $avarias){ ?>
        
        <tr align='center'>
            <td><?php echo $avarias['fabricante']; ?></td>
            
            <td><?php echo $avarias['LOJA 01'];?></td>

            <td><?php echo $avarias['LOJA 02']; ?></td>

            <td><?php echo $avarias['LOJA 03']; ?></td>

            <td><?php echo $avarias['LOJA 04']; ?></td>

            <td><?php echo $avarias['LOJA 05']; ?></td>

            <td><?php echo $avarias['LOJA 06']; ?></td>
        </tr>

        <?php } ?>

        </table>

      </div>
    </div>
  </div>
  
    <div id="flush-collapseThree" class="accordion-collapse collapse" aria-labelledby="flush-headingThree" data-bs-parent="#accordionFlushExample">
      <div class="accordion-body">Placeholder content for this accordion, which is intended to demonstrate the <code>.accordion-flush</code> class. This is the third item's accordion body. Nothing more exciting happening here in terms of content, but just filling up the space to make it look, at least at first glance, a bit more representative of how this would look in a real-world application.</div>
    </div>
  </div>
</div>

</section>

<?php include_once 'footer.php' ?>