".$_SESSION['uid']."<"); header('Location: index.php'); } $uid = $_SESSION['uid']; $mydb = new DB_MySQL(); //$mydb->query("SELECT * AnmeldungAdressen WHERE uid='$uid'"); $mydb->query("SELECT * FROM `AnmeldungAdressen` WHERE `uid` = '$uid' "); $row = $mydb->fetchRow(); $Strasse = $row['strasse']; $Plz = $row['plz']; $Ort = $row['wohnort']; $Telefon = $row['telefon']; $mydb->disconnect(); $AnschriftVonLagerteilnehmer = $Strasse . " " . $Plz . " " . $Ort; $Form = new JFormer('AdressForm', array('submitButtonText' => '-> Anmeldung Step 3')); $Form->addJFormComponentArray(array( new JFormComponentHtml('

Kontaktperson, die während des Lagers zu erreichen ist:

'), new JFormComponentName('namekontaktperson', 'Name der Kontaktperson:', array( 'validationOptions' => array('required'), 'middleInitialHidden' => true )), new JFormComponentAddress('anschriftkontakt', 'Anschrift der Kontaktperson:', array( 'validationOptions' => array('required'), 'initialValues' => array('addressLine1' => $Strasse , 'city' => $Ort , 'zip' => $Plz), 'addressLine2Hidden' => true, )), new JFormComponentSingleLineText('telefonkontakt', 'Telefonnummer der Kontaktperson:', array( 'width' => 'long', 'initialValue' => $Telefon, 'validationOptions' => array('required'), )), )); function onSubmit($formValues) { session_start(); $uid = $_SESSION['uid']; $nachname = $formValues->namekontaktperson->lastName; $vorname = $formValues->namekontaktperson->firstName; $strasse = $formValues->anschriftkontakt->addressLine1; $plz = $formValues->anschriftkontakt->zip; $wohnort = $formValues->anschriftkontakt->city; $telefon = $formValues->telefonkontakt; if ($uid == "") { error_log("ERROR: SUBMIT bei STEP 2 wurde ohne UID aufgerufen"); $_SESSION['step'] = "0"; } else { $_SESSION['step'] = "3"; //DB-Eintrag $mydb = new DB_MySQL(); $mydb->query("UPDATE AnmeldungStatus SET step = '2' WHERE uid='$uid' AND step < '10' "); $mydb->query("INSERT INTO AnmeldungNotfallkontakt (uid, notfall_nachname, notfall_vorname, notfall_strasse, notfall_plz, notfall_wohnort, notfall_telefon) VALUES ('$uid', '$nachname', '$vorname', '$strasse', '$plz', '$wohnort' , '$telefon') ON DUPLICATE KEY UPDATE notfall_nachname = '$nachname', notfall_vorname = '$vorname', notfall_strasse = '$strasse', notfall_plz = '$plz', notfall_wohnort = '$wohnort', notfall_telefon = '$telefon' "); $mydb->disconnect(); } $response = array('redirect' => 'index.php'); return $response; } // Process any request to the form $Form->processRequest(); ?>