<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<!-- #BeginTemplate "master.dwt" -->

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<!-- #BeginEditable "doctitle" -->
<title></title>
<!-- #EndEditable -->
<link href="styles/style3.css" media="screen" rel="stylesheet" title="CSS" type="text/css" />
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1682361-15']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script></head>

<body>

<!-- Begin Container -->
<div id="container">
	<!-- Begin Masthead -->
	<div id="masthead" style="height:170px;">

		
	</div>
	<!-- End Masthead -->
	<!-- Begin Navigation -->
	<!-- #BeginEditable "nav" -->
	<div id="navigation" >
		<a href="default.html" onmouseover="document.home.src='images/Mouseovers/webdesign_02.jpg'" onmouseout="document.home.src='images/webdesign_02.jpg'"><img src="images/webdesign_02.jpg" alt="Home" name="home"/></a>
		<a href="services.html" onmouseover="document.whyuseus.src='images/Mouseovers/webdesign_03.jpg'" onmouseout="document.whyuseus.src='images/webdesign_03.jpg'"><img src="images/webdesign_03.jpg" alt="Why Use Us" name="whyuseus"/></a>
		<a href="operating_area.html" onmouseover="document.operate.src='images/Mouseovers/webdesign_04.jpg'" onmouseout="document.operate.src='images/webdesign_04.jpg'"><img src="images/webdesign_04.jpg"   alt="Operating Area" name="operate" /></a>
		<a href="prices.html" onmouseover="document.prices.src='images/Mouseovers/webdesign_05.jpg'" onmouseout="document.prices.src='images/webdesign_05.jpg'"><img src="images/webdesign_05.jpg"   alt="Prices" name="prices"/></a>
		<a href="contact.html" onmouseover="document.contact.src='images/Mouseovers/webdesign_06.jpg'" onmouseout="document.contact.src='images/webdesign_06.jpg'"><img src="images/webdesign_06.jpg"   alt="Contact us" name="contact"/></a>
		
	
	</div>
	<!-- #EndEditable -->
	<!-- End Navigation -->
	<!-- Begin Page Content -->
	<div id="page_content">
		<!-- Begin Left Column -->
		<div id="column_l" style="top: 0px; width: 550px; left: 10px">
			<!-- #BeginEditable "content" -->
			<h2>Clutter Clearance Request</h2>
			<?php
/*

This script was created by Bryan Helmig at midmodesign.com. It is licensed under http://creativecommons.org/licenses/by-nc-sa/3.0/us/. 
1)   A quick primer: place this on your server. Create a form like below:
--------------------------------------------------------------------------------------------------------
<form action="sendmail.php" method="post" id="contactForm">
	<p>Name:</p> <input type="text" name="name" value="" id="name" />
	<p>Email:</p> <input type="text" name="email" value="" id="email" />
	<p>Telephone:</p> <input type="text" name="tele" value="" id="tele" />
	<span style="display:none;"><p>Honeypot:</p> <input type="text" name="last" value="" id="last" /></span>
	<p>Message:</p> <textarea rows="5" name="message"></textarea>
	<input type="submit" value="Send Message" />
</form
--------------------------------------------------------------------------------------------------------
2)   This will work fine for a standard form. If you want ajax power, add this div above or below and hide it with css.
--------------------------------------------------------------------------------------------------------
<div class="message"><div id="alert"></div></div>
--------------------------------------------------------------------------------------------------------
3)   And add this to the head: Also download jquery-latest.pack.js and jquery.form.js and point to those appropriately.
--------------------------------------------------------------------------------------------------------
<script type="text/javascript" src="jquery-latest.pack.js"></script>
<script type="text/javascript" src="jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function() { 
var options = { 
target:        '#alert',
beforeSubmit:  showRequest,
success:       showResponse
}; 
$('#contactForm').ajaxForm(options); 
}); 
function showRequest(formData, jqForm, options) { 
var queryString = $.param(formData); 
return true; 
} 
function showResponse(responseText, statusText)  {  
} 
$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};
</script>
--------------------------------------------------------------------------------------------------------

Boom. There it is. 
*/

//        Who you want to recieve the emails from the form. (Hint: generally you.)
$sendto = 'info@clutter-clearance.co.uk';

//        The subject you'll see in your inbox
$subject = 'Clearance Request';

//        Message for the user when he/she doesn't fill in the form correctly.
$errormessage = 'Oops! There seems to have been a problem. May we suggest...';

//        Message for the user when he/she fills in the form correctly.
$thanks = "Thanks for the email! We'll get back to you as soon as possible!";

//        Message for the bot when it fills in in at all.
$honeypot = "You filled in the honeypot! If you're human, try again!";

//        Various messages displayed when the fields are empty.
$emptyname =  'Entering your name?';
$emptyemail = 'Entering your email address?';
$emptytele = 'Entering your telephone number?';
$emptymessage = 'Entering a message?';
$emptypartsize = 'There is a problem - please submit your request again';
//       Various messages displayed when the fields are incorrectly formatted.
$alertname =  'Entering your name using only the standard alphabet?';
$alertemail = 'Entering your email in this format: <i>name@example.com</i>?';
$alerttele = 'Entering your telephone number in this format:<i>01923734827</i> or <i>555-555-5555</i> for american numbers';
$alertmessage = "Making sure you aren't using any parenthesis or other escaping characters in the message? Most URLS are fine though!";

