<?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;About Us

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

                                            if($qu==0)
                                    {
                                    ?>
                                    <a href="add_about_details.php" class="btn btn-primary btn-sm float-right add_right">Add</a>
                                    <?php
                                     }
                                    else
                                    {
                                      while($row=mysqli_fetch_array($query))
                                      {
                                       ?>
                                        <a  href="add_about_details.php?edit=<?php echo base64_encode($row['about_details_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->get_aboutdetails();
                  while($row=mysqli_fetch_array($ex))
                  {
                  ?>
               <table class="table table-bordered" width="100%" cellspacing="0">
                
                  <tr>
                     <th>Top</th>
                     <td><?php echo $row['about_details_top'];?></td>
                  </tr>
                  <tr>
                     <th>Bottom</th>
                     <td><?php echo $row['about_details_bottom'];?></td>
                  </tr>
                  <?php } ?>
               </table>
            </div>

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