<?php
  include_once($_SERVER['DOCUMENT_ROOT'] . "/admin/inc/sessionStartGeneral.php");
?>
<?php
  $pageTitle = "Contact Us";
  $pageDescription = "We care about your thoughts. Let us know what we are doing right, or wrong.";
  $pageKeywords = "contact us, feedback";
?>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/common/header.php") ?>
<script src="/Kickstrap/js/jquery.h5validate.js" type="text/javascript"></script>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . "/common/mainNav.php")?>
    
    
    
    <section class="container">
      <div id="blankBuffer" class="carousel-buffer"></div>
      
      <section class="container" id="mainContent">
        <article class="row">
          <div class="span12" id="contactContainer">
            <h1>Tell us your thoughts</h1>
            <p>Whether you are singing our praises or you have major concerns with our operation, we want to know about it. Fill out the form below and we will get back to you in a timely manner.</p><br><br>
            <div class="offsetPadLeft">
              <form action="/formmail.php" name="contactForm" method="post">
                <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
                <input type="hidden" name="recipients" value="brandon@petersonsfreshmarket.com" />
                <input type="hidden" name="required" value="email:Your email address,name:Your name" />
                <input type="hidden" name="subject" value="Contact Form Submission From <?php echo WEB_URL; ?>" />
                <input type="hidden" name="good_url" value="<?php echo DOC_ROOT; ?>thanks.php">
				<input type="hidden" name="derive_fields" value="replyto=email" />
                <input type="hidden" name="conditions1" value=":#
 #TEST#email ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i ##
  Please enter a valid email address.#">
				<input type="hidden" name="conditions2" value=":##IF#phone#phone~ /^\D?(\d{3})?\D?\D?(\d{3})\D?(\d{4})$/##Please enter a valid phone number xxx-xxx-xxxx#:"/>
				
				
                <?php include("https://afsshareportal.com/common/contactForm.php"); ?>
              </form>
            </div>
          </div>
        </article>
        
      </section>
    </section>
      
    
    
    
    <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/common/footer.php"); ?>
  <script>
   
    function getStoreLocations(){
        $.ajax({
            type: "POST",
            url: "/admin/lookUp.php",
            data: "action=getStoreLocations",
            dataType: "json",
            success: function(theResponse){
                var theHTML = "";
                //console.log("num locations: " + theResponse.length);
                if(theResponse.length > 1){
                  $.each(theResponse, function(){
                    theHTML += "<option>" + this.store_name + "</option>";
                  });
                  
                  $("#location").append(theHTML);
                }else{
                  $("#location").closest("div").remove();
                }
            }
        });
    }
    
    getStoreLocations();
   
    $('#contactForm').h5Validate();
			
    $("#contactForm").submit(function(event){
        event.preventDefault();
        
        var myResult = validateForm("contactForm");
        
        var theLocation = $("#location").val();
        
        if(myResult == true)
        {
            var self = $(this);	
            self.unbind('submit').submit()
        }
    });
   
   ks.ready(function() {
      // JavaScript placed here will run only once Kickstrap has loaded successfully.
      
      
   });
  </script>
  
  
</body>
</html>