// --------------------------- Thats it! don't mess with below unless you are really smart! ---------------------------------

//Setting used variables.
$alert = '';
$pass = 0;

// Sanitizing the data, kind of done via error messages first. Twice is better!
function clean_var($variable) {
    $variable = strip_tags(stripslashes(trim(rtrim($variable))));
  return $variable;
}

//The first if for honeypot.
if ( empty($_REQUEST['last']) ) {

	// A bunch of if's for all the fields and the error messages.
	/*if ( empty($_REQUEST['uname']) ) {
		$pass = 1;
		$alert .= "<li>" . $emptyname . "</li>";
	} elseif ( ereg( "[][{}()*+?.\\^$|]", $_REQUEST['uname'] ) ) {
		$pass = 1;
		$alert .= "<li>" . $alertname . "</li>";
	}
	if ( empty($_REQUEST['email']) ) {
		$pass = 1;
		$alert .= "<li>" . $emptyemail . "</li>";
	} elseif ( !eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_REQUEST['email']) ) {
		$pass = 1;
		$alert .= "<li>" . $alertemail . "</li>";
	}*/


	//If the user err'd, print the error messages.
	if ( $pass==1 ) {

			//This first line is for ajax/javascript, comment it or delete it if this isn't your cup o' tea.
		echo "<script>$(\".message\").hide(\"slow\").show(\"slow\"); </script>";
		echo "<b>" . $errormessage . "</b>";
		echo "<ul>";
		echo $alert;
		echo "</ul>";

	// If the user didn't err and there is in fact a message, time to email it.
	} elseif (isset($_REQUEST['email'])) {
		$uname= $_POST['uname'];
		$email= $_POST['email'];
		$phone= $_POST['phone'];
		$description= $_POST['description'];
		$address= $_POST['address'];
		$addresstype= $_POST['addresstype'];
		$coldate= $_POST['coldate'];
		$coltime= $_POST['coltime'];
		$comeback= $_POST['comeback'];
		$what= $_POST['what'];
		$Time= $_POST['Time'];
		$other= $_POST['other'];

		//Construct the message.
		$message = "You have had a request for a junk collection. The details are below - \n\n";
	    $message .= "From: " . clean_var($_REQUEST['uname']) . "\n";
		$message .= "Email: " . clean_var($_REQUEST['email']) . "\n";
		$message .= "Telephone: " . clean_var($_REQUEST['phone']) . "\n";	
		$message .= "Requirements: " . clean_var($_REQUEST['description']) . "\n";
		$message .= "Address: " . clean_var($_REQUEST['address']) . "\n";
		$message .= "Address Type: " . clean_var($_REQUEST['addresstype']) . "\n";		
		$message .= "Desired Date: " . clean_var($_REQUEST['coldate']) . "\n";
		$message .= "Time: " . clean_var($_REQUEST['coltime']) . "\n";
		$message .= "Repeat: " . clean_var($_REQUEST['comeback']) . "\n";
		$message .= "To Collect: " . clean_var($_REQUEST['what']) . "\n";
		$message .= "Time Estimate: " . clean_var($_REQUEST['Time']) . "\n";
		$message .= "Other Info: " . clean_var($_REQUEST['other']) . "\n";

	    $header = 'From:'. clean_var($_REQUEST['email']);
	    
//Mail the message - for production
		mail($sendto, $subject, $message, $header);

//This is for javascript, 
		echo "<script>$(\".message\").hide(\"slow\").show(\"slow\").animate({opacity: 1.0}, 4000).hide(\"slow\"); $(':input').clearForm() </script>";
		echo "<p>$thanks</p><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />";

//Echo the email message - for development
		//echo "<br/><br/>" . $message;

	}
	
//If honeypot is filled, trigger the message that bot likely won't see.
} else {
	echo "<script>$(\".message\").hide(\"slow\").show(\"slow\"); </script>";
	echo $honeypot;
}
?>

			<!-- #EndEditable --></div>
		<!-- End Left Column -->
		<!-- Begin Right Column -->
		<div id="column_r">
			<!-- #BeginEditable "sidebar" -->
			<!-- #EndEditable --></div>
		<!-- End Right Column --></div>
	<!-- End Page Content -->
	<!-- Begin Footer -->
	<div id="footer" style="height: 135px">
	<br/><br/><br/><br/><br/>
		<p><a href="default.html">Home</a> | <a href="operating_area.html">Operating Area</a> 
		|&nbsp;
		<a href="contact.html">Contact</a> |&nbsp;
		<a href="prices.html">Prices</a> |&nbsp;
		<a href="services.html">Services</a> |
		<a href="site_map.html">Site Map</a></p>
		<p>Copyright © 2010 Clutter Clearance.
		<a href="http://www.pendragoninteractive.com" target="_blank">Site design</a> by 
		<a href="http://www.pendragoninteractive.com" target="_blank">Pendragon Interactive</a></p>
	</div>
	<!-- End Footer --></div>
<!-- End Container -->
 <!-- Google Code for Lead Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 999404925;
var google_conversion_language = "ar";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "gKk6CIO9xgIQ_erG3AM";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/999404925/?label=gKk6CIO9xgIQ_erG3AM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

</body>

<!-- #EndTemplate -->

</html>
