$summary_form = new ReportSummaryForm();
$summary_form->setDetails(array($user_row['user_pref_group_1'], $user_row['user_pref_group_2'], $user_row['user_pref_group_3'], $user_row['user_pref_group_4']));
$summary_form->setDetailsSort(array(ReportBasicForm::SORT_NAME));
$summary_form->setDisplayType(array(ReportBasicForm::DISPLAY_TYPE_TABLE));
$summary_form->setStartTime($mysql['from']);
$summary_form->setEndTime($mysql['to']);
$mysql['user_id'] = $db->real_escape_string($_SESSION['user_id']);
$info_result = _mysqli_query($summary_form->getQuery($mysql['user_id'], $user_row));
while ($row = $info_result->fetch_assoc()) {
    $summary_form->addReportData($row);
}
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"GroupOverviewReport" . date("mdy") . ".csv\"");
header("Expires: 0");
header("Pragma: no-cache");
ReportBasicForm::echoCell("Group Overview Report for " . date("m/d/Y", strtotime($summary_form->getStartDate())) . " to " . date("m/d/Y", strtotime($summary_form->getEndDate())));
ReportBasicForm::echoRow();
ReportBasicForm::echoCell($summary_form->getRanOn());
ReportBasicForm::echoRow();
ReportBasicForm::echoRow();
if (count($summary_form->getReportData()->getChildArrayBySort()) > 0) {
    $summary_form->getExportRowHeaderHtml();
    /* @var $summary_form_detail_1 Form */
    foreach ($summary_form->getReportData()->getChildArrayBySort() as $summary_form_detail_1) {
        if (count($summary_form_detail_1->getChildArrayBySort()) > 0) {
            /* @var $summary_form_detail_2 Form */
            foreach ($summary_form_detail_1->getChildArrayBySort() as $key => $summary_form_detail_2) {
                if (count($summary_form_detail_2->getChildArrayBySort()) > 0) {
                    /* @var $summary_form_detail_3 Form */
                    foreach ($summary_form_detail_2->getChildArrayBySort() as $summary_form_detail_3) {
                        if (count($summary_form_detail_3->getChildArrayBySort()) > 0) {