diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0bfe817 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/* +composer.lock diff --git a/.vscode/ftp-sync.json b/.vscode/ftp-sync.json index 83b7186..ccb9463 100644 --- a/.vscode/ftp-sync.json +++ b/.vscode/ftp-sync.json @@ -1,5 +1,5 @@ { - "remotePath": "./", + "remotePath": "./slavforest.com.ua", "host": "uvh12.mirohost.net", "username": "slavforest", "password": "cAAed7MU", @@ -14,7 +14,8 @@ "ignore": [ "\\.vscode", "\\.git", - "\\.DS_Store" + "\\.DS_Store", + "\\.db" ], "generatedFiles": { "uploadOnSave": false, diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f4fd79e --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "require": { + "slim/slim": "^3.0", + "mailgun/mailgun-php": "^2.6", + "slim/php-view": "^2.2" + } +} diff --git a/contact.php b/contact.php index 6bd8e55..d61d324 100644 --- a/contact.php +++ b/contact.php @@ -6,7 +6,7 @@ //E-mail address. Enter your email -define("__TO__", "youremail@domain.com"); +define("__TO__", "sha@shadoll.work"); //Success message define('__SUCCESS_MESSAGE__', "Your message has been sent. We will reply soon. Thank you!"); @@ -41,11 +41,11 @@ function send_mail($to,$subject,$message,$headers){ } //Get data form and send mail -if(isset($_POST['name']) and isset($_POST['mail']) and isset($_POST['messageForm'])){ +if(isset($_POST['name']) && isset($_POST['email']) && isset($_POST['message'])){ $name = $_POST['name']; - $mail = $_POST['mail']; - $subjectForm = $_POST['subjectForm']; - $messageForm = $_POST['messageForm']; + $mail = $_POST['email']; + $subjectForm = $_POST['subject']; + $messageForm = $_POST['message']; if($name == '') { echo json_encode(array('info' => 'error', 'msg' => "Please enter your name.")); @@ -96,4 +96,3 @@ if(isset($_POST['name']) and isset($_POST['mail']) and isset($_POST['messageForm } else { echo json_encode(array('info' => 'error', 'msg' => __MESSAGE_EMPTY_FIELDS__)); } - ?> \ No newline at end of file diff --git a/contactengine.php b/contactengine.php new file mode 100644 index 0000000..14b63ab --- /dev/null +++ b/contactengine.php @@ -0,0 +1,86 @@ +"; +$msg .= 'logo'; +$msg .= "

".$subject."

\r\n"; +$msg .= "

Від кого: ".$username."

\r\n"; +if(!empty($userphone)) + $msg .= "

Телефон: ".$userphone."

\r\n"; +if(!empty($usermail)) + $msg .= "

Email: ".$usermail."

\r\n"; +$msg .= "
\r\n"; +if(!empty($subj)) + $msg .= "

Тема:\r\n".$subj."

\r\n"; +if(!empty($order)) + $msg .= "

Заказ:\r\n".$order."

\r\n"; +if(!empty($message)) + $msg .= "

Повідомлення:\r\n".$message."

\r\n"; +$msg .= "
\r\n"; +$msg .= "

Реферал: ".$referer."

\r\n"; +$msg .= "

IP-адреса відправника: ".$ip."

\r\n"; +if($detect){ + $msg .= "

Провайдер: ".$provider."

\r\n"; + $msg .= "

Країна: ".$country."

\r\n"; + $msg .= "

Регіон: ".$region."

\r\n"; + $msg .= "

Населений пункт: ".$city."

\r\n"; +} +$msg .= ""; + +if(empty($username)){ + echo json_encode([ + 'message'=>'Please enter your name.', + 'callback'=>'error', + 'focus'=>'name' + ]); +} +elseif(empty($usermail)){ + echo json_encode([ + 'message'=>'Please enter valid e-mail.', + 'callback'=>'error', + 'focus'=>'email' + ]); +} +else{ + $success = @mail($sendto, $subject, $msg, $headers); + + echo json_encode([ + 'html'=>'our message has been sent. We will reply soon. Thank you!', + 'target'=>".response", + 'callback'=>"message_send" + ]); +} diff --git a/css/style.css b/css/style.css index 8c52861..5aa62da 100644 --- a/css/style.css +++ b/css/style.css @@ -142,6 +142,7 @@ p { background: url(../images/home.jpg); background-size: cover; background-repeat: no-repeat; + background-color: #a9773a; } .header .section_overlay { background-color: rgba(33, 33, 33, .75); diff --git a/google625b316c457672b3.html b/google625b316c457672b3.html new file mode 100644 index 0000000..f0f29d3 --- /dev/null +++ b/google625b316c457672b3.html @@ -0,0 +1 @@ +google-site-verification: google625b316c457672b3.html \ No newline at end of file diff --git a/index.html b/index.html index 7207cbb..c488aaf 100644 --- a/index.html +++ b/index.html @@ -266,7 +266,7 @@
  • Виробляються брикети РУФ без використання смол, тому вони не забруднюють димохід і дають приємний запах
  • Паливні брикети з тирси виділяють СО2 в десять разів менше, ніж природний газ і в п'ятдесят разів менше, ніж вугілля.
  • -

    Брикет упаковано в пачки по 12 штук в термозбіжний пакет, що захищає їх від проникнення пилу, бруду і вологи. Вага однієї пачки близько 12 кг, загальна вага піддона 1 тонна.

    +

    Брикет упаковано в пачки по 12 штук в термозбіжний пакет, що захищає їх від проникнення пилу, бруду і вологи. Вага однієї пачки близько 10 кг, загальна вага піддона 1 тонна.

    diff --git a/index_en.html b/index_en.html index 867a73e..13837a4 100644 --- a/index_en.html +++ b/index_en.html @@ -285,7 +285,7 @@

    Our briquettes are packed into shrinkbags in sets of 12 pcs., which provides - protection against dust, dirt and moisture. The weight of each bag is approx. 12 kg, + protection against dust, dirt and moisture. The weight of each bag is approx 10 kg, total weight of a pallet is 1 ton.

    diff --git a/js/_actions.js b/js/_actions.js new file mode 100644 index 0000000..43d92e0 --- /dev/null +++ b/js/_actions.js @@ -0,0 +1,96 @@ +/** + * + * @author sHa + * @package sCore + * @version 17.5.9 (17.5.16 fixed) + * + */ +; + +/* AutoLoader */ +jQuery(document).ready(function(){ + jQuery("[data-autoload='true']").each(function(){ + load_objects(jQuery("#"+$(this).attr("id"))); + }); +}); + +/* + Виклик: + load_objects(jQuery("#container_id")); + Параметри data- контейнеру: + * - будь-які данні, будуть передані в викликаємий метод класу + action - клас та метод що маємо викликати, якщо не задано берем з href + method - метод Post або Get + callback - функція яку буде викона після виконання запиту + target - якщо вказано, то значення змінної html відповіді буде розміщенно всередені тегу + якщо target не визначено, а відповідь має змінну html, то її значення буде розміщено в середені контейнеру + template - ім'я php шаблону для формування змінної html + autoload - true|false - автоматичне виконання запиту при завантаженні сторінки +*/ + +var load_objects = function(container){ + if(jQuery(container)!=undefined){ + + var action = container.data('action'); + if (action==undefined) + action = container.attr('href'); + + var method = container.data('method'); + if(method==undefined) + method = 'GET'; + + // Отримуємо необхідну форму, + // якщо не знайшли, беремо всі форми + var form_data = jQuery("form[data-group='"+container.attr('id')+"']").serializeArray(); +// if (form_data[0] == undefined) +// var form_data = jQuery('form').serializeArray(); + + // перетворюємо значення форми на об'ект data + var data = new Object(); + jQuery.each(form_data, function() { + if(this.value!='') + data[this.name] = this.value; + }); + + // додаємо до об'єкту data значання data- полів контейнеру + jQuery.each(container.data(),function(n, v){ + if(n!='action' && n!='callback') + data[n] = v; + }); + + // додамо поточний url (хай буде) + data["uri_source"] = window.location.href; + + jQuery.ajax({ + url: action, + type: method, + data: data + }). + done(function(data){ + var response = jQuery.parseJSON(data); + + var target = jQuery(response.target); + console.log(target); + if(target!=undefined) + jQuery(target).html(response.html); + else + container.html(response.html); + + if(response.callback!==undefined){ + callback = response.callback; + } + else if(container.data('callback')!==undefined){ + callback = container.data('callback'); + } + else{ + callback = undefined; + } + if(callback!==undefined && typeof window[callback] == 'function') { + window[callback](container,response); + } + }). + fail(function( jqXHR, textStatus ){ + container.html("Request failed: " + textStatus); + }); + } +} diff --git a/js/script.js b/js/script.js index b87ac7c..028c379 100644 --- a/js/script.js +++ b/js/script.js @@ -1,3 +1,19 @@ +if ('serviceWorker' in navigator) { + window.addEventListener('load', function() { + navigator.serviceWorker.register('/sw.js', { scope: './' }) + .then(function(registration) { + console.log('ServiceWorker registration successful with scope: ', registration.scope); + }) + .catch(function(whut) { + console.error('error... '); + console.error(whut); + }); + window.addEventListener('beforeinstallprompt', function(e) { + console.log('beforeinstallprompt Event fired'); + }); + }); +} + //LOADER/SPINNER $(window).bind("load", function() { @@ -257,10 +273,10 @@ $(document).ready(function() { } if (name && emaild && message) { $.ajax({ - url: 'contact.php', + url: 'contactengine.php', data: { name: name, - emaild: emaild, + email: emaild, subject: subject, message: message }, diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..f5a07a5 --- /dev/null +++ b/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "SlavForest", + "name": "SlavForest - Production of High-Quality Timber Products", + "icons": [ + { + "src": "images/logo_w.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": "/", + "background_color": "#a9773a", + "theme_color": "#a9773a", + "display": "standalone" +} diff --git a/robots.txt b/robots.txt index 1f53798..45e3f32 100644 --- a/robots.txt +++ b/robots.txt @@ -1,2 +1,2 @@ User-agent: * -Disallow: / +Host: slavforest.com.ua diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..ca43c77 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,5 @@ + + +https://slavforest.com.ua/index.html + + diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..cb7344c --- /dev/null +++ b/sw.js @@ -0,0 +1,3 @@ +/* + This service worker doesn't actually do anything! +*/