<div class="nav-collapse">
                <ul class="nav pull-right">
                    <?php 
AccountDropdownBuilder::buildDropdown($db, $_SESSION);
?>
                    <li><a href="home.php">Home</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<div class="container hero-unit">
    <h1>View Appointments:</h1>  <br/><br/>
    <?php 
$tableBuilder = new AppointmentTableBuilder();
$tableBuilder->showAppointments($_SESSION['user'], $db, false);
?>

    <script type="text/javascript">
        var elems = document.getElementsByClassName('confirmation');
        var confirmIt = function (e) {
            if (!confirm('Are you sure?')) e.preventDefault();
        };
        for (var i = 0, l = elems.length; i < l; i++) {
            elems[i].addEventListener('click', confirmIt, false);
        }
    </script>
</div>

</body>
        echo "<h2>Admin Info:</h2>";
        $info = array("Sex" => "sex");
        break;
}
foreach ($info as $key => $value) {
    if (!empty($userProfile[$value])) {
        echo "<b>" . $key . ":</b> " . $userProfile[$value] . "<br/>";
    }
}
if (!empty($insurance_company)) {
    echo "<b>" . 'Insurance Provider' . ":</b> " . $insurance_company . "<br/>";
}
if ($_SESSION['user']['user_type_id'] == 4 && $userProfile['user_type_id'] != 4) {
    // admins should be able to the users past appointments
    echo "<h2>Appointments:</h2>";
    $tableBuilder = new AppointmentTableBuilder();
    $tableBuilder->showAppointments($userProfile, $db, true);
} else {
}
// Only patients can schedule appointments with doctors.
if ($userProfile['user_type_id'] == 2 && $_SESSION['user']['user_type_id'] == 1) {
    $link = "http://wal-engproject.rhcloud.com/src/schedule_appointment.php?id=" . $userProfile['id'];
    echo "<a href=\"" . $link . "\">Schedule an appointment</a><br/>";
}
?>

    <script type="text/javascript">
        var elems = document.getElementsByClassName('confirmation');
        var confirmIt = function (e) {
            if (!confirm('Are you sure?')) e.preventDefault();
        };