Commit bd17719e by Ruha

v2

1 parent c2b7614c
Pipeline #2593 for bd17719e skipped in 0 seconds
...@@ -23,6 +23,13 @@ ...@@ -23,6 +23,13 @@
</mappings> </mappings>
</serverdata> </serverdata>
</paths> </paths>
<paths name="myjino.ru">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="test.onclinic"> <paths name="test.onclinic">
<serverdata> <serverdata>
<mappings> <mappings>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{Jquery}" />
</component>
</project>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file \ No newline at end of file
...@@ -4,5 +4,6 @@ ...@@ -4,5 +4,6 @@
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Jquery" level="application" />
</component> </component>
</module> </module>
\ No newline at end of file \ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
.button { .button {
display: block; display: block;
width: 306px; width: 336px;
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
-webkit-border-radius: 7px; -webkit-border-radius: 7px;
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
text-align: right; text-align: right;
height: 28px; height: 28px;
} }
.modal-close {
text-align: right;
}
.modal-close-xray {
padding: 18px;
position: relative;
background: url("/img/modal/close.svg") no-repeat 96% 15px;
}
.modal-body-header { .modal-body-header {
font-size: 36px; font-size: 36px;
...@@ -49,10 +57,50 @@ ...@@ -49,10 +57,50 @@
.modal-body-header small { .modal-body-header small {
font-size: 14px; font-size: 14px;
display: block;
padding: 0 0 37px;
} }
.modal-label {
display: block;
font-size:14px;
font-weight: bold;
margin:auto;
padding:0 40px;
}
.time {
width:152px;
display: inline-block;
float:left;
}
.time .input {width:100%; display: inline-block}
.tm {margin-left:40px;}
.arrow-up{
content: "";
display: block;
position: relative;
background: url('/img/modal/butt_up.svg');
height: 30px;
width: 30px;
top: 30px;
right: -110px;
background-size: cover;
margin-top: -32px;
}
.arrow-down {
content: "";
display: block;
position: relative;
background: url('/img/modal/butt_down.svg');
height: 30px;
width: 30px;
top: 50px;
right: -110px;
background-size: cover;
margin-top: -32px;
}
.tm2 {margin-left:32px;}
.input { .input {
width: 333px; width: 336px;
height: 46px; height: 46px;
-webkit-border-radius: 7px; -webkit-border-radius: 7px;
border-radius: 7px; border-radius: 7px;
...@@ -64,7 +112,7 @@ ...@@ -64,7 +112,7 @@
font-size: 15px; font-size: 15px;
color: #333; color: #333;
box-sizing: border-box; box-sizing: border-box;
padding: 8px; padding: 16px;
} }
.input input[type="text"] { .input input[type="text"] {
......
<?php
## params
$mailTo = 'mind.it@ya.ru';
## fields
$name = isset($_POST['name']) ? $_POST['name'] : null;
$phone = isset($_POST['phone']) ? $_POST['phone'] : null;
$city = isset($_POST['city']) ? $_POST['city'] : null;
$email = isset($_POST['email']) ? $_POST['email'] : null;
$till = isset($_POST['till']) ? $_POST['till'] : null;
$from = isset($_POST['from']) ? $_POST['from'] : null;
## additional fields
$type = isset($_POST['type']) ? $_POST['type'] : null;
switch ($type) {
case 'callback':
$data = ['phone' => $phone, 'from' => $from, 'till' => $till];
$callback = new callback($data);
$callback->send($data);
echo json_encode(array('type'=>'success_send', 'text'=>'Ваша заявка успешно отправлена'));
break;
case 'order':
$data = ['name' => $name, 'email' => $email, 'city' => $city,];
$order = new order($data);
$order->send($data);
break;
default:
echo json_encode(array('type'=>'no_template', 'text'=>'Задайте шаблон обработчика!'));
break;
}
class Form{
public static function validate($data, $field = null)
{
switch ($field) {
case 'phone':
if (!preg_match("/^(8|\+7) ? ?\(?(\d{3})\)? ?(\d{3})[ -]?(\d{2})[ -]?(\d{2})/", $data))
die(json_encode(array('type'=>'error_phone', 'text'=>'Телефон введен неверно')));
return $data;
break;
case 'name':
if (mb_strlen($data) <= 1)
die(json_encode(array('type'=>'error_name', 'text'=>'Вы не ввели имя')));
return $data;
break;
case 'email':
if (!preg_match("/.+@.+\..+/i", $data))
die(json_encode(array('type'=>'error_email', 'text'=>'Почтовый адрес введен неверно')));
return $data;
break;
default:
if (strlen($data) < 2)
die(json_encode(array('type'=>'error', 'text'=>"Поле $field пусто")));
return $data;
}
}
public function send(array $data)
{
}
}
class callback extends Form {
public $phone;
public $till;
public $from;
function __construct(array $data)
{
$this->phone = Form::validate($data['phone'], 'phone');
$this->till = $data['till'];
$this->from = $data['from'];
}
}
class order extends Form {
public $name;
public $city;
public $email;
function __construct(array $data)
{
$this->name = Form::validate($data['name'], 'name');
$this->city = $data['city'];
$this->email = Form::validate($data['email'], 'email');
}
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#D81F27;stroke-miterlimit:10;}
</style>
<polyline class="st0" points="20,12.5 15,17.5 10,12.5 "/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#D81F27;stroke-miterlimit:10;}
</style>
<polyline class="st0" points="10,17.5 15,12.5 20,17.5 "/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">
<metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""/>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?></metadata>
<image id="Vector_Smart_Object_copy_4" data-name="Vector Smart Object copy 4" width="20" height="20" xlink:href="data:img/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEUAAAAFBwgFBwgFBwgFBwgFBwgFBwgAAAB+aCDGAAAABnRSTlMALc8k5OjSXqDqAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+EEGgw6Bh448ZQAAABSSURBVAjXYxAyYAADZkUGNWcI0ySJwSQFLMzs5gzGIEGQCJiACIBJqDIgBVUFEoYKAoVTw6AmMjCHpRpgMhEKkLQhDEOyAmExknOQHInkdISHANxMFvsh+uI0AAAAAElFTkSuQmCC"/>
</svg>
img/pin.png

1.28 KB

/* common */ /* common */
$(document).ready(function() { $(document).ready(function () {
if($('.mask').length>0) { if ($('.mask').length > 0) {
$(".mask").mask("8 (999) 999-99-99"); $(".mask").mask("8 (999) 999-99-99");
} }
//$('input, select').styler(); //$('input, select').styler();
var ff; var ff;
$('input[type=text]').focus(function() { $('input[type=text]').focus(function () {
if($(this).attr('data-place')==$(this).val()) { if ($(this).attr('data-place') == $(this).val()) {
$(this).val(''); $(this).val('');
} }
$(this).addClass('ac'); $(this).addClass('ac');
}); });
$('input[type=text]').blur(function() { $('input[type=text]').blur(function () {
if($(this).val()=='') { if ($(this).val() == '') {
$(this).val($(this).attr('data-place')); $(this).val($(this).attr('data-place'));
} }
$(this).removeClass('ac'); $(this).removeClass('ac');
}); });
$('textarea').focus(function() { $('textarea').focus(function () {
if($(this).attr('data-place')==$(this).val()) { if ($(this).attr('data-place') == $(this).val()) {
$(this).val(''); $(this).val('');
} }
$(this).addClass('ac'); $(this).addClass('ac');
}); });
$('textarea').blur(function() { $('textarea').blur(function () {
ff=$(this).attr('data-place'); ff = $(this).attr('data-place');
if($(this).val().length==0) { if ($(this).val().length == 0) {
$(this).val(ff); $(this).val(ff);
} }
$(this).removeClass('ac'); $(this).removeClass('ac');
}); });
function ress() { function ress() {
$('.sl-con').width($('.ct').width()+30); $('.sl-con').width($('.ct').width() + 30);
if($(window).width()<651) { if ($(window).width() < 651) {
$('.sl-con').width($('.ct').width()+16); $('.sl-con').width($('.ct').width() + 16);
} }
else if($(window).width()<961) { else if ($(window).width() < 961) {
$('.sl-con').width($('.ct').width()+24); $('.sl-con').width($('.ct').width() + 24);
} }
} }
ress(); ress();
$(window).resize(function() { $(window).resize(function () {
ress(); ress();
}); });
$(window).load(function() { $(window).load(function () {
ress(); ress();
}); });
$(window).load(function() { $(window).load(function () {
$('input[type=text]').each(function() { $('input[type=text]').each(function () {
$(this).attr('data-place',$(this).val()); $(this).attr('data-place', $(this).val());
}); });
$('textarea').each(function() { $('textarea').each(function () {
$(this).attr('data-place',$(this).val()); $(this).attr('data-place', $(this).val());
}); });
}); });
$('.sl1').slick({ $('.sl1').slick({
...@@ -82,20 +83,21 @@ $(document).ready(function() { ...@@ -82,20 +83,21 @@ $(document).ready(function() {
adaptiveHeight: true adaptiveHeight: true
}); });
$('.sl-con .item-poss a').fancybox({ $('.sl-con .item-poss a').fancybox({
helpers : { helpers: {
overlay: { overlay: {
locked: false locked: false
}, },
media : {}, media: {},
buttons : {} buttons: {}
} }
}); });
function test1() { function test1() {
var mac = navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) ? true : false; var mac = navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) ? true : false;
if(mac){ if (mac) {
$('.ord1,.ord2,.ord3,.form1 input[type=submit]').addClass('ac'); $('.ord1,.ord2,.ord3,.form1 input[type=submit]').addClass('ac');
} }
} }
test1(); test1();
}); });
var tag = document.createElement('script'); var tag = document.createElement('script');
...@@ -110,14 +112,14 @@ function onYouTubeIframeAPIReady() { ...@@ -110,14 +112,14 @@ function onYouTubeIframeAPIReady() {
width: '100%', width: '100%',
videoId: $('#player').attr('dt'), videoId: $('#player').attr('dt'),
events: { events: {
'onReady': function() { 'onReady': function () {
player.playVideo(); player.playVideo();
player.stopVideo(); player.stopVideo();
} }
} }
}); });
} }
$('.play1 span').click(function(e) { $('.play1 span').click(function (e) {
e.preventDefault(); e.preventDefault();
$(this).parent().fadeOut(200); $(this).parent().fadeOut(200);
player.playVideo(); player.playVideo();
...@@ -129,25 +131,86 @@ $(overlay).click(function () { ...@@ -129,25 +131,86 @@ $(overlay).click(function () {
closemodal('bid'); closemodal('bid');
}); });
$('.ord1').click(function(e){ $('.ord1').click(function (e) {
e.preventDefault(); e.preventDefault();
callmodal('callback'); callmodal('callback');
}); });
$('.ord2, .ord3').click(function(e){ $('.ord2, .ord3').click(function (e) {
e.preventDefault(); e.preventDefault();
callmodal('bid'); callmodal('bid');
}); });
$('.modal-close-xray').click(function () {
function callmodal(id){ closemodal($(this).parents('.modal').attr('id'));
});
function callmodal(id) {
overlay.removeClass('hidden'); overlay.removeClass('hidden');
// $('#'+id).css({ $('#' + id).removeClass('hidden');
// 'top' :
// })
$('#'+id).removeClass('hidden');
} }
function closemodal(id){ function closemodal(id) {
overlay.addClass('hidden'); overlay.addClass('hidden');
$('#'+id).addClass('hidden'); $('#' + id).addClass('hidden');
} }
$('.arrow-up').click(function () {
var nearInput = $(this).siblings('input');
var val = $(nearInput).val();
val = time(val, 'up');
$(nearInput).val(val);
});
$('.arrow-down').click(function () {
var nearInput = $(this).siblings('input');
var val = ($(nearInput)).val();
val = time(val, 'down');
$(nearInput).val(val);
});
function time(number, type) {
number = number.toString();
var date = '25.06.2014 ' + number.toString();
var d = new Date();
var time = date.replace(/^(\d+)\.(\d+)\./, '$2/$1/');
d.setTime(Date.parse(time));
if (type == 'down') {
d.setMinutes(d.getMinutes() - 90);
} else {
d.setMinutes(d.getMinutes() - 30);
}
return d.toLocaleTimeString().substr(0, 5);
}
$('#callback-form').submit(function(e){
e.preventDefault();
send('callback-form');
});
$('#order-form').submit(function(e){
e.preventDefault();
send('order-form');
});
function send(form){
$.ajax({
url: '/handler.php',
type: "POST",
dataType: "json",
data: $("#" + form).serialize(),
success: function (response) {
if (response.type == 'success_send') {
$('#'+form).find('input').prop("disabled", true);
alert(response.text)
}
if (response.type == 'error_name') {
alert(response.text)
}
if (response.type == 'error_email') {
alert(response.text)
}
if (response.type == 'error_phone') {
alert(response.text)
}
}
});
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!