' . $title . (($required)?' *':'') . ''; switch ($type) { case 'text': if (isset($_POST['registration'])) { $value = stripslashes($value); } if ($display) { echo '' . ''; } else { echo '' . ($value) . ''; } break; case 'checkbox': if ($display) { echo '' . ''; } else { echo '' . ''; } break; case 'password': if ($display) { echo '' . ''; } else { echo '' . createStars($value) . ''; } break; } } /* //\\//\\//\\//\\//\\// // // // LOGIKA STRANKY // // // //\\//\\//\\//\\//\\// */ //inicializace promennych $errorTitle = ''; //titulek k chybove hlasce $infoTitle = ''; // titulek k informacni hlasce $error = ''; //seznam nevyplnenych povinnych parametru $display = true; //formularove prvky se maji zobrazit jako formulare //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ // pocatecni nastaveni dat pro 3 stavy: \\ // data se nacitaji z odeslaneho formulare \\ // data se nacitaji z DB - aktualizace registrace \\ // prazdny formular pro novou registraci \\ //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ /* Check the deadline of new registration */ $message=''; $infoTitle = ''; $msgType = 'info'; if(time() > getTimestamp($deadline_registration)) { $message = "Registration is closed - time is up.
"; $deadlineRegistration = true; } else { $deadlineRegistration = false; } if (isset($_POST['registration'])) { //\\//\\//\\//\\//\\//\\//\\//\\ // nacteni dat z formulare \\ //\\//\\//\\//\\//\\//\\//\\//\\ $degree1 = (isset($_POST['degree1'])) ? $_POST['degree1'] : ''; //titul pred jmenem $degree2 = (isset($_POST['degree2'])) ? $_POST['degree2'] : ''; //titul za jmenem $name = (isset($_POST['name'])) ? $_POST['name'] : ''; //jmeno $name2 = (isset($_POST['name2'])) ? $_POST['name2'] : ''; //2. jmeno $surname = (isset($_POST['surname'])) ? $_POST['surname'] : ''; //prijmeni $email = (isset($_POST['email'])) ? $_POST['email'] : ''; //e-mail $affiliation = (isset($_POST['affiliation'])) ? $_POST['affiliation'] : ''; //organizace $position = (isset($_POST['position'])) ? $_POST['position'] : ''; //pozice v organizaci $street = (isset($_POST['street'])) ? $_POST['street'] : ''; //ulice $city = (isset($_POST['city'])) ? $_POST['city'] : ''; //mesto $zip = (isset($_POST['zip'])) ? $_POST['zip'] : ''; //PSC $country = (isset($_POST['country'])) ? $_POST['country'] : 0; //zeme $phone = (isset($_POST['phone'])) ? $_POST['phone'] : ''; //telefon $fax = (isset($_POST['fax'])) ? $_POST['fax'] : ''; //fax $participation = (isset($_POST['participation'])) ? $_POST['participation'] : ''; //ucast $paper = (isset($_POST['paper'])) ? $_POST['paper'] : ''; //prispevek $member = (isset($_POST['member'])) ? $_POST['member'] : ''; //EAEEIE clen $student = (isset($_POST['student'])) ? $_POST['student'] : ''; //student $tour = (isset($_POST['tour'])) ? $_POST['tour'] : 0; //prohlidka mesta $accompanying = (isset($_POST['accompanying'])) ? $_POST['accompanying'] : ''; //doprovod $accompName = (isset($_POST['accompName'])) ? $_POST['accompName'] : ''; //jmeno doprovodu $accompName2 = (isset($_POST['accompName2'])) ? $_POST['accompName2'] : ''; //jmeno doprovodu $accompSurname = (isset($_POST['accompSurname'])) ? $_POST['accompSurname'] : ''; //prijmeni doprovodu $accompTour = (isset($_POST['accompTour'])) ? $_POST['accompTour'] : ''; //doprovod - prohlidka mesta $accompPostConf = (isset($_POST['accompPostConf'])) ? $_POST['accompPostConf'] : ''; //ucast doprovodu na postkonferencni akci $username = (isset($_POST['username'])) ? $_POST['username'] : ''; //uziv jmeno $password = (isset($_POST['password'])) ? $_POST['password'] : ''; //heslo $passwordVerify = (isset($_POST['passwordVerify'])) ? $_POST['passwordVerify'] : ''; //overeni hesla $postConf = (isset($_POST['postConf'])) ? $_POST['postConf'] : ''; //ucast na poskonferencni akci } else if ($regUserId) { //\\//\\//\\//\\//\\//\\ // nacteni dat z DB \\ //\\//\\//\\//\\//\\//\\ $dotaz = "SELECT * FROM users WHERE id=$regUserId"; $vysl = dbQueryIntoArray($dotaz); $degree1 = $vysl[0]['degree1']; //titul pred jmenem $degree2 = $vysl[0]['degree2']; //titul za jmenem $name = $vysl[0]['name']; //jmeno $name2 = $vysl[0]['name2']; //2. jmeno $surname = $vysl[0]['surname']; //prijmeni $email = $vysl[0]['email']; //e-mail $affiliation = $vysl[0]['affiliation']; //organizace $position = $vysl[0]['position']; //pozice v organizaci $street = $vysl[0]['street']; //ulice $city = $vysl[0]['city']; //mesto $zip = $vysl[0]['zip']; //PSC $country = $vysl[0]['country']; //zeme $phone = $vysl[0]['phone']; //telefon $fax = $vysl[0]['fax']; //fax $participation = $vysl[0]['participation']; //ucast $paper = $vysl[0]['paper']; //prispevek $member = $vysl[0]['member']; //EAEEIE clen $student = $vysl[0]['student']; //student $tour = $vysl[0]['tour']; //prohlidka mesta $accompanying = $vysl[0]['accompanying']; //doprovod $accompName = $vysl[0]['accompname']; //jmeno doprovodu $accompName2 = $vysl[0]['accompname2']; //jmeno doprovodu $accompSurname = $vysl[0]['accompsurname']; //prijmeni doprovodu $accompTour = $vysl[0]['accomptour']; //doprovod - prohlidka mesta $accompPostConf = $vysl[0]['accomppostconf']; //ucast doprovodu na postkonferencni akci $username = $vysl[0]['username']; //uziv jmeno $password = ''; //heslo $passwordVerify = ''; //overeni hesla $postConf = $vysl[0]['postconf']; //ucast na poskonferencni akci } else { //\\//\\//\\//\\//\\//\\ // prazdny formular \\ //\\//\\//\\//\\//\\//\\ $degree1 = ''; //titul pred jmenem $degree2 = ''; //titul za jmenem $name = ''; //jmeno $name2 = ''; //2. jmeno $surname = ''; //prijmeni $email = ''; //e-mail $affiliation = ''; //organizace $position = ''; //pozice v organizaci $street = ''; //ulice $city = ''; //mesto $zip = ''; //PSC $country = 0; //zeme $phone = ''; //telefon $fax = ''; //fax $participation = ''; //ucast $paper = ''; //prispevek $member = ''; //EAEEIE clen $student = ''; //student $tour = 0; //prohlidka mesta $accompanying = ''; //doprovod $accompName = ''; //jmeno doprovodu $accompName2 = ''; //jmeno doprovodu $accompSurname = ''; //prijmeni doprovodu $accompTour = 0; //doprovod - prohlidka mesta $accompPostConf = ''; //ucast doprovodu na postkonferencni akci $username = ''; //uziv jmeno $password = ''; //heslo $passwordVerify = ''; //overeni hesla $postConf = ''; //ucast na poskonferencni akci } if (isset($_POST['registration'])) { //\\//\\//\\//\\//\\//\\ // odeslan formular \\ //\\//\\//\\//\\//\\//\\ /* overeni povinnych polozek */ checkString($degree1); checkString($degree2); checkString($name2); checkString($position); checkString($phone); checkString($fax); checkString($accompName2); if (!checkString($name, true)) {$error = $error . 'Name
';} if (!checkString($surname, true)) {$error = $error . 'Surname
';} if (!checkString($email, true)) {$error = $error . 'E-mail
';} if (!checkString($affiliation, true)) {$error = $error . 'Affiliation
';} if (!checkString($street, true)) {$error = $error . 'Street
';} if (!checkString($city, true)) {$error = $error . 'City
';} if (!checkString($zip, true)) {$error = $error . 'ZIP code
';} if (!checkInt($country, 1)) {$error = $error . 'Country
';} if (!empty($accompanying)) { if (!checkString($accompName, true)) {$error = $error . 'Accompayning person\'s name
';} if (!checkString($accompSurname, true)) {$error = $error . 'Accompayning person\'s surname
';} } if (!$regUserId) { //tyto polozky se kontroluji pouze u novych prihlasek if (!checkString($username, true)) {$error = $error . 'Username
';} if (empty($password)) {$error = $error . 'Password
';} if (empty($passwordVerify)) {$error = $error . 'Re-type password
';} } /* pokud nebyl formular vyplnen korektne, vypise se upozorneni */ if ($error) { $errorTitle = 'The form has not been filled up correctly'; $errorHtmlText = '

