$(document).on('click', 'body', function (e) {
var div = $(".menu"),
checkbox = $('#menu-toogle'),
label = $('#menu-toogle + label');
if (!div.is(e.target)
&& div.has(e.target).length === 0
&& !checkbox.is(e.target)
&& !label.is(e.target)
) {
checkbox.prop('checked', false);
}
});
// componentName = 'componentA'
<v-data-table>
<template v-slot:expanded-item>
<componentA></componentA>
</template>
</v-data-table>
DATEDIFF(DAY, '2020-03-11T15:12:13', GETDATE()) / 7 = 1
for (let i in users) {
for (let j in views) {
if (users[i].id === views[j].user_id) {
if (users[i].hasOwnProperty('page_views')) {
users[i].page_views += views[j].page_views;
users[i].clicks += views[j].clicks;
}
else {
users[i].page_views = views[j].page_views;
users[i].clicks = views[j].clicks;
}
}
}
}
public function getTreeHtml(Node $node, $level = 1)
.......
if ($node->hasChildren()) {
........
foreach () {
...............
$html .= '</li>';
$counter++;
}
if ($this->escapeUrl($node->getUrl())) {
$html .= sprintf(
'<li class="ammenu-wrapper" %s><a href="%s" title="Show all: %s" class="ammenu-link -level%s">
<span class="ammenu-wrapper">Show all: %s</span>
</a></li>',
$parentDataAttr,
$this->escapeUrl($node->getUrl()),
$this->escapeHtml($node->getName()),
$level,
$this->escapeHtml($node->getName())
);
}
}
}
$(document).on('click', '.clear-input', function() {
$(this).closest('.search').find('.input-class').val('');
});
$(document).on('click', '.radio', function() {
var itog = $('#itog'),
mult = $('#mult'),
$this = $(this),
multiplier = $('#company').find(':selected').val() * $this.data('year');
mult.val(multiplier);
itog.val(multiplier * (1 - $this.data('mult')));
});
<form id="year">
<input class="radio" type="radio" id="radio-1" name="group" data-year="1" data-mult="0"/>
<input class="radio" type="radio" id="radio-2" name="group" data-year="2" data-mult="0.15"/>
<input class="radio" type="radio" id="radio-3" name="group" data-year="3" data-mult="0.2"/>
<div class="company">
<select name="company" id="company">
<option value="1500">1</option>
<option value="5300">до 5</option>
<option value="10100">до 10</option>
<option value="12000">до 25</option>
<option value="17000">до 50</option>
<option value="0">50+</option>
</select>
</div><br>
<input type="label" id="mult" name="789" maxlength="300" readonly><br>
<input type="label" id="itog" name="789" maxlength="300" readonly>
</form>
<?php
$db = mysqli_connect("127.0.0.1", "root", "","main_t");
mysqli_set_charset($db,"utf8");
function getData()
{
$data = [
'cols' => [
[
'id' => '',
'label' => 'Кандидатов',
'type' => 'number'
],
[
'id' => '',
'label' => 'Эффективность',
'type' => 'number'
]
],
'rows' => []
];
$query = "SELECT `stars`,`age` FROM `main_t`";
$res = mysqli_query($db,$query);
while ($row = mysqli_fetch_assoc($res)) {
$data['rows'][] = [
'c' => [
['v' => $row['stars']],
['v' => $row['age']]
]
];
}
return json_encode($data);
}
$data = getData();
echo $data;
?>
SELECT
category_id,
DATEPART(m, date_pub) AS 'month'
COUNT(category_id) AS cat_cnt,
SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) AS status_1_cnt,
SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) AS status_2_cnt,
SUM(CASE WHEN status = 3 THEN 1 ELSE 0 END) AS status_3_cnt,
SUM(CASE WHEN status = 4 THEN 1 ELSE 0 END) AS status_4_cnt,
SUM(CASE WHEN status = 5 THEN 1 ELSE 0 END) AS status_5_cnt,
FROM
zakazy
GROUP BY
category_id,
DATEPART(m, date_pub)
if (isset($_POST["firstname"]) && isset($_POST["lastname"]) && isset($_POST["phone"]) && isset($_POST["email"]) ) {
$result = array(
'firstname' => $_POST["firstname"],
'lastname' => $_POST["lastname"],
'sex' => !empty($_POST["sex"]) ? <признак мужского пола> : <признак женского пола>,
'phone' => $_POST["phone"],
'email' => $_POST["email"]
);
echo json_encode($result);
}
?>
function showMiniCart() {
//показываю мини корзину
var out="", all_count = 0;
for (var key in cart) {
out += key +' --- '+ cart[key]+'';
all_count += cart[key];
}
$('.mini-cart').html(out);
$('<all_count_container>').html(all_count);
}