Blame view

frontend/views/site/contact.php 7.28 KB
950817c6   Alex Savenko   first commit
1
2
3
4
5
6
  <?php
      
      /**
       * @var View     $this
       * @var Feedback $contact
       */
c2828449   alex   fix 2
7
8
  
  use common\models\Feedback;
950817c6   Alex Savenko   first commit
9
10
11
12
13
      use common\models\Settings;
      use frontend\assets\MapAsset;
      use yii\helpers\Html;
      use yii\bootstrap\ActiveForm;
      use yii\web\View;
13ad65b4   alex   Правка футера 2
14
  use himiklab\yii2\recaptcha\ReCaptcha;
950817c6   Alex Savenko   first commit
15
16
17
18
      
      MapAsset::register($this);
      $settings = Settings::getInstance();
      
10e74468   mzavalniuk   translate to ua r...
19
      $this->title = \Yii::t('app', 'Контакти');
950817c6   Alex Savenko   first commit
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
      $this->params[ 'breadcrumbs' ][] = $this->title;
      
      $js = <<< JS
  window.lat = {$settings->lat};
  window.lon = {$settings->lon};
  JS;
      
      $this->registerJs($js, View::POS_END);
  ?>
  
  <div id="content">
      <div class="container" id="contact">
  
          <section>
  
              <div class="row">
                  <div class="col-md-12">
                      <section>
                          <div class="heading">
d05fedfc   mzavalniuk   add/fix titles h1
39
                              <h1><?=Yii::t('app','contact_page_text')?></h1>
950817c6   Alex Savenko   first commit
40
41
42
43
44
45
46
47
48
49
50
51
52
53
                          </div>
                      </section>
                  </div>
              </div>
  
          </section>
          <section>
  
              <div class="row">
                  <div class="col-md-4">
                      <div class="box-simple">
                          <div class="icon">
                              <i class="fa fa-map-marker"></i>
                          </div>
10e74468   mzavalniuk   translate to ua r...
54
                          <h3><?=Yii::t('app','address')?></h3>
950817c6   Alex Savenko   first commit
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
                          <p>
                              <?php
                              if (!empty( $settings->street )) {
                                  echo $settings->street;
                                  if (!empty( $settings->house )) {
                                      echo " " . $settings->house;
                                  }
                                  echo Html::tag('br');
                              }
                              if (!empty( $settings->city )) {
                                  echo $settings->city;
                                  if (!empty( $settings->country )) {
                                      echo Html::tag('strong', ", " . $settings->country);
                                  }
                              }
                              ?>
                          </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>Телефон</h3>
                              <p>
                                  <?php
                                  $phones = explode(';', $settings->phone);
                                  foreach ($phones as $phone){
                                      echo Html::a(Html::tag('strong', $phone), 'tel:' . $phone).'<br>';
                                  }
                                  
                                  ?>
                              </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>
10e74468   mzavalniuk   translate to ua r...
111
                              <h3><?=Yii::t('app','email')?></h3>
950817c6   Alex Savenko   first commit
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
                              <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">
10e74468   mzavalniuk   translate to ua r...
138
                          <h2> <?=Yii::t('app','Contact form')?> </h2>
950817c6   Alex Savenko   first commit
139
140
141
142
143
144
                      </div>
                  </div>
  
                  <div class="col-md-8 col-md-offset-2">
                      <?php $form = ActiveForm::begin(
                          [
6f4bd617   alex   Get block to center
145
146
147
148
  	                        'id' => 'contact-form',
  	                        'method' => 'POST',
  	                        'action' => '/site/feedback',
  
950817c6   Alex Savenko   first commit
149
150
151
152
153
                          ]
                      ); ?>
                      <div class="row">
                          <div class="col-sm-12">
                              <?= $form->field($contact, 'name')
10e74468   mzavalniuk   translate to ua r...
154
155
  	                            ->textInput(['autocomplete' => 'off'])
                              ->label(Yii::t('app','name')); ?>
950817c6   Alex Savenko   first commit
156
157
158
159
                          </div>
  
                          <div class="col-sm-6">
                              <?= $form->field($contact, 'email')
10e74468   mzavalniuk   translate to ua r...
160
161
  	                            ->textInput(['autocomplete' => 'off'])
                                  ->label(Yii::t('app','Email'));?>
950817c6   Alex Savenko   first commit
162
163
164
                          </div>
                          <div class="col-sm-6">
                              <?= $form->field($contact, 'phone')
10e74468   mzavalniuk   translate to ua r...
165
166
  	                            ->textInput(['autocomplete' => 'off'])
                                  ->label(Yii::t('app','phone')); ?>
950817c6   Alex Savenko   first commit
167
168
169
170
171
172
173
                          </div>
                          <div class="col-sm-12">
                              <?= $form->field($contact, 'message')
                                  ->textarea(
                                      [
                                          'rows' => 3,
                                      ]
10e74468   mzavalniuk   translate to ua r...
174
175
                                  )
                                  ->label(Yii::t('app','message')); ?>
950817c6   Alex Savenko   first commit
176
                          </div>
f430a8ef   alex   fix 5
177
178
                          <!--                        	                    --><?= $form->field($contact, 'reCaptcha')->widget(
  		                    \himiklab\yii2\recaptcha\ReCaptcha::className(),
7d1f6148   alex   Get block to center
179
180
181
182
  		                    [
  //		                            'siteKey' => '6LcmYmcUAAAAAASKWf3qnHXJCg9vGfJfDefY9TzW'
  			                    'siteKey' => '6LfWrmkUAAAAABrtKhzz_1NbxTaBFRYvmg9bIemf'
  		                    ]
f430a8ef   alex   fix 5
183
  	                    )->label(false) ?>
950817c6   Alex Savenko   first commit
184
185
                          <div class="col-sm-12 text-center">
                              <?= Html::submitButton(
10e74468   mzavalniuk   translate to ua r...
186
                                  '<i class="fa fa-envelope-o"></i> ' . Yii::t('app','Send message'),
950817c6   Alex Savenko   first commit
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
                                  [
                                      'class' => 'btn btn-template-main',
                                  ]
                              ) ?>
  
                          </div>
                      </div>
                      <!-- /.row -->
                      <?php ActiveForm::end(); ?>
                  </div>
              </div>
              <!-- /.row -->
  
          </section>
  
  
      </div>
      <!-- /#contact.container -->
  </div>
  <!-- /#content -->
  
  <div id="map">
  
  </div>