<?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;Software Top Section

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

                                            if($qu==0)
                                    {
                                    ?>
                                    <a href="add_software_top_section.php" class="btn btn-primary btn-sm float-right add_right">Add</a>
                                    <?php
                                     }
                                    else
                                    {
                                      while($row=mysqli_fetch_array($query))
                                      {
                                       ?>
                                      <a  href="add_software_top_section.php?edit=<?php echo base64_encode($row['soft_top_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_software_top_sec();
                  while($row=mysqli_fetch_array($ex))
                  {
                  ?>
               <table class="table table-bordered" width="100%" cellspacing="0">
                <tr>
                     <th>Image</th>
                     <td><img src="<?php echo $row['soft_top_img'];?>" height="auto" width="300px"></td>
                  </tr>
                  <?php } ?>
               </table>
            </div>

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