<div class="container-fluid">
    <div class="row">
      <div class="col-lg-12">
        <div class="page-content">
           
          <!-- ***** Most Popular Start ***** -->
          <div class="most-popular" style="margin-top:0;">
            <div class="row">
              <div class="col-lg-12">
                <div class="heading-section">
                  <h4><em>All Games</em> Populer</h4>
                </div>
                <div class="row">
                    
                    <?php $sql  = $pdo->query("SELECT * FROM tb_games ORDER BY view DESC LIMIT 16")or die(print_r($pdo->errorInfo(), true)); ?>
                    <?php while($data = $sql->fetch(PDO::FETCH_ASSOC)){ ?>
                    <?php 
                    $cat  = $pdo->query("SELECT * FROM tb_game_categories WHERE id = '".$data['game_category_id']."'")or die(print_r($pdo->errorInfo(), true)); 
                    $data_cat = $cat->fetch(PDO::FETCH_ASSOC)
                    ?>
                    
                  <div class="col-lg-3 col-sm-6" onclick="location.href='<?php echo BASE_URL; ?>/games/<?php echo $data['game_slug']; ?>';" role="button">
                    <div class="item">
                        <?php $image_path = (empty($data['image'])) ? "" . BASE_URL . "/img/default-bg.png" : "" . BASE_URL . "/uploads/".$data['image']; ?>
                      <img src="<?php echo $image_path; ?>" alt="">
                      <h4><?php echo $data['game_title']; ?><br><span><?php echo $data_cat['game_category_name']; ?></span></h4>
                    </div>
                  </div>
                  
                  <?php } ?>
                  
                </div>
              </div>
            </div>
          </div>
          <!-- ***** Most Popular End ***** -->

        </div>
      </div>
    </div>
  </div>