$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"];
        }
    }
    foreach ($leads_funnel as $lf) {
        $completion = $lf["total_leads"] / $total_leads * 100;
        if ($total_leads <= 0) {
            $completion = 0;
Beispiel #2
0
function translate_lead_progress($progress = 0)
{
    $lead_progress = lead_progress_array();
    if (isset($lead_progress[$progress])) {
        return $lead_progress[$progress];
    } else {
        return __("Other");
    }
}
Beispiel #3
0
	$table_advanced = '<tr>';
	$params = array();
	$params['input_id'] = 'id_company_search';
	$params['input_name'] = 'id_company_search';
	$params['input_value'] = $id_company;
	$params['title'] = __('Managed by');
	$params['return'] = true;
	$table_advanced .= '<td>';
	$table_advanced .= print_company_autocomplete_input($params);
	$table_advanced .= '</td><td>';
	$table_advanced .= combo_kb_products ($id_category, true, 'Product type', true);
	$table_advanced .= '</td>';
	$table_advanced .= "<td rowspan=2 valign=top>".get_last_date_control ($last_date, 'last_date_search', __('Date'), $start_date, 'start_date_search', __('Start date'), $end_date, 'end_date_search', __('End date'));
	$table_advanced .= '</td>';
	$table_advanced .= '<tr><td>';
	$progress_values = lead_progress_array ();
	$table_advanced .= print_select ($progress_values, 'progress_search', $progress, '', __('Any'), 0, true, 0, false, __('Lead progress') );
	$table_advanced .= '</td><td>';
	$table_advanced .= print_select_from_sql ('SELECT id_language, name FROM tlanguage ORDER BY name',
		'id_language', $id_language, '', __('Any'), '', true, false, false, __('Language'));
	$table_advanced .= '<tr>';
	
	$table->data['advanced'][2] = print_container('lead_search_advanced', __('Advanced search'), $table_advanced, 'closed', true, false,'','no_border',3);
	$table->colspan['advanced'][2] = 4;
	// Delete new lines from the string
	$where_clause = str_replace(array("\r", "\n"), '', $where_clause);
	
	$form .= "<div class='divresult_left'>";
		$form .= print_table ($table,true);
	$form .= '</div>';
	$table->data = array ();