[% SET print_uniqs = 1 IF !is_direct %] [% header_extra = BLOCK %] [% END %] [% SET title = currency_archive ? iget("Статистика по всем старым кампаниям") : iget("Статистика по всем кампаниям"); SET header = title; IF login_rights.role != 'client'; SET userLink = login_rights.is_internal_user ? '' _ user_fio _ ' (' _ user_login _ ')' _ '' : user_fio _ ' (' _ user_login _ ')'; header = title _ ' ' _ iget('клиента') _ ': ' _ userLink; title = title _ iget(' клиента: %s (%s)', user_fio, user_login); END; IF login_rights.is_any_client && FORM.show_favorites; SET title = iget("Статистика по самым важным кампаниям"); SET header = iget("Статистика по самым важным кампаниям"); ELSIF login_rights.agency_control && FORM.show_favorites; SET title = iget("Статистика по самым важным кампаниям клиента: %s (%s)", user_fio, user_login); SET header = iget("Статистика по самым важным кампаниям клиента: %s", userLink); ELSIF login_rights.manager_control && client_info && FORM.show_favorites && FORM.show_for_manager; SET title = iget('Статистика по самым важным кампаниям клиента: %s (%s), менеджер %s (%s)', client_info.FIO, client_info.login, manager_info.FIO, manager_info.login); SET header = iget("Статистика по самым важным кампаниям клиента: %s, менеджер %s (%s)", userLink, manager_info.FIO, manager_info.login); ELSIF login_rights.manager_control && client_info && FORM.show_favorites; SET title = iget("Статистика по самым важным кампаниям клиента: %s (%s)", client_info.FIO, client_info.login); SET header = iget("Статистика по самым важным кампаниям клиента: %s", userLink, client_info.FIO, client_info.login); ELSIF login_rights.manager_control && client_info && FORM.show_for_manager; SET title = iget("Статистика по кампаниям клиента: %s (%s), менеджер %s (%s)", client_info.FIO, client_info.login, manager_info.FIO, manager_info.login); SET header = iget("Статистика по кампаниям клиента: %s, менеджер %s (%s)", userLink, client_info.FIO, client_info.login, manager_info.FIO, manager_info.login); ELSIF FORM.cid; SET title = iget("Статистика по выбранным кампаниям клиента %s (%s):", user_fio, user_login) _" " _ string2html(FORM.cid); SET header = iget("Статистика по выбранным кампаниям %s:", userLink) _" " _ string2html(FORM.cid); END; PROCESS 'i-header/i-header.tt2' title = title require_css = 'css/clite.css' doctype = 'html' meta_edge = 1 header_extra = header_extra ; PROCESS 'i-script-tag/i-script-tag.tt2' src="js/clite.js"; PROCESS 'b-statistics/form/b-statistics__form.tt2' + 'b-statistics/target/b-statistics__target.tt2' + 'b-statistics/table/b-statistics__table.tt2' + 'b-statistics/table/b-statistics__table.tt2' + 'l-table-form/_mode/l-table-form_mode_oldschool.tt2' + 'l-campinfo/l-campinfo.tt2' ; ~%] [%~ WRAPPER b_statistics__form options = { allpages => FORM.allpages, page => FORM.page, offline_stat => offline_stat || FORM.offline_stat, stat_type => 'campdate', style => 'margin-left: 5px', script => script, cid => FORM.cid, uid_par => uid_par } ~%] [%~ WRAPPER l_campinfo options = {class=>'b-campinfo'} ~%] [%~ WRAPPER l_campinfo__row options = {} ~%] [%~ WRAPPER l_campinfo__left options = {} ~%] [%~ END ~%] [%~ WRAPPER l_campinfo__right options = {} ~%]

[%~ header ~%]

