<?php
$repeatedData = getrepeatedData();
?>

<!-- banner -->
<div class="bnr-smile">
    <div class="container-fluid">
        <div class="banner-text-content ">
            <div class="row">
                <div class="offset-lg-2"></div>
                <div class="main-banner col-md-4">
                </div>
                <div class="banner banner-form col-md-5">
                    <form id="sendMessageForm">
                        <div id="mresultmessageData"></div>
                        <h3 class="text-light">اتصل بنا </h3>
                        <div class="form-group">
                            <div class="cols-sm-9">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-user fa"
                                                                       aria-hidden="true"></i></span>
                                    <input type="text" class="form-control" name="name" id="name"
                                           required="required" placeholder="أدخل الاسم  "/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="cols-sm-9">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-envelope fa" aria-hidden="true"></i></span>
                                    <input type="email" class="form-control" name="email" id="email" required="required" placeholder="البريد الإلكتروني  "/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="cols-sm-9">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-phone fa" aria-hidden="true"></i></span>
                                    <input type="text" class="form-control" name="phone" id="Phpne" required="required" placeholder="رقم الهاتف"/>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="cols-sm-9">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-comment fa-lg" aria-hidden="true"></i></span>
                                    <textarea type="text" class="form-control" name="message" rows="3" required="required" placeholder="اترك رسالتك"/></textarea>
                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="action" value="addsentmessagedata">
                        <div class="form-group ">
                            <button type="submit" id="button" class="btn btn-default btn-lg btn-block login-button sentmessage">
                                إرســال
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- //banner -->

<!-- about-->
<section class="smile-row py-sm-3" id="about">
    <div class="container py-md-5">
        <div class="row abbot-main py-lg-5 py-4">
            <div class="col-lg-6 abbot-right">
                <span></span>
                <img src="<?php echo UPLOAD_LINK.$about['image']; ?>" class="img-fluid" alt="">
            </div>
            <div class="col-lg-6 about-text-grid">
                <h3 class="stat-title">من هو د. محمد ابو زيد ؟
                </h3>
                <p class="mt-3"><?php echo $about['description']; ?></p>
                <br>
                <a href="#services" class="text-capitalize serv_link btn bg-theme scroll">أعرف المزيد </a>
            </div>
        </div>
    </div>
</section>
<!-- //about -->

<!-- services -->
<section class="services " id="services">
    <div class="container py-md-3">
        <h3 class="stat-title text-center pb-lg-3">خدماتنا </h3>
        <div class="services">
            <div class="row">
                <?php
                if (isset($services) && is_array($services)):
                    foreach ($services as $key => $value):
                    ?>
                        <div class="col-sm-6">
                            <div class="classes-block">
                                <div class="classes-img">
                                    <img src="<?php echo UPLOAD_LINK.$value['image']; ?>" alt="" class="img-fluid">
                                    <div class="classes-content">
                                        <h4 class="text-white"><?php echo $value['title']; ?></h4>
                                    </div>
                                </div>
                                <p><?php echo $value['slug']; ?></p>
                                <a href="<?php echo BASE_URL."service/view/".$value['id'] ?>"> إقرا المزيد</a>
                            </div>
                        </div>
                    <?php
                    endforeach;
                endif;
                ?>
            </div>
        </div>
    </div>
</section>
<!-- //services -->

<!-- gallery-->
<div class="gallery" id="gallery">
    <div class="container">
        <h3 class="stat-title text-center pb-lg-3">معرض الصور </h3>
        <div class="row">
            <?php
            if (isset($galleries) && is_array($galleries)):
                foreach ($galleries as $key => $value):
                ?>
                    <div class="col-lg-3 col-md-4 col-xs-6 thumb">
                        <a class="thumbnail" href="#" data-image-id="" data-toggle="modal" data-image="<?php echo UPLOAD_LINK.$value['image']; ?>"
                           data-target="#image-gallery">
                            <img class="img-thumbnail" src="<?php echo UPLOAD_LINK.$value['image']; ?>"
                                 alt="Another alt text">
                        </a>
                    </div>
                <?php
                endforeach;
            endif;
            ?>
        </div>
        <div class="modal fade" id="image-gallery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="image-gallery-title"></h4>
                        <button type="button" class="close" data-dismiss="modal"><span
                                    aria-hidden="true">×</span><span class="sr-only">Close</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <img id="image-gallery-image" class="img-responsive col-md-12" src="">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary float-left" id="show-previous-image"><i
                                    class="fa fa-arrow-left"></i>
                        </button>

                        <button type="button" id="show-next-image" class="btn btn-secondary float-right"><i
                                    class="fa fa-arrow-right"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- //gallery-->

