$where_clause .= sprintf(' AND id IN (%s) ', implode(',', $lead_ids)); } else { $where_clause .= ' AND id IN (-1) '; } } $where_clause .= ")"; $table->class = 'blank'; $table->width = '99%'; $table->data = array(); $table->style = array(); $table->valign = array(); $table->colsapan = array(); $table->valign[0] = "top"; $table->valign[1] = "top"; //FUNNEL $leads_funnel = crm_get_total_leads_funnel($where_clause); if ($read && $enterprise) { $leads_funnel = crm_get_user_leads($config['id_user'], $leads_funnel); } if ($leads_funnel != false) { $data = array(); $lead_progress = lead_progress_array(); $total_leads = count($total_leads_array); foreach ($lead_progress as $key => $name) { $data[$key] = array("title" => $name, "completion" => 0); } //Calculate total number of leads $total_leads = 0; foreach ($leads_funnel as $lf) { if ($lf["progress"] < 100 || $lf["progress"] == 200) { $total_leads = $total_leads + $lf["total_leads"];
$campaign = get_db_row("tcampaign", "id", $id); echo '<div class="under_tabs_info">' . __("Campaign") . ': ' . $campaign["title"] . '</div>'; $table->class = 'blank'; $table->width = '99%'; $table->data = array(); $table->style = array(); $table->valign = array(); $table->colspan = array(); $table->colsapan = array(); $table->valign[0] = "top"; $table->valign[1] = "top"; $table->size = array(); $table->size[0] = "50%"; $table->size[1] = "50%"; //Calculate leads funnel data $leads_funnel = crm_get_total_leads_funnel("WHERE id_campaign = " . $id); if ($read && $enterprise) { $leads_funnel = crm_get_user_leads($config['id_user'], $leads_funnel); } if ($leads_funnel != false) { $data = array(); $lead_progress = lead_progress_array(); $total_leads = count($total_leads_array); foreach ($lead_progress as $key => $name) { $data[$key] = array("title" => $name, "completion" => 0); } //Calculate total number of leads $total_leads = 0; foreach ($leads_funnel as $lf) { if ($lf["progress"] < 100 || $lf["progress"] == 200) { $total_leads = $total_leads + $lf["total_leads"];