<?php

if ($_SESSION['id_user'] == "") {
    echo '
			<script>
				window.location = "/login"
			</script>
        ';
}

$id = $pagina[1];
$base = '';
$bt_iz = '';
$bt_dr = '';
$circulo = '';


$documentos = mysqli_query($connect, "SELECT * FROM Stand_Documentos WHERE id_evento = 1 AND id_stand = $id AND estado = 1");
$interactiva = mysqli_query($connect, "SELECT * FROM Stand_Interactivos WHERE id_evento = 1 AND id_stand = $id AND estado = 1");
$videos = mysqli_query($connect, "SELECT * FROM Stand_Videos WHERE id_evento = 1 AND id_stand = $id AND estado = 1");
$contactos = mysqli_query($connect, "SELECT * FROM Stand_Contactos WHERE id_evento = 1 AND id_stand = $id AND estado = 1");
// $dataIz = mysqli_fetch_array($queryIz);

$base = $recursos . '/' . $data["imagen"];

$bg = "";

if ($id == 1) {
    $bg = "bg_stand_argentina.png";
} else if ($id == 2) {
    $bg = "bg_stand_colombia.png";
} else if ($id == 3) {
    $bg = "bg_stand_mexico.png";
} else if ($id == 4) {
    $bg = "bg_stand_experiencias.png";
} else if ($id == 5) {
    $bg = "bg_stand_juegos.png";
}

?>



<style>
    body {
        background-image: url('/img/img_wd/<?php echo $bg; ?>');
    }

    .blanco {
        color: white !important;
    }

    /*  @media screen and (max-height: 674px) {}

    @media screen and (min-height: 675px) and (max-height: 816px) {}

    @media screen and (min-height: 817px) and (max-height: 1024px) {}

    @media screen and (min-height: 1024px) and (max-height: 1750px) {} */

    /*   @media screen and (min-width: 1750px) {
        .btn-1-1 {
            position: absolute !important;
            top: 10% !important;
            left: 25% !important;
        }
        .btn-1-2 {
            position: absolute;
            top: 30%;
            left: 25%;
        }
        .btn-1-3 {
            position: absolute;
            top: 40%;
            left: 25%;
        }
        .btn-1-4 {
            position: absolute;
            top: 50%;
            left: 25%;
        }

    } */
</style>


<div class="modal fade" id="modal_descargar" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Descargue información correspondiente a su país</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" align="left">

                <div class="list-group">
                    <?php
                    while ($dataInfo = mysqli_fetch_array($documentos)) {
                        echo '
                            <a href="' . $dataInfo["archivo"] . '" target="_blank" class="list-group-item list-group-item-action" onclick="GuardarDato(' . $_SESSION['id_user'] . ',1,' . "'" . $dataInfo["titulo"] . "'" . ')">
                                ' . $dataInfo["titulo"] . '
                            </a>
                        ';
                    }
                    ?>
                </div>

            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal_videos_info" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Videos</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" align="left">

                <div class="list-group">
                    <?php
                    while ($dataVideo = mysqli_fetch_array($videos)) {
                        echo '
                            <a href="#" data-dismiss="modal" class="list-group-item list-group-item-action" onclick="Ver_Videos(' . "'" . $dataVideo["video"] . "'" . '); OcultarPopVideos(); GuardarDato(' . $_SESSION['id_user'] . ',2, ' . "'" . $dataInfo["titulo"] . "'" . ')">
                                ' . $dataVideo["titulo"] . '
                            </a>
                        ';
                    }
                    ?>
                </div>

            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal_chat" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Chat en línea</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" align="left">

                <div class="list-group">
                    <?php
                    while ($dataChat = mysqli_fetch_array($contactos)) {
                        echo '
                            
                            <a href="https://wa.me/' . $dataChat["telefono"] . '/?text=Hola,+quiero+información+sobre+' . $data["nombre"] . '" target="_blank" class="list-group-item list-group-item-action" onclick="GuardarDato(' . $_SESSION['id_user'] . ',3, ' . "'" . $dataInfo["nombre"] . "'" . ')">
                                <img src="' . $url . '/img/whatsapp.png" width="30">
                                ' . $dataChat["nombre"] . '
                            </a>
                        ';
                    }
                    ?>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal_zonas" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Zona Interactiva</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" align="left">
                <div class="list-group">
                    <?php
                    while ($dataZona = mysqli_fetch_array($interactiva)) {
                        echo '
                            <a href="' . $dataZona["link"] . '" target="_blank" class="list-group-item list-group-item-action" onclick="GuardarDato(' . $_SESSION['id_user'] . ',5, ' . "'" . $dataInfo["titulo"] . "'" . ')">
                                ' . $dataZona["titulo"] . '
                            </a>
                        ';
                    }
                    ?>
                </div>


            </div>
        </div>
    </div>
