 <?php

    Yii::app()->setLanguage(isset(Yii::app()->session['lang']) ? Yii::app()->session['lang'] : 'ar');
    $lang = Yii::app()->getLanguage();

    ?>
 <div class="col-sm-2 icon-top footer-click-me" id="clickme" >
     <img class="img-up-btn img-responsive hidden-xs" src="<?php echo Yii::app()->request->baseUrl; ?>/images/<?php echo ($lang == "en" ? "to-up-icon-english.png" : "to-up-icon-arabic.png"); ?>" alt="to-Up icon">
 </div>

 <div id="footer" class="footer-container ">
     <div class="container-fluied">
         <div class="footer-top">
             <div class="col-sm-offset-5 col-sm-2">
                 <img class="img-responsive center-block" alt="footer-logo" src="<?php echo $lang == "en" ? Yii::app()->request->baseUrl . "/images/footerlogoen.png" : Yii::app()->request->baseUrl . "/images/footerlogo.png" ?>">
             </div>
         </div>
         <div class="footer-content col-xs-12">
             <div class="container">
                 <div class="row">
                     <div class="col-sm-2 con1">
                         <div class="row">
                             <div class="head-text contact-us">
                                 <a href="<?php echo Yii::app()->request->baseUrl . "/site/contactUs" ?>">
                                     <?php
                                        if ($lang == 'ar') {
                                            echo '
                                        اتصل بنا
                                    ';
                                        } else {
                                            echo 'Call us';
                                        } ?>
                                 </a>
                             </div>
                             <div class="main-text ltr-direction">
                                 <?php
                                    $contact_phone = Option::model()->findByAttributes(array('key' => 'CONTACT_PHONE'));
                                    if (!empty($contact_phone)) {
                                        echo '<a>+' . $contact_phone->value . '</a>';
                                    } else {
                                        echo '<a>5555</a>';
                                    }
                                    ?>
                             </div>
                             <div class="contact-icon">

                                 <?php
                                    $facebook_page = Option::model()->findByAttributes(array('key' => 'FACEBOOK_PAGE'));
                                    if (!empty($facebook_page)) {
                                        echo '<a href="' . $facebook_page->value . '" class="icon-container">';
                                    } else {
                                        echo '<a href="#" class="icon-container">';
                                    } ?>
                                 <img class="icon-footer img-responsive" src="<?php echo Yii::app()->request->baseUrl ?>/images/footer-icon3.png" alt="icon-facebook">
                                 </a>


                                 <?php
                                    $facebook_page = Option::model()->findByAttributes(array('key' => 'INSTGRAM_PAGE'));
                                    if (!empty($facebook_page)) {
                                        echo '<a href="' . $facebook_page->value . '" class="icon-container">';
                                    } else {
                                        echo '<a href="#" class="icon-container">';
                                    } ?>
                                 <img class="icon-footer img-responsive" src="<?php echo Yii::app()->request->baseUrl ?>/images/footer-inst.png" alt="icon-instagram">
                                 </a>

                                 <?php
                                    $facebook_page = Option::model()->findByAttributes(array('key' => 'YOUTUBE_PAGE'));
                                    if (!empty($facebook_page)) {
                                        echo '<a href="' . $facebook_page->value . '" class="icon-container">';
                                    } else {
                                        echo '<a href="#" class="icon-container">';
                                    } ?>
                                 <img class="icon-footer img-responsive" src="<?php echo Yii::app()->request->baseUrl ?>/images/footer-youtube.png" alt="icon-youtube">
                                 </a>


                                 <?php
                                    $facebook_page = Option::model()->findByAttributes(array('key' => 'TELEGRAM'));
                                    if (!empty($facebook_page)) {
                                        echo '<a href="' . $facebook_page->value . '" class="icon-container">';
                                    } else {
                                        echo '<a href="#" class="icon-container">';
                                    } ?>
                                 <img class="icon-footer img-responsive" src="<?php echo Yii::app()->request->baseUrl ?>/images/footer-telgram.png" alt="icon-telgram">
                                 </a>
                             </div>
                         </div>
                     </div>
                     <div class="col-sm-offset-1 col-sm-3 con2">
                         <?php
                            $footer_menu = Menu::model()->findByAttributes(array('title' => 'footer'));
                            foreach ($footer_menu->menuItems as $item)
                                if ($item->visible == 1) {
                                    echo '<a href="' . ((substr($item->link, 0, 4) === "http") ? $item->link : (Yii::app()->request->baseUrl . $item->link)) . '" class="main-text-link">' . ($lang == 'en' ? $item->en_title : $item->title) . '</a>';
                                }
                            ?>

                     </div>
                     <div class="col-sm-3 con3">
                         <div class="row">
                             <?php
                                $footer_menu = Menu::model()->findByAttributes(array('title' => 'footer2'));
                                foreach ($footer_menu->menuItems as $item)
                                    if ($item->visible == 1) {
                                        echo '<a href="' . ((substr($item->link, 0, 4) === "http") ? $item->link : (Yii::app()->request->baseUrl . $item->link)) . '" class="main-text-link">' . ($lang == 'en' ? $item->en_title : $item->title) . '</a>';
                                    }
                                ?>

                         </div>
                     </div>
                     <div class="col-sm-2 con4">
                         <div class="row">
                             <?php
                                $footer_menu = Menu::model()->findByAttributes(array('title' => 'footer3'));
                                foreach ($footer_menu->menuItems as $item)
                                    if ($item->visible == 1) {
                                        echo '<a href="' . ((substr($item->link, 0, 4) === "http") ? $item->link : (Yii::app()->request->baseUrl . $item->link)) . '" class="main-text-link">' . ($lang == 'en' ? $item->en_title : $item->title) . '</a>';
                                    }
                                ?>

                         </div>
                     </div>
                 </div>
                 <div class="row">
                     <div class="col-sm-6 oppesite">
                         <div class="row">
                             <?php $fmodel = Certificates::model()->findAll(array('limit' => 4));
                                if (!empty($fmodel)) {
                                    foreach ($fmodel as $fimage) {
                                        echo '<div class="col-sm-3">';

                                        echo ' <img class="img-responsive iso-img" src="' . Yii::app()->request->baseUrl . '/uploads/footer/' . $fimage->image . '" alt="' . ($lang == 'ar' ? $fimage->name_ar : $fimage->name_en) . '">';
                                        echo '</div>';
                                    }
                                }

                                ?>

                         </div>
                     </div>
                     <div class="col-sm-6 oppesite2">
                         <?php $twitter_page = Option::model()->findByAttributes(array('key' => 'ANDROID_APP')); ?>
                         <?php if ($twitter_page != null && ($twitter_page->value != "" && $twitter_page->value != "#")) { ?>
                             <a class=" col-sm-4" href="<?php
                                                        echo ($twitter_page != Null ? $twitter_page->value : '#'); ?>" target="_blank">
                                 <img class="img-responsive" src="<?php echo Yii::app()->request->baseUrl ?>/images/android.png" alt="ANDROID APP">
                             </a>
                         <?php } ?>
                         <?php $twitter_page = Option::model()->findByAttributes(array('key' => 'IOS_APP')); ?>
                         <?php if ($twitter_page != null && ($twitter_page->value != "" && $twitter_page->value != "#")) { ?>
                             <a class="col-sm-4" href="<?php
                                                        echo ($twitter_page != Null ? $twitter_page->value : '#'); ?>" target="_blank">
                                 <img class="img-responsive" src="<?php echo Yii::app()->request->baseUrl ?>/images/apple.png" alt="IOS APP">
                             </a>
                         <?php } ?>
                     </div>
                 </div>
                 <div class="row rights-company">
                     <div class="col-sm-6 text-right main-text">
                         <p class="main-text-link ">
                             <?php
                                echo ($lang == 'en' ? 'All rights reserved to Al Baraka Bank Syria © 2010 - ' . date("Y") . '' : 'جميع الحقوق محفوظة لبنك البركة سورية © 2010 - ' . date("Y") . '');
                                ?>
                         </p>
                     </div>
                     <div class="col-sm-6 text-left main-text ">
                         <a class="main-text-link" target="_blank" href="https://www.flexsolution.biz/">Powered By Flex Solutions</a>
                     </div>
                 </div>
             </div>
         </div>


     </div>

     <!-- Modal -->
     <div id="CodeModal" class="modal fade" role="dialog">
         <div class="modal-dialog">

             <!-- Modal content-->
             <div class="modal-content">
                 <div class="modal-header">
                     <button type="button" class="close" data-dismiss="modal">&times;</button>
                     <h4 class="modal-title bold-font"><?= $lang == 'ar' ? 'التحقق من وثائق بنك البركة-سورية' : 'check documents from alBaraka-syria' ?></h4>
                 </div>
                 <div class="modal-body">
                     <strong class="footer-modal-body-strong">
                         <?php if ($lang == 'ar') : ?>
                             يمكنكم التأكد من صحة الوثائق الصادرة عن بنك البركة-سورية من خلال إدخال رمز الـQR الظاهر أسفل الرمز على الوثيقة
                             <br>
                             علماً أن الوثائق الصادرة من تاريخ 05/03/2020 وما بعد تحمل مواصفات أمنية خاصة ببنك البركة - سورية لمنع النسخ أو التزوير أو التصوير , وكل وثيقة صادرة بدأً من هذا التاريخ لا تحمل هذه المواصفات تعتبر لاغية ومزورة وتعرض حاملها للمساءلة القانونية .
                         <?php else : ?>
                             You can check the validity of documents issued by alBaraka Bank Syria by entering the QR code shown below the code on the document, These documents have special security features for alBaraka bank Syria to prevent copy or forgery or printing ,any paper does not meet these features is considered forged and void , and subject to legal liability
                         <?php endif ?>
                     </strong>
                     <p class="four-percent-margin-top">
                        <input type="text" class="suggestions form-control footer-modal-body-p pull-<?= $lang == 'ar' ? 'right' : 'left' ?>" id="doc_num" placeholder="<?= $lang == 'ar' ? 'أدخل رمز QR' : 'Enter QR Code' ?>" name="doc_number" >
                        <input type="button" id="modal-bn" name="submit" class="btn center-block" id="suggestion-btn" value="<?= $lang == 'ar' ? 'التحقق' : 'Check' ?>">
                     </p>

                 </div>
                 <div class="modal-footer">
                     <button type="button" class="btn btn-default" data-dismiss="modal"><?= $lang == 'ar' ? 'اغلاق' : 'Close' ?></button>
                 </div>
             </div>

         </div>
     </div>
     <!-- </div> -->
     <!-- footer -->
     <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/footer.js"> </script>