<?php
extract($_REQUEST);
// process the form if the form was submitted
if ($form_submit) {
	// make sure name and either phone or email have values
	if ($name == "") { $error .= "<br>Your Name"; }
	if ( ($phone == "") && ($email == "") ) { $error .= "<br>Your Phone Number or Email Address"; }

	if(!$error) 
	{
		// send data to tater
		mail("Brad Bulger <brad@madfishgroup.com>", "Contacting Madfish Group", "From: $name\nCompany: $company\nEmail: $email\nPhone: $phone\nReason: $reason");

		// set submit_success to true so success reply will be written to screen
		$submit_success = 1;
	}
}

include($_SERVER['DOCUMENT_ROOT'].'/template/header.inc');

if ($submit_success) {
	echo "Thank you for contacting the Madfish Group. We will be responding to your inquiry as soon as possible.";
} else {
?>

<p>
The Madfish Group would be happy to talk to you, and would love to tell 
you more about our Open Source tools. Please contact 
us via the form, or use any of the 
information below.  We look forward to getting back to you as soon as is 
possible.
</p>
<?php  if ($error) { ?>
	<font color="#CC0000">The following fields were left blank: <?=$error?><p>Please enter the missing information and submit again.</font>
<?php } ?>
<p>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

<table cellpadding="0" cellspacing="5" border="0">
<tr align="left" valign="middle">
	<td>Your Name</td>
	<td><input type="text" name="name" size="15" value="<?=$name?>"></td>
</tr>
<tr align="left" valign="middle">
	<td>Company Name</td>
	<td><input type="text" name="company" size="15" value="<?=$company_name?>"></td>
</tr>
<tr align="left" valign="middle">
	<td>Your Phone Number</td>
	<td><input type="text" name="phone" size="15" value="<?=$phone?>"></td>
</tr>
<tr align="left" valign="middle">
	<td>Your Email Address</td>
	<td><input type="text" name="email" size="15" value="<?=$email?>"></td>
</tr>
<tr align="left" valign="top">
	<td>Reason for Contacting Us</td>
	<td><textarea name="reason" cols="40" rows="10" wrap="virtual"><?=$reason?></textarea></td>
</tr>
<tr align="left" valign="middle">
	<td></td>
	<td><input type="submit" name="form_submit" value="Contact Madfish Group"></td>
</tr>
</table>

</form>
</p>

<?php } // end else ?>

<p>
The Madfish Group<br>
681 Page St. #3<br>
San Francisco, CA &nbsp;94117<br><b>
<h3> Or Contact a Team Member Directly: </h3>
Brad: <a href="mailto:brad@madfishgroup.com">brad@madfishgroup.com</a><br>
</p>

<p>
We're also listed at
 <a href="http://california.oymap.com/">California at OyMap.com - a world directory</a>
</p>

<span style="display:none">
<a href="mailto:<?php echo $REMOTE_ADDR; echo '_on_'; echo date('y_m_j_Gi'); echo '@gladfish.com'; ?>">our special email address
</a>
</span>
<?php include($_SERVER['DOCUMENT_ROOT'].'/template/footer.inc'); ?>
