<?php
session_start();
require_once 'script_php/ConexaoSQL.php';

require_once 'gerador/SqlServer.php';

$Sql = new SqlServer;

if (isset($_GET['cod'])) {

$codForn = $_GET['cod'];

}

$Retorno = $Sql->CodFornCodSoft($codForn);


?>

<!DOCTYPE html>
<html>
<head>

<?php include_once 'head.html' ?>

<title></title>
</head>

<body>

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


<section>

<h3> BUSCAR INTEGRAÇÃO NO SISTEMA </h3>
<h5>
INFORME O CODIGO DO FORNECEDOR
<form method='get' action=''>

<input type="text" class="form-control form_data form_forn" name="cod">


</h5>

<p></p>

<button type="submit" class="btn btn-primary"> Buscar</button>


</form>



<table class='table'>

<tr>
<th> COD FORNECEDOR </th>
<th> CÓD EAN SISTEMA </th>
<th> DATA ENTRADA</th>
<th> NUMERO NOTA</th>
<th> LOJA ENTRADA</th>
<th> FORNECEDOR </th>
</tr>


<?php

foreach ($Retorno as $dados) {

$data_formatada = date("d/m/Y", strtotime($dados[3]));


?>


<tr>
<td>
<?php echo $dados[0] ;?>
</td>

<td>
<?php echo $dados[1] ;?>
</td>

<td>
<?php echo $data_formatada ;?>
</td>

<td>
<?php echo $dados[5] ;?>
</td>

<td>
<?php echo $dados[4] ;?>
</td>

<td>
<?php echo $dados[6] ;?>
</td>



</tr>

<?php } ?>

</table>



</section>



<?php include_once 'footer.php' ?>