DATEDIFF(DAY, '2020-03-11T15:12:13', GETDATE()) / 7 = 1
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())
);
}
}
}
<?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);
}
?>