<?
include "top.php";
$action=$_REQUEST['action'];
if($action=='send')
{
            $dental_prob=$_POST['dental_prob'];
			$like=$_POST['like'];
			$medication=$_POST['medication'];
			$time_miss_teeth=$_POST['time_miss_teeth'];
			$replace=$_POST['replace'];
			$dentures=$_POST['dentures'];
			$dentures_type=$_POST['dentures_type'];
			$dental_implant=$_POST['dental_implant'];
			$financing=$_POST['financing'];
			$dental_procedure=$_POST['dental_procedure'];
			$pay_mode=$_POST['pay_mode'];
            $name=$_POST['name'];
			$age=$_POST['age'];
			$sex=$_POST['sex'];
			$email=$_POST['email'];
			$phone=$_POST['phone'];
			$address1=$_POST['address1'];
			$city=$_POST['city'];
			$state=$_POST['state'];
			$zip=$_POST['zip'];
			$valid=1;
			if($dental_prob=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Dental problem ");
				$valid=0;
			}
			if($like=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"You wnat to correct ");
				$valid=0;
			}
			if($medication=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Medication you taking ");
				$valid=0;
			}
			if($age=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Age ");
				$valid=0;
			}
			if($sex=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Gender ");
				$valid=0;
			}
			
			
			if($name=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Name ");
				$valid=0;
			}
			
			if($address1=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Address ");
				$valid=0;
			}
			if($city=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"City ");
				$valid=0;
			}
			if($state=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"State ");
				$valid=0;
			}
			if($zip=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Zip ");
				$valid=0;
			}
			
			if($email=="" && $valid==1)
			{
				$ERmsg=msgbox(15,"Email ");
				$valid=0;
			}
			else
			  if(!checkEmail($email) && $valid==1)
			  {
			    $ERmsg="Please enter valid email address";
				$valid=0;
			}
	   
	   if ($valid==1) {
		
			//echo "hello";
			// Email FABS
			$to = "surojitbiswas@gmail.com ; ritusmitabiswas@gmail.com";
			$from = $_POST['email'];
			$subject = 'Request for online consultation';
			$message = '
			<h1>'. $subject .'</h1>
			<p>Dental problem: '. $_POST['dental_prob'] . '</p>
			<p>I would like to correct my: '. $_POST['like'] . '</p>
			<p>What Medications are you taking?: '. $_POST['medication'] . '</p>
			<p>How long have you been missing teeth?: '. $_POST['time_miss_teeth'] . '</p>
			<p>When your teeth were removed did they replace bone?: '. $_POST['replace'] . '</p>
			<p>Age: '. $_POST['age'] . '</p>
			<p>Sex: '. $_POST['sex'] . '</p>
			<p>Do you currently wear dentures?: '. $_POST['dentures'].'</p>
			<p>Full or Partial Dentures?: '. $_POST['dentures_type'] . '</p>
			<p>Have you had Dental Implants in the past: '. $_POST['dental_implant'] . '</p>
			<p>Are you interested in Financing?: '. $_POST['financing'] . '</p>
			<p>Will you be using insurance or will you be paying in cash?: '. $_POST['pay_mode'] . '</p>
			<p>What other dental procedures are you interested in?: '. $_POST['dental_procedure'] . '</p>
			<p>Name: '. $_POST['name'] . '</p>
			
			<p>Email: '. $_POST['email'] . '</p>
			<p>Phone: '. $_POST['phone'] . '</p>
			<p>Address: '. $_POST['address1'].'</p>
			<p>City: '. $_POST['city'] . '</p>
			<p>State: '. $_POST['state'] . '</p>
			<p>Zip: '. $_POST['zip'] . '</p>
			
			';
			
			$headers  = 'MIME-Version: 1.0' . "\n";
	        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
	        $headers .= 'From: '. $from . "\n";
			
			mail($to, $subject, $message, $headers);
			
			q("insert into consultation set name='".$_POST['name']."',age='".$_POST['age']."',sex='".$_POST['sex']."',
			email='".$_POST['email']."',phone='".$_POST['phone']."',add1='".$_POST['address1']."',
			city='".$_POST['city']."',state='".$_POST['state']."',zip='".$_POST['zip']."',dental_prob='".$_POST['dental_prob']."',correct='".$_POST['like']."',
			medication='".$_POST['medication']."',time_miss_teeth='".$_POST['time_miss_teeth']."',replace_bone='".$_POST['replace']."',
			dentures='".$_POST['dentures']."',dentures_type='".$_POST['dentures_type']."',dental_implant='".$_POST['dental_implant']."',
			financing='".$_POST['financing']."',pay_mode='".$_POST['pay_mode']."',dental_procedure='".$_POST['dental_procedure']."'");
			//event(0, "Contact Request");
			$ERmsg='Your  request was sent successfully.';
			$name='';
			$age='';
			$sex='';
			$email='';
			$phone='';
			$address1='';
			$city='';
			$state='';
			$zip='';
			$problem='';
			$message='';
			
		}

     // else
	      //  $ERmsg='Some required information was missing or invalid.'; 


}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mini Dental Implant Solutions | Take a online consultation from MDI doctor</title>
<link rel="stylesheet" href="css/style.css" type="text/css" />
<script type="text/javascript" src="js/function.js"></script>
</head>

