<?php
    
    /**
     * @var View     $this
     * @var Feedback $contact
     * @var \artbox\core\forms\Module $module;
     */
    
    use frontend\models\Feedback;
    use common\models\Settings;
    use frontend\assets\MapAsset;
    use yii\helpers\Html;
    use yii\web\View;
use yii\widgets\ActiveForm;
    
    MapAsset::register($this);
    $settings = Settings::getInstance();
    
    $this->title = \Yii::t('app', 'Contacts');
    $this->params[ 'breadcrumbs' ][] = $this->title;
    
    $js = <<< JS
window.lat = {$settings->lat};
window.lon = {$settings->lon};
JS;
    
    $this->registerJs($js, View::POS_END);
    $module = \Yii::$app->getModule('contact');
?>

<div id="content">
    <div class="container" id="contact">
        <section>
            
            <div class="row">
                <div class="col-md-4">
                    <div class="box-simple">
                        <div class="icon">
                            <i class="fa fa-map-marker"></i>
                        </div>
                        <h3><?=\Yii::t('app', 'Address')?></h3>
                        <p>
                            <?php
                                if (!empty( $settings->address )) {
                                    echo $settings->address;
                                }
                            ?>
                        </p>
                    </div>
                    <!-- /.box - simple-->
                </div>
                
                
                <div class="col-md-4">
                    <?php
                        if (!empty( $settings->phone )) {
                            ?>
                            <div class="box-simple">
                                <div class="icon">
                                    <i class="fa fa-phone"></i>
                                </div>
                                <h3><?=\Yii::t('app', 'phone')?></h3>
                               <p>
                                    <?php
                                        echo Html::a(Html::tag('strong', $settings->phone), 'tel:' . $settings->phone);
                                        if (!empty( $settings->phone2 )) {
                                            echo '<br>';
                                            echo Html::a(
                                                Html::tag('strong', $settings->phone2),
                                                "tel:" . $settings->phone2
                                            );
                                        }
                                    ?>
                                </p>
                            </div>
                            <!-- /.box - simple-->
                            <?php
                        }
                    ?>
                </div>
                
                <?php
                    if (!empty( $settings->email )) {
                        ?>
                        <div class="col-md-4">
                            
                            <div class="box-simple">
                                <div class="icon">
                                    <i class="fa fa-envelope"></i>
                                </div>
                                <h3>e-mail</h3>
                                <ul class="list-style-none">
                                    <li>
                                        <?php
                                            echo Html::a(
                                                Html::tag('strong', $settings->email),
                                                'mailto:' . $settings->email
                                            );
                                        ?>
                                    </li>
                                </ul>
                            </div>
                            <!-- /.box - simple-->
                        </div>
                        <?php
                    }
                ?>
            </div>
        
        </section>
        
        <section>
            
            <div class="row text-center">
                
                <div class="col-md-12">
                    <div class="heading">
                        <h2> <?=\Yii::t('app', 'Contact form')?> </h2>
                    </div>
                </div>

                <div class="col-md-8 col-md-offset-2">


	                <?= $module->renderForm($this) ?>
                  
                </div>
            </div>
            <!-- /.row -->
        
        </section>
    
    
    </div>
    <!-- /#contact.container -->
</div>
<!-- /#content -->

<div id="map">

</div>