<?php
/**
 * Система управления сайтом HostCMS v. 5.xx
 * Copyright © 2005-2010 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru
 *
 * Форма формирования отчета.
 * 
 * Файл: /admin/seo/action/form_report_forming.php
 * 
 * @author Hostmake LLC
 * @version 5.x
 */
$form_params = array();
$site = new site();

$site = $site->GetCurrentAlias(CURRENT_SITE);

$form_params['title'] = sprintf($GLOBALS['MSG_seo']['report_for_site'], $site);

//Метод отправки данных
$form_params['form_attribs']['method'] = 'post';

//Адрес всех обработчиков модуля – главный файл формы
$form_params['form_attribs']['action'] = '/admin/seo/seo.php';
$form_params['form_attribs']['target'] = '_blank';

//Метод отправки данных
$form_params['form_attribs']['name'] = 'FormingReport';

$admin_forms_fields = new admin_forms_fields();

//Хлебные крошки
$new_path_array[] = array(
'link' => $admin_forms_fields->GetHtmlCallDoLoadAjax('/admin/seo/seo.php', '&ext_action=1', 141, 'load_data'),
'onclick' => $admin_forms_fields->GetOnClickCallDoLoadAjax('/admin/seo/seo.php', '&ext_action=1', 141, 'load_data'),
'name' => $GLOBALS['MSG_seo']['header_admin_characteristic_forms']);

$new_path_array[] = array(
'link' => $admin_forms_fields->GetHtmlCallDoLoadAjax('/admin/seo/seo.php', '&action=report', 0, 'load_data'),
'onclick' => $admin_forms_fields->GetOnClickCallDoLoadAjax('/admin/seo/seo.php', '&action=report', 0, 'load_data'),
'name' => sprintf($GLOBALS['MSG_seo']['report_for_site'], $site));

// Передаем в массив для констурктора хлебные крошки
$form_params['path_array'] = $new_path_array;

$admin_forms_fields->admin_forms_fields($form_params);

//Устанавливаем значения по умолчанию
//Расчет даты за месяц до текущей
$date_start = date("d.m.Y H:i:s", time() - 60*60*24*31);
$date_end = date("d.m.Y H:i:s");
$pr = 1;
$tyc = 1;
$column_count = 10;

$position_yandex = 1;
$position_google = 1;
$position_rambler = 1;
$position_aport = 1;
$position_gogo = 1;
$position_yahoo = 1;
$position_livesearch = 1;

$links_google = 1;
$links_yandex = 1;
$links_yahoo = 1;
$links_msn = 1;

$indexed_aport = 1;
$indexed_yandex = 1;
$indexed_yahoo = 1;
$indexed_msn = 1;
$indexed_rambler = 1;
$indexed_google = 1;

$catalog_yandex = 1;
$catalog_rambler = 1;
$catalog_mail = 1;
$catalog_dmoz = 1;
$catalog_aport = 1;

$counter_rambler = 1;
$counter_spylog = 1;
$counter_hotlog = 1;
$counter_mail = 1;
$counter_liveinternet = 1;

// Параметры.

//Вкладка Основные
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_seo']['seo_add_edit_characteristic_tab_basic']);

//Дата c
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'date_start';
$param['caption'] = $GLOBALS['MSG_seo']['date_start'];
$param['type'] = 11; // Дата.
$param['value'] = $date_start;
$param['div_attributes']['style'] = 'float: left; margin-top: 5px;  margin-right: 15px;';
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Дата по
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'date_end';
$param['caption'] = $GLOBALS['MSG_seo']['date_end'];
$param['type'] = 11; // Дата.
$param['value'] = $date_end;
$param['div_attributes']['style'] = 'float: left; margin-top: 5px;';
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Количество столбцов
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'column_count';
$param['caption'] = $GLOBALS['MSG_seo']['seo_add_edit_characteristic_caption_column_count'];
$param['type'] = 0; // Поле ввода.
$param['value'] = $column_count;
$param['format']['maxlen']['value'] = 255;
$param['format']['minlen']['value'] = 1;
$param['format']['lib']['value'] = 'integer';
$param['attributes']['style'] = 'width: 140px;';
$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// тИЦ
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'tyc';
$param['caption'] = $GLOBALS['MSG_seo']['seo_add_edit_characteristic_caption_tyc'];
$param['type'] = 1; // Флажок.
$param['value'] = $tyc;


$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// PR
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'pr';
$param['caption'] = $GLOBALS['MSG_seo']['seo_add_edit_characteristic_caption_pr'];
$param['type'] = 1; // Флажок.
$param['value'] = $pr;


$admin_forms_fields->AddField($param);

// Кнопка "Сформировать".
$param = array();
$param['name'] = 'form_report';
$param['caption'] = $GLOBALS['MSG_seo']['report_form_button'];
$param['attributes']['type'] = 'submit';
$admin_forms_fields->AddButton($param);

//Вкладка Ссылки
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_seo']['seo_add_edit_characteristic_tab_links']);

//Ссылки yandex
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'links_yandex';
$param['caption'] = $GLOBALS['MSG_seo']['report_yandex'];
$param['type'] = 1; // Флажок.
$param['value'] = $links_yandex;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Ссылки google
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'links_google';
$param['caption'] = $GLOBALS['MSG_seo']['report_google'];
$param['type'] = 1; // Флажок.
$param['value'] = $links_google;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Ссылки yahoo
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'links_yahoo';
$param['caption'] = $GLOBALS['MSG_seo']['report_yahoo'];
$param['type'] = 1; // Флажок.
$param['value'] = $links_yahoo;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Ссылки Bing.com
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'links_msn';
$param['caption'] = $GLOBALS['MSG_seo']['report_msn'];
$param['type'] = 1; // Флажок.
$param['value'] = $links_msn;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Вкладка Проиндексировано
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_seo']['seo_add_edit_characteristic_tab_indexed']);

