<?php
define('SQL_WEBRAD_ACT_SUM', "SELECT SUM(sk_actions.billing_minus), SUM(sk_actions.time_on), SUM(sk_actions.in_bytes), SUM(sk_actions.out_bytes), datetime('%%m', sk_actions.start_time) FROM %s WHERE datetime('%%Y', sk_actions.start_time)=datetime('%%Y', 'now') AND (TRUE) %s GROUP BY datetime('%%m', sk_actions.start_time)"); define('SQL_WEBRAD_USR_RES', "SELECT
		(SELECT COUNT(*) FROM %s WHERE sk_users.blocked='0' AND (sk_users.activated='0' OR sk_users.last_connection = '1970-01-01') %s) AS not_used,
		(SELECT COUNT(*) FROM %s WHERE sk_users.blocked='0' AND sk_users.activated='1' AND sk_users.last_connection != '1970-01-01' AND (sk_users.deposit > 0 AND (sk_users.expired ='1970-01-01 00:00' OR datetime('%%s', sk_users.expired)>datetime('%%s', 'now'))) %s) AS active,
		(SELECT COUNT(*) FROM %s WHERE sk_users.blocked='0' AND sk_users.activated='1' AND (sk_users.deposit <= 0 OR (sk_users.expired!='1970-01-01 00:00' AND datetime('%%s', sk_users.expired)<=datetime('%%s', 'now'))) %s) AS used,
		(SELECT COUNT(*) FROM %s WHERE sk_users.blocked='1' %s) AS locked,
		COUNT(*) AS total FROM %s WHERE (TRUE) %s"); ?>
