Skip to content
Snippets Groups Projects
Commit 97d1dce0 authored by Florian Schaal's avatar Florian Schaal
Browse files

Send emails to active customers and resellers only. - #5216

parent 665f4a35
No related branches found
No related tags found
No related merge requests found
...@@ -71,18 +71,18 @@ if(isset($_POST) && count($_POST) > 1) { ...@@ -71,18 +71,18 @@ if(isset($_POST) && count($_POST) > 1) {
$where[] = 'client_id = '.$app->functions->intval($tmp_client_id); $where[] = 'client_id = '.$app->functions->intval($tmp_client_id);
} }
if(!empty($where)) $where_clause = ' AND ('.implode(' OR ', $where).')'; if(!empty($where)) $where_clause = ' AND ('.implode(' OR ', $where).')';
$sql = "SELECT * FROM client WHERE email != ''".$where_clause; $sql = "SELECT * FROM client WHERE canceled != 'y' AND email != ''".$where_clause;
} else { } else {
$sql = "SELECT * FROM client WHERE 0"; $sql = "SELECT * FROM client WHERE canceled != 'y'";
} }
} else { } else {
//* Select all clients and resellers //* Select all clients and resellers
if($_SESSION["s"]["user"]["typ"] == 'admin'){ if($_SESSION["s"]["user"]["typ"] == 'admin'){
$sql = "SELECT * FROM client WHERE email != ''"; $sql = "SELECT * FROM client WHERE email != '' AND canceled != 'y'";
} else { } else {
$client_id = $app->functions->intval($_SESSION['s']['user']['client_id']); $client_id = $app->functions->intval($_SESSION['s']['user']['client_id']);
if($client_id == 0) die('Invalid Client ID.'); if($client_id == 0) die('Invalid Client ID.');
$sql = "SELECT * FROM client WHERE email != '' AND parent_client_id = '$client_id'"; $sql = "SELECT * FROM client WHERE email != '' AND canceled != 'y' AND parent_client_id = '$client_id'";
} }
} }
......
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