  <section class="border-top py-4">
         <div class="container">
            <div class="bottom-line">
               <h6 class="h5 mb-4">Best Offers</h6>
            </div>
            <div class="row">
<?php   $sqlc = "SELECT company, image FROM  company_master ORDER BY rand() LIMIT 4";
   
    $myq=$conn->query($sqlc);
  $mydar= $myq->fetchAll()  ;
  
  $rows_fou = $myq->rowCount(); 
   foreach( $mydar as $rowcn) { 
                   $company  = $rowcn['company'];
          $image  = $rowcn['image']; 

          $sql_coupon_company="SELECT * FROM coupon WHERE company_name='$company' AND coupon_code!='' LIMIT 2";

   $myquery_coupon_company=$conn->query($sql_coupon_company);
   $mydaracou_coupon_company= $myquery_coupon_company->fetchAll()  ;
   
   $rows_found_coupon_company = $myquery_coupon_company->rowCount();
   if($rows_found_coupon_company > 0){ 
                  ?>
               <div class="col-lg-3 col-6">
                  <div class="icouponworld-offer">
                     <p class="icouponworld-offer-border text-capitalize text-truncate"><?=$company ?> OFFERS</p>
                    
                        <ul class="list-unstyled b-offers">
                         <?php     
                          foreach( $mydaracou_coupon_company as $rowcou ){
           $rowId    = $rowcou["rowId"];
            $short_title   = $rowcou["short_title"];
            $full_title   = $rowcou["full_title"];
            $link = $rowcou["link"];
            $image   = $rowcou["image"];
            $exp_date = $rowcou["exp_date"];
            $coupon_code   = $rowcou["coupon_code"];
            $category   = $rowcou["category"]; 
             $total_likes   = $rowcou["total_likes"]; ?>
                            <a href="./redeem-id/<?=($rowId)?>" target="_blank">
                           <li>
                              <?php     if (!filter_var($image, FILTER_VALIDATE_URL) === false) { ?>
                                  
                                   <img src="<?=$image ?>" alt="<?=$company ?>" title="<?=$company ?>" class="img-fluid">
                                      
                                  <?php }else { ?>
                                      
                                  
                                    <span alt="<?=$company ?>" title="<?=$company ?>" class="text-truncate best-offer-tleft"><?=$company_name ?></span>
                                
                               <?php } ?>
                              <p title="<?=$short_title?>"><?=$short_title?></p>
                            
                           </li>
                           </a>
                          <?php } ?>
                        </ul>
                   
                     <div class="icouponworld-offer-top bg-white">
                        <p alt="<?=$company ?>" title="<?=$company ?>" class="text-truncate"><?=$company ?> Offers</p>
                        <?php     if (!filter_var($image, FILTER_VALIDATE_URL) === false) { ?>
                                   
                                   <img src="<?=$image ?>"  alt="<?=$company ?>" title="<?=$company ?>" class="img-fluid w-50 best-offer">
                                      
                                  <?php }else { ?>
                                      
                                  
                                    <span alt="<?=$company ?>" title="<?=$company ?>" class="best-offers-title text-truncate"><?=$company ?></span>
                                
                               <?php } ?>
                     </div>
                  </div>
               </div>
              

            <?php } }  ?>
               <div class="col-md-12 my-2">
                  <!--banner Begin-->
                    <?php    if(!empty($google_adar )){
                echo $google_adar ;
            }else{
                echo ' <img src="admin/forms/'.$adimg3.'" alt="Horizontal Banner" title="Horizontal Banner" class="img-fluid rounded-3">';
            }
            
            ?>
             <!--banner End-->
                  
               </div>
            </div>
         </div>
      </section>