|
$i = 1;
$days = ($time_finish - $time_start) / 86400;
while ($i <= $days) {
$dt = $time_start + (86400 * ($i - 1));
if ($dt < time()) {
$lim = mysql_fetch_array(
mysql_query(
'SELECT COUNT(*) FROM `balance_money` WHERE `time` >= ' . $dt . '' . $noobs . ' AND `time` < ' . ($dt + 86400) . ''
)
);
$lim = $lim[0];
$mst = mysql_fetch_array(
mysql_query(
'SELECT `money`,`balance` FROM `balance_money` WHERE `time` < ' . $dt . '' . $noobs . ' AND `cancel` = "0" ORDER BY `id` DESC LIMIT 1'
)
);
$mst = $mst['balance'];
$mft = mysql_fetch_array(
mysql_query(
'SELECT `money`,`balance` FROM `balance_money` WHERE `time` >= ' . $dt . '' . $noobs . ' AND `time` < ' . ($dt + 86400) . ' AND `cancel` = "0" ORDER BY `id` DESC LIMIT 1'
)
);
$mft = $mft['balance'];
?>
Дата: = date('d.m.Y', $dt); ?>, Операций за этот
день: = $lim; ?>, средств в начале дня: = number_format($mst, 0, ",", " "); ?>
RUB, средств в конце дня: = number_format($mft, 0, ",", " "); ?> RUB
$sp = mysql_query(
'SELECT * FROM `balance_money` WHERE `time` >= ' . $dt . '' . $noobs . ' AND `time` < ' . ($dt + 86400) . ' ORDER BY `time` ASC LIMIT ' . $lim
);
while ($pl = mysql_fetch_array($sp)) {
if ($pl['money'] > 0 && $pl['cancel'] == 0) {
?>
= date(
'd.m.Y H:i:s', $pl['time']
); ?> |
= number_format(
$pl['money'], 0, ",", " "
); ?> RUB
|
Остаток: = number_format(
$pl['balance'], 0, ",", " "
); ?> RUB
|
if ($pl['cancel'] == 0) {
echo 'Открепить';
} else {
echo 'Прикрепить';
} ?> |
|
|
} else { ?>
|
= date(
'd.m.Y H:i:s', $pl['time']
); ?> |
= number_format(
$pl['money'], 0, ",", " "
); ?> RUB
|
Остаток: = number_format(
$pl['balance'], 0, ",", " "
); ?> RUB
|
if ($pl['cancel'] == 0) {
echo 'Открепить';
} else {
echo 'Прикрепить';
} ?> |
|
}
} ?>
}
$i++;
} ?>
if ($mm == date('m')) { ?>
} ?>
time :: = time(); ?>
|