<?php 
header('Location: category.php');
exit;
include('header.php');?>
<style>
    .wrapper{
        border:2px solid #000;
        padding:20px;
        background:#d71149;
        border-radius:20px;
        margin-bottom:10px;
        height:125px;
    }
    
    .wrapper strong{
        font-size:20px;
    }
    
    .icon{
            padding: 64px 0;
    }
    .icon .fa{
        font-size:25px;
    }
    
   .wrapper  a:hover, a:focus {
    color: #d9e9ce;
    text-decoration: none;
}

.wrapper img {
    height: 80px;
    width: 80px;
}


.wrapper p {
    line-height: 18px;
    font-size: 12px;
    overflow: hidden;
}
</style>
        <section class="hide-sm">
            <div class="container">
                <div class="row">
                    
                    <?php
							$statement = $pdo->prepare("SELECT * FROM tbl_mid_category WHERE show_on_menu=1");
							$statement->execute();
							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
							foreach ($result as $row) {
								?>
								
								<div class="col-md-6 col-lg-4 col-sm-6 col-xs-12 col-12">
                    <div class="wrapper"><div class="category-item2">
                    <a href="category.php?id=<?php echo $row['tcat_id']; ?>&type=top-category">
                    <div class="row">
                        <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 col-4 text-center"><img class="img-fluid rounded-circle" src="assets/uploads/<?php echo $row['pic']; ?>" alt=""></div>
                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 col-8 "><div class="content">
                               
                                <strong> <?php echo $row['tcat_name']; ?></strong><br>
                                <p>
                                    <?php
										$statement1 = $pdo->prepare("SELECT * FROM tbl_mid_category WHERE tcat_id=?");
										$statement1->execute(array($row['tcat_id']));
										$result1 = $statement1->fetchAll(PDO::FETCH_ASSOC);
										foreach ($result1 as $row1) {
											?>
											<?php echo $row1['mcat_name']; ?>,
                                    	<?php
										}
										?>
                                </p>
                        </div></div>
                        <!--<div class=" col-lg-2 col-md-2 col-sm-2 col-xs-2 col-2 "><div class="icon"><i class="fa fa-chevron-right"></i></div></div>-->
                    </div>
                    </a>
                    </div></div>
                </div>
								<?php
							}
							?>
                
                
                </div>
            </div>
        </section>
  
<?php include('footer.php');?>