<!-- contact -->
<div class="contact py-5" id="contact">
    <div class="container py-lg-5">
        <h3 class="stat-title text-center pb-3 text-dark">contact us
        </h3>
        <div class="row contact-form pt-lg-3">
            <div class="col-lg-6 contact-bottom d-flex flex-column contact-right-s">
                <div class="fv3-contact">
                    <div class="row">
                        <div class="col-2">
                            <span class="fa fa-home"></span>
                        </div>
                        <div class="col-10 contact-add">
                            <h6>العنوان</h6>
                            <p><?php echo $repeatedData['webData']['address'] ?></p>
                        </div>
                    </div>
                </div>
                <div class="fv3-contact my-4">
                    <div class="row">
                        <div class="col-2">
                            <span class="fa fa-phone"></span>
                        </div>
                        <div class="col-10 contact-add">
                            <h6>الهاتف</h6>
                            <p><?php echo $repeatedData['webData']['phone'] ?> </p>
                            <h6>فاكس</h6>
                            <p><?php echo $repeatedData['webData']['fax'] ?> </p>
                        </div>
                    </div>
                </div>
                <div class="fv3-contact">
                    <div class="row">
                        <div class="col-2">
                            <span class="fa fa-envelope-open"></span>
                        </div>
                        <div class="col-10 contact-add">
                            <h6>الايميل</h6>
                            <p>
                                <?php echo $repeatedData['webData']['mail'] ?>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-6 smile-form-left my-lg-0 mt-5">
                <div class="contact-top1">
                    <form id="sendMessageForm2" class="contact-smile">
                         <div id="mresultmessageData2"></div>
                        <div class="form-group d-flex">
                            <label>
                                الأسم
                            </label>
                            <input class="form-control" type="text" placeholder="الاسم" name="name" required="">
                        </div>
                        <div class="form-group d-flex">
                            <label>
                                البريد الالكتروني
                            </label>
                            <input class="form-control" type="email" placeholder="البريد الالكتروني" name="email"
                                   required="">
                        </div>
                        <div class="form-group d-flex">
                            <label>
                                رقم الهاتف
                            </label>
                            <input class="form-control" type="text" placeholder="رقم الهاتف" name="phone"
                                   required="">
                        </div>
                        <div class="form-group d-flex">
                            <label>
                                الرسالة
                            </label>
                            <textarea class="form-control" name="message" rows="5" id="contactcomment" placeholder="اترك رسالتك"
                                      required=""></textarea>
                        </div>
                        <input type="hidden" name="action" value="addsentmessagedata2">
                        <div class="d-flex justify-content-end">
                            <button type="submit" class="btn btn-content  btn-block w-25 sentmessage2">أرســـال</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- //contact -->

<!-- map -->
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1725.995453825835!2d31.329147592946395!3d30.094446737919483!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x1458158b186474cb%3A0x5ffe54a5b10b406b!2sSalah+Eldin+Square!5e0!3m2!1sen!2seg!4v1546187413038"
        width="100%" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
<!-- //map -->




<script>
    $(document).ready(function () {
        // end subscripe code
        // start add subscribe code
        $("body").on("submit", "#sendMessageForm", function () {
            var allData = $(this).serialize();
            $.ajax({
                url: "<?php echo BASE_URL . "home/SendMessageForm" ?>",
                type: "POST",
                data: allData,
                beforeSend: function () {
                    $(".sentmessage").attr("disabled", "disabled");
                },
                statusCode: {
                    404: function () {
                        alert("page not found");
                    },
                },
                success: function (valdata) {
                    var da = jQuery.parseJSON(valdata);
                    if (da['status'] == "success") {
                        $("#mresultmessageData").html(da['message']);
                        setTimeout("location.reload(true);", 2000);
                    } else {
                        $("#mresultmessageData").html(da['message']);
                    }
                    $(".sentmessage").removeAttr("disabled");
                }
            });
            return false;
        });
        // end subscribe code

    })

</script>
<script>
    $(document).ready(function () {
        // end subscripe code
        // start add subscribe code
        $("body").on("submit", "#sendMessageForm2", function () {
            var allData = $(this).serialize();
            $.ajax({
                url: "<?php echo BASE_URL . "home/SendMessageForm2" ?>",
                type: "POST",
                data: allData,
                beforeSend: function () {
                    $(".sentmessage2").attr("disabled", "disabled");
                },
                statusCode: {
                    404: function () {
                        alert("page not found");
                    },
                },
                success: function (valdata) {
                    var da = jQuery.parseJSON(valdata);
                    if (da['status'] == "success") {
                        $("#mresultmessageData2").html(da['message']);
                        setTimeout("location.reload(true);", 2000);
                    } else {
                        $("#mresultmessageData2").html(da['message']);
                    }
                    $(".sentmessage2").removeAttr("disabled");
                }
            });
            return false;
        });
        // end subscribe code

    })

</script>
