$splitid = $listids[$i]; // get the array of stats data $stats = $stats_api->GetStats(array($splitid), $sortdetails, false, $page_number, $perpage, $displayAll, $jobid); foreach ($stats as $stats_id => $stats_details) { $stats[$stats_id]['splitname'] = htmlspecialchars($stats_details['splitname'], ENT_QUOTES, SENDSTUDIO_CHARSET); $stats[$stats_id]['campaign_names'] = htmlspecialchars($stats_details['campaign_names'], ENT_QUOTES, SENDSTUDIO_CHARSET); $stats[$stats_id]['list_names'] = htmlspecialchars($stats_details['list_names'], ENT_QUOTES, SENDSTUDIO_CHARSET); } // A Splittest can be sent multiple times hence we might have multiple campaign record sets here while (list($id, $data) = each($stats)) { $charts = $this->generateCharts($data['splitname'], $data['campaigns'], $subaction); foreach ($charts as $type => $data) { $stats[$id][$type] = $data; } } $statistics[] = $stats; } $template = GetTemplateSystem(dirname(__FILE__) . '/templates'); $template->Assign('DateFormat', $dateFromat); $template->Assign('statsData', $statistics); $template->Assign('subaction', $subaction); $options = $this->_getGETRequest('options', null); for ($i = 0; $i < count($options); $i++) { $template->Assign($options[$i], $options[$i]); } $template->ParseTemplate('Stats_Summary_Splittest'); } } $PrintStats = new PrintStats(); $PrintStats->printPage();