</div>
<div class="e_web">

    <?php
    if ($id == 1) {
    ?>
        <div class="row text-center">
            <div class="col-12">
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_descargar" style="position: absolute; top: 180px; left: 370px;">
                    <img src="/img/img_wd/bt_descargar.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_videos_info" style="position: absolute; top: 240px; right: 400px;">
                    <img src="/img/img_wd/bt_video.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_chat" style="position: absolute; top: 220px; right: 600px;">
                    <img src="/img/img_wd/bt_chat.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_zonas" style="position: absolute; top: 180px; left: 180px;">
                    <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
                </button>
            </div>
        </div>

    <?php
    } else if ($id == 2) {
    ?>
        <div class="row text-center">
            <div class="col-12">
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_descargar" style="position: absolute; top: 160px; left: 370px;">
                    <img src="/img/img_wd/bt_descargar.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_videos_info" style="position: absolute; top: 230px; right: 400px;">
                    <img src="/img/img_wd/bt_video.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_chat" style="position: absolute; top: 210px; right: 600px;">
                    <img src="/img/img_wd/bt_chat.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_zonas" style="position: absolute; top: 210px; left: 160px;">
                    <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
                </button>
            </div>
        </div>

    <?php
    } else if ($id == 3) {
    ?>
        <div class="row text-center">
            <div class="col-12">
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_descargar" style="position: absolute; top: 150px; right: 410px;">
                    <img src="/img/img_wd/bt_descargar.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_videos_info" style="position: absolute; top: 230px; left: 280px;">
                    <img src="/img/img_wd/bt_video.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_chat" style="position: absolute; top: 200px; right: 600px;">
                    <img src="/img/img_wd/bt_chat.png" width="100px" alt="">
                </button>
                <button type="button" class="btn" data-toggle="modal" data-target="#modal_zonas" style="position: absolute; top: 180px; right: 150px;">
                    <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
                </button>
            </div>
        </div>

    <?php
    } else if ($id == 4) {
    ?>
        <div class="row text-center">
            <div class="col-12">
                <a href="#" target="_blank">
                    <button type="button" class="btn" style="position: absolute; top: 220px; left: 350px;">
                        <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
                    </button>
                </a>
                <a href="#" target="_blank">
                    <button type="button" class="btn" style="position: absolute; top: 220px; right: 350px;">
                        <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
                    </button>
                </a>

                <a href="#" target="_blank">
                    <button type="button" class="btn" style="position: absolute; top: 180px; left: 505px;">
                    <img src="/img/img_wd/bt_descargar.png" width="100px" alt="">
                    </button>
                </a>
                <a href="#" target="_blank">
                    <button type="button" class="btn" style="position: absolute; top: 180px; right: 475px;">
                    <img src="/img/img_wd/bt_descargar.png" width="100px" alt="">
                    </button>
                </a>

                <a href="#" target="_blank">
                    <button type="button" class="btn" style="position: absolute; top: 220px; left: 235px;">
                    <img src="https://www.compralohuila.com/img/whatsapp.png" width="30">
                    </button>
                </a>
                <a href="#" target="_blank">
                    <button type="button" class="btn" style="position: absolute; top: 210px; right: 275px;">
                    <img src="https://www.compralohuila.com/img/whatsapp.png" width="30">
                    </button>
                </a>
            </div>
        </div>
    <?php
    } else if ($id == 5) {
    ?>

        <a href="<?php echo $url; ?>/concursos/1">
            <button type="button" class="btn parpadea" style="position: absolute; top: 55%; left: 25%;">
                <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
            </button>
        </a>
        <a href="<?php echo $url; ?>/trivia/1">
            <button type="button" class="btn parpadea" style="position: absolute; top: 55%; left: 45%;">
                <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
            </button>
        </a>
        <a href="<?php echo $url; ?>/concursos/2">
            <button type="button" class="btn parpadea" style="position: absolute; top: 55%; left: 67%;">
                <img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt="">
            </button>
        </a>
        <!-- <a href="<?php echo $url; ?>/concursos/3"><button type="button" class="btn btn-light" style="position: absolute; top: 80%; left: 48%; background-color: #fdd300; border: 0;">DRIVE TRIP</button></a> -->

    <?php
    }
    ?>

    <?php /* echo $bt_iz;  */ ?>
    <?php /* echo $bt_dr; */ ?>

    <div>
        <a class="fixed-bottom" href="<?php echo $url; ?>/muestra">
            <button type="button" class="btn btn-danger" style="border-radius: 30px; margin-bottom: 15px; margin-left: 10%; color: #000; font-size: 15px; background-color: #fdd300; border: 0; font-family: S-Core-CoreSansBold;">
                <i class="fa fa-arrow-left" aria-hidden="true"></i> Stands
            </button>
            <!-- <img src="<?php echo $url; ?>/img/img_wd/bt_back.png" style="width: 130px; position: absolute; bottom: 20px; left: 10%;"> -->
        </a>
    </div>

    <div align="right">
        <a href="<?php echo $url; ?>/lobby" class="fixed-bottom">
            <button type="button" class="btn btn-danger" style="border-radius: 30px; margin-bottom: 15px; margin-right: 10%; color: #000; font-size: 15px; background-color: #fdd300; border: 0; font-family: S-Core-CoreSansBold;">
                <i class="fa fa-arrow-left" aria-hidden="true"></i> Lobby
            </button>
            <!-- <img src="<?php echo $url; ?>/img/img_wd/bt_back.png" style="width: 130px; position: absolute; bottom: 20px; left: 10%;"> -->
        </a>
    </div>


