<?php
   require_once("header.php");
   require_once("menu.php");
   
   if(isset($_REQUEST['del']))
{
    $office_id = base64_decode($_REQUEST['del']);
    $ex = $obj->delete_office_location($office_id);
    echo '<script>window.location="contact.php"</script>';
}
   ?>
<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-table mr-1"></i>Contact us Deatils
            <a href="add_contact.php" class="btn btn-primary btn-sm float-right add_right">Add New Location</a>
         </div>
       <div class="card-body">
                   <div class="table-responsive">
                <?php
                  $ex = $obj->view_contact_info();
                  while($row=mysqli_fetch_array($ex))
                  {
                  ?>
               <table class="table table-bordered" width="100%" cellspacing="0">
                 <tr>
                     <th style="width: 300px;">Office Address</th>
                     <td><?php echo $row['office_address'];?></td>
                  </tr>
                   <tr>
                     <th style="width: 300px;">Email</th>
                     <td><?php echo $row['office_email'];?></td>
                  </tr>
                   <tr>
                     <th style="width: 300px;">Phone</th>
                     <td><?php echo $row['office_phone'];?></td>
                  </tr>
				  <tr>
                     <th style="width: 300px;">Map Code</th>
                     <td><?php echo $row['office_map'];?></td>
                  </tr>
                  <tr>
                      <th>Slider Background</th>
                      <td><img width="500" src="<?php echo $row['office_bg_img'];?>"></td>
                  </tr>
               <!--  <tr>
                      <th>Slider Image</th>
                      <td><img width="100" src="<?php echo $row['home_slider_img'];?>"></td>
                  </tr> -->
          <tr>
                     <th>Action</th>
                      <td colspan="2">
                        <a href="add_contact.php?edit=<?php echo base64_encode($row['contact_id']);?>" class="edit_right btn btn-primary btn-sm"><i class="fas fa-edit"></i></a>
                        <a href="contact.php?del=<?php echo base64_encode($row['contact_id']);?>" class="btn btn-danger btn-sm delete_right" title="Delete"><i class="fas fa-trash"></i></a>
                     </td>
                  </tr>
           
                  <?php } ?>
               </table>
            </div>
            </div>
      </div>
   </div>
</main>
<?php require_once("footer.php");?>