<?php 
include_once('includes/header.php'); 
include_once('includes/menu.php');
?>
<div id="content">
    <h3>Contact Us</h3>
    <p>
        Contacting us is as simple as filling in all the fields below and clicking the <strong>Send</strong>
        button. 
        <br/>
		Or Simply send an email to <a href="mailto:enquiries@islandselfcatering.co.uk">enquiries@islandselfcatering.co.uk</a>.
    </p>
    <div id="contact-form">
        <?php
			if(!empty($_POST['submit']))
			{
				include_once('includes/functions.php'); 
			
				$body = $fullname = $email_address = $contact_number = $message = '';
				
				$fullname = fcnRemoveXSSAttacks($_POST['fullname']);
				$email_address = fcnRemoveXSSAttacks($_POST['email_address']);
				$contact_number = fcnRemoveXSSAttacks($_POST['contact_number']);
				$message = fcnRemoveXSSAttacks($_POST['message']);
				
				if(!empty($fullname))
				{
					if(!empty($email_address) && fcnValidateEmail($email_address) == true)
					{
						if(!empty($contact_number))
						{
							if(!empty($message))
							{
								$message = htmlentities($message);
												
								$body .= '<html>'."\n";
								$body .= '<head>'."\n";
								$body .= '	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'."\n";
								$body .= '	<meta http-equiv="Content-Language" content="en-gb">'."\n";
								$body .= '	<title></title>'."\n";
								$body .= '	<meta name="description" content="">'."\n";
								$body .= '	<meta name="keywords" content="">'."\n";
								$body .= '	<meta name="robots" content="all">'."\n";
								$body .= '	<meta name="author" content="">'."\n";
								$body .= '	<meta name="page-topic" content="">'."\n";
								$body .= '</head>'."\n";
								$body .= '<body leftmargin="10" rightmargin="10">'."\n";
								$body .= '     <p>'.nl2br(html_entity_decode($message)).'</p>';
								$body .= '<p>Contact Number Supplied:'."\n";
								$body .= '</p><p>'.$contact_number. "\n";
								$body .= '</p></body>'."\n";
								$body .= '</html>'."\n";
									
								require_once('classes/phpmailer.php');
								
								$mail = new PHPMailer();
								$mail->From = $email_address;
								$mail->FromName = $fullname;
								$mail->ContentType = 'text/html';
								$mail->Sender = '';
								$mail->CharSet = 'iso-8859-1';
								$mail->Priority = 1;
								$mail->IsHTML(true);
								$mail->AddAddress('enquiries@islandselfcatering.co.uk','Iona Self-Catering');
								$mail->Subject = 'Contact Form Submitted - Iona Self-Catering';
								$mail->Body = $body;
	
								ini_set('sendmail_from',$mail->Sender);
	
								if($mail->Send())
								{												
									$mail->ClearAddresses();
									
									echo '<h3 class="error">Thank you for contacting us.  Once we have received your email, we will be in touch either via email or telephone.</h3>';
								}
								else
								{
									echo '<p class="error">Sorry your message has not been sent:<br/>'.$mail->ErrorInfo.'</p>';
								}
							}
							else
							{
								echo '<p class="error">Please provide us with your Enquiry.</p>';
							}
						}
						else
						{
							echo '<p class="error">Please provide us with your Contact Telephone Number.</p>';
						}
					}
					else
					{
						echo '<p class="error">Please provide us with your valid Email Address.</p>';
					}	
				}
				else
				{
					echo '<p class="error">Please provide us with your Fullname.</p>';
				}
			}
			
			unset($body,$message,$fullname,$email_address,$contact_number,$message);
			?>
        <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="contact-us" id="contact-us">
            <dl>
                <dt>
                    <label for="fullname">
                        Fullname:
                    </label>
                </dt>
                <dd>
                    <input type="text" name="fullname" id="fullname" value="<?php echo (!empty($_REQUEST['fullname']) ? $_REQUEST['fullname'] : ''); ?>" title="Type your Fullname in this field" tabindex="1" class="input-field" />
                </dd>
                <dt>
                    <label for="email_address">
                        Email Address (joe@bloggs.com):
                    </label>
                </dt>
                <dd>
                    <input type="text" name="email_address" id="email_address" value="<?php echo (!empty($_REQUEST['email_address']) ? $_REQUEST['email_address'] : ''); ?>" title="Type your Email Address in this field" tabindex="2" class="input-field" />
                </dd>
                <dt>
                    <label for="contact_number">
                        Contact Telephone Number:
                    </label>
                </dt>
                <dd>
                    <input type="text" name="contact_number" id="contact_number" value="<?php echo (!empty($_REQUEST['contact_number']) ? $_REQUEST['contact_number'] : ''); ?>" title="Type your contact Telephone number in this field" tabindex="3" class="input-field" />
                </dd>
                <dt>
                    <label for="message">
                        Enquiry:
                    </label>
                </dt>
                <dd>
                    <textarea name="message" id="message" cols="" rows="8" title="Type your Message in this field" tabindex="4">
                        <?php echo (!empty($_REQUEST['message']) ? $_REQUEST['message'] : ''); ?>
                    </textarea>
                </dd>
                <dt>
                    &nbsp;
                </dt>
                <dd>
                    <input type="submit" name="submit" id="submit" value="Send" title="Click this button to Send your details to us" tabindex="5" class="button" />
                </dd>
            </dl>
        </form>
    </div>
    <div id="postal-address">
        <h4>Our Postal Address</h4>
        <p>
            Michael &amp; Brenda McDonald,
            <br/>
            &quot;Springston&quot;
            <br/>
            58 Kirk Brae, Cults,
            <br/>
            Aberdeen, AB15 9QQ,
            <br/>
            Scotland.
            <br/>
            <br/>
            Tel: +44 (0) 1224 867 184
            <br/>
            Mob: +44 (0)7803016972
        </p>
    </div>
    
	<h4 class="safe">Other Accommodation</h4>
	<img src="images/hilton_site.jpg" title="Hilton Appartment, Hilton Self Catering" class="right_photo" />
	
		<p> We provide other self catering accommodation currently in Aberdeen, Scotland.  For more information, please visit our other site :
		
			<strong><a href="http://www.hiltonselfcatering.co.uk/index.php " title="Hilton Self Catering" rel="follow" accesskey="" target="_blank">www.hiltonselfcatering.co.uk</a></strong>
		</p>

    <h4 class="safe">Is My Information Safe?</h4>
	    <p>
	        Please note that any personal details collected via our site, such as email addresses, will only be used for the purpose of getting in touch with you as appropriate.
	    </p>
	    <p>
	        Under no circumstances will any such details be passed on to third-party organisations or will we send unsolicited email to you as a result of using our contact us page.
	    </p>
</div>
<?php include_once('includes/footer.php'); ?>
