Beispiel #1
0
<?php

$template->setTitle('Viewing User List');
$users = getAllUsersByStatus(USER_TEACHER) + getAllUsersByStatus(USER_PARENT);
if (!isset($_GET['user'])) {
    // Remove the break user.
    unset($users[-1]);
    $return = 'Here is a list of all users. Click on a user to view the list of appointments currently scheduled.<br /><br />';
    foreach ($users as $user) {
        $return .= '<a href="index.php?list&user='******'id'] . '">';
        $return .= $user['fname'] . ' ' . $user['lname'] . ' (' . $user['description'] . ')';
        $return .= '</a><br />';
    }
    $template->setContent($return);
} else {
    // Because the partial appends to the $return array so that it's compatible
    // with other views, we must set the $return variable.
    $return = '';
    $user = getUser($_GET['user']);
    include ROOT . '/views/_appointments.php';
    $_SESSION['notices'][] = $return;
    header('Location: index.php');
    exit;
}
Beispiel #2
0
<?php

$template->setTitle('Viewing Admin Page');
$return = '<br /><strong>Currently logged in as: </strong>' . $_SESSION['username'] . '. Click <a href="index.php?logout">here</a> to logout.';
$return .= '<br />Click <a href="index.php?list">here</a> to view appointments in terms of each user (teachers and parents).';
$return .= '<h3>Instructions:</h3>';
$return .= '<ul><li>Please use a Javascript enabled browser to make your appointments.</li>
<li>To schedule, please click next to the teachers name. Then, click on the time that you would like to schedule. Finally, click the Submit button.</li>
<li>If you need to delete a previously scheduled appointment, click the appointment again and select the Delete button.</li>

<li>Please contact <a href="mailto:' . $support_email . '">' . $support_email . '</a> if you have problems.</li> </ul>';
$return .= '<br />';
$tabular_times = tabularTimes();
$teachers = getAllUsersByStatus(USER_TEACHER);
$return .= '<div id="time_grid">';
foreach ($teachers as $teacher) {
    include ROOT . '/views/_grid.php';
}
$return .= '</div>';
$template->setContent($return);
Beispiel #3
0
<?php

echo 'Please confirm the scheduling of this appointment:<br />';
echo '<form class="app_form" id="appointment" method="post" action="index.php?add">';
echo 'Parent: ';
if ($_SESSION['user_access'] == USER_ADMIN || $_SESSION['user_access'] == USER_TEACHER) {
    $parents = getAllUsersByStatus(USER_PARENT);
    echo '<select id="parent" name="parent">';
    foreach ($parents as $parent) {
        echo '<option value="' . $parent['id'] . '">' . $parent['lname'] . '</option>';
    }
    echo '</select>';
} elseif ($_SESSION['user_access'] == USER_PARENT) {
    $parent = getUser($_SESSION['user_id']);
    echo $parent['fname'] . ' ' . $parent['lname'];
    echo '<input id="parent" type="hidden" name="parent" value="' . $parent['id'] . '" />';
}
echo '<br />';
echo 'Teacher: ';
$teacher = getUser($teacher_id);
echo $teacher['fname'] . ' ' . $teacher['lname'];
echo '<input id="teacher" type="hidden" name="teacher" value="' . $teacher['id'] . '" />';
echo '<br />';
echo 'Time: ' . date($date_format, $time);
echo '<input id="time" type="hidden" name="time" value="' . $time . '" />';
echo '<br />';
echo '<input id="hash" type="hidden" name="hash" value="' . md5($secure_hash . $_SESSION['user_id'] . $time) . '" />';
echo '<input type="submit" id="submit" value="Submit" />';
echo '</form>';