$headers[VERIFY_RESULTS_SHOW_CUSTOM_6] = lang_get('show_custom_6');
     }
     $headers[VERIFY_RESULTS_TIMESTAMP] = lang_get('time_tested');
     $headers[VERIFY_RESULTS_WINDOW] = lang_get('window');
     $headers[VERIFY_RESULTS_OBJ] = lang_get('object');
     $headers[VERIFY_RESULTS_LINE_NUMBER] = lang_get('line_no');
     if ($show_memory_stats == 'Y') {
         $headers[VERIFY_RESULTS_TOTAL_PHY_MEM] = lang_get('tot_phy_mem');
         $headers[VERIFY_RESULTS_FREE_PHY_MEM] = lang_get('free_phy_mem');
         $headers[VERIFY_RESULTS_TOTAL_VIR_MEM] = lang_get('tot_vir_mem');
         $headers[VERIFY_RESULTS_FREE_VIR_MEM] = lang_get('free_vir_mem');
         $headers[VERIFY_RESULTS_CUR_MEM_UTIL] = lang_get('cur_mem_util');
         $headers[VERIFY_RESULTS_TOTAL_PAGE_FILE] = lang_get('tot_page_file');
         $headers[VERIFY_RESULTS_FREE_PAGE_FILE] = lang_get('free_page_file');
     }
     $rows = results_get_verify_results_detail($test_run_id);
     /*
     foreach($rows as $key => $val) {
     	print"$key = $val<br>";
     }
     */
     break;
 case "bugs":
     $headers = array(BUG_ID => lang_get('bug_id'), BUG_PRIORITY => lang_get('bug_priority'), BUG_SEVERITY => lang_get('bug_severity'), BUG_STATUS => lang_get('bug_status'), BUG_CATEGORY => lang_get('bug_category'), BUG_REPORTER => lang_get('reported_by'), BUG_ASSIGNED_TO => lang_get('assigned_to'), BUG_ASSIGNED_TO_DEVELOPER => lang_get('assigned_to_developer'), BUG_FOUND_IN_RELEASE => lang_get('found_in_release'), BUG_ASSIGN_TO_RELEASE => lang_get('assigned_to_release'), BUG_DESCRIPTION => lang_get('bug_description'), BUG_SUMMARY => lang_get('bug_summary'));
     $display_options = session_get_display_options("bug");
     # We really should create a seperate function for csv/excel export
     $rows = bug_get($project_id, $page_number = 0, $display_options['order_by'], $display_options['order_dir'], $display_options['filter']['status'], $display_options['filter']['category'], $display_options['filter']['component'], $display_options['filter']['reported_by'], $display_options['filter']['assigned_to'], $display_options['filter']['assigned_to_developer'], $display_options['filter']['found_in_release'], $display_options['filter']['assigned_to_release']);
     break;
 case "test_steps":
     $headers = array(TEST_STEP_NO => lang_get('step_no'), TEST_STEP_ACTION => lang_get('step_action'), TEST_STEP_TEST_INPUTS => lang_get('test_inputs'), TEST_STEP_EXPECTED => lang_get('step_expected'), TEST_STEP_INFO_STEP => lang_get('info_step'));
     $s_test_details = session_get_properties("test");
    //print"Error uploading file. Either the file size = 0 or the file is not a valid file";
    # WE NEED TO PRINT AN ERROR MESSAGE WHEN THIS DOESN'T WORK.
}
# ------------------------------------------------
# TEST SUITE RESULTS
# ------------------------------------------------
results_edit_testsuite_result($test_run_id, $testset_id, $test_id, $test_name, $test_status, $username, $time_started, $time_finished, $comments, $root_cause, $environment, $os);
# PREPARE TO UPDATE THE VERIFY_RESULTS TABLE
$vr_tbl = VERIFY_RESULTS_TBL;
$f_vr_id = VERIFY_RESULTS_ID;
$f_run_id = VERIFY_RESULTS_TS_UNIQUE_RUN_ID;
$f_timestamp = VERIFY_RESULTS_LOG_TIME_STAMP;
$f_actual = VERIFY_RESULTS_ACTUAL_RESULT;
$f_status = VERIFY_RESULTS_TEST_STATUS;
# UPDATE VERIFY_RESULTS
foreach (results_get_verify_results_detail($test_run_id) as $row_test_step) {
    $verify_results_id = $row_test_step[VERIFY_RESULTS_ID];
    $q = "\tUPDATE {$vr_tbl}\n\t\t\tSET\n\t\t\t\t{$f_timestamp} = '{$time_finished}',\n\t\t\t\t{$f_actual} = '" . session_validate_form_get_field("actual_result_{$verify_results_id}") . "',\n\t\t\t\t{$f_status} = '" . session_validate_form_get_field("step_status_{$verify_results_id}") . "'\n\t\t\tWHERE\n\t\t\t\t{$f_run_id} = '{$test_run_id}'\n\t\t\tAND \n\t\t\t\t{$f_vr_id} = '{$verify_results_id}'";
    #print"$q<br>";
    db_query($db, $q);
}
# ------------------------------------------------
# UPDATE TEST RUN STATUS
# ------------------------------------------------
if ($test_status == "Passed") {
    $finished = '1';
} else {
    $finished = '0';
}
#results_update_test_run( $test_run_id, $username, session_validate_form_get_field("test_run_status"), $finished, session_validate_form_get_field("comments"), $root_cause );
results_update_test_result($testset_id, $test_id, $username, $test_status, $root_cause, $finished, $comments);