The following fields must be filled.


' . $error . '

'; } else if($regUserId) { /* aktualizace jiz existujici registrace */ $dotaz = 'UPDATE users SET '; $dotaz = $dotaz . 'degree1=\'' . ($degree1) . '\', '; $dotaz = $dotaz . 'name=\'' . ($name) . '\', '; $dotaz = $dotaz . 'name2=\'' . ($name2) . '\', '; $dotaz = $dotaz . 'surname=\'' . ($surname) . '\', '; $dotaz = $dotaz . 'degree2=\'' . ($degree2) . '\', '; $dotaz = $dotaz . 'email=\'' . ($email) . '\', '; $dotaz = $dotaz . 'affiliation=\'' . ($affiliation) . '\', '; $dotaz = $dotaz . 'position=\'' . ($position) . '\', '; $dotaz = $dotaz . 'street=\'' . ($street) . '\', '; $dotaz = $dotaz . 'city=\'' . ($city) . '\', '; $dotaz = $dotaz . 'zip=\'' . ($zip) . '\', '; $dotaz = $dotaz . 'country=\'' . ($country) . '\', '; $dotaz = $dotaz . 'phone=\'' . ($phone) . '\', '; $dotaz = $dotaz . 'fax=\'' . ($fax) . '\', '; $dotaz = $dotaz . 'participation=' . ((empty($participation))? '0, ' : '1, '); $dotaz = $dotaz . 'paper=' . ((empty($paper))? '0, ' : '1, '); $dotaz = $dotaz . 'member=' . ((empty($member))? '0, ' : '1, '); $dotaz = $dotaz . 'student=' . ((empty($student))? '0, ' : '1, '); $dotaz = $dotaz . 'tour=' . $tour . ', '; $dotaz = $dotaz . 'postconf=' . ((empty($postConf))? '0, ' : '1, '); $dotaz = $dotaz . 'accompanying=' . ((empty($accompanying))? '0, ' : '1, '); if ($accompanying) { $dotaz = $dotaz . 'accompname=\'' . ($accompName) . '\', '; $dotaz = $dotaz . 'accompname2=\'' . ($accompName2) . '\', '; $dotaz = $dotaz . 'accompsurname=\'' . ($accompSurname) . '\', '; $dotaz = $dotaz . 'accomptour=' . ($accompTour) . ', '; $dotaz = $dotaz . 'accomppostconf=' . ((empty($accompPostConf))? '0 ' : '1 '); } else { $dotaz = $dotaz . 'accompname=\'\', '; $dotaz = $dotaz . 'accompname2=\'\', '; $dotaz = $dotaz . 'accompsurname=\'\', '; $dotaz = $dotaz . 'accomptour=0, '; $dotaz = $dotaz . 'accomppostconf=0 '; } $dotaz = $dotaz . 'WHERE id=' . $regUserId; //echo $dotaz; if (dbQuery($dotaz)) { //prihlaska aktualizovana $display = false; //formularove prvky zobrazi jako text $infoTitle = 'Registration updated'; $infoHtmlText = 'Your registration form has been updated successfully'; } else { //pri ukladani doslo k chybe $errorTitle = 'Database error'; $errorHtmlText = '

