<?php 
	include_once "../view/partials/template/message.php";
?>
<section class="speaker-banner bg_img" data-background="images/banner/mytickets.png" style="opacity: 1;">
    <div class="container">
        <div class="speaker-banner-content">
            <h2 class="capital">Mis Tickets</h2>
        </div>
    </div>
</section>
<section class="apps-seciton padding-top padding-bottom pt-lg-3">
    <div class="container">
        <div class="row flex-wrap-reverse justify-content-center">

            <?php include_once "../view/partials/template/myTicketsSidebar.php"; ?>

            <div class="col-lg-9">

                <div class="checkout-widget checkout-contact">

                    
                    <h5 class="title capital">Mis Pr&oacute;ximos Eventos</h5>
                    <p class="title text-white">Para ingresar al evento debes generar un c&oacute;digo <b>QR</b> desde la app m&oacute;vil de <b>Qubit Tickets</b>.</p>
                    
                    <?php
                     
                    if($events){

                        foreach ($events as $ev) { 
                        
                        ?>

                        <div class="faq-wrapper">

                            <div class="faq-item">

                                <div class="faq-title">

                                    <h6 class="title capital"><?= $ev['evennomb']." - ".strftime('%b %d %Y', strtotime($ev['evenfech'])); ?></h6>

                                    <span class="right-icon"></span>

                                </div>

                                <div class="faq-content">

                                <div class="ticket--area row justify-content-center">

                                <?php foreach ($tickets as $tk) { 

                                    if($tk['evenid'] == $ev['evenid']){
                                    
                                    ?>
                                                                    
                                    <div class="col-sm-8 col-md-6 col-xl-5">
                                        <div class="ticket-item pb-3">
                                            <div class="ticket-thumb">
                                                <img src="images/event/ticket/ticket02.png" alt="event">
                                            </div>
                                            <div class="ticket-content">
                                                <span class="ticket-title"><?= $tk['locanomb']; ?></span>
                                                <p class="title">Ticket # <?= $tk['numboleta']; ?></p>
                                                <div>
                                                    <form id="transferForm" action="<?= getUrl("tickets", "Tickets", "transferTickets"); ?>" method="POST">
                                                        <div class="form-group px-2">
                                                            <input type="number" name="transfernumber" id="transfernumber" min="10" placeholder="Ingresa n&uacute;mero celular" class="form-control transition-3" required>
                                                            <input type="hidden" name="ticketnum" value="<?= $tk['indexChain']; ?>">
                                                            <input type="submit" name="locId" class="custom-button mt-3" value="Transferir">
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <?php 
                                    }
                                } 
                                ?>
                                </div>
                                </div>

                            </div>
                            
                        </div>

                    <?php 
                        } 
                    } else { 
                    ?>
                        <div class="container">
                            <p class="sub-title">Parece que a&uacute;n no tienes eventos para asistir</p>
                            <div class="event-about-thumb">  
                                <img src="images/account/notickets.png" class="border-white" alt="no_tickets">
                            </div>
                        </div>
                    <?php 
                    } 
                    ?>
                </div>
            </div>
        </div>
        <div class="row pt-5">
            <?php include_once "../view/partials/template/sponsors.php"; ?>
        </div>
    </div>
</section>