This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".forms").submit(function() { | |
$.ajax({ | |
type: "POST", | |
url: "mail.php", | |
data: $(this).serialize() | |
}).done(function() { | |
alert("Спасибо за заявку! Скоро мы с вами свяжемся."); | |
setTimeout(function(){ | |
$(".form").trigger("reset"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$recepient = "[email protected]"; | |
$sitename = "Название сайта"; | |
$name = trim($_POST["name"]); | |
$phone = trim($_POST["phone"]); | |
$text = trim($_POST["text"]); | |
$message = "Имя: $name \nТелефон: $phone \nТекст: $text"; | |
$pagetitle = "Новая заявка с сайта \"$sitename\""; | |
mail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: $recepient"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*img svg | |
===============================*/ | |
if(!Modernizr.svg){ | |
$('img[src*="svg"]').attr('src', function(){ | |
return $(this).attr().replace('svg', 'png'); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> | |
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | |
viewBox="0 0 2457.6 100" preserveAspectRatio="none" style="enable-background:new 0 0 2457.6 100;" xml:space="preserve"> | |
<style type="text/css"> | |
.st0{fill:#394B5F;} | |
</style> | |
<polyline class="st0" points="1228.8,0 2457.6,100 0,100 "/> | |
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.card').each(function(index){ | |
var ths = $(this); | |
setInterval(function(){ | |
ths.removeClass('active'); | |
}, 100*index); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isNumeric(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function str_all_pos($haystack, $needle) { | |
$pos = 0; | |
$result = []; | |
while (false !== ($pos = strpos($haystack, $needle, $pos))) { | |
$result[] = $pos; | |
$pos = $pos + strlen($needle); | |
} | |
return $result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function autoload($className){ | |
//переводим в нижний регистр; заменяем обратные слеши. | |
$path = str_replace('\\', '/', $className).'.php'; | |
if(is_readable($path)){ | |
require_once ($path);//подключаем файл | |
}else throw new \DbException('Класс не найден: '.$path); | |
} | |
//регистрируем функцию | |
spl_autoload_register('autoload'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton | |
{ | |
protected static $instance; | |
protected function __construct() | |
{ | |
} | |
public static function instance() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$option = [ | |
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, | |
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, | |
\PDO::ATTR_EMULATE_PREPARES => false | |
]; | |
try{ | |
$this->dbh = new \PDO('mysql:host=127.0.0.1;dbname=stepantev', 'root', 'root', $option); | |
$this->dbh->exec('set charset UTF8'); | |
} |
OlderNewer