session_start();
require_once('../Connections/connection.php');
include_once('../include/header_functions.php');
include_once('report_functions.php');
include_once('../include/functions.php');
$recipient_name = get_person_name($recipient_id);
show_header("Export Data for $recipient_name");
show_job_header();
$num_questions = count_questions();
// get all question texts out of the database
$question_texts = get_question_texts();
//Returns an array in the form array[respondent_id][question_number] = score
$scores = get_scores($recipient_id, $num_questions);
//var_dump($scores);
$num_respondents = get_num_respondents($recipient_id);
//echo "num_respondents = $num_respondents
";
$respondent_names = get_respondent_names($recipient_id);
$respondent_ids = get_respondent_ids($recipient_id);
$respondent_types = get_respondent_types($recipient_id);
$self_scores = get_self_scores($recipient_id);
$others_scores = get_others_scores($recipient_id);
$boss_scores = get_boss_scores($recipient_id);
$peers_scores = get_peers_scores($recipient_id);
$dr_scores = get_dr_scores($recipient_id);
echo"
| SELF | ALL OTHERS | boss | peers | dr | "; // generate types of respondents to put in cells on this first row for ($i=0; $i<$num_respondents; $i++){ $respondent_id = $respondent_ids[$i]; echo "$respondent_types[$i] | "; } echo"|
| $i. $q_text | $self_score% | $others_score% | $boss_score% | $peers_score% | $dr_score% | "; for ($j=0; $j<$num_respondents; $j++){ $respondent_id = $respondent_ids[$j]; $score = $scores[$respondent_id][$i]; if ($score == ""){ $score = "NULL"; } echo"$score | "; } echo"