traceVar('$_POST');
//*/
/**
*
* @access public
* @return string
*/
function getRegistrationForm(&$myquery, &$db)
{
// Instantiate the HTML_QuickForm object
$form =& new GWCMS_QuickForm(
'anmeldung', // form name
'post', // method
$_SERVER['REQUEST_URI'], // action
NULL, // target
'', // attributes
TRUE, // track submit
FALSE // do not auto append
);
// add header elemnt
$form->addElement(
'header', // element type
'anmeldung_header', // name
'Anmeldung für Besucher zur MEDIENMESSE 2008' // label
);
// add text field
$form->addElement(
'text', // element type
'anmeldung[firma]', // name
'Firma', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add text field
$form->addElement(
'text', // element type
'anmeldung[vorname]', // name
'Vorname', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add text field
$form->addElement(
'text', // element type
'anmeldung[name]', // name
'Name', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add textarea
$form->addElement(
'text', // element type
'anmeldung[strasse]', // name
'Strasse', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add textarea
$form->addElement(
'text', // element type
'anmeldung[plz]', // name
'PLZ', // label
'maxlength="5" style="width: 50px;"' // html attributes
);
// add textarea
$form->addElement(
'text', // element type
'anmeldung[ort]', // name
'Ort', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add text field
$form->addElement(
'text', // element type
'anmeldung[email]', // name
'E-Mail', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add text field
$form->addElement(
'text', // element type
'anmeldung[web]', // name
'Webpage', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add text field
$form->addElement(
'text', // element type
'anmeldung[branche]', // name
'Branche', // label
'maxlength="255" style="width: 250px;"' // html attributes
);
// add text field
$form->addElement(
'textarea', // element type
'anmeldung[vonwoerf]', // name
'Wo haben Sie von der Messe erfahren?', // label
'rows="6" cols="33" style="width: 250px;"' // html attributes
);
/*
// add group item
$member[] = HTML_QuickForm::createElement(
'radio', // element type
'anmeldung[mitglied]', // name
' ', // text to display before button
'Ja', // text to display after button
'1', // the value returned
'' // attributes
);
// add group item
$member[] = HTML_QuickForm::createElement(
'radio', // element type
'anmeldung[mitglied]', // name
' ', // text to display before button
'Nein', // text to display after button
'0', // the value returned
'' // attributes
);
// add group
$form->addGroup(
$member, // group elements
'anmeldung_mitglied_group', // group name
'Sind Sie Mitglied im Mediennetzwerk Potsdamer/Bülowstraße?
', // group label
' ', // separator
FALSE // append name
);
*/
// add group item
$exhibitor[] = HTML_QuickForm::createElement(
'radio', // element type
'anmeldung[visitor07]', // name
' ', // text to display before button
'Ja', // text to display after button
'1', // the value returned
'' // attributes
);
// add group item
$exhibitor[] = HTML_QuickForm::createElement(
'radio', // element type
'anmeldung[visitor07]', // name
' ', // text to display before button
'Nein', // text to display after button
'0', // the value returned
'' // attributes
);
// add group
$form->addGroup(
$exhibitor, // group elements
'anmeldung_visitor_group', // group name
'Haben Sie auch die Medienmesse 2007 besucht?
', // group label
' ', // separator
FALSE // append name
);
// add button submit
$buttons[] = HTML_QuickForm::createElement(
'reset', // element type
'anmeldung_reset', // name
'zurücksetzen', // value
'class="button_reset"' // attributes
);
// add button submit
$buttons[] = HTML_QuickForm::createElement(
'submit', // element type
'anmeldung_submit', // name
'anmelden', // value
'class="button_submit"' // attributes
);
// add button group
$form->addGroup(
$buttons, // group elements
'anmeldung_button_group', // group name
' ', // group label
' ', // separator
FALSE // append name
);
// filter
$form->applyFilter('anmeldung[email]', 'trim');
// add rules
$form->addRule(
'anmeldung[name]', // element to apply rule on
'Dieses Feld darf nicht leer sein.', // error message
'required' // rule type
);
$form->addRule(
'anmeldung[name]', // element to apply rule on
'Der Name darf nur aus Buchstaben bestehen.', // error message
'regex', // rule type
'@^[a-zA-z,\.\s]*$@' // format
);
$form->addRule(
'anmeldung[strasse]', // element to apply rule on
'Dieses Feld darf nicht leer sein.', // error message
'required' // rule type
);
$form->addRule(
'anmeldung[plz]', // element to apply rule on
'Dieses Feld darf nicht leer sein.', // error message
'required' // rule type
);
$form->addRule(
'anmeldung[plz]', // element to apply rule on
'PLZ besteht nur aus Zahlen.', // error message
'numeric' // rule type
);
$form->addRule(
'anmeldung[ort]', // element to apply rule on
'Dieses Feld darf nicht leer sein.', // error message
'required' // rule type
);
$form->addRule(
'anmeldung[email]', // element to apply rule on
'Die E-Mail-Adresse entspricht nicht den Normen.', // error message
'email' // rule type
);
/*
$form->addGroupRule(
'anmeldung_mitglied_group', // element to apply rule on
array(
'anmeldung[mitglied]' => array(
// array('Bitte wählen Sie das Zutreffende aus.', 'required'),
array('Dieser Wert ist nicht zulässing.', 'regex', '@^[0-1]{1}$@'),
)
)
);
// this is necessary for the required note to show up (minor bug in qf tpl)
$form->addGroupRule(
'anmeldung_mitglied_group', // element to apply rule on
'Bitte wählen Sie das Zutreffende aus.', // error message
'required', // rule type
null, // format
1 // number of valid elements
);
*/
$form->addGroupRule(
'anmeldung_visitor_group', // element to apply rule on
array(
'anmeldung[visitor07]' => array(
// array('Bitte wählen Sie das Zutreffende aus.', 'required'),
array('Dieser Wert ist nicht zulässing.', 'regex', '@^[0-1]{1}$@'),
)
)
);
/*
// this is necessary for the required note to show up (minor bug in qf tpl)
$form->addGroupRule(
'anmeldung_visitor_group', // element to apply rule on
'Bitte wählen Sie das Zutreffende aus.', // error message
'required', // rule type
null, // format
1 // number of valid elements
);
$form->addGroupRule(
'anmeldung_confirm_group', // element to apply rule on
'Sie müssen sich verbindlich anmelden.', // error message
'required', // rule type
null, // format
1 // number of valid elements
);
*/
// add notes
$form->setRequiredNote('bezeichnet ein erforderliches Feld');
if ($form->validate()) {
// clean insert fields
foreach($_POST['anmeldung'] as $anmeldung_key => $anmeldung_value){
$anmeldung_key = $myquery->db->escapeSimple(strip_tags($anmeldung_key));
$anmeldung[$anmeldung_key] = stripslashes(strip_tags($anmeldung_value));
}
// add registration_time
$anmeldung['reg_time'] = date('Y-m-d H:i:s');
// insert in db
/* temp *
$GLOBALS['traceVar']->setTracing(TRUE);
$GLOBALS['traceVar']->traceVar($anmeldung);
//*/
/* AKTIVATE THIS TO USE DB */
$insert_db = $myquery->insertCertainRecord($db, // db object
'messe08_besucher', // table
$anmeldung // insert data
);
//*/
// write confirm message
if (isset($insert_db) && $insert_db == '1') {
$output = '
Vielen Dank, für Ihre Anmeldung!
' . 'Wir freuen uns Sie als Besucher auf der Medienmesse 2008 begrüßen zu dürfen.
' . 'Ihr MEDIENMESSE-TEAM
' . 'Sollten sie Fragen an uns haben,
'
. 'bitte wenden Sie sich an:'
. '
' . '
' . 'B&R companyVielen Dank, für Ihre Anmeldung!
' . 'Leider gab es Schwierigkeiten bei der Datenübertragung...
'
. 'Wir konnten ihre Daten nicht erfassen.
'
. 'Bitte wenden Sie sich an den Administrator: '
. 'internet@medienportal-berlin.de
Mit dem Absenden dieses Formulars melden Sie sich '
. 'als Besucher '
. 'für die Medienmesse'
. ''
. '°mstreet am '
. '31. Januar 2008 an.
Der Eintritt ist für Besucher frei !
'
. '
'
. 'weitere Informationen zur Veranstaltung
Anmeldung nicht mehr möglich - die Veranstaltung liegt in der Vergangenheit.