dbprefix}koolielu_polls WHERE ID = {$poll_id};"); $poll_variants = get_data("SELECT * FROM {$CONFIG->dbprefix}koolielu_polls_variants WHERE poll_id = {$poll_id} ORDER BY pos"); $vars_text = ""; foreach ($poll_variants as $var) { $vars_text .= $var->variant . "\n"; } $isCompleted = false; $answerstext = ""; $polls_answers = get_data("SELECT * FROM {$CONFIG->dbprefix}koolielu_polls_answers WHERE poll_id=$poll_id"); if (is_array($polls_answers) && count($polls_answers) > 0) { $isCompleted = true; } if ($isCompleted == true || $poll->isActive == 1) $answerstext = poll_results_html($poll_id); $poll_array = array( "poll_id" => $poll->ID, "questiontext" => $poll->questiontext, "variantstext" => $vars_text, "isActive" => $poll->isActive, "isCompleted" => $isCompleted, "answerstext" => $answerstext); //echo($poll->questiontext); // $encoded = json_encode($poll_array); echo($encoded); //echo($vars_text); //json_encode($export) ?>