<?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>

        <!-- Icon Cards-->



<div class="container-fluid">

<!-- Breadcrumbs-->

<!-- DataTables Example -->
<div class="card mb-3">
  <div class="card-header">
    <i class="fas fa-table"></i>
    <b>Tipos de contractos editados</b></div>
  <div class="card-body">
    <div class="table-responsive">
      <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
        <thead>
          <tr>
            <th>Item</th>
            <th>Nome</th>
            <th>Valor</th>
           	 <th>Contracto</th>
			 </tr>
        </thead>
       
        <tbody>
            
          <?php 
          $item =1;
          $find = $database->query("SELECT ce.id,ce.credito_id, cr.id,cr.id_cliente,cr.valor,cli.id_cliente,cli.nome_cliente
           FROM contratos_editados ce INNER JOIN creditos cr ON cr.id = ce.credito_id 
           INNER JOIN clientes cli ON cli.id_cliente = cr.id_cliente");
          while($row = $database->fetch_assoc($find)){
                $id = $row['id'];
                         
            ?>
           <tr>   
            <td><?php echo $item++;?></td>
            <td><?php echo $row['nome_cliente'];?></td>
            <td><?php echo number_format($row['valor'],2,",",".");?></td>
      
<td><button type="button" class="btn btn-info btn-sm"><a href="contractoFinalEditado.php?id=<?php echo $id;?>" target="_blank" style="text-decoration:none;color:white"><span><i class="fa fa-print" aria-hidden="true"></i></span></a></button></td>


      
          </tr>
        
        <?php }
          
          ?>  

         
      
   
               </tbody>
      </table>
    </div>
  </div>
  <div class="card-footer small text-muted">Jonas Dinis Chambela</div>
</div>


</div>

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

		 </div>
        
        
        </div>
      </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";?>
 <?php include "includes/sweatscripFooter.php";?>
