Beispiel #1
0
    $idtomodify = $_POST["idtomodify" . $modifier];
    $sql = 'UPDATE ' . MAIN_DB_PREFIX . "opensurvey_user_studs";
    $sql .= " SET reponses = '" . $db->escape($nouveauchoix) . "'";
    $sql .= " WHERE id_users = '" . $db->escape($idtomodify) . "'";
    $resql = $db->query($sql);
    if (!$resql) {
        dol_print_error($db);
    }
}
// Delete comment
$idcomment = GETPOST('deletecomment', 'int');
if ($idcomment) {
    if (!$canbemodified) {
        accessforbidden();
    }
    $resql = $object->deleteComment($idcomment);
}
/*
 * View
 */
$form = new Form($db);
$arrayofjs = array();
$arrayofcss = array('/opensurvey/css/style.css');
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss);
// Define format of choices
$toutsujet = explode(",", $object->sujet);
$listofanswers = array();
foreach ($toutsujet as $value) {
    $tmp = explode('@', $value);
    $listofanswers[] = array('label' => $tmp[0], 'format' => $tmp[1] ? $tmp[1] : 'checkbox');
}