<?php
session_start();

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

$remoto = new RemotoInterno;

$lojaConsultar = $_GET['lojaConsultaImportacao'];
$dataPedido = $_GET['dataPedido'];
$fabricante = $_GET['fabricante'];


$sqlServer = new SqlServer;

$notas = $sqlServer->verificarSeExisteNotasImportadasFabricanteListar($dataPedido,$lojaConsultar,$fabricante);



?>

<!DOCTYPE html>
<html>
<head>

<?php include_once 'head.html' ?>

<title></title>
</head>

<body>

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


<h3>NOTAS ENCONTRADAS NO SOFTCOM</h3>



<table class="table table-striped">

  <thead class="table-dark" >

      <th scope="col">DATA ENTRADA</th>
      <th scope="col">CFOP</th>
      <th scope="col">NUMERO NOTA</th>
      <th scope="col">CHAVE</th>
      <th scope="col">FORNECEDOR</th>         
   </thead>


<?php 



foreach ($notas as $importadas){ ?>


<tr>
	<td><?php echo $remoto->converterData($importadas[0]) ?></td>
	<td><?php echo $importadas[1] ?></td>
	<td><?php echo $importadas[2] ?></td>
 	<td><a href="listarNotasEntradaProdutos.php?chave=<?=$importadas[3]?>&fabricante=<?=$fabricante?>"><?php echo $importadas[3]?> </a></td>
	<td><?php echo $importadas[4] ?></td> 	    
</tr>


<?php } ?>




</table>

















<?php include_once 'footer.php' ?>