Commit bd17719e by Ruha

v2

1 parent c2b7614c
Pipeline #2593 for bd17719e skipped in 0 seconds
......@@ -23,6 +23,13 @@
</mappings>
</serverdata>
</paths>
<paths name="myjino.ru">
<serverdata>
<mappings>
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="test.onclinic">
<serverdata>
<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
<?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
......@@ -4,5 +4,6 @@
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Jquery" level="application" />
</component>
</module>
\ No newline at end of file
......@@ -23,7 +23,7 @@
.button {
display: block;
width: 306px;
width: 336px;
height: 48px;
line-height: 48px;
-webkit-border-radius: 7px;
......@@ -41,6 +41,14 @@
text-align: right;
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 {
font-size: 36px;
......@@ -49,10 +57,50 @@
.modal-body-header small {
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 {
width: 333px;
width: 336px;
height: 46px;
-webkit-border-radius: 7px;
border-radius: 7px;
......@@ -64,7 +112,7 @@
font-size: 15px;
color: #333;
box-sizing: border-box;
padding: 8px;
padding: 16px;
}
.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 */
$(document).ready(function() {
if($('.mask').length>0) {
$(".mask").mask("8 (999) 999-99-99");
}
//$('input, select').styler();
var ff;
$('input[type=text]').focus(function() {
if($(this).attr('data-place')==$(this).val()) {
$(this).val('');
}
$(this).addClass('ac');
});
$('input[type=text]').blur(function() {
if($(this).val()=='') {
$(this).val($(this).attr('data-place'));
}
$(this).removeClass('ac');
});
$('textarea').focus(function() {
if($(this).attr('data-place')==$(this).val()) {
$(this).val('');
}
$(this).addClass('ac');
});
$('textarea').blur(function() {
ff=$(this).attr('data-place');
if($(this).val().length==0) {
$(this).val(ff);
}
$(this).removeClass('ac');
});
function ress() {
$('.sl-con').width($('.ct').width()+30);
if($(window).width()<651) {
$('.sl-con').width($('.ct').width()+16);
}
else if($(window).width()<961) {
$('.sl-con').width($('.ct').width()+24);
}
}
ress();
$(window).resize(function() {
ress();
});
$(window).load(function() {
ress();
});
$(window).load(function() {
$('input[type=text]').each(function() {
$(this).attr('data-place',$(this).val());
});
$('textarea').each(function() {
$(this).attr('data-place',$(this).val());
});
});
$('.sl1').slick({
arrows: false,
slidesToShow: 4,
draggable: false,
responsive: [
{
breakpoint: 652,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
draggable: true,
dots: true,
adaptiveHeight: true
}
}
]
});
$('.sl2').slick({
arrows: false,
dots: true,
adaptiveHeight: true
});
$('.sl3').slick({
arrows: false,
dots: true,
adaptiveHeight: true
});
$('.sl-con .item-poss a').fancybox({
helpers : {
overlay: {
locked: false
},
media : {},
buttons : {}
}
});
function test1() {
var mac = navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) ? true : false;
if(mac){
$('.ord1,.ord2,.ord3,.form1 input[type=submit]').addClass('ac');
}
}
test1();
$(document).ready(function () {
if ($('.mask').length > 0) {
$(".mask").mask("8 (999) 999-99-99");
}
//$('input, select').styler();
var ff;
$('input[type=text]').focus(function () {
if ($(this).attr('data-place') == $(this).val()) {
$(this).val('');
}
$(this).addClass('ac');
});
$('input[type=text]').blur(function () {
if ($(this).val() == '') {
$(this).val($(this).attr('data-place'));
}
$(this).removeClass('ac');
});
$('textarea').focus(function () {
if ($(this).attr('data-place') == $(this).val()) {
$(this).val('');
}
$(this).addClass('ac');
});
$('textarea').blur(function () {
ff = $(this).attr('data-place');
if ($(this).val().length == 0) {
$(this).val(ff);
}
$(this).removeClass('ac');
});
function ress() {
$('.sl-con').width($('.ct').width() + 30);
if ($(window).width() < 651) {
$('.sl-con').width($('.ct').width() + 16);
}
else if ($(window).width() < 961) {
$('.sl-con').width($('.ct').width() + 24);
}
}
ress();
$(window).resize(function () {
ress();
});
$(window).load(function () {
ress();
});
$(window).load(function () {
$('input[type=text]').each(function () {
$(this).attr('data-place', $(this).val());
});
$('textarea').each(function () {
$(this).attr('data-place', $(this).val());
});
});
$('.sl1').slick({
arrows: false,
slidesToShow: 4,
draggable: false,
responsive: [
{
breakpoint: 652,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
draggable: true,
dots: true,
adaptiveHeight: true
}
}
]
});
$('.sl2').slick({
arrows: false,
dots: true,
adaptiveHeight: true
});
$('.sl3').slick({
arrows: false,
dots: true,
adaptiveHeight: true
});
$('.sl-con .item-poss a').fancybox({
helpers: {
overlay: {
locked: false
},
media: {},
buttons: {}
}
});
function test1() {
var mac = navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i) ? true : false;
if (mac) {
$('.ord1,.ord2,.ord3,.form1 input[type=submit]').addClass('ac');
}
}
test1();
});
var tag = document.createElement('script');
......@@ -105,49 +107,110 @@ var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: $('#player').attr('dt'),
events: {
'onReady': function() {
player.playVideo();
player.stopVideo();
}
}
});
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: $('#player').attr('dt'),
events: {
'onReady': function () {
player.playVideo();
player.stopVideo();
}
}
});
}
$('.play1 span').click(function(e) {
e.preventDefault();
$(this).parent().fadeOut(200);
player.playVideo();
$('.play1 span').click(function (e) {
e.preventDefault();
$(this).parent().fadeOut(200);
player.playVideo();
});
var overlay = $('#overlay');
$(overlay).click(function () {
closemodal('callback');
closemodal('bid');
closemodal('callback');
closemodal('bid');
});
$('.ord1').click(function (e) {
e.preventDefault();
callmodal('callback');
});
$('.ord2, .ord3').click(function (e) {
e.preventDefault();
callmodal('bid');
});
$('.modal-close-xray').click(function () {
closemodal($(this).parents('.modal').attr('id'));
});
function callmodal(id) {
overlay.removeClass('hidden');
$('#' + id).removeClass('hidden');
}
function closemodal(id) {
overlay.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);
}
$('.ord1').click(function(e){
e.preventDefault();
callmodal('callback');
$('#callback-form').submit(function(e){
e.preventDefault();
send('callback-form');
});
$('.ord2, .ord3').click(function(e){
e.preventDefault();
callmodal('bid');
$('#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)
}
}
});
function callmodal(id){
overlay.removeClass('hidden');
// $('#'+id).css({
// 'top' :
// })
$('#'+id).removeClass('hidden');
}
function closemodal(id){
overlay.addClass('hidden');
$('#'+id).addClass('hidden');
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!