All pastes #288012 Raw Edit

Stuff

public text v1 · immutable
#288012 ·published 2006-12-21 23:29 UTC
rendered paste body
<?
	function check_inquiry(){
		
		// bools

		$error				= false;
		$incomplete		= false;
		$email_error	= false;
		$job_error		= true;
		$desc_error   = false;


		// contact vars
		
		$c_fname				= $_POST['client_first_name'];
		$c_lname				= $_POST['client_last_name'];
		$c_telephone		= $_POST['client_telephone'];
		$c_email				= $_POST['client_email'];
		$c_company_name = $_POST['client_company_name'];
		$c_address1			= $_POST['client_address1'];
		$c_address2			= $_POST['client_address2'];
		$c_city					= $_POST['client_city'];
		$c_state				= $_POST['client_state'];
		$c_zip					= $_POST['client_zipcode'];
		$c_contact_time	= $_POST['client_best_time'];

		// job vars - checkboxes - javascript disabled browsers

		$c_print	= $_POST['print_checkbox'];
		$c_web		= $_POST['web_checkbox'];
		$c_gd			= $_POST['gd_checkbox'];

		//job vars - buttons - javascript enabled browsers

		$b_print	= $_POST['item_print'];
		$b_web		= $_POST['item_web'];
		$b_gd			= $_POST['item_gd'];

		// job descriptions

		$jd_print = $_POST['print_description'];
		$jd_web   = $_POST['web_description'];
		$jd_gd		= $_POST['gd_description'];

		// validate fields
		
		if (!$c_fname)					{ $incomplete = true; }
		if (!$c_lname)					{ $incomplete = true; }
		if (!$c_telephone)			{ $incomplete = true; }
		if (!$c_email)					{ $incomplete = true; }
		if (!$c_company_name)		{ $incomplete = true; }
		if (!$c_address1)				{ $incomplete = true; }
		if (!$c_city)						{ $incomplete = true; }
		if (!$c_state)					{ $incomplete = true; }
		if (!$c_zip)						{ $incomplete = true; }
		if (!$c_contact_time)		{ $incomplete = true; }

		if ($c_print) { $job_error = false; $job_type .= "print work,"; }
		if ($b_print) { $job_error = false; $job_type .= "print work,"; }

		if ($c_web)		{ $job_error = false; $job_type .= "website development,"; }
		if ($b_web)		{ $job_error = false; $job_type .= "website development,"; }

		if ($c_gd)		{ $job_error = false; $job_type .= "graphic design,"; }
		if ($b_gd)		{ $job_error = false; $job_type .= "graphic design,"; }
		
		if (($b_print && !$jd_print) || ($c_print && !$jd_print)) { $desc_error = true; }
		if (($b_web && !$jd_web) || ($c_web && !$jd_web)) { $desc_error = true; }
		if (($b_gd && !$jd_gd) || ($c_gd && !$jd_gd)) { $desc_error = true; }
		
		if (!$job_error) { 
			$job_type = substr($job_type,0,strlen($job_type)-1); 
			$job = explode(",",$job_type);
		}



		
		if ($incomplete) { 
			echo "<div id=\"submission_bg\"><h1>Incomplete</h1><p>Please be sure that you have filled out the form completely. Atleast one (1) item category is required to be selected and a short project description must be provded describing what you are inquiring about..</p></div><div id=\"submission_bottom\"></div>"; return;
		} else if ($job_error) {
			echo "<div id=\"submission_bg\"><h1>No category selected</h1><p>Please be sure that you have filled out the form completely. Atleast one (1) item category is required to be selected and a short project description must be provded describing what you are inquiring about..</p></div><div id=\"submission_bottom\"></div>"; return;
		} else if ($desc_error) {
			echo "<div id=\"submission_bg\"><h1>Description Omitted</h1><p>Please be sure that you have filled out the form completely. You have selected a job type but did not provide a project description for it.</p></div><div id=\"submission_bottom\"></div>"; return;
		} else {
			
			$recipient = "admin@ansimation.net";
			$subject = "Inquiry from: ".$c_fname." ".$c_lname." [".$c_email."]";
			
			$body = '
				<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
								"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
				<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
					<head>
						<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
						<title>Inquiry</title>
						<style type="text/css">
							div#container {
								width:700px;
							}

							div#sub_container {
								padding:0px 0px 10px 0px;
								border-bottom:1px #000 solid;
							}

							div#container p {
								color:#000;
								padding:0px;
								margin:0px 0px 0px 0px;
								font-family:Trebushet MS;
								font-size:14px;
								font-weight:normal;
								line-height:14px;
							}

							div#header {
								padding:5px 5px 13px 5px;
								border:1px #000 solid;
								overflow:show;
								background: transparent url(http://www.ansimation.net/ansi/images/inquire_mail_header.gif) top left no-repeat;
							}

							div#header p {
								font-family:Trebuchet MS;
								font-size:14px;
								line-height:14px;
								padding:0px;
								margin:37px 0px 0px 10px;
								width:600px;
								color:#000;
							}

							div#contact_info h1 {
								color:#000;
								padding:0px;
								margin:0px 0px 5px 0px;
								font-family:Trebushet MS;
								font-size:15px;
								font-weight:bold;			
							}

							div#contact_info {
								margin:10px 0px 10px 0px;
								padding:10px 50px 10px 10px;
								width:150px;
								float:left;
								border-right:1px #000 solid;
							}
							
							div#job_description h1 {
								color:#000;
								padding:0px;
								margin:0px 0px 5px 0px;
								font-family:Trebushet MS;
								font-size:15px;
								font-weight:bold;			
							}

							div#job_description h2 {
								color:red;
								padding:0px;
								margin:0px 0px 0px 15px;
								font-family:Trebushet MS;
								font-size:15px;
								font-weight:bold;			
							}

							div#job_description p {
								color:#000;
								padding:0px;
								margin:0px 0px 0px 25px;
								font-family:Trebushet MS;
								font-size:14px;
								font-weight:normal;
								line-height:12px;
							}

							div#job_description {
								margin:10px 0px 10px 0px;
								padding:10px 10px 10px 10px;
								float:right;
								width:450px;
							}

							.row {
								margin: 0px 0px 0px 10px;
							}
							
							.blank_row {
								height:12px;
								width:1px;
							}

							.clear
								{ clear:both; }

							.important
							{
								color: red;
								font-weight:bold;	
							}

						</style>
					</head>
				<body>
					<div id="container">
						<div id="sub_container">

							<div id="header">
								<p>from <span class="important">'.$c_fname.' '.$c_lname.'</span> [<a href="mailto:'.$c_email.'">'.$c_email.'</a>] on <span class="important">'.date("",time()).'</span></p>
							</div>

							<div id="contact_info">
								<h1>Contact Information:</h1>
								<div class="row"><span >'.$c_fname.' '.$c_lname.'</span></div>
								<div class="row"><span >'.$c_address1.'</span></div>
								<div class="row"><span >'.$c_address2.'</span></div>
								<div class="row"><span >'.$c_city.', '.$c_state.'</span></div>
								<div class="row"><span >'.$c_zipcode.'</span></div>
								<div class="blank_row"></div>
								<div class="row"><span ><a href="mailto:'.$c_email.'">'.$c_email.'</a></span></div>
							</div>
							
							<div id="job_description">
								<h1>Requested Services:</h1>';



					foreach ($service) {			
						$body .= '
								<div class="service">
									<h2>'.$service[$x].'</h2>
									<p>'.$description[$x].'</p>
									<div class="blank_row"></div>
								</div>';
					}

						$body .= '
							</div>
							<div class="clear"></div>
						</div>

						<div class="blank_row"></div>
						<p>This e-mail contains proprietary information and may be confidential. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this message is strictly prohibited. If you received this message in error, please delete it immediately.</p>
						
						<div class="blank_row"></div>
						<p>This e-mail was automatically generated by travisballard.com's e-mail services at the visitor's request. Any reply to this e-mail will not be received by travisballard.com. Please contact the travisballard.com directly if you have questions regarding this inquiry.</p>
					
					</div>
				</body>
				</html>			
			';
			
			
			echo "<div id=\"submission_bg\"><h1>Thank You!</h1><p>your inquiry has been sent to me for review. a copy has also been sent to the email address you provided for you to keep with your records. I will contact you regarding your inquiry as soon as possible.</p></div><div id=\"submission_bottom\"></div>"; return;
		}
	}
?>