get_full_list("", "leads.id in ('".implode("','",$ids)."')"); foreach ($leads as $lead){ $lead->mark_deleted($lead->id); $r=$db->query("select * from leads_contactleads where lead_id='".$lead->id."'"); while($dane=$db->fetchByAssoc($r)){ $db->query("delete from contactleads where id='".$dane['contactlead_id']."'"); $db->query("delete from leads_contactleads where id='".$dane['id']."'"); } } header("Location: index.php?module=Leads&action=index"); } ?>