[%~ can_see_favorites = login_rights.is_any_client || login_rights.manager_control || login_rights.agency_control || login_rights.super_control || login_rights.support_control ~%]
[% IF show_manager_filter %] [% END %] [% IF error %] [% END %] [%~ statistics_params_default = 0; ~%] [%~ PROCESS b_statistics__form__calendar date_from = {y => y1, m=>m1, d=>d1}, date_to = {y => y2, m=>m2, d=>d2} ~%] [%~ PROCESS b_statistics__form__group options={group=>FORM.group} ~%] [%~ IF is_direct; SET formated_currency = no_data_found ? '' : ', ' _ format_currency(currency); SET common_columns = [ {id=> 'shows', title=>iget("Показы")}, {id=> 'clicks', title=>iget("Клики")}, {id=> 'ctr', title=>iget("CTR (%)")}, {id=> 'sum', title=>iget('Расход всего%s', formated_currency)}, {id=> 'av_sum', title=>iget('Ср. цена клика%s', formated_currency)}, {id=> 'av_day', title=>iget('Ср. расход за день%s', formated_currency)} ]; IF had_discounts; common_columns.unshift({id=> 'bonus', title=>iget('Размер бонуса всего%s', formated_currency)}); END; SET metrika_columns = [ {id=> 'adepth', title=>iget("Глубина (стр.)")}, {id=> 'agoalnum', title=>iget("Конверсии")}, {id=> 'aconv', title=>iget("Конверсия (%)")}, {id=> 'agoalcost', title=>iget('Цена цели%s', formated_currency)} ]; SET metrika_fields = ['adepth', 'agoalnum', 'aconv', 'agoalcost']; SET common_fields = ['shows', 'clicks', 'ctr', 'sum', 'av_sum', 'av_day']; IF had_discounts; common_fields.unshift('bonus'); END; ELSE; SET common_columns = [ {id=> 'shows', title=>iget("Показы, тыс")}, {id=> 'clicks', title=>iget("Клики")}, {id=> 'ctr', title=>iget("CTR (%)")} ]; SET metrika_columns = []; SET metrika_fields = []; SET common_fields = ['shows', 'clicks', 'ctr']; END; ~%] [%~ SET target_options = {}; IF !FORM.target_all.defined && !FORM.target_0.defined && !FORM.target_1.defined; FORM.target_all = 1; END; b_statistics__target_set_options(FORM, common_columns, metrika_columns, {is_direct=> is_direct, show=>is_target_separate, all_disabled=>all_disabled, show_metrika=>!directya}, target_options); b_statistics__target(target_options); ~%] [%~ PROCESS b_statistics__form__with_nds ~%] [%~ PROCESS b_statistics__form__with_discount ~%] [%~ PROCESS b_statistics__form__submit ~%]

