/** 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(); }
/** Creates the table with score data, but only totals (for root test categories) */ function create_total_score_table($testcats, $testinvites) { $CI =& get_instance(); base_table(); $CI->table->set_heading(lang('participant'), lang('score'), lang('date'), lang('age'), lang('percentile'), lang('language_age'), lang('actions')); foreach ($testcats as $tc) { foreach ($testinvites as $ti) { $score = $CI->testCatModel->total_score($tc->id, $ti->id); $t = $CI->testCatModel->get_test_by_testcat($tc); if ($score->score > 0) { $p = $CI->testInviteModel->get_participant_by_testinvite($ti); $score_age = age_in_months($p, $score->date); $p_link = participant_get_link($p); $percentile = $CI->percentileModel->find_percentile($tc->id, $p->gender, $score_age, $score->score); $language_age = $CI->percentileModel->find_50percentile_age($tc->id, $p->gender, $score->score); $edit_link = anchor('score/edit_all/' . $t->id . '/' . $p->id, img_edit()); $actions = implode(' ', array($edit_link)); $CI->table->add_row($p_link, $score->score, output_date($score->date), $score_age, $percentile, $language_age, $actions); } } } return $CI->table->generate(); }
?> </p> <?php } ?> <!-- Participation info --> <div> <table class="pure-table"> <tr> <th><?php echo lang('participant'); ?> </th> <td><?php echo is_leader() ? $participant->firstname : participant_get_link($participant); ?> </td> </tr> <tr> <th><?php echo lang('parent'); ?> </th> <td><?php echo is_leader() ? $participant->parentfirstname : parent_name($participant); ?> </td> </tr> <tr> <th><?php
/** Returns the get link for a participant */ function participant_get_link_by_id($participant_id) { $CI =& get_instance(); $participant = $CI->participantModel->get_participant_by_id($participant_id); return participant_get_link($participant); }
/** * Generates HTML Output for the calender tooltip * @param Participation $participation ID * @param Participant $participant * @param Experiment $experiment */ private function generate_tooltip($participation, $participant, $experiment) { $exp_link = lang('experiment') . ': '; $exp_link .= experiment_get_link($experiment); $exp_link .= br(); $part_link = lang('participant') . ': '; $part_link .= participant_get_link($participant); $part_link .= br(); $loc_link = lang('location') . ': '; $loc_link .= location_get_link_by_id($experiment->location_id); $loc_link .= br(); $user_link = ''; if ($participation->user_id_leader) { $user_link .= lang('leader') . ': '; $user_link .= user_get_link_by_id($participation->user_id_leader); $user_link .= br(); } $comment = ''; if ($participation->calendar_comment) { $comment .= lang('comment') . ': '; $comment .= $participation->calendar_comment; $comment .= br(); } // Show actions only if user the leader of this participation (or if user is admin/caller) $current_user_is_leader = is_leader() && $participation->user_id_leader != current_user_id(); $participation_actions = $current_user_is_leader ? '' : '<center>' . participation_actions($participation->id) . '</center>'; return addslashes($exp_link . $part_link . $loc_link . $user_link . $comment . $participation_actions); }