<?php
session_start();
include('conexion.php');

?>
<!doctype html>
<html lang="en" onclick="cerrar();cerrar2()" ;>

<head>
    <?php
    include('./include/sesiones.php');
    include('include/head.php');
    ?>
    <div id="div_buscador"></div>
    <?php
    include('php_menu/menu_categorias.php');
    include('php_menu/menu_izquierdo.php');
    ?>
</head>

<body>
    <br>
    <section class="home_product_area mb-50">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="section_title" id="categoria_productos">
                        <h2> <span>PROMOCIONES</span></h2>
                    </div>
                    <div class="shop_area shop_sidebar  mb-50">
                        </h2>
                        <div class="row">
                            <div class="col-md-12 col-lg-12">
                                <div class="shop_toolbar_wrapper">
                                    <div class="shop_toolbar_btn">
                                        <button data-role="grid_4" type="button" class="active btn-grid-4" data-bs-toggle="tooltip" title="4"></button>
                                        <button data-role="grid_3" type="button" class="btn-grid-3" data-bs-toggle="tooltip" title="3"></button>
                                    </div>
                                </div>
                                <div class='filter_data'></div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</body>
<div id="resultados"></div>
<?php

?>

<?php include('include/footer.php') ?>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
<div id="resultados"></div>

<script>
    function buscador() {
        $.get("./php_menu/buscador.php", "", function(data) {
            $("#div_buscador").html(data);
        })
    }
    buscador();

    $(document).ready(function() {
        load(1);
    });

    function load(page) {
        $('.filter_data').html('');
        $.ajax({
            url: "./php_tienda/tabla_resultados_promociones.php",
            method: "GET",
            data: {
                page: page
            },
            success: function(data) {
                $('.filter_data').html(data);
                buscador();
            }
        });
    }



    function get_filter(class_name) {
        var filter = [];
        $('.' + class_name + ':checked').each(function() {
            filter.push($(this).val());
        });
        return filter;
    }
    $('.common_selector').click(function() {
        load(1);
    });
</script>


</html>