<?php
$db_host = "192.168.1.4";
$db_user = "n1cro";
$db_password = "XRT6IPLkeK5DyYzc";
$db_name = "invitation";
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$birthdate = $_POST['birthdate'];
$repsubject = $_POST['subject'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$link = mysql_connect($db_host, $db_user, $db_password)
or die("Ошибка " . mysqli_error($link));
mysql_select_db($db_name);
mysql_query("INSERT INTO users(firstname, lastname) VALUES ('".$_POST['firstname']."','".$_POST['lastname']."')");
mysql_close();
if (document.body.classList.contains('home')) {
var slides = document.querySelectorAll('.slider-item');
var sliderToggles = document.querySelectorAll('.slider-toggle');
var currentSlide = 0;
var slideInterval = setInterval(nextSlide, 2500);
function nextSlide() {
sliderToggles[currentSlide].classList.remove('slider-toggle--active');
slides[currentSlide].classList.remove('active');
currentSlide = (currentSlide+1)%slides.length;
sliderToggles[currentSlide].classList.add('slider-toggle--active');
slides[currentSlide].classList.add('active');
}
}
var tabsWrapper = document.querySelector('.services .container');
var tabsBtn = tabsWrapper.querySelectorAll('.services__tabs-item');
var tabsContent = tabsWrapper.querySelectorAll('.services__item');
var activeBtnTab = tabsWrapper.querySelector('.services__tabs-item--active');
var activeContentTab = tabsWrapper.querySelector('.services__item--active');
tabsWrapper.addEventListener('click', function(event) {
event.preventDefault();
var target = event.target;
if (target.parentNode.classList.contains('services__tabs-item')) {
for (var i = 0; i < tabsBtn.length; i++) {
if (tabsBtn[i] === target.parentNode) {
activeBtnTab.classList.remove('services__tabs-item--active');
activeBtnTab = target.parentNode;
activeBtnTab.classList.add('services__tabs-item--active');
activeContentTab.classList.remove('services__item--active');
activeContentTab = tabsContent[i];
activeContentTab.classList.add('services__item--active');
return;
}
}
}
});
var tabsWrapper = document.querySelector('.services .container');
var tabsBtn = tabsWrapper.querySelectorAll('.services__tabs-item');
var tabsContent = tabsWrapper.querySelectorAll('.services__item');
var activeBtnTab = tabsWrapper.querySelector('.services__tabs-item--active');
var activeContentTab = tabsWrapper.querySelector('.services__item--active');
tabsWrapper.addEventListener('click', function(event) {
event.preventDefault();
var target = event.target;
if (target.parentNode.classList.contains('services__tabs-item')) {
for (var i = 0; i < tabsBtn.length; i++) {
if (tabsBtn[i] === target.parentNode) {
activeBtnTab.classList.remove('services__tabs-item--active');
activeBtnTab = target.parentNode;
activeBtnTab.classList.add('services__tabs-item--active');
activeContentTab.classList.remove('services__item--active');
activeContentTab = tabsContent[i];
activeContentTab.classList.add('services__item--active');
return;
}
}
}
});