예제 #1
0
<?php

include '../config.php';
include '../functions.php';
saveQuestion($_POST['question']);
예제 #2
0
     }
     foreach ($_POST['data'] as $key => $dataset) {
         if (isset($dataset['delete'])) {
             deleteQuestion($key);
         }
         $rank = $dataset['rank'];
         $parentid = $dataset['parentid'];
         $title = trim($dataset['title']);
         $description = $dataset['description'];
         $percent = $dataset['percent'];
         if (!parentExists($pollid, $parentid)) {
             $notify->add($lang->get('detailedpoll'), sprintf($lang->get('notify_parent_missing'), $parentid, $title));
         } else {
             if ($title != '') {
                 if ($key == 'new') {
                     saveQuestion($pollid, $title, $description, $rank, $parentid, $percent);
                 } else {
                     updateQuestion($key, $title, $description, $rank, $parentid, $percent);
                 }
             }
         }
     }
 }
 if ($pollid > 0) {
     $poll = getPollById($pollid);
     if ($poll) {
         $smarty->assign('poll', $poll);
         $smarty->assign('questions', getQuestions($pollid));
     }
 }
 $smarty->assign('singlequestion_path', $template_dir . '/questions_single.tpl');