File inc/admin.inc.php changed (mode: 100644) (index 87c2bf2..76e750f) |
... |
... |
function rg_admin_report1($db, $rg) |
349 |
349 |
'apikeys' => 'api keys', |
'apikeys' => 'api keys', |
350 |
350 |
'workers' => 'workers'); |
'workers' => 'workers'); |
351 |
351 |
$total_yesterday_changes = 0; |
$total_yesterday_changes = 0; |
|
352 |
|
$body .= "\n" . 'Yesterday' . "\t" . 'Total' . "\t" . 'Category' . "\n"; |
352 |
353 |
foreach ($list as $table => $text) { |
foreach ($list as $table => $text) { |
353 |
354 |
// Yesterday |
// Yesterday |
354 |
355 |
$sql = "SELECT COUNT(*) AS count FROM " . $table |
$sql = "SELECT COUNT(*) AS count FROM " . $table |
|
... |
... |
function rg_admin_report1($db, $rg) |
375 |
376 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
376 |
377 |
} |
} |
377 |
378 |
|
|
378 |
|
$body .= "\n" . $yesterday . "\t" . $total |
|
379 |
|
. "\t" . "yesterday / total " . $text; |
|
|
379 |
|
$body .= $yesterday . "\t" . $total . "\t" . $text . "\n"; |
380 |
380 |
} |
} |
381 |
|
$body .= "\n"; |
|
382 |
381 |
|
|
|
382 |
|
$body .= "\nYesterday users:"; |
383 |
383 |
$sql = 'SELECT username, realname, email FROM users' |
$sql = 'SELECT username, realname, email FROM users' |
384 |
384 |
. ' WHERE itime >= ' . $y_start |
. ' WHERE itime >= ' . $y_start |
385 |
385 |
. ' AND itime <= ' . $y_end; |
. ' AND itime <= ' . $y_end; |
386 |
386 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
387 |
387 |
if ($res === FALSE) { |
if ($res === FALSE) { |
388 |
|
$users = "ERR"; |
|
|
388 |
|
$body .= ' ERR' . "\n"; |
389 |
389 |
} else { |
} else { |
390 |
|
$users = 0; |
|
391 |
|
$list = ''; |
|
|
390 |
|
$body .= "\n"; |
392 |
391 |
while (($row = rg_sql_fetch_array($res))) { |
while (($row = rg_sql_fetch_array($res))) { |
393 |
|
$users++; |
|
394 |
|
$list .= "\t" . $row['username'] |
|
395 |
|
. "\t" . $row['realname'] |
|
396 |
|
. "\t" . $row['email'] |
|
|
392 |
|
$body .= ' ' . $row['username'] |
|
393 |
|
. ' - ' . $row['realname'] |
|
394 |
|
. ' - ' . $row['email'] |
397 |
395 |
. "\n"; |
. "\n"; |
398 |
396 |
} |
} |
399 |
|
if ($users) |
|
400 |
|
$body .= "\nYesterday users (" . $users . "):\n" |
|
401 |
|
. $list; |
|
402 |
397 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
403 |
398 |
} |
} |
404 |
399 |
|
|
405 |
|
$sql = "SELECT name, description, public FROM repos" |
|
406 |
|
. " WHERE itime >= $y_start" |
|
407 |
|
. " AND itime <= $y_end"; |
|
|
400 |
|
$body .= "\nYesterday repos:"; |
|
401 |
|
$sql = 'SELECT name, uid, description, public FROM repos' |
|
402 |
|
. ' WHERE itime >= ' . $y_start |
|
403 |
|
. ' AND itime <= ' . $y_end; |
408 |
404 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
409 |
405 |
if ($res === FALSE) { |
if ($res === FALSE) { |
410 |
|
$repos = "ERR"; |
|
|
406 |
|
$body .= ' ERR' . "\n"; |
411 |
407 |
} else { |
} else { |
412 |
|
$repos = 0; |
|
413 |
|
$list = ''; |
|
|
408 |
|
$body .= "\n"; |
414 |
409 |
while (($row = rg_sql_fetch_array($res))) { |
while (($row = rg_sql_fetch_array($res))) { |
415 |
|
$repos++; |
|
416 |
|
$desc = substr($row['description'], 0, 50) . '...'; |
|
|
410 |
|
$u = rg_user_nice($db, $row['uid']); |
|
411 |
|
$desc = mb_substr($row['description'], 0, 50) . '...'; |
417 |
412 |
$desc = preg_replace('/\s/', ' ', $desc); |
$desc = preg_replace('/\s/', ' ', $desc); |
418 |
|
$list .= "\t" . $row['name'] . " - " . $desc |
|
|
413 |
|
$body .= ' ' . $row['name'] . ' - ' . $u . ' - ' . $desc |
419 |
414 |
. ($row['public'] == 1 ? " (public)" : " (private)") . "\n"; |
. ($row['public'] == 1 ? " (public)" : " (private)") . "\n"; |
420 |
415 |
} |
} |
421 |
|
if ($repos) |
|
422 |
|
$body .= "\nYesterday repos (" . $repos . "):\n" . $list; |
|
423 |
416 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
424 |
417 |
} |
} |
425 |
418 |
|
|