$title = "show ticket"; include "functions.php"; if (ereg("([0-9]+)([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])", $_ENV[REQUEST_URI], $regs)) { $ticket_id = $regs[1]; $ticket_auth = $regs[2]; } else { $ticket_id = $_GET[ticket_id] + 0; $ticket_auth = $_GET[ticket_auth] + 0; if (!$ticket_auth) { if ($user->user_is_admin) { $q = mysql_query_wrapper("select ticket_auth from tickets where ticket_id='$ticket_id'"); $row = mysql_fetch_object($q); $ticket_auth = $row->ticket_auth; } else { header("Location: login.php?r=show.php%3fticket_id%3d$ticket_id"); exit; } } } include "top.php"; $myurl = ("http://" . $_SERVER['HTTP_HOST'] . "/" . $ticket_id . $ticket_auth); $q = mysql_query_wrapper("select *, users.user_name user_name, users.user_id user_id, assigned.user_name assigned_user_name, concat(lower(date_format(note_date_created, '%l:%i%p')),date_format(note_date_created, ' %M %e, %Y')) nice_note_date_created from tickets left join notes on ticket_id=note_ticket_id and ('$user->user_is_admin'>0 or note_is_public>0) left outer join users on note_user_id=users.user_id left join states on ticket_state_id=state_id left outer join users assigned on ticket_assigned_to=assigned.user_id where ticket_id='$ticket_id' and ticket_auth='$ticket_auth' order by note_date_created"); ?>
Ticket #=$ticket_id.$ticket_auth?>
include "bottom.php"; ?>