info['admin'] != 1 && !isset($_COOKIE['adminionself'])) { die('balance.php'); } if ($u->info['admin'] < 1 && !isset($_COOKIE['adminionself'])) { header('location: /'); die(); } $noobs = ''; if (isset($_GET['all'])) { $data = [ ]; //по дням с самого начала $sp = mysql_query('SELECT * FROM `balance_money` WHERE `money` > 0' . $noobs . ' ORDER BY `id` ASC'); $max = 0; // $starttime = mysql_fetch_array(mysql_query('SELECT `time` FROM `balance_money` ORDER BY `id` ASC LIMIT 1')); if (isset($starttime['time'])) { $starttime = $starttime['time']; } else { $starttime = time(); } // while ($pl = mysql_fetch_array($sp)) { if ($starttime == 0) { $starttime = $pl['time'] - 50700; } $data[date('d.m.Y', $pl['time'])] += $pl['money']; if ($max < $pl['money']) { $max = $pl['money']; } } echo ''; echo '
'; $i = $starttime; $j = 0; $mn = 0; while ($i <= time()) { // $nl = 0; if ($data[date('d.m.Y', $i)] == 0) { $nl = 1; } if ($mn != date('m', $i) || date('d.m.Y') == date('d.m.Y', $i)) { if ($mn != 0) { echo ' | ' . $summ . ' RUB |
'; // $i += 86400; $sum += round(($data[date('d.m.Y', $i)]), 2); $summ += round(($data[date('d.m.Y', $i)]), 2); $today = round(($data[date('d.m.Y', $i)]), 2); $j++; } // // | // echo ' |
= ' . $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
= ' . $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) {
?>
time :: = time(); ?> |