".$s."
"; } $__content__ .= "

".MENU_ITEM_5."

"; $res = mysql_query("select * from pages where page_id=9"); while ($row = mysql_fetch_array ($res)) { $pdesc = stripslashes($row['description_'.$lang]); $_imgcontent_ = ""; for ($i=1;$i<=10;$i++) { if ($row['image'.$i] != "" and file_exists("tcache/tpages_".substr($row['image'.$i], 0, -4).".jpg")) $_imgsource_ = "tcache/tpages_".substr($row['image'.$i], 0, -4).".jpg"; else if ($row['image'.$i] != "") $_imgsource_ = "tpages.php?file=".$row['image'.$i].""; if ($row['image'.$i] != "") $_imgcontent_ .= "
\"\"
\n"; } } if (isset($_POST['submit'])) { $frm_errors = 0; $name = addslashes(trim($_POST['name'])); if ($name == "" or $name == CONTACT_NAME) { $frm_errors++; } $email = addslashes(trim($_POST['email'])); if ($email == "" or $email == "Email") { $frm_errors++; } $notes = addslashes(trim($_POST['notes'])); if ($notes == "" or $notes == CONTACT_NOTES) { $frm_errors++; } $regex = "/^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$/"; if(!preg_match($regex,$email)) { $frm_errors++; } $datein = addslashes(trim($_POST['dateIn'])); $dateout = addslashes(trim($_POST['dateOut'])); if ($frm_errors == 0) { $body = ""; $body .= "Name: ".$name."\n"; $body .= "Email: ".$email."\n"; if ($datein != "") $body .= "Check in date: ".$datein."\n"; if ($dateout != "") $body .= "Check out date: ".$dateout."\n"; $body .= "Notes: ".$notes."\n"; require_once 'includes/lib/swift_required.php'; $transport = Swift_MailTransport::newInstance(); $mailer = Swift_Mailer::newInstance($transport); $message = Swift_Message::newInstance('parosinn contact form') ->setFrom(array('webmaster@parosinn.gr' => 'parosinn webmaster')) ->setTo(array('info@parosinn.gr' => 'parosinn')) ->setBody($body, 'text/plain', 'utf-8'); ; //Send the message $result = $mailer->send($message); if ($result) { $mailsent = 1; $frmout = RES_RESULT_1; } else { $mailsent = 0; $frmout = RES_RESULT_0; } } else { $frmout = RES_RESULT_NODATA; } } if (!isset($frmout)) $frmout = "

".ASKAVAIL."

"; $__content__ .= "
".$frmout."
".$pdesc."
".$_imgcontent_."
"; $ttemplate = $template; $ttemplate = str_replace("_____SITE_TITLE_____", MENU_ITEM_5.SITE_TITLE, $ttemplate); $ttemplate = str_replace("_____CONTENT_____", $__content__, $ttemplate); echo $ttemplate; ?>