function pointInPoly(polyCords, pointX, pointY)
{
var i, j, c = 0;
for (i = 0, j = polyCords.length - 1; i < polyCords.length; j = i++)
{
if (((polyCords[i][1] > pointY) != (polyCords[j][1] > pointY)) && (pointX < (polyCords[j][0] - polyCords[i][0]) * (pointY - polyCords[i][1]) / (polyCords[j][1] - polyCords[i][1]) + polyCords[i][0]))
{
c = !c;
}
}
return c;
}
function crossLine(l1,l2) {
var dx1 = l1[1][0] - l1[0][0],
dy1 = l1[1][1] - l1[0][1],
dx2 = l2[1][0] - l2[0][0],
dy2 = l2[1][1] - l2[0][1],
x = dy1 * dx2 - dy2 * dx1;
if(!x, !dx2) {
return false;
}
var y = l2[0][0] * l2[1][1] - l2[0][1] * l2[1][0];
x = ((l1[0][0] * l1[1][1] - l1[0][1] * l1[1][0]) * dx2 - y * dx1) / x;
y = (dy2 * x - y) / dx2;
return ((l1[0][0] <= x && l1[1][0] >= x) || (l1[1][0] <= x && l1[0][0] >= x)) &&
((l2[0][0] <= x && l2[1][0] >= x) || (l2[1][0] <= x && l2[0][0] >= x));
}
<?php
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\HttpKernel;
$locator = new FileLocator(array(__DIR__));
$loader = new YamlFileLoader($locator);
$routes = $loader->load('route.yml');
$context = new RequestContext();
$request = Request::createFromGlobals();
$context->fromRequest($request);
$matcher = new UrlMatcher($routes, $context);
$controllerResolver = new HttpKernel\Controller\ControllerResolver();
$argumentResolver = new HttpKernel\Controller\ArgumentResolver();
try {
$matcher = $matcher->match($request->getPathInfo());
$matcher['_controller'] .= 'Action';
$request->attributes->add($matcher);
$controller = $controllerResolver->getController($request);
$arguments = $argumentResolver->getArguments($request, $controller);
call_user_func_array($controller, $arguments);
} catch (ResourceNotFoundException $e) {
$response = new Response('Not found!', Response::HTTP_NOT_FOUND);
}
require_once(JPATH_SITE.'/libraries/phpmailer/phpmailer.php');
$mail = new PHPMailer;
$sender = array($call_email, JText::_('modcallback_title'));
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'ssl://smtp.yandex.ru';
$mail->Port = 465;
$mail->SMTPSecure = 'SSL';
$mail->SMTPAuth = true;
$mail->Username = $call_email;
$mail->Password = "";// Пароль
$mail->setFrom($sender);
$mail->addReplyTo($sender);
$mail->addAddress($sender);
$mail->Subject = 'subjec't;
$mail->Body = 'Body';
return $mail->send();
$fields = array(
'comment' => '<textarea name="comment"></textarea>',
'author' => '<input type="text" name="author" placeholder="Введите Ваше имя">',
'email' => '<input type="email" name="email" placeholder="Введите Ваш Email (необязательно)">',
'url' => '<input type="text" name="url" placeholder="Введите Ваш телефон (необязательно)">'
);
comment_form(array(
'comment_field' => '',
'fields' => apply_filters( 'comment_form_default_fields', $fields )
));