$code .= '$participant_status_mapping["y"]["n"]="' . $_REQUEST['status_y_n'] . '";' . "\n"; $code .= '$participant_status_mapping["y"]["y"]="' . $_REQUEST['status_y_y'] . '";' . "\n"; $code .= '' . "\n"; $code .= '// mapping of participation statuses' . "\n"; $code .= '// participation_mapping[shownup y/n][participated y/n]=pstatus_id' . "\n"; $code .= '$participation_mapping=array();' . "\n"; $code .= '$participation_mapping["n"]["n"]="' . $_REQUEST['pstatus_n_n'] . '";' . "\n"; $code .= '$participation_mapping["n"]["y"]="' . $_REQUEST['pstatus_n_n'] . '";' . "\n"; $code .= '$participation_mapping["y"]["n"]="' . $_REQUEST['pstatus_y_n'] . '";' . "\n"; $code .= '$participation_mapping["y"]["y"]="' . $_REQUEST['pstatus_y_y'] . '";' . "\n"; $code .= '' . "\n"; $code .= '// mapping from old participant profile form to new form' . "\n"; $code .= '// empty value for new column name implies no import' . "\n"; $code .= '// pform_mapping[old column name]=new column name' . "\n"; $code .= '$pform_mapping=array();' . "\n"; $new_fields = participant__userdefined_columns(); foreach ($new_fields as $field => $f) { if (isset($_REQUEST['map_' . $field]) && $_REQUEST['map_' . $field]) { $code .= '$pform_mapping["' . $_REQUEST['map_' . $field] . '"]="' . $field . '";' . "\n"; } } $code .= '' . "\n"; $code .= '// other settings' . "\n"; $code .= '$import_type="' . $_REQUEST['import_type'] . '";' . "\n"; $code .= '$replace_tokens="' . $_REQUEST['replace_tokens'] . '";' . "\n"; $code .= '' . "\n"; $code .= '' . "\n"; echo '<TABLE>'; echo '<TR><TD>'; echo 'Below you find the code to copy over to install/data_import.php. <BR>';
<?php // part of orsee. see orsee.org ob_start(); $title = "participant_profile_fields"; $menu__area = "options_main"; include "header.php"; if ($proceed) { $allow = check_allow('pform_config_field_configure', 'options_main.php'); } if ($proceed) { $user_columns = participant__userdefined_columns(); foreach ($user_columns as $k => $arr) { $user_columns[$k]['has_index'] = 0; $user_columns[$k]['is_configured'] = 0; } $query = "SHOW INDEX FROM " . table('participants'); $result = or_query($query); while ($line = pdo_fetch_assoc($result)) { if (isset($user_columns[$line['Column_name']])) { $user_columns[$line['Column_name']]['has_index'] = 1; } } $query = "SELECT * FROM " . table('profile_fields'); $result = or_query($query); $redundant = array(); while ($line = pdo_fetch_assoc($result)) { if (isset($user_columns[$line['mysql_column_name']])) { $user_columns[$line['mysql_column_name']]['is_configured'] = 1; $user_columns[$line['mysql_column_name']]['enabled'] = $line['enabled']; $user_columns[$line['mysql_column_name']]['type'] = $line['type'];