<?php include "header.php"; ?>

 <!--Header Ends -->
      
      <div style="float:left; width:970px;">
        <!--Left Start -->
        
        <?php include "left.php"; ?>
            
            <!--Left Ends -->
		
        <div style="float:left; width:17px; height:100px;"></div>
        <div style="float:left; width:485px;">
          <div class="pr_middle">
            <p style="font-family:'Times New Roman', Times, serif; font-size:20px; text-shadow:#000000 1px 1px 1px;">&nbsp;&nbsp;Take an Online Consultation</p>
          </div>
          <div style="float:left; width:485px;">
		  <div>For the Smile you've always wanted contact a Mini Dental Implant Dentist today!

           For a qualified MDIS dentist in your area please complete the form below and we'll put you in touch with local dentist within 24 hours.
		   </div>

		  <div style="font-weight:bold"><?=$ERmsg?></div>
            <?
			  global $state_list;
			  $states = '<select name="state" style="border:#000000 1px solid">';
	          foreach ($state_list as $key=>$value) $states .= '<option value="'. $value .'">'. $value .'</option>';
	          $states .= '</select>';
			  ?>
              <br />
			  <form action="<?=$_SERVER['PHP_SELF']?>" method="post" class="affiliate_contact_form">
			  <input type="hidden" name="action" value="send" />
					<table width="100%" cellpadding="2">
												<tr>
							<td valign="top">Describe your dental problem (ex. Missing Teeth, Loose Dentures):*</td>
							<td width="198"><textarea name="dental_prob" id="dental_prob" rows="5" cols="30" style="border:#000000 1px solid"><?=$dental_prob?></textarea></td>
						</tr>
						<tr>
							<td valign="top">I would like to correct my (ex: Top Teeth, Bottom Teeth, Front Teeth, All of my teeth): *</td>
							<td><textarea name="like" id="like" rows="5" cols="30" style="border:#000000 1px solid"><?=$like?></textarea></td>
						</tr>
						<tr>
							<td valign="top">What Medications are you taking?:*</td>
							<td><textarea name="medication" id="medication" rows="5" cols="30" style="border:#000000 1px solid"><?=$medication?></textarea></td>
						</tr>
						<tr>
							<td valign="top">How long have you been missing teeth?:</td>
							<td><textarea name="time_miss_teeth" id="time_miss_teeth" rows="5" cols="30" style="border:#000000 1px solid"><?=$time_miss_teeth?></textarea></td>
						</tr>
						<tr>
							<td valign="top">When your teeth were removed did they replace bone?:</td>
							<td><textarea name="replace" id="replace" rows="5" cols="30" style="border:#000000 1px solid"><?=$replace?></textarea></td>
						</tr>
						<tr>
							<td>Your Age: *</td>
							<td><input type="text" name="age" id="age" value="<?=$age?>" style="border:#000000 1px solid" size="10" onkeypress="return checkNumeric_dot(event)"/></td>
						</tr>
						<tr>
							<td>Gender: *</td>
							<td><input type="radio" value="Male" name="sex" />Male&nbsp;&nbsp;<input type="radio" value="Female" name="sex" />Female</td>
						</tr>
						<tr>
							<td>Do you currently wear dentures?:*</td>
							<td><input type="radio" value="yes" name="dentures" />Yes&nbsp;&nbsp;<input type="radio" value="no" name="dentures" />No</td>
						</tr>
						<tr>
							<td valign="top">If yes, Full or Partial Dentures?:</td>
						  <td><input type="radio" value="full" name="dentures_type" />Full Dentures &nbsp;&nbsp;<br /><input type="radio" value="partial" name="dentures_type" />Partial Dentures</td>
						</tr>
						<tr>
							<td>Have you had Dental Implants in the past?:</td>
							<td><input type="radio" value="yes" name="dental_implant" />Yes&nbsp;&nbsp;<input type="radio" value="no" name="dental_implant" />No</td>
						</tr>
						<tr>
							<td>Are you interested in Financing?:</td>
							<td><input type="radio" value="yes" name="financing" />Yes&nbsp;&nbsp;<input type="radio" value="no" name="financing" />No</td>
						</tr>
						<tr>
							<td>Will you be using insurance or will you be paying in cash?:</td>
							<td><input type="radio" value="insurance" name="pay_mode" />Insurance&nbsp;&nbsp;<input type="radio" value="cash" name="pay_mode" />Cash</td>
						</tr>
						<tr>
							<td height="89" valign="top">What other dental procedures are you interested in?:</td>
			        <td><input type="radio" value="teeth cleaning" name="dental_procedure" />teeth cleaning&nbsp;&nbsp;<br /><input type="radio" value="oral exam" name="dental_procedure" />oral exam <br /><input type="radio" value="fillings" name="dental_procedure" />fillings&nbsp;&nbsp;<br /><input type="radio" value="etc" name="dental_procedure" />etc</td>
							<!--<td width="117"><input type="radio" value="fillings" name="sex" />fillings&nbsp;&nbsp;<input type="radio" value="etc" name="sex" />etc</td>-->
						</tr>
						<tr>
							<td width="271">Your Name: *</td>
							<td><input type="text" name="name" id="name" style="border:#000000 1px solid" value="<?=$name?>"/></td>
						</tr>
						
						<tr>
							<td valign="top">Your Address: *</td>
							<td>
							 <textarea name="address1" id="address1" rows="5" cols="30" style="border:#000000 1px solid"><?=$address?></textarea><br/>
								
							</td>
						</tr>
						<tr>
							<td>Your City: *</td>
							<td><input type="text" name="city" id="city" value="<?=$city?>" style="border:#000000 1px solid"/></td>
						</tr>
						<tr>
							<td>Your State: *</td>
							<td><?=$states?></td>
						</tr>
						<tr>
							<td>Your Zip: *</td>
							<td><input type="text" name="zip" id="zip" value="<?=$zip?>" style="border:#000000 1px solid"/></td>
						</tr>
						<tr>
							<td>Your Email: *</td>
							<td><input type="text" name="email" value="<?=$email?>" id="email" style="border:#000000 1px solid"/></td>
						</tr>
						<tr>
							<td>Your Phone:</td>
							<td><input type="text" name="phone" id="phone" value="<?=$phone?>" style="border:#000000 1px solid"/></td>
						</tr>
						
						
						<tr>
							<td>&nbsp;</td>
							<td><input type="image" src="images/contact_send_btn.png" alt="search" style="padding:10px 0px 0px 0px;" /></td>
						</tr>
					</table>
					
					<input type="hidden" name="action" value="send"/>
				</form>
              </p>
		
		
          </div>
        </div>
        <div style="float:left; width:16px; height:100px;"></div>
         <!-- Right Start -->
        
        <?php include "right.php"; ?>
        
        <!-- Right Ends -->
      </div>
    </div>
  

 <!--Footer Start -->
    
    <?php
include "footer.php";
?>