Commit 5a5709d7f28c3ecc51286eb07e78762a55446273

Authored by Eugeny Galkovskiy
1 parent d7f5f4b6

Контакты

Showing 1 changed file with 181 additions and 0 deletions   Show diff stats
frontend/views/site/contact.php
  1 +<?php
  2 +
  3 + /**
  4 + * @var View $this
  5 + * @var Feedback $contact
  6 + */
  7 +
  8 + use artbox\core\models\Feedback;
  9 + use common\models\Settings;
  10 + use frontend\assets\MapAsset;
  11 + use yii\helpers\Html;
  12 + use yii\bootstrap\ActiveForm;
  13 + use yii\web\View;
  14 +
  15 + MapAsset::register($this);
  16 + $settings = Settings::getInstance();
  17 +
  18 + $this->title = \Yii::t('app', 'Контакты');
  19 + $this->params[ 'breadcrumbs' ][] = $this->title;
  20 +
  21 + $js = <<< JS
  22 +window.lat = {$settings->lat};
  23 +window.lon = {$settings->lon};
  24 +JS;
  25 +
  26 + $this->registerJs($js, View::POS_END);
  27 +?>
  28 +
  29 +<div id="content">
  30 + <div class="container" id="contact">
  31 +
  32 + <section>
  33 +
  34 + <div class="row">
  35 + <div class="col-md-4">
  36 + <div class="box-simple">
  37 + <div class="icon">
  38 + <i class="fa fa-map-marker"></i>
  39 + </div>
  40 + <h3>Адрес</h3>
  41 + <p>
  42 + <?php
  43 + if (!empty( $settings->street )) {
  44 + echo $settings->street;
  45 + if (!empty( $settings->house )) {
  46 + echo " " . $settings->house;
  47 + }
  48 + echo Html::tag('br');
  49 + }
  50 + if (!empty( $settings->city )) {
  51 + echo $settings->city;
  52 + if (!empty( $settings->country )) {
  53 + echo Html::tag('strong', ", " . $settings->country);
  54 + }
  55 + }
  56 + ?>
  57 + </p>
  58 + </div>
  59 + <!-- /.box - simple-->
  60 + </div>
  61 +
  62 +
  63 + <div class="col-md-4">
  64 + <?php
  65 + if (!empty( $settings->phone )) {
  66 + ?>
  67 + <div class="box-simple">
  68 + <div class="icon">
  69 + <i class="fa fa-phone"></i>
  70 + </div>
  71 + <h3> Телефон </h3>
  72 + <p>
  73 + <?php
  74 + echo Html::a(Html::tag('strong', $settings->phone), 'tel:' . $settings->phone);
  75 + ?>
  76 + </p>
  77 + </div>
  78 + <!-- /.box - simple-->
  79 + <?php
  80 + }
  81 + ?>
  82 + </div>
  83 +
  84 + <?php
  85 + if (!empty( $settings->email )) {
  86 + ?>
  87 + <div class="col-md-4">
  88 +
  89 + <div class="box-simple">
  90 + <div class="icon">
  91 + <i class="fa fa-envelope"></i>
  92 + </div>
  93 + <h3> Электронная почта </h3>
  94 + <ul class="list-style-none">
  95 + <li>
  96 + <?php
  97 + echo Html::a(
  98 + Html::tag('strong', $settings->email),
  99 + 'mailto:' . $settings->email
  100 + );
  101 + ?>
  102 + </li>
  103 + </ul>
  104 + </div>
  105 + <!-- /.box - simple-->
  106 + </div>
  107 + <?php
  108 + }
  109 + ?>
  110 + </div>
  111 +
  112 + </section>
  113 +
  114 + <section>
  115 +
  116 + <div class="row text-center">
  117 +
  118 + <div class="col-md-12">
  119 + <div class="heading">
  120 + <h2> Форма контактов </h2>
  121 + </div>
  122 + </div>
  123 +
  124 + <div class="col-md-8 col-md-offset-2">
  125 + <?php $form = ActiveForm::begin(
  126 + [
  127 + 'id' => 'contact-form',
  128 + 'method' => 'POST',
  129 + 'action' => '/site/feedback',
  130 + ]
  131 + ); ?>
  132 + <div class="row">
  133 + <div class="col-sm-12">
  134 + <?= $form->field($contact, 'name')
  135 + ->textInput(); ?>
  136 + </div>
  137 +
  138 + <div class="col-sm-6">
  139 + <?= $form->field($contact, 'email')
  140 + ->textInput(); ?>
  141 + </div>
  142 + <div class="col-sm-6">
  143 + <?= $form->field($contact, 'phone')
  144 + ->textInput(); ?>
  145 + </div>
  146 + <div class="col-sm-12">
  147 + <?= $form->field($contact, 'message')
  148 + ->textarea(
  149 + [
  150 + 'rows' => 3,
  151 + ]
  152 + ); ?>
  153 + </div>
  154 +
  155 + <div class="col-sm-12 text-center">
  156 + <?= Html::submitButton(
  157 + '<i class="fa fa-envelope-o"></i> Отправить сообщение',
  158 + [
  159 + 'class' => 'btn btn-template-main',
  160 + ]
  161 + ) ?>
  162 +
  163 + </div>
  164 + </div>
  165 + <!-- /.row -->
  166 + <?php ActiveForm::end(); ?>
  167 + </div>
  168 + </div>
  169 + <!-- /.row -->
  170 +
  171 + </section>
  172 +
  173 +
  174 + </div>
  175 + <!-- /#contact.container -->
  176 +</div>
  177 +<!-- /#content -->
  178 +
  179 +<div id="map">
  180 +
  181 +</div>
0 182 \ No newline at end of file
... ...