' . lang('delete_participation_status') . ' "' . $pstatus_internal_name[lang('lang')] . '"
								</TD>
						</TR></TABLE>
					</TD></TR>
                    <TR>
						<TD colspan=2>
                                ' . lang('really_delete_participation_status?') . '<BR><BR>';
    dump_array($pstatus);
    echo '
                        </TD>
                    </TR>';
    $pstatus_internal_names = lang__load_lang_cat('participation_status_internal_name');
    echo '
                        <TR>
                            <TD align=left colspan=2>
                            <INPUT class="button" type=submit name=reallydelete value="' . lang('yes_delete') . '">
					<BR>
					' . lang('merge_participation_status_with') . '
					' . expregister__participation_status_select_field('merge_with', '', array($pstatus_id)) . '  				
					</TD></TR>
				<TR>
                                <TD align=center colspan=2><BR><BR>
                                <INPUT class="button" type=submit name=betternot value="' . lang('no_sorry') . '">
                                </TD>
                        </TR>
                </TABLE>

                </FORM>
                </center>';
}
include "footer.php";
            if ($show_payment_types) {
                $field = '';
                $field .= lang('set_payment_type') . '&nbsp';
                $field .= payments__paytype_selectfield('paytype_allsel', '', array(), $thislist_avail_payment_types);
                $field .= '<button class="button" name="paytype_button" id="paytype_button">' . lang('button_set') . '</button>';
                $fields[] = $field;
            }
            $field = '';
            $field .= lang('set_payment_amount') . '&nbsp';
            $field .= '<INPUT type="text" name="payamt_allsel" value="0.00" size="7" maxlength="10" style="text-align:right;">';
            $field .= '<button class="button" name="payamt_button" id="payamt_button">' . lang('button_set') . '</button>';
            $fields[] = $field;
        }
        $field = '';
        $field .= lang('set_participation_status') . '&nbsp';
        $field .= expregister__participation_status_select_field('pstatus_allsel', '');
        $field .= '<button class="button" name="pstatus_button" id="pstatus_button">' . lang('button_set') . '</button>';
        $fields[] = $field;
        foreach ($fields as $k => $field) {
            $fields[$k] = '<TD align="center">
												<TABLE border="0" class="or_panel"><TR><TD>' . $field . '</TD></TR></TABLE>
														</TD>';
        }
        echo '<TABLE class="or_option_buttons_box" style="width: 95%; background: ' . $color['options_box_background'] . ';">';
        echo '<TR><TD colspan="' . count($fields) . '" style="padding: 5px;"><B>' . lang('for_all_selected_participants') . '</B></TD></TR>';
        echo '<TR>';
        echo implode('<TD>&nbsp</TD>', $fields);
        echo '</TR>';
        echo '<TR><TD colspan="' . count($fields) . '"></TD></TR>';
        echo '</TABLE>';
        $status_colors = expregister__get_pstatus_colors();
