if ($_POST) { $form_content = $_POST; $form_content = $form->handle_action( $survey_data, $form_content ); } if ($error_message != '') { $form_content['question'] = $_SESSION['temp_user_message']; $form_content['answers'] = $_SESSION['temp_answers']; $form_content['values'] = $_SESSION['temp_values']; $form_content['horizontalvertical'] = $_SESSION['temp_horizontalvertical']; unset($_SESSION['temp_user_message']); unset($_SESSION['temp_answers']); unset($_SESSION['temp_values']); unset($_SESSION['temp_horizontalvertical']); } $form->create_form($survey_data, $form_content); $form->render_form(); } else { $form_content = $_POST; $form = new survey_question(); $form->handle_action($survey_data, $form_content); } // Footer Display :: display_footer();
$form_content['values'][3] = 2; $form_content['values'][4] = 3; } // We are editing a question if (isset($_GET['question_id']) && !empty($_GET['question_id'])) { $form_content = survey_manager::get_question($_GET['question_id']); } // An action has been performed (for instance adding a possible answer, moving an answer, ...) if ($_POST) { $form_content = $_POST; $form_content = $form->handle_action($form_content); } if ($error_message != '') { $form_content['question'] = $_SESSION['temp_user_message']; $form_content['answers'] = $_SESSION['temp_answers']; $form_content['values'] = $_SESSION['temp_values']; $form_content['horizontalvertical'] = $_SESSION['temp_horizontalvertical']; unset($_SESSION['temp_user_message']); unset($_SESSION['temp_answers']); unset($_SESSION['temp_values']); unset($_SESSION['temp_horizontalvertical']); } $form->create_form($form_content); $form->render_form(); } else { $form_content = $_POST; $form = new survey_question(); $form->handle_action($form_content); } // Footer Display::display_footer();