/** * post action */ function post() { parent::post(); // require user details $this->node_data['component']['require_user_details'] = $this->node_data['component']['require_user_details'] ? 'checked="checked"' : ''; // require terms and conditions $this->node_data['component']['require_t_and_c'] = $this->node_data['component']['require_t_and_c'] ? 'checked="checked"' : ''; // display results options $this->node_data['component']['display_results'] = $this->node_data['component']['display_results'] ? 'checked="checked"' : ''; // survey dropdown $Survey = new education_survey(); $surveys = $Survey->getSurveyList("publish = 1"); foreach ($surveys as $survey) { $survey['selected'] = $this->node_data['component']['survey_id'] == $survey['id'] ? "selected='selected'" : ''; $this->tpl->assign("SURVEY_ITEM", $survey); $this->tpl->parse("content.survey_item"); } // template dropdown $this->tpl->assign("SELECTED_template_{$this->node_data['component']['template']}", "selected='selected'"); // restriction dropdown $this->tpl->assign("SELECTED_restriction_{$this->node_data['component']['restriction']}", "selected='selected'"); // limit dropdown $this->tpl->assign("SELECTED_limit_{$this->node_data['component']['limit']}", "selected='selected'"); $this->tpl->assign("SPAM_PROTECTION", array('captcha_text_js' => $this->node_data['component']['spam_protection'] == 'captcha_text_js' ? 'selected="selected"' : '')); }
/** * get list */ public function getList() { require_once 'models/education/education_survey.php'; $Survey = new education_survey(); $list = $Survey->getSurveyListStats('', 'id DESC'); return $list; }
/** * main action */ public function mainAction() { set_time_limit(0); require_once 'models/education/education_survey.php'; $Survey = new education_survey(); /** * Get the list */ $records = $Survey->getSurveyListStats(); $this->commonCSVAction($records, 'surveys'); return true; }