Ejemplo n.º 1
0
     			echo tpx('report_table', $assign);
     		}
     	} else {
     	
     	}
     	
     }
     */
 } else {
     $report = get_clicks_report_grouped2($params);
     // Собираем переменные в шаблон
     $assign = $params;
     $assign['campaign_params'] = $report['campaign_params'];
     $assign['click_params'] = $report['click_params'];
     $assign['report_params'] = $params;
     $assign['report_name'] = col_name($params, true) . ' за ';
     $assign['timestep'] = $params['part'] == 'month' ? 'monthly' : 'daily';
     $assign['arr_report_data'] = $report['data'];
     $assign['arr_dates'] = $report['dates'];
     //click_params
     // Заголовок отчета
     echo tpx('report_name', $assign);
     // Фильтры
     //echo tpx('report_conv', $assign);
     // Фильтры
     echo tpx('report_groups', $assign);
     // Таблица отчета
     echo tpx('report_table', $assign);
     // Если в Отчете по переходам выбран разрез Источник, то выводим таблицу Целевые страницы, добавляем к ней столбец Целевая страница и делаем источники кликабельными.
     //if(in_array($params['group_by'], array('source_name', 'ads_name', 'campaign_name', 'referer', 'country'))) {
     $params['where'] = '';
// Таблица отчёта
global $group_types, $table_n, $row_total_data, $table_total_data, $column_total_data;
if (!isset($table_n)) {
    $table_n = 0;
} else {
    $table_n++;
}
echo '<div class="table-report-box">';
echo "<table class='table table-striped table-report table-bordered dataTableT" . $table_n . "'>";
// Заголовок
echo "<thead>";
echo "<tr>";
if ($var['report_params']['mode'] == 'popular') {
    echo "<th>Популярные</th><th>Значение</th>";
} else {
    echo "<th>" . _e(col_name($var)) . "</th><th></th>";
}
foreach ($var['arr_dates'] as $cur_date) {
    $d = $var['timestep'] == 'monthly' ? $cur_date : date('d.m', strtotime($cur_date));
    echo "<th>" . _e($d) . "</th>";
}
echo "<th>Итого</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
$table_total_data = array();
// суммирование всего
$column_total_data = array();
// суммирование колонок
$arr_sparkline = array();
$i = 0;
	left: 8px;
}
tr.sub.last td.name:before {
	content: '└';
	position: absolute;
	left: 8px;
}
</style>
<div class="table-report-box hidecont">
    <table class="table table-striped table-report dataTableT<?php 
echo $table_n;
?>
">
			<thead>
				<tr><th><?php 
echo col_name($var);
?>
</th><th>Переходы</th><th>Повторные</th><th>LP&nbsp;CTR</th><th class="col_s">Продажи</th><th class="col_l">Лиды</th><th class="col_a">Действия</th><th class="col_s">Конверсия</th><th class="col_l">Конверсия</th><th class="col_a">Конверсия</th><th>Затраты</th><th class="col_s col_a">Прибыль</th><th class="col_s">EPC</th><th class="col_s">ROI</th><th class="col_s">CPS</th><th class="col_l">CPL</th><th class="col_a">CPA</th></tr>
			</thead>
			<tbody>
				<?php 
$column_total_data = array();
foreach ($var['arr_report_data'] as $r) {
    $var['r'] = $r;
    $var['class'] = '';
    $var['sub'] = 0;
    $var['parent'] = '';
    $var['pre_name'] = '';
    echo tpx('report_click_all_row', $var);
    if (!empty($r['sub'])) {
        $i = 1;
    foreach ($params['filter_str'] as $k => $v) {
        $source_type = param_name($k, $params['filter'][0]['source_name']) . ': ';
        list($v, $type) = explode(':', $v);
        $v = current(explode('|', $v));
        $source_name = param_val($v, $k, $params['filter'][0]['source_name']);
        // Текущая ссылка
        if ($i == count($params['filter_str'])) {
            if ($params['group_by'] != '') {
                //echo 1;
                if ($params['mode'] == 'lp_offers') {
                    echo '<li class="active">' . $source_type . '' . _e($source_name) . '</li>
						<li class="active">' . col_name($params) . '</a></li>';
                    //$group_types[$params['group_by']][0]
                } else {
                    echo '<li class="active">' . $source_type . '<a href="' . report_lnk($params, array('group_by' => '', 'mode' => 'popular', 'subgroup_by' => '')) . '">' . _e($source_name) . '</a></li>
						<li class="active">' . col_name($params) . '</a></li>';
                    //$group_types[$params['group_by']][0]
                }
            } else {
                //echo 2;
                echo '<li class="active">' . $source_type . _e($source_name) . '</li>';
                echo '<li class="active">Популярные</li>';
            }
        } else {
            //echo 3;
            echo '<li class="active">' . $source_type . '<a href="' . report_lnk($params, array('filter_str' => array_slice($params['filter_str'], 0, $i))) . '">' . _e($source_name) . '</a></li>';
        }
        $i++;
    }
    echo '</ol></div>';
}