<?php 
session_start();
include_once '../../../../conexao/index.php';

/*Variaveis do Sistema*
********************************************/
$userID = $_SESSION['idUsuario'];
$userNOME = $_SESSION['nomeUsuario'];
$userCATE = $_SESSION['categoriaUsuario'];
/*********************************************/
$procura = $_GET['procura'];
	$sqlBox = "SELECT * FROM EMPRESA WHERE NOME LIKE '$procura%' OR ID LIKE '$procura%' OR CONTRATO LIKE '$procura%' OR NUIT LIKE '$procura%' OR ENDERECO LIKE '$procura%' OR CONTACTO LIKE '$procura%' OR EMAIL LIKE '$procura%'";
	$rsBox = mysqli_query($db, $sqlBox);
	while ($dados = mysqli_fetch_array($rsBox)) {
		$id = $dados['ID'];
		$cod = $dados['COD'];
		$nome = $dados['NOME'];
		$contrato = $dados['CONTRATO'];
		$nuit = $dados['NUIT'];
		$endereco = $dados['ENDERECO'];
		$contacto = $dados['CONTACTO'];
		$email = $dados['EMAIL'];
		$data = $dados['DATA'];

		echo "<tr>";
		echo "<td class='idp'>$id</td>";
		echo "<td title='cod' class='editavel'>$cod</td>";
		echo "<td title='nome' class='editavel'>$nome</td>";
		echo "<td title='contrato' class='editavel'>$contrato</td>";
		echo "<td title='nuit' class='editavel'>$nuit</td>";
		echo "<td title='endereco' class='editavel'>$endereco</td>";
		echo "<td title='contacto' class='editavel'>$contacto</td>";
		echo "<td title='email' class='editavel'>$email</td>";
		echo "<td>$data</td>";
		echo "<td><img src='../img/config/iconfinder_basket_1814090.png' class='img' ida = '$id' style='cursor: pointer;'></td>";
		echo "</tr>";
}