<?php include "includes/header.php";?>

<?php include "includes/navbar.php";?>

  <div id="wrapper">

    <!-- Sidebar -->
   <?php include "includes/sidebar.php";?>

    <div id="content-wrapper">

      <div class="container-fluid">

        <!-- Breadcrumbs-->
        <ol class="breadcrumb">
          <li class="breadcrumb-item">
            <a href="#">Ola</a>
          </li>
          <li class="breadcrumb-item active"><?php echo $_SESSION['nome'];?></li>
        </ol>

        <h2><font color='green'>Arquivo do cliente</font></h2>

	  
	  
	  

		<table class="table">
		 <thead>
		  <tr>
		   <th>B.I</th>
		   <th>NUIT</th>
		   <th>DECLARACAO DO BAIRRO</th>
		   <th>DECLARACAO DE SALARIO</th>

		  </tr>
		 </thead>
		 
		 <tbody>
		 
		<?php 
		if(isset($_GET['id']) && !empty($_GET['id'])){
		    $id = $_GET['id'];
		}
		$item=1;	
		
		$buscar_ficheiros = mysqli_query($con,"SELECT * FROM clientes WHERE id_cliente = '$id'");
		while($row = mysqli_fetch_assoc($buscar_ficheiros)){
			
			$bi_scan = $row['bi_scan'];
			$nuit_scan = $row['nuit_scan'];
			$dec_bairro = $row['dec_bairro'];
			$dec_salario = $row['dec_salario'];

		
		?>
		  <tr>
         <td><a href="#" onclick="verArquivo('img/<?php echo $bi_scan;?>')" class="btn btn-sm btn-info">Ver B.I</a></td>
         <td><a href="#" onclick="verArquivo('img/<?php echo $nuit_scan;?>')" class="btn btn-sm btn-info">Ver NUIT</a></td>
           <td><a href="#" onclick="verArquivo('img/<?php echo $dec_bairro;?>')" class="btn btn-sm btn-info">Ver Declaração Bairro</a></td>
            <td><a href="#" onclick="verArquivo('img/<?php echo $dec_salario;?>')" class="btn btn-sm btn-info">Ver Declaração Salário</a></td>

		
		  </tr>
		  <?php }?>
		
		  
		 </tbody>
		 
		 
		</table>	
		

      </div>
      <!-- /.container-fluid -->

      <!-- Sticky Footer -->
     <?php include "includes/footer.php";?>

    </div>
    <!-- /.content-wrapper -->

  </div>
  <!-- /#wrapper -->

  <!-- Scroll to Top Button-->
  <a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
  </a>

  <!-- Logout Modal-->
<?php include "includes/logout_modal.php"; ?>

<!-- Modal para visualização -->
<div class="modal fade" id="verArquivoModal" tabindex="-1" role="dialog" aria-labelledby="verArquivoModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="verArquivoModalLabel">Visualizar Arquivo</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Fechar">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <iframe id="iframeArquivo" src="" width="100%" height="600px" style="border:none;"></iframe>
      </div>
    </div>
  </div>
</div>


  <!-- Bootstrap core JavaScript-->
  <script src="vendor/jquery/jquery.min.js"></script>
  <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

  <!-- Core plugin JavaScript-->
  <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

  <!-- Page level plugin JavaScript-->
  <script src="vendor/chart.js/Chart.min.js"></script>
  <script src="vendor/datatables/jquery.dataTables.js"></script>
  <script src="vendor/datatables/dataTables.bootstrap4.js"></script>

  <!-- Custom scripts for all pages-->
  <script src="js/sb-admin.min.js"></script>

  <!-- Demo scripts for this page-->
  <script src="js/demo/datatables-demo.js"></script>
  <script src="js/demo/chart-area-demo.js"></script>
  
  <script>
function verArquivo(caminho) {
  document.getElementById('iframeArquivo').src = caminho;
  $('#verArquivoModal').modal('show');
}
</script>


</body>

</html>
