main.php
13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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
111
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<?php
/**
* @var $this Controller
*/
//header('X-XSS-Protection:0');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="language" content="en"/>
<link type="text/css" rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css"/>
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie7.css"/>
<![endif]-->
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
<?php
if (!empty($this->keywords))
echo ' <meta name="keywords" content="', CHtml::encode($this->keywords), '"/>', "\n";
if (!empty($this->description))
echo ' <meta name="description" content="', CHtml::encode($this->description), '"/>', "\n";
?>
<?php
$css = Yii::app()->getClientScript();
$css->registerCssFile('/css/bootstrap/css/bootstrap.min.css');
?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27775302-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<!-- Modal -->
<div class="modal fade " id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content send_sto_form">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Введите ваши данные</h4>
</div>
<form id="sto-form" class="form-horizontal">
<div class="form-group">
<label for="exampleInputName">Имя</label>
<input type="text" class="form-control" name="name" id="exampleInputName" required />
</div>
<div class="form-group">
<label for="exampleInputEmail">Email</label>
<input type="email" class="form-control" name="email" id="exampleInputEmail" />
</div>
<div class="form-group">
<label for="exampleInputPhone">Номер телефона</label>
<input type="text" class="form-control" name="phone" id="exampleInputPhone" required />
</div>
<div class="modal-header">
<button type="submit" class="btn btn-primary">Отправить</button>
</div>
</form>
</div>
</div>
</div>
<!-- up button -->
<div class="up-btn-wrapper" style="bottom: 30px; left: 136px" id="back-top">
<!-- top = any num, mb window.height/2; left=(window.width-1000)/2 -->
<a class="up-btn"><?php echo Yii::t('site', 'Наверх');?></a>
</div>
<!-- end up button -->
<div id="fb-root"></div>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1&appId=484895001520612";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<?php $this->renderPartial('//snippets/bigGallery');?>
<div class="modal-wrapper letter" style="display: none;" id="contact_form">
<?php
if (isset($this->contactForm->contact)) {
/** @var $contact Contact */
$contact = Contact::model()->with('i18n')->findByPk($this->contactForm->contact);
}
?>
<div class="center-wrapper">
<div class="modal-content">
<a class="modal-close"></a>
<div class="consultant">
<div class="consultant-photo">
<?php echo isset($contact) ? CHtml::image($contact->imageBehavior->getFileUrl(), '', array('width' => 222)) : '<img src="" width="222"/>' ?>
</div>
<p class="consultant-name"><?php if (isset($contact)) echo $contact->i18n->name ?></p>
<p class="consultant-speciality"><?php if (isset($contact)) echo $contact->i18n->position ?></p>
<p class="asd"><b><?php if (isset($contact)) echo $contact->phone ?></b><br/>
<a href="mailto:<?php if (isset($contact)) echo $contact->email ?>"><?php if (isset($contact)) echo $contact->email ?></a>
</p>
</div>
<div class="text-content">
<p> </p>
</div>
<div class="form-content">
<div class="form-wrap in-col6">
<?php
/** @var $form CActiveForm */
$form = $this->beginWidget('CActiveForm');
echo $form->textField($this->contactForm, 'link', array('style' => 'display:none;'));
echo $form->hiddenField($this->contactForm, 'contact');
?>
<div class="form-line">
<?php
echo $form->label($this->contactForm, 'name');
echo $form->textField($this->contactForm, 'name', array('class' => 'middle'));
?>
</div>
<div class="form-line">
<?php
echo $form->label($this->contactForm, 'email');
echo $form->textField($this->contactForm, 'email', array('class' => 'middle'));
?>
</div>
<div class="form-line">
<?php
echo $form->label($this->contactForm, 'phone');
echo $form->textField($this->contactForm, 'phone', array('class' => 'middle'));
?>
</div>
<div class="form-line">
<?php
echo $form->label($this->contactForm, 'body');
echo $form->textArea($this->contactForm, 'body', array('class' => 'wide'));
?>
</div>
<div class="form-line with-submit">
<input type="submit" class="button"
value="<?php echo Yii::t('site', 'Отправить сообщение');?>"/>
</div>
<?php
$this->endWidget();
?>
</div>
</div>
</div>
</div>
</div>
<div class="wrapper-global">
<div class="center-wrapper">
<div class="wrapper">
<!-- header start-->
<?php $this->renderPartial('//snippets/header');?>
<!-- header end-->
<?php echo $content?>
</div>
</div>
<div class="push"></div>
</div>
<?php $this->renderPartial('//snippets/footer')?>
<!-- Yandex.Metrika counter -->
<div style="display:none;">
<script type="text/javascript">
(function (w, c) {
(w[c] = w[c] || []).push(function () {
try {
w.yaCounter11889511 = new Ya.Metrika({id:11889511, enableAll:true, ut:"noindex", webvisor:true});
}
catch (e) {
}
});
})(window, "yandex_metrika_callbacks");
</script>
</div>
<script src="//mc.yandex.ru/metrika/watch.js" type="text/javascript" defer="defer"></script>
<noscript>
<div><img src="//mc.yandex.ru/watch/11889511?ut=noindex" style=" left:-9999px;" alt=""/></div>
</noscript>
<!-- /Yandex.Metrika counter -->
<div style="display:none;">
<!-- Google Code for all visitors 60 days -->
<!-- Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. For instructions on adding this tag and more information on the above requirements, read the setup guide: google.com/ads/remarketingsetup -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1017652643;
var google_conversion_label = "0CKrCIWpiQQQo8ug5QM";
var google_custom_params = window.google_tag_params || {};
var google_remarketing_only = true;
google_custom_params['style'] = 'display:none;';
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt=""
src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1017652643/?value=0&label=0CKrCIWpiQQQo8ug5QM&guid=ON&script=0"/>
</div>
</noscript>
</div>
</body>
</html>
<?php
/** @var $cs CClientScript */
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$needOpenContact = CJavaScript::encode($this->contactForm->hasErrors());
$contactFieldId = CHtml::activeId($this->contactForm, 'contact');
$src = <<<JS
function openContactForm(text){
// $(window).scrollTop(0);
$('body').addClass('no-scroll');
var form = $('#contact_form');
form.show();
form.click(function(e){
if(e.target.id=='contact_form')closeContactForm();
});
var mc =$('.modal-content',form);
if(!text){
$('.text-content',mc).css('display','none');
$('.form-content',mc).css('display','block');
} else {
$('.text-content',mc).css('display','block');
$('.form-content',mc).css('display','none');
$('.text-content p',mc).html(text);
}
var w = mc.outerWidth();
var h = mc.outerHeight();
if ($(window).height() > h){
mc.css({
'margin-left':(mc.parent().width()-w)/2,
'margin-top':($(window).height()-h)/2
})
}
else {
mc.css({
'margin-left':(mc.parent().width()-w)/2,
'margin-top': 40,
'margin-bottom': 40
})
}
$('input[type=submit]', form).click(function(){
_gaq.push(['_trackEvent', 'Mail', 'Визитка попап', $('.consultant-name', form).text()]);
})
}
function closeContactForm(){
$('body').removeClass('no-scroll');
$('#contact_form').hide();
}
$('#contact_form .modal-close').click(closeContactForm);
$('.consultant').each(function(){
var c = $(this);
//image name email position phone contact
function fillForm(f){
$('#contact_form .consultant-name').text(c.data('name'));
$('#contact_form .consultant-speciality').text(c.data('position'));
$('#contact_form .asd b').text(c.data('phone'));
$('#contact_form .asd a').attr('href','mailto:'+c.data('email').toString()).text(c.data('email'));
$('#'+'$contactFieldId').attr('value',c.data('contact'));
var img =c.data('image');
var oldImg = $('#contact_form .consultant-photo img').attr('src');
if(img != oldImg)
$('#contact_form .consultant-photo img').load(function(){f('');}).attr('src',img);
else
f('');
}
$('.consultant-photo img, a, p a',c).click(function(e){
e.preventDefault();
_gaq.push(['_trackEvent', 'Mail', 'Визитка справа', c.data('name').toString()]);
fillForm(openContactForm);
});
$('#contact_form .asd a').click(function(){
_gaq.push(['_trackEvent', 'Mail', 'mailto', c.data('email').toString()]);
})
}) ;
if($needOpenContact) openContactForm('');
JS;
if (Yii::app()->user->hasFlash('contact')) {
$src .= "\n openContactForm(" . CJavaScript::encode(Yii::app()->user->getFlash('contact')) . ');';
}
$cs->registerScript('contactForm', $src);
//$cs->registerScriptFile(Yii::app()->baseUrl . '/js/fancybox/jquery.mousewheel-3.0.4.pack.js');
$cs->registerScriptFile(Yii::app()->baseUrl . '/js/fancybox/jquery.fancybox-1.3.4.pack.js');
$cs->registerCssFile(Yii::app()->baseUrl . '/js/fancybox/jquery.fancybox-1.3.4.css');
$src = <<<JS
$('.text-content img').each(function(){
var img = $(this);
var src = img.attr('src');
if(img.attr('width')&&(!img.parent().hasClass('lightbox'))){
img.replaceWith($('<a class="lightbox" href="'+src+'"/>').append(img.clone()));
}
}) ;
var gallery = $("a.lightbox").attr('rel','lightbox').fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none'
});
JS;
$cs->registerScript('content_gallery', $src);
$cs->registerScript('bak_to_top', <<<JS
var backToTopPos = $(".wrapper").position();
$("#back-top").css({
'bottom':($(window).height()/2)+'px',
'left':backToTopPos.left-$("#back-top").width() +'px'}).hide();
if($('.hide-back-top').length == 0)
$(function () {
$(window).scroll(function () {
var pos = $(this).scrollTop();
if (pos > 700) {
$('#back-top').fadeIn();
} else {
$('#back-top').fadeOut();
}
});
$('#back-top a').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
JS
);
$cs->registerScript('MCE', <<<JS
$('#mce-EMAIL')
.data('holder',$('#mce-EMAIL').attr('placeholder'))
.focusin(function(){ $(this).attr('placeholder',''); })
.focusout(function(){ $(this).attr('placeholder',$(this).data('holder')); });
JS
)
?>