<?php
   require_once("header.php");
   require_once("menu.php");
   $databaseService = new DatabaseService();
   $con = $databaseService->getConnection();
?>
<style>
   th {
   width: 20%;
   }
</style>
<div id="layoutSidenav_content">
<main class="mt-4">
   <div class="container-fluid">
      <div class="card mb-4">
         <div class="card-header">
            <i class="fas fa-border-style"></i>  &nbsp;Integration

                                    <?php 
                                   $query= $obj-> view_integration($row['integration_id']);
                                   $qu= mysqli_num_rows($query);

                                            if($qu==0)
                                    {
                                    ?>
                                    <a href="add_integration.php" class="btn btn-primary btn-sm float-right add_right">Add</a>
                                    <?php
                                     }
                                    else
                                    {
                                      while($row=mysqli_fetch_array($query))
                                      {
                                       ?>
                                        <a  href="add_integration.php?edit=<?php echo base64_encode($row['integration_id']);?>" class="btn btn-primary btn-sm float-right add_right">EDIT INFORMATION</a>
                                       
                                   <?php
                                     }
                                     }
                                     ?>
            
         </div>
         <div class="card-body">
            <div class="table-responsive">
               <?php
                  $ex = $obj->view_integration();
                  while($row=mysqli_fetch_array($ex))
                  {
                  ?>
               <table class="table table-bordered" width="100%" cellspacing="0">
                  <tr>
                     <th>Integration Image</th>
                     <td><img src="<?php echo $row['integration_img'];?>" width="500" height="auto"></td>
                  </tr>
                  <tr>
                     <th>Integration Top Description</th>
                     <td><?php echo $row['integration_top'];?></td>
                  </tr>
                    <tr>
                     <th>Integration Bottom Description</th>
                     <td><?php echo $row['integration_bottom'];?></td>
                  </tr>
           
               </table>
             <?php } ?>
            </div>

         </div>
      </div>
   </div>
</main>
<?php require_once("footer.php");?>