Пример #1
0
    $id = $stmt->fetchColumn();
    $stmt = $FD->db()->conn()->prepare('INSERT INTO ' . $FD->db()->getPrefix() . "poll_answers (poll_id, answer)\n                   VALUES ('{$id}', ?)");
    for ($i = 0; $i < count($_POST['ant']); $i++) {
        if (!emptystr($_POST['ant'][$i])) {
            $stmt->execute(array($_POST['ant'][$i]));
        }
    }
    systext('Umfrage wurde hinzugef&uuml;gt');
    unset($_POST);
}
/////////////////////
///// Poll Form /////
/////////////////////
if (true) {
    if (isset($_POST['sended']) && !isset($_POST['add_answers'])) {
        echo get_systext($FD->text("admin", "changes_not_saved") . '<br>' . $FD->text("admin", "form_not_filled"), $FD->text("admin", "error"), 'red', $FD->text("admin", "icon_save_error"));
    }
    //time array for "Now" Button
    $jetzt['tag'] = date('d');
    $jetzt['monat'] = date('m');
    $jetzt['jahr'] = date('Y');
    $jetzt['stunde'] = date('H');
    $jetzt['minute'] = date('i');
    if (!isset($_POST['nowtag'])) {
        $_POST['nowtag'] = date('d');
        $_POST['endtag'] = date('d');
    }
    if (!isset($_POST['nowmonat'])) {
        $_POST['nowmonat'] = date('m');
    }
    if (!isset($_POST['nowjahr'])) {
Пример #2
0
                               WHERE answer_id = ?');
                    $stmt->execute(array($_POST['ant'][$i], $_POST['count'][$i], $_POST['id'][$i]));
                }
            }
        }
    }
    systext('Umfrage wurde aktualisiert');
    unset($_POST);
}
///////////////////////
////// Edit Poll //////
///////////////////////
if (isset($_POST['pollid'])) {
    $_POST['pollid'] = $_POST['pollid'][0];
    if (isset($_POST['sended']) && !isset($_POST['add_answers'])) {
        echo get_systext($FD->text('admin', 'changes_not_saved') . '<br>' . $FD->text('admin', 'form_not_filled'), $FD->text('admin', 'error'), 'red', $FD->text('admin', 'icon_save_error'));
    }
    //Time Array for "Now" Button
    $jetzt['tag'] = date('d');
    $jetzt['monat'] = date('m');
    $jetzt['jahr'] = date('Y');
    $jetzt['stunde'] = date('H');
    $jetzt['minute'] = date('i');
    if (isset($_POST['tempid'])) {
        $_POST['pollid'] = $_POST['tempid'];
    }
    settype($_POST['pollid'], 'integer');
    $index = $FD->db()->conn()->query('SELECT * FROM ' . $FD->db()->getPrefix() . "poll WHERE poll_id = '{$_POST['pollid']}'");
    $row = $index->fetch(PDO::FETCH_ASSOC);
    if (!isset($_POST['frage'])) {
        $_POST['frage'] = $row['poll_quest'];