//if dropdown value is All then use the below foreach othewise just put the user_id in array based on dropdown
$usersarray=array();
foreach($supervisoras$users){
$usersarray[]=$users->id;
}
//print_r($usersarray);
$totalIncome=DB::select("select sum(income) as income from output_report where user_id IN (".implode(',',$usersarray).")");
$Contacts=DB::select("select sum(call_attempts) as call_attempts, sum(call_contacts) as call_contacts, sum(call_unique_contacts) as unique_contacts from output_report where user_id IN (".implode(',',$usersarray).") group by product_id limit 1; ");
$report=DB::select("SELECT product_id,product_name, SUM(lead_generated) as totallead, SUM(lead_generated_amount) as totalleadamt, SUM(lead_closed) as totalleadclosed, Sum(lead_closed_amount) as leadcloseamt FROM `output_report` where user_id in (".implode(',',$usersarray).") group by product_id");