function templateNewTicket($id, $user) { $b = bilheteGet($id); if ($b['acontecimento'] == 'E') { $e = eventosGet($b['id_entidade']); } else { $e = provaGet($b['id_entidade']); } return getTemplate("newticket", array("NAME" => $user['nome'], "USER" => $user['email'], "TIPO" => $b['tipo'] == 'C' ? 'compra' : 'reserva', "ACONTECIMENTO" => $b['acontecimento'] == 'E' ? 'Evento' : 'Prova', "EVENTO" => $e['designacao'], "LOCAL" => $e['local_nome'], "PRECO" => $b['preco'], "QUANTIDADE" => $b['quantidade'], "TOTAL" => $b['preco'] * $b['quantidade'], "ID" => $id, "CHECKSUM_ACCEPT" => md5("ACCEPT" . $id), "CHECKSUM_REJECT" => md5("REJECT" . $id))); }
<?php require_once '../../includes/utils.php'; include_once rootPath('includes/sijo/html_header.php', 1); include_once rootPath('includes/sijo/master_header.php', 1); $error = false; if (isset($_GET['code']) && isset($_GET['checksum'])) { if (md5("ACCEPT" . $_GET['code']) == $_GET['checksum']) { $b = bilheteGet($_GET['code']); if ($b['status'] == 'I') { bilheteUpdateStatus($_GET['code'], 'C'); } else { $error = true; } } else { if (md5("REJECT" . $_GET['code']) == $_GET['checksum']) { bilheteUpdateStatus($_GET['code'], 'X'); } else { $error = true; } } } else { $error = true; } if ($error) { ?> <div class="errormsg" >Não foi possivel confirmar o bilhete.</div> <?php } else { ?> <div class="informationmsg" >Operação realizada com sucesso.</div>