GetResultAnswerArray
Описание и параметры
CForm::GetResultAnswerArray( int form_id, array &columns, array &answers, array &answers2 = array(), array filter = array(), )
Возвращает массивы, описывающие вопросы и поля веб-формы, а также ответы на вопросы. Метод нестатический.
Параметры метода
Параметр | Описание | С версии |
---|---|---|
form_id | ID формы. | Удален с 3.3.10 |
columns | Параметр примет значение ссылки на массив, описывающий те вопросы и поля формы, которые:
Array ( [140] => Array ( [ID] => 140 [FORM_ID] => 4 [TIMESTAMP_X] => 19.05.2005 11:42:04 [ACTIVE] => Y [TITLE] => Фамилия, имя, отчество [TITLE_TYPE] => html [SID] => VS_NAME [C_SORT] => 100 [ADDITIONAL] => N [REQUIRED] => Y [IN_FILTER] => Y [IN_RESULTS_TABLE] => N [IN_EXCEL_TABLE] => N [FIELD_TYPE] => [IMAGE_ID] => [COMMENTS] => [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => ) [144] => Array ( [ID] => 144 [FORM_ID] => 4 [TIMESTAMP_X] => 11.11.2004 18:11:21 [ACTIVE] => Y [TITLE] => Какие области знаний вас интересуют ? [TITLE_TYPE] => text [SID] => VS_INTEREST [C_SORT] => 500 [ADDITIONAL] => N [REQUIRED] => N [IN_FILTER] => Y [IN_RESULTS_TABLE] => Y [IN_EXCEL_TABLE] => Y [FIELD_TYPE] => [IMAGE_ID] => [COMMENTS] => [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => ) ... ) |
|
answers | Параметр примет значение ссылки на массив, содержащий ответы на вопросы формы, а также значения полей формы. Ключами данного массива являются:
Array ( [186] => Array ( [140] => Array ( [586] => Array ( [RESULT_ID] => 186 [FIELD_ID] => 140 [SID] => VS_NAME [TITLE] => Фамилия, имя, отчество [TITLE_TYPE] => html [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => [ANSWER_ID] => 586 [ANSWER_TEXT] => [MESSAGE] => [ANSWER_VALUE] => [VALUE] => [USER_TEXT] => Иванов Дмитрий Витальевич [USER_DATE] => [USER_FILE_ID] => [USER_FILE_NAME] => [USER_FILE_IS_IMAGE] => [USER_FILE_HASH] => [USER_FILE_SUFFIX] => [USER_FILE_SIZE] => [FIELD_TYPE] => text [FIELD_WIDTH] => 50 [FIELD_HEIGHT] => 0 [FIELD_PARAM] => ) ) [144] => Array ( [594] => Array ( [RESULT_ID] => 186 [FIELD_ID] => 144 [SID] => VS_INTEREST [TITLE] => Какие области знаний вас интересуют ? [TITLE_TYPE] => text [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => [ANSWER_ID] => 594 [ANSWER_TEXT] => иностранные языки [MESSAGE] => иностранные языки [ANSWER_VALUE] => 4 [VALUE] => 4 [USER_TEXT] => [USER_DATE] => [USER_FILE_ID] => [USER_FILE_NAME] => [USER_FILE_IS_IMAGE] => [USER_FILE_HASH] => [USER_FILE_SUFFIX] => [USER_FILE_SIZE] => [FIELD_TYPE] => checkbox [FIELD_WIDTH] => 0 [FIELD_HEIGHT] => 0 [FIELD_PARAM] => ) [595] => Array ( [RESULT_ID] => 186 [FIELD_ID] => 144 [SID] => VS_INTEREST [TITLE] => Какие области знаний вас интересуют ? [TITLE_TYPE] => text [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => [ANSWER_ID] => 595 [ANSWER_TEXT] => програмирование [MESSAGE] => програмирование [ANSWER_VALUE] => 5 [VALUE] => 5 [USER_TEXT] => [USER_DATE] => [USER_FILE_ID] => [USER_FILE_NAME] => [USER_FILE_IS_IMAGE] => [USER_FILE_HASH] => [USER_FILE_SUFFIX] => [USER_FILE_SIZE] => [FIELD_TYPE] => checkbox [FIELD_WIDTH] => 0 [FIELD_HEIGHT] => 0 [FIELD_PARAM] => SELECTED class=inputcheckbox ) ) ... ) ... ) |
|
answers2 | Параметр примет значение ссылки на массив, содержащий, по сути, те же данные, что и массив answers, но имеющий несколько другую структуру.
Пример: Array ( [186] => Array ( [VS_NAME] => Array ( [0] => Array ( [RESULT_ID] => 186 [FIELD_ID] => 140 [SID] => VS_NAME [TITLE] => Фамилия, имя, отчество [TITLE_TYPE] => html [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => [ANSWER_ID] => 586 [ANSWER_TEXT] => [MESSAGE] => [ANSWER_VALUE] => [VALUE] => [USER_TEXT] => Иванов Дмитрий Витальевич [USER_DATE] => [USER_FILE_ID] => [USER_FILE_NAME] => [USER_FILE_IS_IMAGE] => [USER_FILE_HASH] => [USER_FILE_SUFFIX] => [USER_FILE_SIZE] => [FIELD_TYPE] => text [FIELD_WIDTH] => 50 [FIELD_HEIGHT] => 0 [FIELD_PARAM] => ) ) [VS_INTEREST] => Array ( [0] => Array ( [RESULT_ID] => 186 [FIELD_ID] => 144 [SID] => VS_INTEREST [TITLE] => Какие области знаний вас интересуют ? [TITLE_TYPE] => text [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => [ANSWER_ID] => 594 [ANSWER_TEXT] => иностранные языки [MESSAGE] => иностранные языки [ANSWER_VALUE] => 4 [VALUE] => 4 [USER_TEXT] => [USER_DATE] => [USER_FILE_ID] => [USER_FILE_NAME] => [USER_FILE_IS_IMAGE] => [USER_FILE_HASH] => [USER_FILE_SUFFIX] => [USER_FILE_SIZE] => [FIELD_TYPE] => checkbox [FIELD_WIDTH] => 0 [FIELD_HEIGHT] => 0 [FIELD_PARAM] => ) [1] => Array ( [RESULT_ID] => 186 [FIELD_ID] => 144 [SID] => VS_INTEREST [TITLE] => Какие области знаний вас интересуют ? [TITLE_TYPE] => text [FILTER_TITLE] => [RESULTS_TABLE_TITLE] => [ANSWER_ID] => 595 [ANSWER_TEXT] => програмирование [MESSAGE] => програмирование [ANSWER_VALUE] => 5 [VALUE] => 5 [USER_TEXT] => [USER_DATE] => [USER_FILE_ID] => [USER_FILE_NAME] => [USER_FILE_IS_IMAGE] => [USER_FILE_HASH] => [USER_FILE_SUFFIX] => [USER_FILE_SIZE] => [FIELD_TYPE] => checkbox [FIELD_WIDTH] => 0 [FIELD_HEIGHT] => 0 [FIELD_PARAM] => SELECTED class=inputcheckbox ) ) ... ) ... ) |
|
filter | Массив для фильтрации выбираемых значений. Необязательный параметр. В массиве допустимы следующие ключи:
|
|
arrAnswersVarname | 3.3.10. Удален с версии 4.0.4 | |
web_form_id | ID формы. | 3.3.10 |
arrAnswersSID | 4.0.4 |
Смотрите также
Примеры использования
// получим данные по результату ID=145 CForm::GetResultAnswerArray( $FORM_ID, $arrColumns, $arrAnswers, $arrAnswersVarname, array("RESULT_ID" => "145") ); echo "<pre>"; echo "arrColumns:"; print_r($arrColumns); echo "arrAnswers:"; print_r($arrAnswers); echo "arrAnswersVarname:"; print_r($arrAnswersVarname); echo "</pre>";
© «Битрикс», 2001-2024, «1С-Битрикс», 2024