Exemplo n.º 1
0
 function widget($args, $instance)
 {
     extract($args);
     echo $before_widget;
     echo $before_title . 'Original Point of Contact' . $after_title;
     echo '<ul>';
     global $total;
     $categories = get_categories('taxonomy=poc&orderby=count&order=DESC');
     foreach ($categories as $category) {
         echo '<li>' . $category->name . ': ' . crm_percent($category->count, $total) . ' 	</li>';
     }
     echo '</ul>';
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     echo $before_widget;
     echo $before_title . 'Source of Inquiry' . $after_title;
     echo '<ul>';
     global $total;
     $sources = get_categories('taxonomy=sources&orderby=count&order=DESC');
     foreach ($sources as $source) {
         echo '<li>' . $source->name . ': ' . crm_percent($source->count, $total) . '</li>';
     }
     echo '</ul>';
     echo $after_widget;
 }
 function widget($args, $instance)
 {
     extract($args);
     echo $before_widget;
     echo $before_title . 'Result of Inquiry' . $after_title;
     global $project_result;
     if (!empty($project_result)) {
         echo '<ul>';
         $project_result_count = array_count_values($project_result);
         $total_project_result = count($project_result);
         foreach ($project_result_count as $key => $value) {
             echo '<li>' . $key . ': ' . crm_percent($value, $total_project_result) . '</li>';
         }
         echo '</ul>';
     }
     echo $after_widget;
 }
Exemplo n.º 4
0
 function widget($args, $instance)
 {
     extract($args);
     echo $before_widget;
     echo $before_title . 'Reason for Forwarding Away' . $after_title;
     global $forwarded_away;
     if (!empty($forwarded_away)) {
         echo '<ul>';
         $forwarded_away_count = array_count_values($forwarded_away);
         $forwarded_away_total = count($forwarded_away);
         foreach ($forwarded_away_count as $key => $value) {
             echo '<li>' . $key . ': ' . crm_percent($value, $forwarded_away_total) . '</li>';
         }
         echo '</ul>';
     }
     echo $after_widget;
 }