<?php 
if (!defined('NTLCMS')) die('<center><b>Restricted access</b></center>');			
$sql = DB :: run() -> query("select * from `users` where `click_day` <> '0' and `id` <> '0' order by `click_day` desc");
$readsstat = DB :: run() -> querySingle("select count(`id`) from `users` where `click_day` <> '0' and `id` <> '0' order by `click_day` desc");			
if ($readsstat != 0){
while ($ready = $sql -> fetch(PDO::FETCH_OBJ)){
DB :: run() -> query("insert into `clickdb` (`d`, `m`, `Y`, `login`, `clicks`) values (?, ?, ?, ?, ?)", array(date('d', time() - 86400), date('m', time() - 86400), date('Y', time() - 86400), $ready -> login, $ready -> click_day));
}
}
?>