Ejemplo n.º 1
0
        }
        // if all checks are done, cancel ...
        if ($continue) {
            $done = expregister__cancel($participant, $session);
            $done = participant__update_last_enrolment_time($participant_id);
            $done = log__participant("cancel_session_enrolment", $participant['participant_id'], "experiment_id:" . $session['experiment_id'] . "\nsession_id:" . $session_id);
            message(lang('successfully_canceled_enrolment_xxx') . " " . experiment__get_public_name($session['experiment_id']) . ", " . session__build_name($session_id) . ". " . lang('this_will_be_confirmed_by_an_email'));
            redirect("public/participant_show_mob.php" . $token_string);
        }
    }
}
if ($proceed) {
    $labs = laboratories__get_laboratories();
    // load the data
    // invitations
    $invdata = expregister__get_invitations($participant_id);
    $invited = $invdata['invited'];
    $inv_experiments = $invdata['inv_experiments'];
    // registrations
    $registered = expregister__get_registrations($participant_id);
    // history
    $history = expregister__get_history($participant_id);
    if (isset($_SESSION['message_text'])) {
        $message_text = $_SESSION['message_text'];
    } else {
        $message_text = "";
    }
    $_SESSION['message_text'] = "";
    // render the page
    $footer = '<div data-role="footer" data-theme="a"><h1>' . $settings['default_area'] . '</h1></div></div>';
    //$footer='</div>';
Ejemplo n.º 2
0
function expregister__list_invited_for($participant)
{
    global $lang, $color, $preloaded_laboratories, $token_string;
    if (!(is_array($preloaded_laboratories) && count($preloaded_laboratories) > 0)) {
        $preloaded_laboratories = laboratories__get_laboratories();
    }
    $invdata = expregister__get_invitations($participant['participant_id']);
    $invited = $invdata['invited'];
    $inv_experiments = $invdata['inv_experiments'];
    $now = time();
    echo '<TABLE width="100%" border="0" cellspacing="0">';
    $labs = array();
    foreach ($invited as $s) {
        if ($s['new_experiment']) {
            echo '<TR>
        			<TD colspan=3 bgcolor="' . $color['list_shade_subtitle'] . '">
                		<B>' . $s['experiment_public_name'] . '</B>';
            if (or_setting('allow_public_experiment_note') && isset($s['public_experiment_note']) && trim($s['public_experiment_note'])) {
                echo '<BR><i>' . lang('note') . ': ' . trim($s['public_experiment_note']) . '</i>';
            }
            echo '</TD></TR>';
        }
        echo '<TR><TD>&nbsp;&nbsp;&nbsp;</TD><TD bgcolor="' . $color['list_shade1'] . '">';
        echo '<B>' . $s['session_name'] . '</B>, ';
        if (isset($preloaded_laboratories[$s['laboratory_id']])) {
            echo $preloaded_laboratories[$s['laboratory_id']]['lab_name'];
        } else {
            echo lang('unknown_laboratory');
        }
        if (or_setting('include_sign_up_until_on_enrolment_page')) {
            echo ",  " . lang('registration_until') . " ";
            echo ortime__format($s['registration_unixtime'], '', lang('lang'));
        }
        if (or_setting('allow_public_session_note') && isset($s['public_session_note']) && trim($s['public_session_note'])) {
            echo '<BR><i>' . lang('note') . ': ' . trim($s['public_session_note']) . '</i>';
        }
        echo '</TD>';
        if (!$s['session_full'] && $s['registration_unixtime'] >= $now) {
            echo '<FORM action="participant_show.php">';
            if ($token_string) {
                echo '<INPUT type=hidden name="p" value="' . $participant['participant_id_crypt'] . '">';
            }
            echo '<INPUT type=hidden name="s" value="' . $s['session_id'] . '">
				<TD bgcolor="' . $color['list_shade1'] . '">
				<INPUT class="button small" style="font-size: 8pt;" type=submit name="register" value="' . lang('register') . '">
				</TD>
				</FORM>';
        } elseif ($s['registration_unixtime'] < $now) {
            echo '<TD bgcolor="' . $color['list_shade1'] . '">
				<span class="button disabled" style="font-size: 8pt; color: ' . $color['session_public_expired'] . ';">' . lang('expired') . '</span></TD>';
        } else {
            echo '<TD bgcolor="' . $color['list_shade1'] . '">
				<span class="button disabled" style="font-size: 8pt; color: ' . $color['session_public_complete'] . ';">' . lang('complete') . '</span></TD>';
        }
        echo '
			</TR>
			<TR><TD colpan=3>&nbsp;</TD></TR>';
        $labs[$s['laboratory_id']] = $s['laboratory_id'];
    }
    if (count($invited) == 0) {
        echo '<TD><B>' . lang('no_current_invitations') . '</B></TD>';
    }
    echo '</TABLE>';
    return $labs;
}