<?php
require('db.php');
include "x.php";
?>
<!doctype html>
<html lang="en">
  <head>
    
     <?php include "include/meta.php"; ?>

     <?php include "include/css.php"; ?>

     <style>
  * {box-sizing: border-box}
  body {font-family: "Lato", sans-serif;}

/* Style the tab */
.tab {
  float: left;
  border: 1px solid #ccc;
  background-color: #f1f1f1;
  width: 30%;
  height: 2300px;
}

/* Style the buttons that are used to open the tab content */
.tab button {
  display: block;
  background-color: inherit;
  color: #990000;
  font-size: 14px;
  padding: 22px 6px;
  width: 100%;          /* class="text-capitalize text-dark text-center" size="3px" color="#ff4d4d" */
  border: none;
  outline: none;
  text-align: left;
  cursor: pointer;
  transition: 0.3s;
}

/* Change background color of buttons on hover */
.tab button:hover {
  background-color: #ddd;
}

/* Create an active/current "tab button" class */
.tab button.active {
  background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
  float: left;
  padding: 0px 12px;
  border: 1px solid #ccc;
  width: 70%;
  border-left: none;
  height: 2300px;
}
@media screen and (max-width: 790px) {
    .tabcontent {
     height: 5200px;}
     .tab {
     height: 5200px;}
}
</style>
<style> #logo_wrapper img {
  max-width: 100%;
  height: auto;
 
 
}
 #Display_none img {
 display: none;
}

.fright{
 float: right;
 heig ht:90px;
}
.fleft{
 float: left;
 hei ght:90px;

}

  @media (max-width: 768px) { 
  .xxxx {
      
  width: 100%;
	   
  }
  

</style>
<style>
table {
  border-collapse: collapse;
  width: 100%;
}

.td1 {
  text-align: center;
  padding: 8px;
}

tr:nth-child(even) {background-color: #f2f2f2;}
</style>
  </head>
  <body>
<?php include "include/header.php"; ?>

<?php
    {

    

    $news_sql = "SELECT * FROM blog WHERE bcat = '6' ORDER BY bid ASC  ";
    $news_run = mysqli_query($con, $news_sql);
  
?>
 <?php                   
	    $see_run = mysqli_query($con, "SELECT * FROM category WHERE cid = '6'");
	    $see_row = mysqli_fetch_assoc($see_run);
	?>
<section class="w3l-contact-breadcrum">
  <div class="breadcrum-bg py-sm-5 py-4">
    <div class="container py-lg-3">
      <h2><?php echo $see_row["cname"]; ?></h2>
      <p><a href="index.php">Home</a> &nbsp; / &nbsp; <?php echo $see_row["cname"]; ?></p>
    </div>
  </div>
</section>
<br>


 
	

<!-- contact -->

                
              
<section class="container">
<div class="tab">
    
     	<?php
          while ( $news_rows = mysqli_fetch_assoc($news_run) ) {
             $newsPath = substr($news_rows['bimage'], 3);
			 $newsPath = "login/".$newsPath;
            $trimmedTitle = mb_strimwidth($news_rows['btitle'], 0, 74, "...");
	?>
  <button class="tablinks" onclick="openCity(event, '<?php echo "$news_rows[bid]";?>')" id="defaultOpen"><b> <?php echo $news_rows['btitle']; ?></b></button>
 
 
 	<?php 

		}

 	?>
              
 
</div>


<?php
    {

    

    $newss_sql = "SELECT * FROM blog WHERE bcat = '6' ORDER BY bid ASC  ";
    $newss_run = mysqli_query($con, $newss_sql);
  
?>


  
 <?php
          while ( $newss_rows = mysqli_fetch_assoc($newss_run) ) {
             $newssPath = substr($newss_rows['bimage'], 3);
			 $newssPath = "login/".$newssPath;
            $trimmedTitle = mb_strimwidth($newss_rows['btitle'], 0, 74, "...");
	?>
	
	
<div  id="<?php echo "$newss_rows[bid]";?>" class="tabcontent"> <br>
<div id="logo_wrapper"> <?php echo $newss_rows['blog']; ?>
 </div>
 </div>
 	<?php 

		}

 	?>
      





</div>


</section>

                
                
            </div>
        </div>
      
</section>
<br><br>
<!-- //contact -->

<?php include "include/footer.php"; ?>
<?php include "include/js.php"; ?>

<script>
      function openCity(evt, cityName) {
        var i, tabcontent, tablinks;
        tabcontent = document.getElementsByClassName("tabcontent");
        for (i = 0; i < tabcontent.length; i++) {
          tabcontent[i].style.display = "none";
        }
        tablinks = document.getElementsByClassName("tablinks");
        for (i = 0; i < tablinks.length; i++) {
          tablinks[i].className = tablinks[i].className.replace(" active", "");
        }
        document.getElementById(cityName).style.display = "block";
        evt.currentTarget.className += " active";
      }

      // Get the element with id="defaultOpen" and click on it
      document.getElementById("defaultOpen").click();
    </script>

</body>

</html>
<?php 
}
 ?>
<?php 
}
 ?>