Uw offerteaanvraag is verzonden

Wij nemen zo snel mogelijk contact met u op."; //koptekst $txtKop = "Voor de aanvraag van een offerte kunt u onderstaand formulier gebruiken"; // form fields /* every form field is an array consisting of 6 elements: 1) field caption 2) field name 3) field type: line, field, radio, select, checkbox, multiselect, divider 4) additional info: if field type is - 'radio' this field contains the radio captions/values like so: {caption1|value1} {caption2|value2} {caption3|value3}... - 'select' this field contains the radio captions/values like so: {caption1|value1} {caption2|value2} {caption3|value3}... - 'email' the field value must be a valid emailaddress - 'checkbox' this field contains the radio captions/values like so: {caption1|value1} {caption2|value2} {caption3|value3}... - 'multiselect' this field contains the radio captions/values like so: {caption1|value1} {caption2|value2} {caption3|value3}... - 'divider' -> you can specify something like '
' in the caption field - 'field' this values optional defines a max chars number 5) mandatory ('*') or not ('') 6) error message if empty on submit and set to mandatory previously */ $fields[] = array("Voor de aanvraag van een offerte kunt u onderstaand formulier gebruiken", "", "divider", "", "", ""); $fields[] = array("
", "", "divider", "", "", ""); $fields[] = array("Naam", "naam", "line", "", "*", "Graag uw naam invullen"); $fields[] = array("Adres", "adres", "line", "*", "", "Graag uw adres invullen"); $fields[] = array("Postcode", "postcode", "line", "*", "", "Graag uw postcode invullen"); $fields[] = array("Woonplaats", "woonplaats", "line", "", "*", "Graag uw woonplaats invullen"); $fields[] = array("Telefoon", "telefoon", "line", "", "*", "Graag uw telefoonnummer invullen"); $fields[] = array("Telefax", "telefax", "line", "", "", ""); $fields[] = array("Email", "email", "line", "email", "*", "Graag een geldig e-mailadres invullen"); $fields[] = array("Website", "website", "line","","",""); $fields[] = array("
", "", "divider", "", "", ""); $fields[] = array("Welke werkzaamheden hebben betrekking op het project?", "werkzaamheden", "checkbox", "{nieuw huis bouwen}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{renovatie/opknapbeurt}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{badkamer}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{tuinaanleg/tuinonderhoud/tuinarchitectuur}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{electriciteit/verlichting/domotica/alarm}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{garage/carport}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{verwarming/ventilatie/airconditioning}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{zolder}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{bestrating}", "", "" ); $fields[] = array("", "werkzaamheden", "checkbox", "{loodgieterij}", "", "" ); $fields[] = array("", "werkzaamheden", "checkbox", "{trappen}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{toilet}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{uitbreiding}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{keuken}", "", ""); $fields[] = array("", "werkzaamheden", "checkbox", "{meubel-/binnentimmerwerk}", "", ""); $fields[] = array("
", "", "divider", "", "", ""); $fields[] = array("Hoe ver bent u met het uitwerken van de plannen?", "uitwerking", "select", "{-- kies uit --|}{ik heb een gedetailleerd beeld/ontwerp van mijn project|gedetailleerd}{ik heb een globaal beeld/ontwerp van mijn project|globaal}{ik heb geen idee en verwacht advies van de vakman die de werkzaamheden zal uitvoeren|geen idee}"); $fields[] = array("
", "", "divider", "", "", ""); $fields[] = array("Beschrijf uw project in uw eigen woorden. Graag met uitleg en details.", "beschrijven", "field", "", ""); $fields[] = array("
", "", "divider", "", "", ""); $fields[] = array("Overige vragen of opmerkingen die betrekking hebben op het project:", "overige vragen", "field", "", ""); // ################ END CONFIG ########################################################## // ####################################################################################### $version = "1.5"; $errorPointer = ($posError == "above") ? "↓ " : "↑ "; function spaces($num, $fill=" "){ $foo=""; for ($i=0; $i<$num; $i++) $foo.=$fill; return $foo; } function isValidEmail($addr){ if(eregi("^[a-z0-9]+([_.-][a-z0-9]+)*@([a-z0-9]+([.-][a-z0-9]+)*)+\\.[a-z]{2,4}$", $addr)) return true; else return false; } function jsCharCount(){ if ($GLOBALS['cfCharCountFunc'] != 1){ $html = "\n"; $GLOBALS['cfCharCountFunc'] = 1; return $html; } } // start form evaluation unset($error); if ($_REQUEST['do']=="send"){ $error = false; $fromAddress = ""; $message = ""; foreach ($fields as $field){ if ($field[4] == "*"){ if ($field[3] == "email"){ if (!isValidEmail($_REQUEST[$field[1]])) $error[$field[1]] = $field[5]; }else{ if ($_REQUEST[$field[1]] == "" || $_REQUEST[$field[1]] == " " || $_REQUEST[$field[1]] == " ") $error[$field[1]] = $field[5]; } } } if ($error === false){ $message = $emailSubject." \n"; for ($i = 0; $i < strlen($emailSubject); $i++) $message .= "*"; $message .= " \n\n$msgDate:".spaces($msgIndent-strlen($msgDate)).date($dateFormat); foreach ($fields as $field){ if ($field[2] == "divider"){ $message .= "\n-----------------------------------"; }else{ $message .= "\n".$field[0].":".spaces($msgIndent-strlen($field[0])); if ($field[3] == "email"){ $message .= "mailto:".$_REQUEST[$field[1]]; $fromAddress = "From: ".$_REQUEST[$field[1]]; }else if ($field[2] == "checkbox" || $field[2] == "multiselect"){ $multi = ""; foreach ($_REQUEST[$field[1]] as $val){ $divider = ($multi != "") ? ", " : ""; $multi .= (isset($val) && $val != "") ? $divider.$val : ""; } $message .= $multi; }else $message .= $_REQUEST[$field[1]]; } $message .= " "; } mail($targetAddress, $emailSubject, $message, $fromAddress); //echo "
$message
"; echo $txtThankyou; } } if ($error!==false){ $html = ""; // draw form $html .= "\n\n \n\n"; $html .= "
\n"; $html .= "\n"; foreach ($fields as $field){ $htmlError = ""; $htmlField = ""; if ($field[2] == "divider"){ $html .= ""; }else{ $html .= "\n\n"; } $html .= "\n"; $html .= "\n"; $html .= "\n"; $html .= "
".$field[0]."
".$field[0].$field[4]." "; } switch ($field[2]){ case "line": $htmlField = ""; if (isset($error[$field[1]])) $htmlError = "
".$errorPointer.$error[$field[1]]."
"; $html .= ($posError == "above") ? $htmlError.$htmlField : $htmlField.$htmlError; break; case "field": if (is_numeric($field[3])){ $attrVal = "cfCount('cf_".$field[1]."', 'cf_remchars_".$field[1]."', ".$field[3].")"; $attr = "onkeydown=\"$attrVal\" onkeyup=\"$attrVal\""; }else $attr = ""; $htmlField .= "\n"; if (is_numeric($field[3])){ $remChars = (isset($_REQUEST[$field[1]])) ? ($field[3] - strlen($_REQUEST[$field[1]])) : $field[3]; $htmlField .= jsCharCount()."
$txtRemainingChars ".$remChars.""; } if (isset($error[$field[1]])) $htmlError .= "
".$errorPointer.$error[$field[1]]."
"; $html .= ($posError == "above") ? $htmlError.$htmlField : $htmlField.$htmlError; break; case "radio": preg_match_all("/\{(.*?)\}/", $field[3], $foo); $options = $foo[1]; $i=1; foreach ($options as $opt){ $opt = explode("|", $opt); $label = $opt[0]; $value = (isset($opt[1])) ? $opt[1] : $opt[0]; $checked = ($_REQUEST[$field[1]] == $value) ? "checked" : ""; $htmlField .= "   "; $i++; } if (isset($error[$field[1]])) $htmlError .= "
".$errorPointer.$error[$field[1]]."
"; $html .= ($posError == "above") ? $htmlError.$htmlField : $htmlField.$htmlError; break; case "checkbox": preg_match_all("/\{(.*?)\}/", $field[3], $foo); $options = $foo[1]; $i=1; foreach ($options as $opt){ $opt = explode("|", $opt); $label = $opt[0]; $value = (isset($opt[1])) ? $opt[1] : $opt[0]; $checked = ($_REQUEST[$field[1]][($i)] == $value) ? "checked" : ""; $htmlField .= "   "; $i++; } if (isset($error[$field[1]])) $htmlError .= "
".$errorPointer.$error[$field[1]]."
"; $html .= ($posError == "above") ? $htmlError.$htmlField : $htmlField.$htmlError; break; case "select": preg_match_all("/\{(.*?)\}/", $field[3], $foo); $options = $foo[1]; $i=1; $htmlField .= "\n\n"; if (isset($error[$field[1]])) $htmlError .= "
".$errorPointer.$error[$field[1]]."
"; $html .= ($posError == "above") ? $htmlError.$htmlField : $htmlField.$htmlError; break; case "multiselect": preg_match_all("/\{(.*?)\}/", $field[3], $foo); $options = $foo[1]; $i=1; $htmlField .= "\n\n"; if (isset($error[$field[1]])) $htmlError .= "
".$errorPointer.$error[$field[1]]."
"; $html .= ($posError == "above") ? $htmlError.$htmlField : $htmlField.$htmlError; break; } $html .= "
 $txtKop
 * $txtMandatory
 \n"; $html .= "
\n"; $html .= "
\n"; //$html .= "\n \n\n"; echo $html; } /* ######################### END Contact Form ########################## ##################################################################### */ ?>