<?php
require_once 'config.php';

if (isset($_GET['notify'])) {
    $notify_id = $_GET['notify'];
}

if (isset($_GET['error'])) {
    $error_id = $_GET['error'];
}

?>
<?php include 'includes/header.php'; ?>

<!-- bradcam_area_start -->
<div class="bradcam_area breadcam_bg_2">
    <h3>Contact Us</h3>
</div>
<!-- bradcam_area_end -->

<!-- ================ contact section start ================= -->
<section class="contact-section">
    <div class="container">
        <!-- <div class="d-none d-sm-block mb-5 pb-4">
            <div id="map" style="height: 480px; position: relative; overflow: hidden;"></div>
           
            <script>
                function initMap() {
                    var uluru = {
                        lat: -25.363,
                        lng: 131.044
                    };
                    var grayStyles = [{
                            featureType: "all",
                            stylers: [{
                                    saturation: -90
                                },
                                {
                                    lightness: 50
                                }
                            ]
                        },
                        {
                            elementType: 'labels.text.fill',
                            stylers: [{
                                color: '#ccdee9'
                            }]
                        }
                    ];
                    var map = new google.maps.Map(document.getElementById('map'), {
                        center: {
                            lat: -31.197,
                            lng: 150.744
                        },
                        zoom: 9,
                        styles: grayStyles,
                        scrollwheel: false
                    });
                }
            </script>
            <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDpfS1oRGreGSBU5HHjMmQ3o5NLw7VdJ6I&amp;callback=initMap">
            </script>

        </div> -->


        <div class="row">
            <div class="col-12">
                <h2 class="contact-title">Get in Touch</h2>
            </div>
            <div class="col-lg-8">
                <form class="form-contact contact_form" action="mails/contact_us_page_mailer.php" method="post" id="contactForm" novalidate="novalidate">
                    <div class="row">
                        <div class="col-12">
                            <div class="form-group">
                                <textarea class="form-control w-100" name="message" id="message" cols="30" rows="9" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter Message'" placeholder=" Enter Message"></textarea>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                <input class="form-control valid" name="name" id="name" type="text" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter your name'" placeholder="Enter your name">
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group">
                                <input class="form-control valid" name="email" id="email" type="email" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter email address'" placeholder="Email">
                            </div>
                        </div>
                        <div class="col-12">
                            <div class="form-group">
                                <input class="form-control" name="subject" id="subject" type="text" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Enter Subject'" placeholder="Enter Subject">
                            </div>
                        </div>
                    </div>
                    <div class="form-group mt-3">
                        <button type="submit" name="submit" class="button button-contactForm boxed-btn">Send</button>
                    </div>
                </form>
            </div>
            <div class="col-lg-3 offset-lg-1">
                <div class="media contact-info">
                    <span class="contact-info__icon"><i class="ti-home"></i></span>
                    <div class="media-body">
                        <h3>31 Edirisinghe Mawatha
                            Hawa Eliya,<br>
                            Nuwara Eliya.
                         </h3>
                        <p></p>
                    </div>
                </div>
                <div class="media contact-info">
                    <span class="contact-info__icon"><i class="ti-tablet"></i></span>
                    <div class="media-body">
                        <h3>Order Hotline: 0777666555
                        </h3><br>
                        <h3>Special Orders for Functions : 0779183139
                        </h3>
                        <p></p>
                    </div>
                </div>
                <div class="media contact-info">
                    <span class="contact-info__icon"><i class="ti-email"></i></span>
                    <div class="media-body">
                        <h3>Order Website: mycaterer.lk</h3><br>
                        <h3>Special Orders for Functions : yogesh@silverbird.lk 
                        </h3>
                        <h3>mycaterer@silverbird.lk 
                        </h3>
                        <!-- <p>Email: mycaterer@silverbird.lk</p> -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- ================ contact section end ================= -->



<!-- Modal 1 (Email Submission) -->
<input type="hidden" id="txtnotify" value="<?php if (isset($notify_id)) {
                                                echo $notify_id;
                                            } ?>">

<div class="modal mail-notification" id="mail-sent">
    <div class="modal-dialog">
        <div class="modal-content">

            <!-- Modal Header -->
            <div class="modal-header">
                <h4 class="modal-title">Email Notification</h4>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>

            <!-- Modal body -->
            <div class="modal-body">
                We’ve received your message. Thank You!
            </div>

        </div>
    </div>
</div>
<!-- Modal 1 (Email Submission) -->

<!-- Modal 2 (Email Submission) -->
<input type="hidden" id="txterror" value="<?php if (isset($error_id)) {
                                                echo $error_id;
                                            } ?>">

<div class="modal mail-notification" id="mail-not-sent">
    <div class="modal-dialog">
        <div class="modal-content">

            <!-- Modal Header -->
            <div class="modal-header">
                <h4 class="modal-title">Email Notification</h4>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>

            <!-- Modal body -->
            <div class="modal-body">
                Your message hasn't been sent! Please re-send your message.
            </div>

        </div>
    </div>
</div>
<!-- Modal 2 (Email Submission) -->


<?php include 'includes/footer.php'; ?>

<script>
    var notify_id = $("#txtnotify").val();
    var error_id = $("#txterror").val();

    if (notify_id != "" && notify_id != null) {

        $("#mail-sent").modal('show');

    } else if (error_id != "" && error_id != null) {

        $("#mail-not-sent").modal('show');

    }

    $("#mail-sent").on('hide.bs.modal', function() {
        location.href = "index.php";
    });
    $("#mail-not-sent").on('hide.bs.modal', function() {
        location.href = "index.php";
    });
</script>