var ysums=[123,456,789];
function Sum(ysums) {
for(var i=0;i<ysums.length;i++){
$('.y_sums h1 span').eq(i).text(ysums[i]);
}
}
Sum(ysums);
SELECT T1.tel_id, T1.sum1, T2.sum2
FROM
(SELECT tel_id, sum(money) AS sum1
FROM accounts
WHERE date >= CURDATE() AND tel_id = 1234 AND type = 1 AND status = 1
) T1,
(SELECT tel_id, sum(money) AS sum2
FROM accounts
WHERE date >= CURDATE() AND tel_id IN (1542, 6624, 2524) AND type = 1 AND status = 1
) T2
WHERE T2.tel_id = T1.tel_id
SELECT sum(money) FROM `accounts` WHERE date >= CURDATE() AND tel_id IN (1234, 1888, 1666) AND type = 1 AND status = 1
SELECT id, sum(money)
FROM `accounts`
WHERE date >= CURDATE() AND type = 1 AND status = 1
GROUP BY id
$time = '24-05-16';
$count_day = 2;
$sec_in_one_day = 60 * 60 * 24;
if (function_exists('strtotime'))
{
$timestamp = strtotime($time);
}
else
{
$a = strptime($time, '%d.%m.%Y');
$timestamp = mktime($a['tm_hour'], $a['tm_min'], $a['tm_sec'], $a['tm_mon']+1, $a['tm_mday'], $a['tm_year']+1900);
}
$timestamp_end = $timestamp + $count_day * $sec_in_one_day;
for ($i = $timestamp; $i <= $timestamp_end; $i++) {
echo date('d-m-y | h:i:s', $i), '<br>';
}
<?php
$interval = new DateInterval('PT1S');
$start = new Datetime('2016-05-24 00:00:01');
$period = new DatePeriod($start, $interval, 3 * 24 * 60 * 60);
foreach ($period as $date) {
echo $date->format('d-m-y | H:i:s') . PHP_EOL;
}
<?php
$interval = new DateInterval('P1D');
$start = new Datetime('2016-05-24');
$period = new DatePeriod($start, $interval, 3);
foreach ($period as $date) {
$day = $date->format('d-m-y');
for ($H = 0; $H < 24; $H++) {
for ($i = 0; $i < 60; $i++) {
for ($s = 0; $s < 60; $s++) {
echo sprintf('%s | %02d:%02d:%02d', $day, $H, $i, $s) . PHP_EOL;
}
}
}
}
Jekyll был первым генератором статических сайтов, представившим концепцию “вводной части” — способа добавления метаданных в шаблоны или файлы markdown. Вводная состоит из небольшого количества данных в формате YAML в начале каждого файла, отделенных тремя дефисами (---) с конца и с начала:
---
title: A blog post
date: 2014-09-01
tags: ["meta", "yaml"]
---
# Blogpost with meta data
This is a short example of a Markdown document with meta data as front matter.