<?php
if(!is_admin()){
	show_error_page('not_adm');
}

$tpl->load_template('elements/title.tpl');
$tpl->set("{title}", $page->title);
$tpl->set("{name}", $conf->name);
$tpl->compile( 'title' );
$tpl->clear();

$tpl->load_template('head.tpl');
$tpl->set("{title}", $tpl->result['title']);
$tpl->set("{image}", $page->image);
$tpl->set("{other}", '');
$tpl->set("{token}", $token);
$tpl->set("{cache}", $conf->cache);
$tpl->set("{template}", $conf->template);
$tpl->set("{site_host}", $site_host);
$tpl->compile( 'content' );
$tpl->clear();

$tpl->load_template('top.tpl');
$tpl->set("{site_host}", $site_host);
$tpl->set("{site_name}", $conf->name);
$tpl->compile( 'content' );
$tpl->clear();

$tpl->load_template('menu.tpl');
$tpl->set("{site_host}", $site_host);
$tpl->compile( 'content' );
$tpl->clear();

$nav = array(
	$PI->to_nav('admin', 0, 0),
	$PI->to_nav('admin_logs', 1, 0)
);
$nav = $tpl->get_nav($nav, 'elements/nav_li.tpl', 1);

$tpl->load_template('page_top.tpl');
$tpl->set("{nav}", $nav);
$tpl->compile( 'content' );
$tpl->clear();

$tpl->load_template('logs.tpl');
$tpl->set("{site_host}", $site_host);
$tpl->set("{file1}", get_log_file($_SERVER['DOCUMENT_ROOT']."/logs/".get_log_file_name("log")));
$tpl->set("{file2}", get_log_file($_SERVER['DOCUMENT_ROOT']."/logs/".get_log_file_name("error_log")));
$tpl->set("{file3}", get_log_file($_SERVER['DOCUMENT_ROOT']."/logs/".get_log_file_name("pdo_errors")));
$tpl->set("{file4}", get_log_file($_SERVER['DOCUMENT_ROOT']."/logs/".get_log_file_name("payment_successes")));
$tpl->set("{file5}", get_log_file($_SERVER['DOCUMENT_ROOT']."/logs/".get_log_file_name("payment_errors")));
$tpl->set("{file6}", get_log_file($_SERVER['DOCUMENT_ROOT']."/logs/".get_log_file_name("services_log")));
$tpl->compile( 'content' );
$tpl->clear();

$tpl->load_template('bottom.tpl');
$tpl->set("{site_host}", $site_host);
$tpl->compile( 'content' );
$tpl->clear();
?>