<footer>
    <section class="calltoaction">
        <div class="container">
            <h1>Contact Us</h1>
            <div class="row">
                <div class="col-xs-12 col-sm-4 col-md-4">
                    <address>
                        <p><i class="fa fa-envelope"></i> <span><?= $this->config->item('province_email_id') ?></span></p>
                        <p><i class="fa fa-mobile"></i> <span><?= $this->config->item('province_telephone') ?></span></p>
                        <p><i class="fa fa-map-marker"></i> <span><?= $this->config->item('province_address') ?></span></p>
                    </address>
                </div>
                <div class="col-xs-12 col-sm-8 col-md-8">
                    <form class="form-horizontal homeform" id="enquiry" method="POST" action="<?= site_url('getContactUs') ?>">
                        <div class="form-group">
                            <div class="col-sm-6">
                                <input type="text" name="full_name" value="<?= $full_name ?>" class="form-control requiredField" placeholder="Name">
                            </div>
                            <div class="col-sm-6">
                                <input type="text" name="email_id" value="<?= $email_id ?>" class="form-control requiredField email_id" placeholder="Email">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-12">
                                <textarea name="message" class="form-control requiredField" placeholder="Message"><?= $message ?></textarea>
                            </div>
                        </div>
                        <div class="form-group pull-right">
                            <div class="col-sm-12">                                
                                <button type="submit" class="btn btn-default msg">Send Message</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
    <section class="social">
        <ul class="list-unstyled social-list">
            <li><a href="<?= $this->config->item('twitter') ?>"><i class="fa fa-twitter"></i></a></li>
            <li><a href="<?= $this->config->item('facebook') ?>"><i class="fa fa-facebook"></i></a></li>
            <li><a href="<?= $this->config->item('google') ?>"><i class="fa fa-google-plus"></i></a></li>          
        </ul>
    </section>
    <section class="copyright">
       <?= ($this->config->item('copyright_text')!='')?$this->config->item('copyright_text'):'Copyright © 2015. A1 Sweets Privacy Policy' ?>
    </section>
</footer>      
<script>
    $('body').delegate('.change_location', 'change', function () {
        var location_id = $(this).val();
        if (location_id != '0')
        {
            window.location.href = '<?= site_url() ?>change-location/' + location_id + '?redirect=<?= current_url() ?>';
        }
    });
</script>
<style>
    .error{ color: red;}    
</style>
<script>
    $(document).ready(function () {
        $('form#enquiry').submit(function () {
            $('form#enquiry .error').remove();
            var hasError = false;
            $('.requiredField').each(function () {
                if ($.trim($(this).val()) == '') {
                    var labelText = $(this).prev('label').text();
                    $(this).parent().append('<span class="error">This field is required!</span>');
                    $(this).addClass('inputError');
                    hasError = true;
                } else if ($(this).hasClass('email_id')) {
                    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
                    if (!emailReg.test($.trim($(this).val()))) {
                        var labelText = $(this).prev('label').text();
                        $(this).parent().append('<span class="error">Sorry! You\'ve entered an invalid email.</span>');
                        $(this).addClass('inputError');
                        hasError = true;
                    }
                }
            });
            if (!hasError) {
                var formInput = $(this).serialize();
                $.post($(this).attr('action'), formInput, function (data) {
                    $('form#enquiry').slideUp("fast", function () {
                        $(this).before('<p class="tick"><strong>Thanks!</strong> We will contact you soon!</p>');
                    });
                });
            }

            return false;
        });
    });
</script>
<?= $this->config->item('google_analytic_code') ?>   
</body>
</html>