示例#3
0
function participant__get_result_table_row($columns, $p)
{
    global $settings, $color;
    global $thislist_sessions, $thislist_avail_payment_budgets, $thislist_avail_payment_types;
    $pform_columns = participant__load_all_pform_fields();
    $out = '';
    foreach ($columns as $k => $arr) {
        switch ($k) {
            case 'email_unconfirmed':
                $message = "";
                $message = experimentmail__get_confirmation_mail_text($p);
                $message = str_replace(" ", "%20", $message);
                $message = str_replace("\n\\m", "\n", $message);
                $message = str_replace("\\m\n", "\n", $message);
                $message = str_replace("\\m", "\n", $message);
                $message = str_replace("\n", "%0D%0A", $message);
                $linktext = 'mailto:' . $p['email'] . '?subject=' . str_replace(" ", "%20", lang('registration_email_subject')) . '&reply-to=' . urlencode($settings['support_mail']) . '&body=' . $message;
                $out .= '<td class="small">';
                $out .= '<A class="small" HREF="' . $linktext . '">' . $p['email'] . '</A>';
                $out .= '</td>';
                break;
            case 'checkbox':
                $out .= '<td class="small">';
                $out .= '<INPUT type="checkbox" name="sel[' . $p['participant_id'] . ']" value="y"';
                if (isset($_REQUEST['sel'][$p['participant_id']]) && $_REQUEST['sel'][$p['participant_id']] == 'y') {
                    $out .= ' CHECKED';
                } elseif (isset($_SESSION['sel'][$p['participant_id']]) && $_SESSION['sel'][$p['participant_id']] == 'y') {
                    $out .= ' CHECKED';
                }
                $out .= '></td>';
                break;
            case 'number_noshowup':
                $out .= '<td class="small">';
                $out .= $p['number_noshowup'] . '/' . $p['number_reg'];
                $out .= '</td>';
                break;
            case 'invited':
                $out .= '<td class="small">' . ($p['invited'] ? lang('y') : lang('n')) . '</td>';
                break;
            case 'rules_signed':
                if ($settings['enable_rules_signed_tracking'] == 'y') {
                    $out .= '<td class="small">';
                    $out .= lang($p['rules_signed']);
                    $out .= '</td>';
                }
                break;
            case 'subscriptions':
                $exptypes = load_external_experiment_types();
                $inv_arr = db_string_to_id_array($p[$k]);
                $inv_names = array();
                foreach ($inv_arr as $inv) {
                    if (isset($exptypes[$inv]['exptype_name'])) {
                        $inv_names[] = $exptypes[$inv]['exptype_name'];
                    } else {
                        $inv_names[] = 'undefined';
                    }
                }
                $out .= '<td class="small">' . implode(", ", $inv_names) . '</td>';
                break;
            case 'subpool_id':
                $subpools = subpools__get_subpools();
                $subpool_name = isset($subpools[$p[$k]]['subpool_name']) ? $subpools[$p[$k]]['subpool_name'] : $p[$k];
                $out .= '<td class="small">' . $subpool_name . '</td>';
                break;
            case 'status_id':
                $participant_statuses = participant_status__get_statuses();
                $pstatus_name = isset($participant_statuses[$p[$k]]['name']) ? $participant_statuses[$p[$k]]['name'] : $p[$k];
                if ($participant_statuses[$p['status_id']]['eligible_for_experiments'] == 'y') {
                    $ccolor = $color['participant_status_eligible_for_experiments'];
                } else {
                    $ccolor = $color['participant_status_noneligible_for_experiments'];
                }
                $out .= '<td class="small" bgcolor="' . $ccolor . '">' . $pstatus_name . '</td>';
                break;
            case 'edit_link':
                if (check_allow('participants_edit')) {
                    $out .= '<TD class="small">' . javascript__edit_popup_link($p['participant_id']) . '</TD>';
                }
                break;
            case 'creation_time':
            case 'deletion_time':
            case 'last_enrolment':
            case 'last_profile_update':
            case 'last_activity':
            case 'last_login_attempt':
                $out .= '<td class="small">';
                if ($p[$k]) {
                    $out .= ortime__format($p[$k], 'hide_second:false');
                } else {
                    $out .= '-';
                }
                $out .= '</td>';
                break;
            case 'session_id':
                $out .= '<td class="small">';
                if (check_allow('experiment_edit_participants')) {
                    $out .= '<INPUT type=hidden name="orig_session[' . $p['participant_id'] . ']" value="' . $p['session_id'] . '">';
                    $out .= select__sessions($p['session_id'], 'session[' . $p['participant_id'] . ']', $thislist_sessions, false);
                } else {
                    $out .= session__build_name($thislist_sessions[$p['session_id']]);
                }
                $out .= '</td>';
                break;
            case 'payment_budget':
                if ($settings['enable_payment_module'] == 'y') {
                    $payment_budgets = payments__load_budgets();
                    if (check_allow('payments_edit')) {
                        $out .= '<td class="small">';
                        $out .= payments__budget_selectfield('paybudget[' . $p['participant_id'] . ']', $p['payment_budget'], array(), $thislist_avail_payment_budgets);
                        $out .= '</td>';
                    } elseif (check_allow('payments_view')) {
                        $out .= '<td class="small">';
                        if (isset($payment_budgets[$p['payment_budget']])) {
                            $out .= $payment_budgets[$p['payment_budget']]['budget_name'];
                        } else {
                            $out .= '-';
                        }
                        $out .= '</td>';
                    }
                }
                break;
            case 'payment_type':
                if ($settings['enable_payment_module'] == 'y') {
                    $payment_types = payments__load_paytypes();
                    if (check_allow('payments_edit')) {
                        $out .= '<td class="small">';
                        $out .= payments__paytype_selectfield('paytype[' . $p['participant_id'] . ']', $p['payment_type'], array(), $thislist_avail_payment_types);
                        $out .= '</td>';
                    } elseif (check_allow('payments_view')) {
                        $out .= '<td class="small">';
                        if (isset($payment_types[$p['payment_type']])) {
                            $out .= $payment_types[$p['payment_type']];
                        } else {
                            $out .= '-';
                        }
                        $out .= '</td>';
                    }
                }
                break;
            case 'payment_amount':
                if ($settings['enable_payment_module'] == 'y') {
                    if (check_allow('payments_edit')) {
                        $out .= '<td class="small">';
                        $out .= '<INPUT type="text" name="payamt[' . $p['participant_id'] . ']" value="';
                        if ($p['payment_amt'] != '') {
                            $out .= $p['payment_amt'];
                        } else {
                            $out .= '0.00';
                        }
                        $out .= '" size="7" maxlength="10" style="text-align:right;">';
                        $out .= '</td>';
                    } elseif (check_allow('payments_view')) {
                        $out .= '<td class="small">';
                        if ($p['payment_amt'] != '') {
                            $out .= $p['payment_amt'];
                        } else {
                            $out .= '-';
                        }
                        $out .= '</td>';
                    }
                }
                break;
            case 'pstatus_id':
                $out .= '<td class="small">';
                if (check_allow('experiment_edit_participants')) {
                    $out .= '<INPUT type=hidden name="orig_pstatus_id[' . $p['participant_id'] . ']" value="' . $p['pstatus_id'] . '">';
                    $out .= expregister__participation_status_select_field('pstatus_id[' . $p['participant_id'] . ']', $p['pstatus_id']);
                } else {
                    $pstatuses = expregister__get_participation_statuses();
                    $out .= $pstatuses[$p['pstatus_id']]['internal_name'];
                }
                $out .= '</td>';
                break;
            default:
                if (isset($pform_columns[$k])) {
                    $out .= '<td class="small">';
                    if ($pform_columns[$k]['link_as_email_in_lists'] == 'y') {
                        $out .= '<A class="small" HREF="mailto:' . $p[$k] . '">';
                    }
                    if (preg_match("/(radioline|select_list|select_lang|radioline_lang)/", $pform_columns[$k]['type'])) {
                        if (isset($pform_columns[$k]['lang'][$p[$k]])) {
                            $out .= lang($pform_columns[$k]['lang'][$p[$k]]);
                        } else {
                            $out .= $p[$k];
                        }
                    } else {
                        $out .= $p[$k];
                    }
                    if ($pform_columns[$k]['link_as_email_in_lists'] == 'y') {
                        $out .= '</A>';
                    }
                    $out .= '</td>';
                } else {
                    $out .= '<td class="small">';
                    if (isset($p[$k])) {
                        $out .= $p[$k];
                    } else {
                        $out .= '???';
                    }
                    $out .= '</td>';
                }
        }
    }
    return $out;
}