webui: Added toner support in health metrics list (#7595)

This commit is contained in:
Neil Lathwood
2017-10-31 20:31:56 +00:00
committed by GitHub
parent 087dbbd173
commit f00e896e93
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?php
if (is_admin() || is_read()) {
$data['count'] = array('query' => "SELECT COUNT(`toner_id`) FROM toner");
} else {
$data['count'] = array(
'query' => "SELECT COUNT(`toner_id`) FROM toner AS T, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND T.`device_id` = D.`device_id`",
'params' => array($_SESSION['user_id']),
);
}