/*----------------------------- 3 ---------------------------*/
// Links after google-ads-3 par
//google-ads-3
//google_ads_3
add_filter( 'the_content', 'wpse_content_google_ads_3' );
function wpse_content_google_ads_3( $content ) {
if( !is_single() )
return $content;
/*Number paragraf*/
global $paragraphAfter3;
$paragraphAfter = $paragraphAfter3; //number of paragraph
$contentOLD = $content;
$contentOLD_explode = explode ( "</p>", $contentOLD );
//var_dump($content);
$content = explode ( "</p>", $content );
$new_content = '';
if($paragraphAfter < count ( $content )) {
//var_dump($contentOLD);
for ($a = 0, $c = count($content); $a < $c; $a++) {
if ( $a == $paragraphAfter ) {
ob_start();
if ( is_active_sidebar( 'google-ads-3' ) ) :
dynamic_sidebar( 'google-ads-3' );
else :
echo '<span></span>';
endif;
$result = ob_get_clean();
$new_content .= $result ;
}
$new_content .= $content[$a] . "</p>";
}
return $new_content;
}
if($paragraphAfter > count ( $contentOLD_explode )) {
//var_dump($contentOLD);
return $contentOLD_explode;
}
}
/*----------------------------- 3 ---------------------------*/
// Links after google-ads-3 par
//google-ads-3
//google_ads_3
add_filter( 'the_content', 'wpse_content_google_ads_3' );
function wpse_content_google_ads_3( $content ) {
if( !is_single() )
return $content;
/*Number paragraf*/
/* $paragraphAfter = 3; //number of paragraph */
global $paragraphAfter3;
$paragraphAfter = $paragraphAfter3; //number of paragraph
$contentOLD = $content;
//var_dump($content);
$content = explode ( "</p>", $content );
$new_content = '';
$DSV_B = 0;
if($paragraphAfter > count ( $contentOLD )) {
return $contentOLD;
} elseif ($paragraphAfter < count ( $content )){
for ( $a = 0; $a < count ( $content ); $a ++ ) {
if ( $a == $paragraphAfter ) {
ob_start();
if ( is_active_sidebar( 'google-ads-3' ) ) :
dynamic_sidebar( 'google-ads-3' );
else :
echo '<span></span>';
endif;
$result = ob_get_clean();
$new_content .= $result ;
}
$new_content .= $content[$a] . "</p>";
}
return $new_content;
}
}
jQuery(document).ready(function($){
//$('span#raznuyfuter').each(function () {
//$(window).load(function () {
//EN
if($( 'html:lang(en)').length) {
$('span#raznuyfuter').text('ENGLISH TEXT');
$('span#vtoroydiv').text('Development and design of website');
}
//RU
else {
if($( 'html:lang(ru)').length) {
$('span#raznuyfuter').text('РУССКИЙ ТЕКСТ');
$('span#vtoroydiv').text('Разработка и дизайн сайта');
};
//UK
else if($( 'html:lang(uk)').length) {
$('span#raznuyfuter').text('УКРАЇНСЬКИЙ ТЕКСТ');
$('span#vtoroydiv').text('Розробка та дизайн сайту');
};
//});
};
});
jQuery( document ).ready(function( $ ) {
//Функция сложения
$sum = function() {
return Array.prototype.reduce.call(arguments, function (sum, current) {
return sum + parseInt(current);
}, 0);
};
//Функция обработки клика и всего остальног по формам
//$("button#Vіnnitcka_oblast").click(function () {
$("button#Vіnnitcka_oblast").click(function () {
//----------------Google Sheets-----------------------//
GoogleROWS = 0;
$(document).ready(function(){
//--
var worksheets = [
'', // defaults to first worksheet without id
'01'];
//--
worksheets.forEach(function(worksheet){
$.googleSheetToJSON('1zb18flEHZsMX1Wh8kZ_nAQpkG8V_hd3fl90D7u1s2yc', worksheet)
.done(function(rows){
// each row is a row of data from the spreadsheet
//console.log(rows);
//console.log(rows);
window.GoogleROWS = rows;
return GoogleROWS;
/* var $container = $('<div>');
$container.append('<h1>' + (worksheet || 'default') + '</h1>');
rows.forEach(function(row){
$dl = $('<dl>');
Object.getOwnPropertyNames(row).forEach(function(name){
var val = [].concat(row[name]).join(' / ');
$dl.append('<dt>' + name + '</dt><dd>' + val + '</dd>');
});
$container.append($dl);
});
$(document.body).append($container); */
})
.fail(function(err){
console.log('error!', err);
});
});
});
//---------------- END ----- Google Sheets --------------------//
GoogleROWS
//Объявление переменных для захвата всех значений из INPUTов
var value1 = $("input#Vіnnitcka_oblast_1_replyNumber").val();
var value2 = $("input#Vіnnitcka_oblast_2_replyNumber").val();
var value3 = $("input#Vіnnitcka_oblast_3_replyNumber").val();
var value4 = $("input#Vіnnitcka_oblast_4_replyNumber").val();
var value5 = $("input#Vіnnitcka_oblast_5_replyNumber").val();
var value6 = $("input#Vіnnitcka_oblast_6_replyNumber").val();
var value7 = $("input#Vіnnitcka_oblast_7_replyNumber").val();
//Выводим отплюсованное в переменную
//var Otplusovali = $sum(value2,value3,value4,value5,value6,value7);
//Замена запятой на точку http://javascript.ru/forum/css-html/43937-zamenit-zapyatuyu-na-tochku.html
//Умножаем
//var valueSUPER1 = $("input#Vіnnitcka_oblast_1_replyNumber").val();
//var Ymnogenie = GoogleROWS["0"]._d180g * valueSUPER1;
//Выводим каждый инпут в поле напротив
//$("td.Vіnnitcka_oblast_1.text-center").text(GoogleROWS["0"]._d180g);
$("td.Vіnnitcka_oblast_1.text-center").text(GoogleROWS["0"]["назва"]);
$("td.Vіnnitcka_oblast_2.text-center").text(value2);
$("td.Vіnnitcka_oblast_3.text-center").text(value3);
$("td.Vіnnitcka_oblast_4.text-center").text(value4);
$("td.Vіnnitcka_oblast_5.text-center").text(value5);
$("td.Vіnnitcka_oblast_6.text-center").text(value6);
$("td.Vіnnitcka_oblast_7.text-center").text(value7);
//
//$("td#Vіnnitcka_oblast_vsogo").text(Otplusovali);
//$("td#Vіnnitcka_oblast_vsogo").html("<strong>Всього:</strong><br><b>" + Otplusovali + "</b>");
//return false;
})
//return false;
});
/*Bootstrap валидация и стилизация ввода в формы*/
$(document).ready(function() {
$('.input-group input[required], .input-group textarea[required], .input-group select[required]').on('keyup change', function() {
var $form = $(this).closest('form'),
$group = $(this).closest('.input-group'),
$addon = $group.find('.input-group-addon'),
$icon = $addon.find('span'),
state = false;
if (!$group.data('validate')) {
state = $(this).val() ? true : false;
}else if ($group.data('validate') == "email") {
state = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).val())
}else if($group.data('validate') == 'phone') {
state = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}$/.test($(this).val())
}else if ($group.data('validate') == "length") {
state = $(this).val().length >= $group.data('length') ? true : false;
}else if ($group.data('validate') == "number") {
state = !isNaN(parseFloat($(this).val())) && isFinite($(this).val());
}
if (state) {
$addon.removeClass('danger');
$addon.addClass('success');
$icon.attr('class', 'glyphicon glyphicon-ok');
}else{
$addon.removeClass('success');
$addon.addClass('danger');
$icon.attr('class', 'glyphicon glyphicon-remove');
}
//Валидация формы. Кнопка "Підрахувати будет не активной до полного заполнения всех input"
if ($('span.glyphicon.glyphicon-remove').length == 0) {
//$form.find('[type="submit"]').prop('disabled', false);
$('button').prop('disabled', false);
}else{
//$form.find('[type="submit"]').prop('disabled', true);
$('button').prop('disabled', true);
}
});
$('.input-group input[required], .input-group textarea[required], .input-group select[required]').trigger('change');
});
/*END Bootstrap валидация ввода*/
//----------------Google Sheets-----------------------//
GoogleROWS = 0;
$(document).ready(function(){
//--
var worksheets = [
'', // defaults to first worksheet without id
'01'];
//--
worksheets.forEach(function(worksheet){
$.googleSheetToJSON('1zb18flEHZsMX1Wh8kZ_nAQpkG8V_hd3fl90D7u1s2yc', worksheet)
.done(function(rows){
// each row is a row of data from the spreadsheet
//console.log(rows);
//console.log(rows);
window.GoogleROWS = rows;
return GoogleROWS;
/* var $container = $('<div>');
$container.append('<h1>' + (worksheet || 'default') + '</h1>');
rows.forEach(function(row){
$dl = $('<dl>');
Object.getOwnPropertyNames(row).forEach(function(name){
var val = [].concat(row[name]).join(' / ');
$dl.append('<dt>' + name + '</dt><dd>' + val + '</dd>');
});
$container.append($dl);
});
$(document.body).append($container); */
})
.fail(function(err){
console.log('error!', err);
});
});
});
//---------------- END ----- Google Sheets --------------------//
var GoogleROWS = 0;
$(document).ready(function(){
//--
var worksheets = [
'', // defaults to first worksheet without id
'01'];
//--
worksheets.forEach(function(worksheet){
$.googleSheetToJSON('1zb18flEHZsMX1Wh8kZ_nAQpkG8V_hd3fl90D7u1s2yc', worksheet)
.done(function(rows){
// each row is a row of data from the spreadsheet
GoogleROWS = rows;
return GoogleROWS;
/* var $container = $('<div>');
$container.append('<h1>' + (worksheet || 'default') + '</h1>');
rows.forEach(function(row){
$dl = $('<dl>');
Object.getOwnPropertyNames(row).forEach(function(name){
var val = [].concat(row[name]).join(' / ');
$dl.append('<dt>' + name + '</dt><dd>' + val + '</dd>');
});
$container.append($dl);
});
$(document.body).append($container); */
})
.fail(function(err){
console.log('error!', err);
});
});
});
$(document).ready(function(){
var worksheets = [
'', // defaults to first worksheet without id
'ouab0ad'];
worksheets.forEach(function(worksheet){
$.googleSheetToJSON('1nmrLOKhY_XB9vYgr-8xYTQ7dAB7AykY9G-UolHvcit0', worksheet)
.done(function(rows){
// each row is a row of data from the spreadsheet
console.log(rows);
})
.fail(function(err){
console.log('error!', err);
});
});
});