";
include INFUSIONS."katalog/Polish.php";
if (isset($_POST['sendbooking'])) {
$error = "";
$subject = $locale['bok_002'];
$mailname = isset($_POST['mailname']) ? substr(stripinput(trim($_POST['mailname'])), 0, 50) : "";
$email = isset($_POST['email']) ? substr(stripinput(trim($_POST['email'])), 0, 100) : "";
$telephone = isset($_POST['telephone']) ? substr(stripinput(trim($_POST['telephone'])), 0, 50) : "";
$from_date = isset($_POST['from_date']) ? descript(stripslash(trim($_POST['from_date']))) : "";
$to_date = isset($_POST['to_date']) ? descript(stripslash(trim($_POST['to_date']))) : "";
$num_adults = isset($_POST['num_adults']) ? substr(stripinput(trim($_POST['num_adults'])), 0, 4) : "";
$num_children = isset($_POST['num_children']) ? substr(stripinput(trim($_POST['num_children'])), 0, 4) : "";
$rooms =(isset($_POST['rooms']) && isNum($_POST['rooms'])) ? $_POST['rooms'] : "0";
$smoking =(isset($_POST['smoking']) && isNum($_POST['smoking'])) ? $_POST['smoking'] : "0";
$stay_type =(isset($_POST['stay_type']) && isNum($_POST['stay_type'])) ? $_POST['stay_type'] : "0";
$notes = isset($_POST['message']) ? descript(stripslash(trim($_POST['message']))) : "";
$message = $locale['bok_003'].$mailname.$locale['bok_004'].$telephone.$locale['bok_005'].$from_date.$locale['bok_006'].$to_date.$locale['bok_007'].(($num_adults == "0") ? "0" : $num_adults).$locale['bok_008'].(($num_children == "0") ? "0" : $num_children).$locale['bok_009'].$rooms.$locale['bok_010'].(($stay_type == "0") ? $locale['bok_011'] : "").(($stay_type == "1") ? $locale['bok_012'] : "").(($stay_type == "2") ? $locale['bok_013'] : "").$locale['bok_014'].(($smoking == "0") ? $locale['bok_015'] : $locale['bok_016']).$locale['bok_017'].(($notes !== "") ? $notes : $locale['bok_018'])."";
if ($mailname == "") {
$error .= "
".$locale['bok_019']."\n";
}
if ($email == "" || !preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $email)) {
$error .= "
".$locale['bok_020']."\n";
}
if ($telephone == "" || !preg_match("/^[0-9]+$/", $telephone) || strlen($telephone) < 10) {
$error .= "
".$locale['bok_021']."\n";
}
if ($from_date == "" || !preg_match("/^(?:(0[1-9]|1[012])[\/.](0[1-9]|[12][0-9]|3[01])[\/.](19|20)[0-9]{2})$/", $from_date)|| strlen($from_date)> 10 || strlen($from_date)< 10) {
$error .= "
".$locale['bok_022']."\n";
}
if ($to_date == "" || !preg_match("/^(?:(0[1-9]|1[012])[\/.](0[1-9]|[12][0-9]|3[01])[\/.](19|20)[0-9]{2})$/", $to_date) || strlen($to_date)> 10 || strlen($to_date)< 10) {
$error .= "
".$locale['bok_023']."\n";
}
if ($num_adults == "" || !preg_match("/^[0-9]+$/", $num_adults)) {
$error .= "
".$locale['bok_024']."\n";
}
if ($num_children == "" || !preg_match("/^[0-9]+$/", $num_children)) {
$error .= "
".$locale['bok_025']."\n";
}
if ($rooms == "" || $rooms == "0") {
$error .= "
".$locale['bok_026']."\n";
}
if (strlen($notes)>= 200) {
$error .= "
".$locale['bok_027']."\n";
}
if ($stay_type == "") {
$error .= "
".$locale['bok_028']."\n";
}
if ($smoking == "") {
$error .= "
".$locale['bok_029']."\n";
}
if (!$error) {
require_once INCLUDES."sendmail_include.php";
if (!sendemail($settings['siteusername'],$settings['siteemail'],$mailname,$email,$subject,$message,$from_date,$to_date)) {
$error .= "
".$locale['bok_031']."\n";
}
}
if ($error) {
opentable($locale['bok_001']);
echo "
\n".$locale['bok_032'].":
\n".$error."
\n".$locale['bok_033']."
\n";
closetable();
} else {
opentable($locale['bok_001']);
echo "
\n".$locale['bok_034']."
\n".$locale['bok_035']."
\n";
closetable();
}
} else {
opentable($locale['bok_001']);
echo $locale['bok_036'];
echo "
\n";
closetable();
echo "
";
add_to_footer("