[% error | html | replace("\n", "
") %]

[%~ PROCESS b_statistics__form__offline_stat_message offline_stat => offline_stat || FORM.offline_stat ~%]
[%~ END ~%] [%~ END ~%] [%~ END ~%] [% END %] [% WRAPPER l_table_form_oldschool options = { class => 'content' }; %] [% b_statistics__table_header_total_trs(target_options) %] [% IF !is_direct %] [% END %] [% SET common_data = {} %] [% FOREACH f = common_fields; SET f0 = f _ '_0'; SET f1 = f _ '_1'; common_data.$f = $f; common_data.$f0 = $f0; common_data.$f1 = $f1; END; %] [% SET metrika_data = {} %] [% FOREACH f = metrika_fields; SET f0 = f _ '_0'; SET f1 = f _ '_1'; metrika_data.$f = $f; metrika_data.$f0 = $f0; metrika_data.$f1 = $f1; END; %] [% b_statistics__table_row_common(target_options, common_data, common_fields); %] [% b_statistics__table_row_metrika(target_options, metrika_data, metrika_fields, 1); %] [% SET sorting_options = { default_column => "sorting", params => {anchor=>o.cid}, params_reverse => {anchor=>o.cid, default_reverse => 1} } %] [% b_statistics__table_header_trs(target_options, sorting_options) %] [% FOREACH a = sort_table_data(dates, FORM, "sorting", ["text"]) %] [% IF !is_direct %] [% END %] [% b_statistics__table_row_common(target_options, a, common_fields); %] [% b_statistics__table_row_metrika(target_options, a, metrika_fields); %] [% END %] [% IF !is_direct %] [% END %] [% SET common_data = {} %] [% SET metrika_data = {} %] [% FOREACH f = metrika_fields; SET f0 = f _ '_0'; SET f1 = f _ '_1'; metrika_data.$f = $f; metrika_data.$f0 = $f0; metrika_data.$f1 = $f1; END; FOREACH f = common_fields; SET f0 = f _ '_0'; SET f1 = f _ '_1'; common_data.$f = $f; common_data.$f0 = $f0; common_data.$f1 = $f1; END; %] [% b_statistics__table_row_common(target_options, common_data, common_fields); %] [% b_statistics__table_row_metrika(target_options, metrika_data, metrika_fields); %] [% FOREACH o = orders %] [% IF o.shows %] [% LAST %] [% END %] [% END %] [% FOREACH o = orders %] [% NEXT IF !o.shows %] [% SET sorting_options = { default_column => "sorting", params => {anchor=>o.cid}, params_reverse => {anchor=>o.cid, default_reverse => 1} } %] [% b_statistics__table_header_trs(target_options, sorting_options, 1) %] [% FOREACH a = sort_table_data(o.dates, FORM, "sorting", ["text"]) %] [% IF !is_direct %] [% END %] [% b_statistics__table_row_common(target_options, a, common_fields); %] [% b_statistics__table_row_metrika(target_options, a, metrika_fields); %] [% END %] [% IF !is_direct %] [% END %] [% b_statistics__table_row_common(target_options, o, common_fields); %] [% b_statistics__table_row_metrika(target_options, o, metrika_fields); %] [% END %]
[% iget("с") %] [% d1 %].[% m1 %].[% y1 %] [% iget("по") %] [% d2 %].[% m2 %].[% y2 %]  
 
[% IF dates.size %]
[% SET plot_page_hash = get_plot_link(FORM, { group=>plot_group, group_by=>['date'], stat_type=>'campdate', cmd => 'showPlotPage'}, 1); %] [% IF !(plot_group == group); print_variants = {day => iget('по дням'), week => iget('по неделям'), month => iget('по месяцам'), year => iget('по годам')}; SET plot_group_to_print = " (" _ iget(print_variants.$plot_group) _ ")"; END %]
[%~ FOREACH i IN plot_page_hash ~%] [%~ END ~%]

[% iget("Показать график") %][% plot_group_to_print %]

[% END %]
[% iget("По всем кампаниям") %]
 
[%~ a.date _ (group == 'day' ? ', ' _ format_date(a.stat_date, 'strftime', '{dow_short}') : '') ~%]  
[% iget("Итого:") %] 


[% iget("По каждой кампании") %]

[% IF o.dates.size %]
[% SET plot_page_href = get_plot_link(FORM, { group=>plot_group, group_by=>['date'], cid=>o.cid, stat_type=>'custom', norefresh=>0}); %] [% IF !(plot_group == group); print_variants = { day => iget('по дням'), week => iget('по неделям'), month => iget('по месяцам'), year => iget('по годам')}; SET plot_group_to_print = " (" _ iget(print_variants.$plot_group) _ ")"; END %]

[% iget("Показать график") %][% plot_group_to_print %]

[% END %]
[% IF o.can_view_details %] [% o.name | html %] [% ELSE %][% o.name | html %][% END %] ([%o.cid%])[% IF o.ManagerUID %], [% iget('менеджер') %]: [% o.ManagerFio | html %] [% END %]
[%~ a.date _ (group == 'day' ? ', ' _ format_date(a.stat_date, 'strftime', '{dow_short}') : '') ~%]   [% format_units(a.unique_cnt||0, 'shows') || ' ' %]
[% iget("Итого:") %]  [% format_units(o.unique_cnt||0, 'shows') || ' ' %]


[% iget("скачать в виде xls-файла") %]
 
[% END %] [% PROCESS 'i-footer/i-footer.tt2' %]