<?php require_once("../resources/config.php"); ?>

<?php include(TEMPLATE_FRONT . DS . "header.php"); ?>

<!-- Page Content -->
<div class="container">

    <!-- Jumbotron Header -->
    <header>
        <table>
            <tr>
                <td>
                    <h1>Shop</h1>
                </td>

                <td>
                    <div class="col-md-12">
                        <form action="" method="GET" class="form-inline my-2 my-lg-0">
                            <input type="text" name="search_products" class="form-control mr-sm-2" />
                            <input type="submit" value="Search" />
                            <button href="shop.php">All Products</button>
                        </form>
                    </div>
                </td>

            </tr>


        </table>

    </header>

    <hr>

    <!-- /.row -->

    <!-- Page Features -->

        <div class="card-columns">
            
    
            <?php
            if (isset($_GET['search_products'])) {
                search_products();
            } else {
                get_products_in_shop_page();
            }
    
    
    
            ?>
    
        </div>
         
    <!-- /.row -->




<!-- /.container -->
</div>
<?php include(TEMPLATE_FRONT . DS . "footer.php"); ?>