</div>

<div class="e_movil" align="center">
    <div class="fixed-bottom">
        <?php
        if ($id == 1) {
        ?>
            <div class="row text-center">
                <div class="col-12">
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_descargar"><img src="/img/img_wd/bt_descargar.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_videos_info"><img src="/img/img_wd/bt_video.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_chat"><img src="/img/img_wd/bt_chat.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_zonas"><img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt=""></button>
                </div>
            </div>

        <?php
        } else if ($id == 2) {
        ?>
            <div class="row text-center">
                <div class="col-12">
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_descargar"><img src="/img/img_wd/bt_descargar.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_videos_info"><img src="/img/img_wd/bt_video.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_chat"><img src="/img/img_wd/bt_chat.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_zonas"><img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt=""></button>
                </div>
            </div>

        <?php
        } else if ($id == 3) {
        ?>
            <div class="row text-center">
                <div class="col-12">
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_descargar"><img src="/img/img_wd/bt_descargar.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_videos_info"><img src="/img/img_wd/bt_video.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_chat"><img src="/img/img_wd/bt_chat.png" width="100px" alt=""></button>
                    <button type="button" class="btn" data-toggle="modal" data-target="#modal_zonas"><img src="/img/img_wd/bt_zona_interactiva.png" width="100px" alt=""></button>
                </div>
            </div>

        <?php
        } else if ($id == 4) {
        } else if ($id == 5) {
        ?>

            <a href="<?php echo $url; ?>/stand/5"><button type="button" class="btn btn-light">CRUCIGRAMA</button></a>
            <a href="<?php echo $url; ?>/stand/5"><button type="button" class="btn btn-light">TRIVIA</button></a>
            <a href="<?php echo $url; ?>/stand/5"><button type="button" class="btn btn-light">BUSCA PALABRA</button></a>

        <?php
        }
        ?>
    </div>

    <div style="margin-top: 70px;">
        <a href="<?php echo $url; ?>/muestra">
            <img src="<?php echo $url; ?>/img/img_wd/bt_back.png" width="130">
        </a>
    </div>
</div>


<style>
    .botones {
        position: absolute;
        border-radius: 30px;
        font-size: 11px;
        padding: 5px 20px;
        font-weight: bold;
    }

    .parpadea {

        animation-name: parpadeo;
        animation-duration: 1s;
        animation-timing-function: linear;
        animation-iteration-count: infinite;

        -webkit-animation-name: parpadeo;
        -webkit-animation-duration: 3s;
        -webkit-animation-timing-function: linear;
        -webkit-animation-iteration-count: infinite;
    }

    @-moz-keyframes parpadeo {
        0% {
            transform: scale(1);
        }

        15% {
            transform: scale(1.1);
        }

        30% {
            transform: scale(1);
        }

        100% {
            transform: scale(1);
        }
    }

    @-webkit-keyframes parpadeo {
        0% {
            transform: scale(1);
        }

        15% {
            transform: scale(1.1);
        }

        30% {
            transform: scale(1);
        }

        100% {
            transform: scale(1);
        }
    }

    @keyframes parpadeo {
        0% {
            transform: scale(1);
        }

        15% {
            transform: scale(1.1);
        }

        30% {
            transform: scale(1);
        }

        100% {
            transform: scale(1);
        }
    }
</style>

<script>
    $(document).ready(function() {
        $("#maestro").height($("#img_muestra").height());
    });

    $(window).resize(function() {
        $("#maestro").height($("#img_muestra").height());
    });
</script>