<?php   

session_start();
include('functions/userfunctions.php');
    include('includes/header.php');?>

<div class="container mt-5 mb-5"  id="mainnav">
    <div class="row product_data">
        <?php
        $category_ids = array(19, 42, 43, 53, 51, 52, 54, 50, 42, 43, 44, 45, 46, 47, 48, 49, 24, 18, 17, 16, 15, 14, 20, 23, 25, 22, 21, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41);
        foreach ($category_ids as $category_id) {
          $category_name = getCategoryName($category_id);
          echo '<h2 class="mt-4 mb-2" id="'.$category_id.'">'.getCategoryName($category_id).'</h2>';
            $allproducts = getProdByCategory($category_id);
            if(mysqli_num_rows($allproducts) > 0) {
                foreach($allproducts as $item) {
                    include('includes/indexcatlist.php');
                }
            } else {
                echo "No data available.";
            }
        }
        ?>
    </div>
</div>


    <?php include('includes/footer.php');?>