<?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="row">
       
	   
	   <div class="container">
        <div class="col-sm-4">
            <form action="" method="post" enctype="multipart/form-data">
                <?php cadCompany();?>
                <div class="form-group">
                    <label for="nome_empresa">Nome da empresa</label>
                    <input type="text" name="nome_empresa" class="form-control" required/>
                </div>

                <div class="form-group">
                    <label for="nuit">Nuit</label>
                    <input type="number" name="nuit" class="form-control" required/>
                </div>

                <div class="form-group">
                    <label for="endereco">Endereco</label>
                    <input type="text" name="endereco" class="form-control" required/>
                </div>

                <div class="form-group">
                    <label for="email">Email</label>
                    <input type="email" name="email" class="form-control" required/>
                </div>

                <div class="form-group">
                    <label for="contactos">Contactos</label>
                    <input type="text" name="contactos" class="form-control" required/>
                </div>

                <div class="form-group">
                    <label for="logo">Logotipo</label>
                    <input type="file" name="logo" class="form-control" required/>
                </div>

                <div class="form-group">
                    <input type="submit" name="cad_empresa" class="btn btn-info btn-sm" value="Cadastrar"/>
                </div>
            </form>
        </div>
       </div>
       
       <div class="container">
           <table class="table">
               <thead>
                   <tr>
                       <th>Nome da empresa</th>
                       <th>Nuit</th>
                       <th>Endereco</th>
                       <th>Email</th>
                       <th>Contacto</th>
                   </tr>
                   </thead>
                   <tbody>
                       <?php 
                       $sql = "SELECT * FROM empresa";
                       $query = mysqli_query($con,$sql);
                       while($row = mysqli_fetch_assoc($query)){
                       ?>
                       <tr>
                           <td><?php echo $row['nome_empresa'];?></td>
                           <td><?php echo $row['nuit'];?></td>
                           <td><?php echo $row['endereco'];?></td>
                           <td><?php echo $row['email'];?></td>
                           <td><?php echo $row['contactos'];?></td>
                       </tr>
                       <?php } ?>
                   </tbody>
               </th>
           </table>
       </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";?>

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

</body>

</html>
