<tr> <th>id</th> <th>Concierto</th> <th>Fecha</th> <th>Hora</th> <th>Precio</th> <th>Entradas Disponibles</th> </tr> </thead> <tbody> '; foreach ($concertItems as $key => $item) { echo ' <tr id="' . $item['idConcierto'] . '"> <td> ' . $item['idConcierto'] . ' </td> <td> ' . $item['tituloConcierto'] . '</td> <td>' . $item['fechaConcierto'] . '</td> <td>' . $item['horaConcierto'] . '</td> <td>₡ ' . $item['precioConcierto'] . '</td> <td>' . (150 - $concert->countTicketsItems($item['idConcierto'])->count) . '</td> <td> <a class="btn-buy-ticket btn-success" href="buy.php?id=' . $item['idConcierto'] . '">Comprar Entrada</a> </td> </tr> '; } echo '</tbody>'; echo '</table>';
<?php error_reporting(E_ALL); ini_set('display_errors', 1); require_once "buy.php"; require_once "classes/concertClass.php"; include "views/header.php"; $name = $_POST['name']; $userId = $_POST['userId']; $email = $_POST['email']; $ticket = $_POST['entradas']; $concert = new drawConcertTable(); //Get the quantity of tickets in the table ENTRADA $itemsQuant = $concert->countTicketsItems($_GET['id'])->count; for ($i = 0; $i < $ticket; $i++) { $insertTicket = $concert->insertEntrada($itemsQuant + $i, $_GET['id']); } $expectator = $concert->insertEspectador($userId, $name, $email, $ticket, $_GET['id']); include "views/footer.php";
ini_set('display_errors', 1); require_once "buy.php"; require_once "classes/concertClass.php"; include "views/header.php"; $id = $_GET['id']; $name = $_POST['name']; $userId = $_POST['userId']; $email = $_POST['email']; $ticket = $_POST['entradas']; $ticketResponse = ''; if ($ticket == 1) { $ticketResponse = '<p>El total a pagar por tu entrada es de: '; } else { $ticketResponse = '<p>El total a pagar por tus ' . $ticket . ' entradas es de: '; } $concert = new drawConcertTable(); $concertAll = $concert->eventInfo($id); $print = $concertAll[0]['precioConcierto']; //Get the quantity of tickets in the table ENTRADA $itemsQuant = $concert->countTicketsItems($id)->count; for ($i = 0; $i < $ticket; $i++) { $insertTicket = $concert->insertEntrada($itemsQuant + $i, $_GET['id']); } $expectator = $concert->insertEspectador($userId, $name, $email, $ticket, $_GET['id']); echo ' <div class="col-md-6 thanks-msj">' . $ticketResponse . '<span>' . $print * $ticket . ' colones.<span></p> <p>Gracias por su compra!</p> <a href="index.php" class="btn-buy-ticket btn-success">Volver al inicio</a> </div> '; include "views/footer.php";