<?php
   require_once("header.php");
   require_once("menu.php");
?>
<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;Why Us

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

                                            if($qu==0)
                                    {
                                    ?>
                                    <a href="add_why_us.php" class="btn btn-primary btn-sm float-right add_right">Add</a>
                                    <?php
                                     }
                                    else
                                    {
                                      while($row=mysqli_fetch_array($query))
                                      {
                                       ?>
                                        <a  href="add_why_us.php?edit=<?php echo base64_encode($row['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_why_us();
                  while($row=mysqli_fetch_array($ex))
                  {
                  ?>
               <table class="table table-bordered" width="100%" cellspacing="0">
                
                  <tr>
                     <th>Section 1 Text</th>
                     <td><?php echo $row['section1_text'];?></td>
                  </tr>
                  <tr>
                     <th>Section 1 Image</th>
                     <td><img src="<?php echo $row['section1_img'];?>" height="auto" width="300px"></td>
                  </tr>
                   <tr>
                     <th>Section 2 Text</th>
                     <td><?php echo $row['section2_text'];?></td>
                  </tr>
				   <tr>
                     <th>Section 2 Image</th>
                     <td><img src="<?php echo $row['section2_img'];?>" height="auto" width="300px"></td>
                  </tr>
				  <tr>
                     <th>Section 3 Text</th>
                     <td><?php echo $row['section3_text'];?></td>
                  </tr>
				   <tr>
                     <th>Section 3 Image</th>
                     <td><img src="<?php echo $row['section3_img'];?>" height="auto" width="300px"></td>
                  </tr>
				  <tr>
                     <th>Where We Operate Title</th>
                     <td><?php echo $row['where_we_oprate_title'];?></td>
                  </tr>
				  <tr>
                     <th>Where We Operate Text</th>
                     <td><?php echo $row['where_we_oprate_text'];?></td>
                  </tr>
                  <?php } ?>
				 </table>
				 
				 <h5 style="background: #243a4f3d;padding: 15px;">360 Visibility Content</h5>
				 <table class="table table-bordered"  width="100%" cellspacing="0">
                        <thead>
                            <tr>

                         <th>360 Visibility Title</th>
						 <th>360 Visibility Content</th>
						 <th>360 Visibility Icon Text</th>
                          <th>Action (Edit)</th>
                            </tr>
                        </thead>
                        <tbody>
								<?php
								$ex = $obj->view_whyus_visibility();
								while($row=mysqli_fetch_array($ex))
								{
								?>
									<tr>
								
										<td><?php echo $row['360_title'];?></td>
										<td><?php echo $row['360_content'];?></td>
										<td><?php echo $row['360_icon'];?></td>
										
										<td>
											<a href="update_why_us.php?edit=<?php echo base64_encode($row['360_id']);?>" class="edit_right btn btn-primary btn-sm"><i class="fas fa-edit"></i></a>
										</td>
									</tr>
								<?php } ?>
                        </tbody>
                    </table>
					
					<h5 style="background: #243a4f3d;padding: 15px;">Digital Promotion 360 Content</h5>
					<table class="table table-bordered"  width="100%" cellspacing="0">
                        <thead>
                            <tr>

                         <th>Digital Promotion Title</th>
						 <th>Digital Promotion Content</th>
						 <th>Digital Promotion Icon Text</th>
                          <th>Action (Edit)</th>
                            </tr>
                        </thead>
                        <tbody>
								<?php
								$ex = $obj->view_digital_promotion();
								while($row=mysqli_fetch_array($ex))
								{
								?>
									<tr>
								
										<td><?php echo $row['digital_promo_title'];?></td>
										<td><?php echo $row['digital_promo_content'];?></td>
										<td><?php echo $row['digital_promo_icon'];?></td>
										
										<td>
											<a href="update-digitalpromo.php?edit=<?php echo base64_encode($row['digital_promo_id']);?>" class="edit_right btn btn-primary btn-sm"><i class="fas fa-edit"></i></a>
										</td>
									</tr>
								<?php } ?>
                        </tbody>
                    </table>
            </div>

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