Esempio n. 1
0
    // if not admin, skip (don't update) the following fields
    if (!$admin) {
        $skipped = array('emails1', 'schnip', 'dimo', 'sch1', 'sch2');
        $newForm->skipFields($skipped);
    }
    $newForm->submitForm();
} else {
    //retrieve a record for update if GET var is set
    if (isset($_GET['id'])) {
        $newForm->getRecord($_GET['id']);
    } else {
        die("Error...(no get var)");
    }
    // check if school or admin, else die
    if (!$admin) {
        $email = $newForm->getFieldValue('emails1');
        if (!strcmp($email, $_SESSION['email1']) || !strcmp($email, $_SESSION['email2'])) {
        } else {
            $errormsg = iconv('Windows-1253', 'UTF-8', '<h2>Λάθος. Δεν έχετε δικαίωμα να δείτε αυτό το πρόγραμμα...</h2>');
            die($errormsg);
        }
    }
    $title = $newForm->getFieldValue('titel');
    $updated = $newForm->getFieldValue('timestamp');
    echo iconv('Windows-1253', 'UTF-8', "<h1><i>Πρόγραμμα:</i> ") . $title . "</h1>";
    // hide fields from users
    $hidden = array('id', 'timestamp', 'vev');
    $newForm->hideFields($hidden);
    // force types
    //$newForm->forceType('visits','select');
    //$newForm->forceType('duration','select');