<?php
include_once 'config.php';
include_once 'functions.php';

$tpl = new Template;
$tpl->dir = 'templates/admin/tpl/';

$tpl->load_template('head.tpl');
$tpl->set("{title}", "Установка GameCMS");
$tpl->set("{image}", "../files/miniatures/standart.jpg");
$tpl->set("{cache}", "1");
$tpl->set("{other}", "");
$tpl->set("{token}", "");
$tpl->compile( 'content' );
$tpl->clear();

if(!isset($_SERVER['SERVER_SOFTWARE'])) {
	$_SERVER['SERVER_SOFTWARE'] = '0';
}
if(!isset($_SERVER['GATEWAY_INTERFACE'])) {
	$_SERVER['GATEWAY_INTERFACE'] = '0';
}
if(!isset($_SERVER['DOCUMENT_ROOT'])) {
	$_SERVER['DOCUMENT_ROOT'] = '0';
}

$key = md5($_SERVER['SERVER_SOFTWARE'].$_SERVER['GATEWAY_INTERFACE'].$_SERVER['DOCUMENT_ROOT']);

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

$tpl->set( '{content}', $tpl->result['content'], false);
$tpl->load_template('main.tpl');
$tpl->compile('main');
$tpl->show($tpl->result['main']);
$tpl->global_clear();
exit();