Skip to content
Snippets Groups Projects
Commit 78e231a6 authored by Dominik's avatar Dominik
Browse files

combined sql-queries

parent b4547961
No related branches found
No related tags found
No related merge requests found
...@@ -14,12 +14,7 @@ class quota_lib { ...@@ -14,12 +14,7 @@ class quota_lib {
//print_r($monitor_data); //print_r($monitor_data);
// select all websites or websites belonging to client // select all websites or websites belonging to client
if($clientid != null){ $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".(($clientid != null)?" AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)":''), $app->functions->intval($client_id));
$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost' AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)", $app->functions->intval($client_id));
}
else {
$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'");
}
//print_r($sites); //print_r($sites);
if(is_array($sites) && !empty($sites)){ if(is_array($sites) && !empty($sites)){
...@@ -114,12 +109,7 @@ class quota_lib { ...@@ -114,12 +109,7 @@ class quota_lib {
//print_r($monitor_data); //print_r($monitor_data);
// select all email accounts or email accounts belonging to client // select all email accounts or email accounts belonging to client
if($clientid != null){ $emails = $app->db->queryAllRecords("SELECT * FROM mail_user".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : ''), $app->functions->intval($client_id));
$emails = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)", $app->functions->intval($client_id));
}
else {
$emails = $app->db->queryAllRecords("SELECT * FROM mail_user");
}
//print_r($emails); //print_r($emails);
if(is_array($emails) && !empty($emails)){ if(is_array($emails) && !empty($emails)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment