/** Creates the table with participation data with a specific counter column (no_shows, interruptions) */
 function create_participation_counter_table($participations, $title)
 {
     if (empty($participations)) {
         return lang('no_results_found');
     }
     $CI =& get_instance();
     base_table();
     $CI->table->set_heading(lang('participant'), lang('participations'), $title, lang('percentage'), lang('actions'));
     foreach ($participations as $pp) {
         $participant = $CI->participantModel->get_participant_by_id($pp->participant_id);
         $p_link = participant_get_link($participant);
         $act_link = participant_activate_link($participant);
         $CI->table->add_row($p_link, $pp->count, $pp->count_column, round($pp->count_column / $pp->count * 100, 2) . '%', $act_link);
     }
     return $CI->table->generate();
 }
</td>
				</tr>
			</table>
		</div>
		<div class="pure-u-2-5">
			<?php 
if (!$participant->activated) {
    $reason = $participant->deactivated_reason;
    $new = $reason == DeactivateReason::NewParticipant;
    $class = $new ? 'warning' : 'info';
    echo '<div class="' . $class . '"';
    echo "<p>" . lang('p_not_yet_active') . "</p>";
    echo "<p>" . lang('reason') . br();
    echo lang('reason_' . $reason) . ' (' . output_datetime($participant->deactivated) . ")</p>";
    if ($new) {
        echo participant_activate_link($participant, lang('activate'));
    }
    echo "</div>";
}
?>
		</div>
	</div>

	<!-- Contact details -->
	<?php 
echo heading(lang('contact_details'), 3);
?>
	<div>
		<table class="pure-table">
			<tr>
				<th><?php 
 /** Possible actions for a participant: edit, activate, comments, scores */
 function participant_actions($participant_id)
 {
     $CI =& get_instance();
     $pp = $CI->participantModel->get_participant_by_id($participant_id);
     $edit_link = anchor('participant/edit/' . $participant_id, img_edit());
     $act_link = participant_activate_link($pp);
     $nr_comments = count($CI->commentModel->get_comments_by_participant($participant_id));
     $com_link = $nr_comments > 0 ? anchor('comment/participant/' . $participant_id, img_comments($nr_comments)) : img_comments();
     $nr_scores = count($CI->scoreModel->get_scores_by_participant($participant_id));
     $score_link = $nr_scores > 0 ? anchor('score/participant/' . $participant_id, img_scores()) : img_scores(TRUE);
     return is_admin() ? implode(' ', array($edit_link, $act_link, $com_link, $score_link)) : implode(' ', array($edit_link, $com_link));
 }