info['admin'] != 1 && !isset($_COOKIE['adminionself']) ) { die('balance.php'); } if($u->info['admin']<1 && !isset($_COOKIE['adminionself'])) { header('location: https://new-combats.com/'); die(); } $noobs = ''; /* if(!isset($_GET['noob']) || isset($_POST['money'])) { $noobs = ' AND `time` < 1443155244 '; } */ if(isset($_GET['all'])) { $data = array( ); //по дням с самого начала $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


'; } $summ = 0; $mn = date('m',$i); } echo ''; // $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 '
 

Дней: '.$j.' , сумма: '.$sum.' RUB
Среднее в день: '.round($sum/$j,2).' RUB
Среднее в месяц: '.round($sum/$j*30,2).' RUB
За сегодня: '.$today.' RUB'; die(); } if(isset($_POST['money'])) { $balance = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0'.$noobs.'')); $balance = $balance[0]+(int)$_POST['money']; mysql_query('INSERT INTO `balance_money` (`time`,`ip`,`money`,`comment2`,`balance`) VALUES ("'.time().'","'.$u->info['ip'].'","'.((int)$_POST['money']).'","'.mysql_real_escape_string($_POST['text']).'","'.$balance.'")'); }elseif(isset($_GET['cancel'])) { mysql_query('UPDATE `balance_money` SET `cancel` = "'.$u->info['id'].'" WHERE `id` = "'.((int)$_GET['cancel']).'" LIMIT 1'); }elseif(isset($_GET['recancel'])) { mysql_query('UPDATE `balance_money` SET `cancel` = "0" WHERE `id` = "'.((int)$_GET['recancel']).'" LIMIT 1'); } $mm = date('m'); $yy = date('Y'); if(isset($_GET['mm'])) { $mm = $_GET['mm'];//strtotime } $mf = array( '01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December' ); $mf2 = array( '12' => 'January', '01' => 'February', '02' => 'March', '03' => 'April', '04' => 'May', '05' => 'June', '06' => 'July', '07' => 'August', '08' => 'September', '09' => 'October', '10' => 'November', '11' => 'December' ); if(!isset($mf[$mm])) { $mm = date('m'); } $yy2 = $yy; if($mm=='12') { $yy2++; } $time_start = strtotime("1 ".$mf[$mm]." ".$yy.""); $time_finish = strtotime("1 ".$mf2[$mm]." ".$yy2.""); $balance = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0'.$noobs.'')); $balance = $balance[0]; $plus = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `balance_money` WHERE `cancel` = 0'.$noobs.' AND `time` >= '.$time_start.' AND `time` < '.$time_finish.' AND `cancel` = "0"')); $plus = $plus[0]; ?> Отчетность проекта
Период отчетности: , года. Доступные средства: RUB | Прибыль за этот месяц: RUB | Дата генерации отчета:
= '.$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']; ?>
Дата: , Операций за этот день: , средств в начале дня: RUB, средств в конце дня: 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) { ?>
RUB Остаток: RUB Открепить'; }else{ echo 'Прикрепить'; } ?>
 
 
RUB Остаток: RUB Открепить'; }else{ echo 'Прикрепить'; } ?>



Сумма: RUB

Комментарий (500 символов максимум):




time ::