An error occured during registration. Try it again, please.

'; } } else { /* vytvoreni nove registrace */ /* overeni shodnosti hesel */ if ($password != $passwordVerify) { $errorTitle = 'Error: Passwords are not the same'; $errorHtmlText = '

Correct the form, please.

'; /* overeni, zda uziv. jmeno jiz existuje */ } else { $dotaz = "SELECT * FROM users WHERE username='$username'"; $vysledek = dbQuery($dotaz); if (dbNumRows($vysledek) > 0) { /*uziv. jmeno jiz existuje */ $errorTitle = 'Username already exists'; $errorHtmlText = '

Username \''. $username . '\' already exists. Change your username, please.

'; } else { /* ulozeni registrace */ $dotaz = 'INSERT INTO users (registration_date, username, password, degree1, name, name2, surname, degree2,'; $dotaz = $dotaz . 'email, affiliation, position, street, city, zip, country, phone, fax,'; $dotaz = $dotaz . 'participation, paper, member, student, tour, postconf, accompanying, accompname, accompname2, accompsurname, accomptour, accomppostconf) VALUES ('; $dotaz = $dotaz . "NOW(), "; $dotaz = $dotaz . "'".($username)."', "; $dotaz = $dotaz . "'".MD5($password)."', "; $dotaz = $dotaz . "'".($degree1)."', "; $dotaz = $dotaz . "'".($name)."', "; $dotaz = $dotaz . "'".($name2)."', "; $dotaz = $dotaz . "'".($surname)."', "; $dotaz = $dotaz . "'".($degree2)."', "; $dotaz = $dotaz . "'".($email)."', "; $dotaz = $dotaz . "'".($affiliation)."', "; $dotaz = $dotaz . "'".($position)."', "; $dotaz = $dotaz . "'".($street)."', "; $dotaz = $dotaz . "'".($city)."', "; $dotaz = $dotaz . "'".($zip)."', "; $dotaz = $dotaz . ($country).", "; $dotaz = $dotaz . "'".($phone)."', "; $dotaz = $dotaz . "'".($fax)."', "; $dotaz = $dotaz . ((empty($participation))? '0, ' : '1, '); //zapsani participation $dotaz = $dotaz . ((empty($paper))? '0, ' : '1, '); //zapsani paperu $dotaz = $dotaz . ((empty($member))? '0, ' : '1, '); //zapsani clena EAEEIE $dotaz = $dotaz . ((empty($student))? '0, ' : '1, '); //zapsani studenta $dotaz = $dotaz . $tour . ', '; $dotaz = $dotaz . ((empty($postConf))? '0, ' : '1, '); //zapsani na postkonferencni akci $dotaz = $dotaz . ((empty($accompanying))? '0, ' : '1, '); //zapsani doprovodu if (empty($accompanying)) { //nevkladat info o doprovodne osobe $dotaz = $dotaz . "'', '', '', 0, 0"; } else { //vlozit info o doprovodne osobe $dotaz = $dotaz . "'".($accompName)."', '".($accompName2)."', '".($accompSurname)."', $accompTour, "; $dotaz = $dotaz . ((empty($accompPostConf))? '0' : '1'); //zapsani doprovodu na postkonferencni akci } $dotaz = $dotaz . ')'; //echo $dotaz; if (!$deadlineRegistration) { if (dbQuery($dotaz)) { //prihlaska byla ulozena //odeslani e-mailu $subject = '[EAEEIE 2007] Confirmation of Registration'; $message = "Dear Delegate,\n\nYou have successfully registered for the EAEEIE 2007 Conference.\nYour username is $username.\nYour password is $password\n\nPlease go to the Conference website (\"http://eaeeie.cvut.cz/\") and log in to submit your abstract (the deadline is March 14).\nIf you have questions or need assistance, you will find the contact information at the Conference website in the section Contacts.\n\nLooking forward to welcoming you in Praha, EAEEIE 2007 Organizing Committee"; @mail ( $email, $subject, $message, "From: eaeeie@comtel.cz\n"); $display=false; //formularove prvky zobrazi jako text $infoTitle = 'Registration inserted'; $infoHtmlText = 'You have been registered successfully'; $infoHtmlText = $infoHtmlText . '

When you are logged in you can change your informations in section MyFolder/Registration

'; //poslani emailu } else { //pri ukladani doslo k chybe $errorTitle = 'Database error'; $errorHtmlText = '

An error occured during registration. Try it again, please.

'; } } else { //pri ukladani doslo k chybe $infoTitle = 'Notice'; $errorHtmlText = '

Registration is closed - time is up.

'; } } } } } /* //\\//\\//\\//\\//\\//\\// // // // ZOBRAZENI STRANKY // // // //\\//\\//\\//\\//\\//\\// */ include ('include/header.inc.php'); //vypis chybove nebo informacni hlasky if ($errorTitle) { showMsg('error', $errorTitle, $errorHtmlText); } if ($infoTitle) { showMsg('info', $infoTitle, $infoHtmlText); } if(!empty($message)) showMsg('info','Notice',$message); ?>

Registration form

Personal information