Example #1
0
        $path = $this->_getGETRequest('path', '');
        SendStudio_Functions::LoadLanguageFile('stats');
        $stats_api = $this->GetApi('Splittest_Stats');
        $bg_color = 'white';
        $print_options = '<input type="hidden" name="statstype" value="' . htmlentities($statstype, ENT_QUOTES, SENDSTUDIO_CHARSET) . '" />';
        switch ($statstype) {
            case 'splittest':
                $splitStatIds = $this->_getGETRequest('statids', null);
                $jobIds = $this->_getGETRequest('jobids', null);
                $splitStatIds = SplitTest_API::FilterIntSet($splitStatIds);
                $jobIds = SplitTest_API::FilterIntSet($jobIds);
                $print_options .= '<input type="hidden" name="split_statids" value="' . implode(',', $splitStatIds) . '" />';
                $print_options .= '<input type="hidden" name="jobids" value="' . implode(',', $jobIds) . '" />';
                $options = array('snapshot' => GetLang('Addon_splittest_Menu_ViewStats'), 'open' => GetLang('Addon_splittest_open_summary'), 'click' => GetLang('Addon_splittest_linkclick_summary'), 'bounce' => GetLang('Addon_splittest_bounce_summary'), 'unsubscribe' => GetLang('Addon_splittest_unsubscribe_summary'));
                foreach ($options as $key => $val) {
                    $bg_color = $bg_color == 'white' ? '#EDECEC' : 'white';
                    $print_options .= '<div style="background-color: ' . $bg_color . '; padding: 5px; margin-bottom: 5px;">';
                    $print_options .= '<input id="print_' . $key . '" type="checkbox" name="options[]" value="' . $key . '" checked="checked" style="margin:0;"/>
						<label for="print_' . $key . '">' . $val . '</label>' . "\n";
                    $print_options .= '</div>' . "\n";
                }
                break;
        }
        $this->template_system->assign('path', $path);
        $this->template_system->Assign('title', GetLang('Addon_splittest_PrintSplitTestStatistics'));
        $this->template_system->Assign('print_options', $print_options);
        $this->template_system->ParseTemplate('print_stats_options');
    }
}
$PrintStats = new PrintStats();
$PrintStats->showOptionsPage();
Example #2
0
            $jobid = $jobids[$i];
            $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();