This repository has been archived on 2025-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
host_rhein/content/anfrage.php
2014-04-28 19:37:51 +02:00

58 lines
4.7 KiB
PHP

<?php
if (basename ($_SERVER['SCRIPT_NAME']) == basename (__FILE__)) die ("no direct access allowed");
set_include_path(/*get_include_path() . PATH_SEPARATOR . */realpath(dirname(__FILE__).'/../../../pear/PEAR/') . PATH_SEPARATOR . dirname(__FILE__).'/../../../');
//set_include_path(get_include_path() . PATH_SEPARATOR . 'C:\Daten\source\website\files\pear' . PATH_SEPARATOR . 'C:\Daten\source\website\files');
require_once('HTML/QuickForm2.php');
require_once('sources/qf-functions.php');
$form = new HTML_QuickForm2($formName = 'anfrage');
$form->setAttribute('action', $_SERVER['REQUEST_URI']);
echo "<h2>Reservierungsanfrage</h2>";
$form->addElement('select', 'anrede', array('style' => 'width: 304px;'), array('options' => array('Herr','Frau'), 'label' => '<font color="red">*</font>Anrede : '));
$form->addElement('text', 'name', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>Name : '));
$form->addElement('text', 'vorname', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>Vorname : '));
$form->addElement('text', 'strasse', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>Stra&szlig;e, Hausnr. : '));
$form->addElement('text', 'plz', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>PLZ : '));
$form->addElement('text', 'ort', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>Ort : '));
$form->addElement('text', 'land', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>Land : '));
$form->addElement('text', 'telefon', array('style' => 'width: 300px;'), array('label' => 'Telefon : '));
$form->addElement('text', 'handy', array('style' => 'width: 300px;'), array('label' => 'Handy : '));
$form->addElement('text', 'mail', array('style' => 'width: 300px;'), array('label' => '<font color="red">*</font>E-Mail : '));
$form->addElement('textarea', 'bemerkung', array('style' => 'width: 420px; height: 150px', 'rows' => '5', 'cols' => '1' ),array('label' => 'Reservierungsw&uuml;nsche/Anmerkungen/Fragen : '));
$form->addElement('submit', 'send', array('value' => 'Abschicken', 'style' => 'float: left'));
$form->addElement('submit', 'clear', array('value' => 'Zuruecksetzen', 'style' => 'float: left'));
if ($form->validate())
{
// Code wenn das Formular abgeschickt wurde
$vars = $form->getValue();
if(!$vars["name"] == "" && !$vars["vorname"] == "" && !$vars["strasse"] == "" && !$vars["plz"] == "" && !$vars["ort"] == "" && !$vars["land"] == "" && !$vars["mail"] == "")
{
if($vars['anrede'] == 0)
{
mail( "info@fewo-rhein-zwbg.de",
"Ferienwohnung-Anfrage",
"Ferienwohnung-Anfrage:\n\nName: Herr ".utf8_decode($vars['vorname'])." ".utf8_decode($vars['name'])."\nAddresse: ".utf8_decode($vars['strasse']).", ".utf8_decode($vars['plz'])." ".utf8_decode($vars['ort']).", ".utf8_decode($vars['land'])."\nTelefon: ".utf8_decode($vars['telefon'])."\nHandy: ".utf8_decode($vars['handy'])."\nEMail: ".$vars['mail']."\n\nBemerkung:\n".utf8_decode($vars['bemerkung']),
"From: ".utf8_decode($vars['vorname'])." ".utf8_decode($vars['name'])." <".$vars['mail'].">\r\n");
}else
{
mail( "info@fewo-rhein-zwbg.de",
"Ferienwohnung-Anfrage",
"Ferienwohnung-Anfrage:\n\nName: Frau ".utf8_decode($vars['vorname'])." ".utf8_decode($vars['name'])."\nAddresse: ".utf8_decode($vars['strasse']).", ".utf8_decode($vars['plz'])." ".utf8_decode($vars['ort']).", ".utf8_decode($vars['land'])."\nTelefon: ".utf8_decode($vars['telefon'])."\nHandy: ".utf8_decode($vars['handy'])."\nEMail: ".$vars['mail']."\n\nBemerkung: ".utf8_decode($vars['bemerkung']),
"From: ".utf8_decode($vars['vorname'])." ".utf8_decode($vars['name'])." <".$vars['mail'].">\r\n");
}
echo "Ihre Afrage wurde <font color='green'>abgeschickt</font>. Wir werden Ihnen so schnell wie m&ouml;glich eine Antwort zukommen lassen.<br/><br/>";
// echo "<font color='red'>Hinweis: Zur Zeit sind wir leider nicht erreichbar.<br/>Wir werden Ihre Anfrage bearbeiten, sobald es uns m&ouml;glich ist.<br/><br/>MfG<br/>Familie Rhein<br/><br/></font>";
} else echo "<font color='red'>Achtung:</font> Bitte f&uuml;llen Sie alle mit * markierten Felder aus! Ihre Anfrage wurde nicht abgeschickt.<br/><br/>";
}
echo '<form' . $form->getAttributes(true) . ">\n";
foreach ($form as $element) output_element($element);
echo '</form>';
echo "<div id='red_star_info'>Mit <font color='red'>*</font> markierte Felder m&uuml;ssen ausgef&uuml;llt werden</div>";
?>