//Индексировано yandex
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'indexed_yandex';
$param['caption'] = $GLOBALS['MSG_seo']['report_yandex'];
$param['type'] = 1; // Флажок.
$param['value'] = $indexed_yandex;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Индексировано google
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'indexed_google';
$param['caption'] = $GLOBALS['MSG_seo']['report_google'];
$param['type'] = 1; // Флажок.
$param['value'] = $indexed_google;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Индексировано rambler
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'indexed_rambler';
$param['caption'] = $GLOBALS['MSG_seo']['report_rambler'];
$param['type'] = 1; // Флажок.
$param['value'] = $indexed_rambler;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Индексировано aport
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'indexed_aport';
$param['caption'] = $GLOBALS['MSG_seo']['report_aport'];
$param['type'] = 1; // Флажок.
$param['value'] = $indexed_aport;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Индексировано Bing.com
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'indexed_msn';
$param['caption'] = $GLOBALS['MSG_seo']['report_msn'];
$param['type'] = 1; // Флажок.
$param['value'] = $indexed_msn;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Индексировано yahoo
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'indexed_yahoo';
$param['caption'] = $GLOBALS['MSG_seo']['report_yahoo'];
$param['type'] = 1; // Флажок.
$param['value'] = $indexed_yahoo;



$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Вкладка Каталоги
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_seo']['seo_add_edit_characteristic_tab_catalog']);

//Каталог yandex
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'catalog_yandex';
$param['caption'] = $GLOBALS['MSG_seo']['report_yandex'];
$param['type'] = 1; // Флажок.
$param['value'] = $catalog_yandex;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Каталог rambler
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'catalog_rambler';
$param['caption'] = $GLOBALS['MSG_seo']['report_rambler'];
$param['type'] = 1; // Флажок.
$param['value'] = $catalog_rambler;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Каталог dmoz
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'catalog_dmoz';
$param['caption'] = $GLOBALS['MSG_seo']['report_dmoz'];
$param['type'] = 1; // Флажок.
$param['value'] = $catalog_dmoz;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Каталог aport
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'catalog_aport';
$param['caption'] = $GLOBALS['MSG_seo']['report_aport'];
$param['type'] = 1; // Флажок.
$param['value'] = $catalog_aport;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Каталог mail
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'catalog_mail';
$param['caption'] = $GLOBALS['MSG_seo']['report_mail'];
$param['type'] = 1; // Флажок.
$param['value'] = $catalog_mail;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Вкладка Счетчики
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_seo']['seo_add_edit_characteristic_tab_counter']);

//Счетчик rambler
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'counter_rambler';
$param['caption'] = $GLOBALS['MSG_seo']['report_rambler_top'];
$param['type'] = 1; // Флажок.
$param['value'] = $counter_rambler;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Счетчик spylog
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'counter_spylog';
$param['caption'] = $GLOBALS['MSG_seo']['report_spylog'];
$param['type'] = 1; // Флажок.
$param['value'] = $counter_spylog;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Счетчик hotlog
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'counter_hotlog';
$param['caption'] = $GLOBALS['MSG_seo']['report_hotlog'];
$param['type'] = 1; // Флажок.
$param['value'] = $counter_hotlog;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Счетчик liveinternet
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'counter_liveinternet';
$param['caption'] = $GLOBALS['MSG_seo']['report_liveinternet'];
$param['type'] = 1; // Флажок.
$param['value'] = $counter_liveinternet;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Счетчик mail
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'counter_mail';
$param['caption'] = $GLOBALS['MSG_seo']['report_mail'];
$param['type'] = 1; // Флажок.
$param['value'] = $counter_mail;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

//Вкладка Поисковые запросы
$tab_id = $admin_forms_fields->AddTab($GLOBALS['MSG_seo']['report_tab_position_search']);

// Позиции в Yandex
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_yandex';
$param['caption'] = $GLOBALS['MSG_seo']['report_yandex'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_yandex;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиции в Google
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_google';
$param['caption'] = $GLOBALS['MSG_seo']['report_google'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_google;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиции в Rambler
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_rambler';
$param['caption'] = $GLOBALS['MSG_seo']['report_rambler'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_rambler;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиции в Aport
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_aport';
$param['caption'] = $GLOBALS['MSG_seo']['report_aport'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_aport;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиции в GoGo
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_gogo';
$param['caption'] = $GLOBALS['MSG_seo']['report_gogo'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_gogo;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиции в Yahoo
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_yahoo';
$param['caption'] = $GLOBALS['MSG_seo']['report_yahoo'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_yahoo;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Позиции в Bing
$param = array();
$param['tab_id'] = $tab_id;
$param['name'] = 'position_livesearch';
$param['caption'] = $GLOBALS['MSG_seo']['report_livesearch'];
$param['type'] = 1; // Флажок.
$param['value'] = $position_livesearch;

$admin_forms_fields->AddField($param);

// Разделитель.
$admin_forms_fields->AddSeparator($tab_id);

// Отображение формы.
$admin_forms_fields->ShowForm();
?>