Projektanfrage
function PrintTR($aText, $aValue) {
$text = "
"; // Zeile neu
$text .= "| " . $aText . " | ";
$text .= "" . $aValue . " | ";
$text .= "
"; // Zeile zu Ende
return $text;
}
function PrintTRBool($aText, $aValue) {
$text = "
"; // Zeile neu
$text .= "| " . $aText . " | ";
If (!empty($aValue)) {
$Value = "Ja";
} else {
$Value = "Nein";
}
$text .= "" . $Value . " | ";
$text .= "
"; // Zeile zu Ende
return $text;
}
$RedBorder1 = false;
$RedBorder2 = false;
$RedBorder3 = false;
$RedBorder4 = false;
$RedBorder5 = false;
$RedBorder6 = false;
$RedBorder7 = false;
$RedBorder8 = false;
$RedBorder9 = false;
$WrongEMail = false;
$valid = "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$";
If (!empty($_GET["EMail"]))
$WrongEMail = !(eregi($valid, $_GET["EMail"]));
$CountEmptyFields = 0;
If (empty($_GET["name"])) $CountEmptyFields++;
If (empty($_GET["funktion"])) $CountEmptyFields++;
If (empty($_GET["unternehmen"])) $CountEmptyFields++;
If (empty($_GET["anschrift"])) $CountEmptyFields++;
If (empty($_GET["telefon"])) $CountEmptyFields++;
If (empty($_GET["EMail"])) $CountEmptyFields++;
If (empty($_GET["start"])) $CountEmptyFields++;
If (empty($_GET["dauer"])) $CountEmptyFields++;
If (empty($_GET["recipient"])) $CountEmptyFields++;
$SendMail = ($CountEmptyFields == 0);
If ($_GET["id"] == 1)
If ($SendMail) {
$Email_Absender = $_GET["EMail"];
$Email_Header = "From:".$Email_Absender."\r\n";
$Email_Header .= "Reply-To:".$Email_Absender."\r\n";
$Email_Header .= "Content-Type: text/html";
$Datum = date("d.m.Y H:i:s");
// Einleitungstext
$Email_Nachricht = "
Folgende Mail wurde am $Datum über Ihre Webseite aufgegeben:
";
// Tabelle beginnen
$Email_Nachricht .= "
";
// Reihe für Reihe über Funktion Tabelle aufbauen
$Email_Nachricht .= PrintTR('Name/Vorname', $_GET["name"]);
$Email_Nachricht .= PrintTR('Funktion', $_GET["funktion"]);
$Email_Nachricht .= PrintTR('Unternehmen', $_GET["unternehmen"]);
$Email_Nachricht .= PrintTR('Betrieb/Betriebsteil', $_GET["betrieb_betriebsteil"]);
$Email_Nachricht .= PrintTR('Mitgliedsnummer', $_GET["mitgliedsnummer"]);
$Email_Nachricht .= PrintTR('Anschrift', $_GET["anschrift"]);
$Email_Nachricht .= PrintTR('Telefon', $_GET["telefon"]);
$Email_Nachricht .= PrintTR('Fax', $_GET["fax"]);
$Email_Nachricht .= PrintTR('E-Mail', $_GET["EMail"]);
$Email_Nachricht .= PrintTR('Beabsichtigter Start', $_GET["start"]);
$Email_Nachricht .= PrintTR('Dauer der Aktion', $_GET["dauer"]);
$Email_Nachricht .= "
";
$Email_Nachricht .= "
";
$Email_Nachricht .= PrintTR('Aktionsprogramm:', '');
// If (!empty($gefaerdungs_beurteilung_vorhanden))
$Email_Nachricht .= PrintTRBool('Gefährdungsbeurteilung vorhanden', $_GET["gefaerdungs_beurteilung_vorhanden"]);
$Email_Nachricht .= PrintTRBool('Gefährdungsbeurteilung muss noch erfolgen', $_GET["gefaerdungs_beurteilung_erfolgen"]);
If (!empty($betriebliche_veranstaltungen)) {
$Email_Nachricht .= PrintTR('Betriebliche Veranstaltungen:', $_GET["betriebliche_veranstaltungen_art"]);
} else {
$Email_Nachricht .= PrintTRBool('Betriebliche Veranstaltungen:', 0);
}
If (!empty($zeitungen)) {
$Email_Nachricht .= PrintTR('Zeitungen:', $_GET["zeitungen_art"]);
} else {
$Email_Nachricht .= PrintTRBool('Zeitungen:', 0);
}
If (!empty($plakate)) {
$Email_Nachricht .= PrintTR('Plakate:', $_GET["plakate_art"]);
} else {
$Email_Nachricht .= PrintTRBool('Plakate:', 0);
}
If (!empty($werbemittel)) {
$Email_Nachricht .= PrintTR('Werbemittel:', $_GET["werbemittel_art"]);
} else {
$Email_Nachricht .= PrintTRBool('Werbemittel:', 0);
}
$Email_Nachricht .= PrintTRBool('Ausstellung DEINE HAUT', $_GET["austellung_deine_haut"]);
$Email_Nachricht .= PrintTRBool('Wabe 1 "Sensibilisieren":', $_GET["wabe_1"]);
$Email_Nachricht .= PrintTRBool('Wabe 2 "Haut- und Handschutz":', $_GET["wabe_2"]);
$Email_Nachricht .= PrintTRBool('Wabe 3 "Hautreinigung":', $_GET["wabe_3"]);
$Email_Nachricht .= PrintTRBool('Wabe 4 "Hautpflege":', $_GET["wabe_4"]);
$Email_Nachricht .= PrintTRBool('Wabe 5 "Privater Bereich":', $_GET["wabe_5"]);
$Email_Nachricht .= PrintTRBool('Hautmobil:', $_GET["hautmobil"]);
$Email_Nachricht .= PrintTRBool('Betriebliche Handschuhausstellung:', $_GET["betriebliche_handschuausstellung"]);
$Email_Nachricht .= PrintTRBool('Hautschutzseminar BBG.StBG.', $_GET["hautschutzseminar"]);
$Email_Nachricht .= PrintTRBool('Schulungsunterlagen "Haut"', $_GET["schulungsunterlagen_haut"]);
If (!empty($medien)) {
$Email_Nachricht .= PrintTR('Medien:', $_GET["medien_art"]);
} else {
$Email_Nachricht .= PrintTRBool('Medien:', 0);
}
$Email_Nachricht .= PrintTRBool('Wettbewerb "Hautschutz ist..."', $_GET["schulungsunterlagen_haut"]);
$Email_Nachricht .= PrintTRBool('PC-Quiz', $_GET["schulungsunterlagen_haut"]);
If (!empty($ueberbetriebl_veranstaltungen)) {
$Email_Nachricht .= PrintTR('Überbetriebliche Veranstaltungen', $_GET["ueberbetriebl_veranstaltungen_art"]);
} else {
$Email_Nachricht .= PrintTRBool('Überbetriebliche Veranstaltungen:', 0);
}
$Email_Nachricht .= PrintTR('Betriebliches Budget', $_GET["budget"]);
$Email_Nachricht .= "
";
$Email_Nachricht .= "
";
$Email_Nachricht .= PrintTR('Gewählter Empfänger', $_GET["recipient"]);
$Email_Nachricht .= "
";
// Sonstige Angaben
$Email_Betreff = "Projektanfrage über Ihre Webseite";
$Email_Empfaenger = $_GET["recipient"];
//ini_set("SMTP", "mail.sw-media.de"); // SMTP Adresse des Mailservers
If (mail($Email_Empfaenger, $Email_Betreff, $Email_Nachricht, $Email_Header)) {
?>
Vielen Dank für Ihre Anfrage.
Wir werden uns sobald wie möglich bei Ihnen melden.
} else {
echo "Es ist ein Fehler aufgetreten.";
}
} else {
// Rote Box zeigen wo Pflichteingaben
$RedBorder1 = (empty($_GET["name"]));
$RedBorder2 = (empty($_GET["funktion"]));
$RedBorder3 = (empty($_GET["unternehmen"]));
$RedBorder4 = (empty($_GET["anschrift"]));
$RedBorder5 = (empty($_GET["telefon"]));
$RedBorder6 = (empty($_GET["EMail"]) or ($WrongEMail));
$RedBorder7 = (empty($_GET["start"]));
$RedBorder8 = (empty($_GET["dauer"]));
$RedBorder9 = (empty($_GET["recipient"]));
?>
Bitte füllen Sie mindestens die rot umrandeten Eingabefelder aus.
If ($RedBorder9) echo "
Wählen Sie außerdem einen Empfänger aus der Auswahlbox (im unteren Bereich des Formulars)
";
// Hinweis bei fehlerhafter E-Mail-Adresse
If ($WrongEMail) echo "
In Ihrer E-Mail-Adresse scheint ein Schreibfehler zu sein.
";
}
If ((!$SendMail)) {
?>
* Pflichteingaben