private static $isFieldChanged = false;
/**
* Событие перед обновлением контакта
**/
public static function handleOnBeforeContactUpdae(&$fields)
{
//Если поле присутствует в массиве обновления
if(array_key_exists('UF_CODE', $fields))
{
//Проверяем его текущее значение
$currentContact = \Bitrix\Crm\ContactTable::getRow([
'filter' => [
'ID' => $fields['ID']
],
'select' => ['UF_CODE']
]);
if($currentContact['UF_CODE'] != $fields['UF_CODE'])
{
static::$isFieldChanged = true;
}
}
}
/**
* Событие после обновления контакта
**/
public static function handleOnAfterContactUpdae(&$fields)
{
if(static::$isFieldChanged === true)
{
static::$isFieldChanged = false;
// Запускаем наш бизнес-процесс
...
}
}
$('form').trigger('reset');
$(function() {
'use strict';
$('form').on('submit', function(e) {
e.preventDefault();
alert('Наш менеджер в скором времени свяжется с вами!');
var popupClass = $(this).attr('id').replace('form', 'popup');
$.ajax({
url: 'send.php',
type: 'POST',
contentType: false,
processData: false,
data: new FormData(this),
success: function(msg) {
console.log(msg);
if (msg == 'ok') {
console.log('Нужный класс попапа: ' + popupClass);
$('#form').trigger('reset'); // очистка формы
} else {
alert('Ошибка');
}
}
});
});
});
class Point {
public $x, $y;
function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}
function distanceTo(Point $point) {
$distanceX = $this->x - $point->x;
$distanceY = $this->y - $point->y;
$distance = sqrt($distanceX * $distanceX + $distanceY * $distanceY);
return $distance;
}
function __toString() {
return 'x: ' . $this->x . ', y: ' . $this->y;
}
}
$a = new Point(0, 0);
$points = array(new Point(0, 2), new Point(0.5, 0.3), new Point(1, 1), new Point(-1, -2));
$curNearestPoint = $points[0];
$curNearestDistance = $a->distanceTo($curNearestPoint);
foreach ($points as $point) {
$distance = $a->distanceTo($point);
if ($distance < $curNearestDistance) {
$curNearestDistance = $distance;
$curNearestPoint = $point;
}
}
echo 'nearest point: ' . $curNearestPoint;
.breadcrumbs li:not(:first-child) a {
padding: 5px 30px;
background: #fff;
background: linear-gradient(-135deg, transparent 10px, #fff 0) top right,
linear-gradient(-45deg, transparent 10px, #fff 0) bottom right,
linear-gradient(135deg, transparent 10px, #fff 0) bottom left,
linear-gradient(45deg, transparent 10px, #fff 0) top left;
background-size: 51% 51%;
background-repeat: no-repeat; }
WHERE
DATE_FORMAT(claim.created_at,'%Y-%m' ) = DATE_FORMAT('07.2013','%Y-%m' )
myPlacemark.events.add('click', function (e) {
alert('Привет, покажи-ка div :)');
});
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$spreadsheet->setActiveSheetIndex(0);
$activeSheet = $spreadsheet->getActiveSheet();
use DocxMerge\DocxMerge;
$dm = new DocxMerge();
$dm->merge( [
"templates/TplPage1.docx",
"templates/TplPage2.docx"
], "/tmp/result.docx" );