<section class="page container">
            <div class="row">
                <div class="span16">
                        <?php 
mysqli_fetch_object(getProfiles());
$tickets = getTicketByID($_GET['ticket']);
while ($ticket = $tickets->fetch_object()) {
    echo "<div class='box'>\n                                        <div class='box-header'>\n                                            <i class='icon-leaf icon-large'></i>\n                                            <h5>({$ticket->ticketnumber}) {$ticket->ticket_name}</h5>\n                                            \n                                        </div>\n                                        <div style='padding:5px;font-size:12px'>\n                                            <b>Date Created</b>: {$ticket->t_date_time}<br>\n                                            <b>Created By</b>: {$ticket->firstname} {$ticket->lastname}, {$ticket->middlename}<br>\n                                            <b>Status</b>: {$ticket->ticket_status_name}<br>\n                                            <b>Notes</b>: {$ticket->ticket_notes}<br>\n                                            <button type='button' class='btn' onClick='window.location.replace(\"/scc/?page=caseview&case={$ticket->case_id}\");'>Back</button>\n                                            ";
    if ($ticket->ticket_status_id == 1 && $_SESSION['user']['employee_id'] == $ticket->t_created_by) {
        echo "<button type='button' class='btn' onClick='window.location.replace(\"/scc/?page=ticketform&update={$ticket->ticket_id}\");'>Update</button>";
    }
    echo "\n                                         </div>\n                                        <div class='box-content box-table'>\n\n                                        </table>\n                                        </div>\n\n                                    </div>";
}
?>
                
                    
                
                
                
                </div>
            </div>
        </section>
        
    
            </div>
        </div>

        <div id="spinner" class="spinner" style="display:none;">
            Loading&hellip;
        </div>
<?php

if (isset($_POST['action']) && isset($_GET['update'])) {
    $ticket = array('ticket_id' => $_GET['update'], 'ticket_notes' => $_POST['ticket_notes'], 'ticket_status' => $_POST['ticket_status']);
    updateTicket($ticket);
}
$ticket = null;
if (isset($_GET['update'])) {
    $ticket = mysqli_fetch_object(getTicketByID($_GET['update']));
}
?>
        <section id="my-account-security-form" class="page container">
            <form id="userSecurityForm" class="form-horizontal" action="" method="post">
                <div class="container">

                    <div class="alert alert-block alert-info">
                        <p>
                            Enter information for your account as desired.  Fields marked with an asterisk
                            are required.
                        </p>
                    </div>
                    <div class="row">
                        <div id="acct-password-row" class="span7">
                            <fieldset>
                                <legend>Ticket Form</legend><br>

                                <?php 
if (isset($_POST['action']) && !isset($_GET['update'])) {
    $ticket = array('ticket_name' => $_POST['ticket_name'], 'ticket_notes' => nl2br($_POST['ticket_notes']), 'ticket_status' => $_POST['ticket_status'], 'case_id' => $_GET['case'], 'created_by' => $_SESSION['user']['employee_id']);
    $ticket_id = createTicket($ticket);
    if ($ticket_id > -1) {