<?php

$include_level_up = 0;
$g_public_page = true;

include('./ladybug_include/generic_include.php');
include('./include/site_include.php');

//$g_page_title = "";
//$g_page_meta_description = "";

# Non CMS
$g_carousel_source = "./image/carousel/contact";
$g_filmstrip_source = "./image/filmstrip/contact";

# CMS
if ($g_cms_exists) {
    $g_carousel_source = "home_carousel_images";
    $g_filmstrip_source = "home_filmstrip_images";
}

include('./ladybug_include/header_include.php');
include('./include/site_header.php'); # Header for this project
?>
	
	<section id="contact-us-container">

        <?php
        if ($g_cms_exists) {
            print cms_get_content_by_internal_name("contact_us_heading");
        } else {

        ?>
        <h1>Contact Us</h1>
        <?php
        }
        ?>

        <section class="contact-details">
    	    <div class="column-one">
                <?php
                if ($g_cms_exists) {
                    print cms_get_content_by_internal_name("contact_us_column_one");
                } else {

                ?>
                <p><strong>Location</strong><br />
                    We come to you so we can see what your dog's doing in it's home environment. We service the outer East and South Eastern suburbs of Melbourne.</p>
                    <?php
                }
                ?>
            </div>
            
            <div class="column-two">
                <?php
                if ($g_cms_exists) {
                    print cms_get_content_by_internal_name("contact_us_column_one");
                } else {

                ?>
                <p><br /><strong>m&nbsp;&nbsp;</strong><a href="tel:0402211659">0402 211 659</a></p>
                <p><strong>e&nbsp;&nbsp;</strong><a href="mailto:matt@muddypawsdt.com.au">matt@muddypawsdt.com.au</a></p>

                    <?php
                }
                ?>
            </div>
        </section>
        
        <div class="clear-both"></div>
        
        <!-- Uncomment this section if a form is required -->
        
        <section id="enquiry-form-container">
            <form id="enquiry-form">
                <input type="hidden" name="_action_id" value="mail_form" />
                <input type="hidden" name="_title" value="Enquiry form" />
                <span class="form-message" style="color: #ff0000"></span>
                <h2>Tell us what your dog's been up to...</h2>
                
                <div class="column-one">
                    <div class="form-field_label-container">
                        <p class="form-detail_label">Your name</p>
                    </div>
                    
                    <div class="form-field_input-container">
                        <input id="enquiry-form_name" class="form_input" type="text" name="Name" />
                    </div>
                    
                    <div class="form-field_label-container">
                        <p class="form-detail_label">Email</p>
                    </div>
                    
                    <div class="form-field_input-container">
                        <input id="enquiry-form_email" class="form_input" type="email" name="Email" />
                    </div>
                </div>
                
                    <div class="column-two">
                    
                    <div class="form-field_label-container">
                        <p class="form-detail_label">Phone</p>
                    </div>
                    
                    <div class="form-field_input-container">
                        <input id="enquiry-form_phone-number" class="form_input" type="tel" name="Phone Number" />
                    </div>
                    
                    <div class="form-field_label-container">
                        <p class="form-detail_label">What does your dog need help with?</p>
                    </div>
                    
                    <div class="form-field_input-container">
                        <textarea id="enquiry-form_enquiry" class="form_input" rows="4" cols="100" name="Enquiry"></textarea>
                    </div>
                                
                    <input id="form-terms" class="form-terms no-fancy-checkbox" type="checkbox" name="Terms" tabindex="-1" />
                    <span class="form-terms"><label for="form-terms">Do you agree to the terms and conditions of this website?</label></span>
                            
                    <div id="submit-button-container">
                        <input id="submit-button" type="submit" name="_enquiry-form_submit-button" value="Submit" role="button" />
                    </div>
                </div>                    
                <div class="clear-both"></div>
                
                <script>
                    $('#enquiry-form').on('submit', function(e) {
                        var that = $(this);
                        e.preventDefault();
                        // Makes sure all required fields are entered
                        if ($(that).find(':input[required]').filter(function() { return $(this).val() == ""; }).exists()) {
                            fancyAlert('Please ensure you fill in all required fields');
                            $(that).find(':input[required]').filter(function() { return $(this).val() == ""; }).first().focus();
                            return;
                        }
                        // Makes sure at least one field is entered
                        if ($(that).find(':input:visible:not(.form-terms):not([type=submit])').filter(function() { return $(this).val() != ""; }).exists() == false) {
                            fancyAlert('Please ensure you fill in at least one field');
                            $(that).find(':input:visible:not(.form-terms):not([type=submit])').filter(function() { return $(this).val() != ""; }).first().focus();
                            return;
                        }
                        // Send the form
                        $.ajax({
                            type: 'POST',
                            url: fw_ajax_url,
                            data: {
                                '_action_id': 'mail_form',
                                '_data': $(that).serialize()
                            },
                            success: function(data, textStatus, jqXHR) {
                                $(that).find('.form-message').html('Thank you, your enquiry has been sent<br /><br />');
                                $(that)[0].reset();
                            },
                            error: function(jqXHR, textStatus, errorThrown) {
                                $(that).html('There was an error when attempting to submit this enquiry<br /><br />');
                            }
                        });
                    });
                </script>
                
            </form>        
        
        
        </section> <!-- End of enquiry-form-container -->    
        
        <div class="clear-both"></div>
        
<img src="image/stock-photo-happy-children-with-a-shepherd-dog-isolated-on-a-white-background-218530870.jpg" alt="Happy owner with their dog" title="Happy owner with their dog" style="width:100%;" />

	
	</section>
	
	

<?php

include('./include/site_footer.php'); # Footer for this project
include('./ladybug_include/footer_include.php');

?>
