<?php
/*
* Simlery by Simlution.org
* www.simlution.org
*/
extract( $_GET );
define( 'CUSTOMER_PAGE', true );

require 'config/general.php';
require DB_CONFIG_LANG;

require_once DIR_LANG.LANGUAGE.'.php';
header( 'Content-Type: text/html; charset='.$config['charset'] );
require_once DIR_LIBRARIES.'TplParser.php';
require_once DIR_LIBRARIES.'FileJobs.php';
require_once DIR_LIBRARIES.'FlatFiles.php';
require_once DIR_LIBRARIES.'Trash.php';

require_once DIR_CORE.'common.php';
require_once DIR_CORE.'pages.php';
require_once DIR_CORE.'images.php';
require_once DIR_CORE.'votes-comments.php';

$aActions = isset( $p ) ? getAction( $p ) : getUrlFromGet( );
if( isset( $aActions['f'] ) && $aActions['f'] == 'p' )
  $iContent = ( isset( $aActions['a'] ) && is_numeric( $aActions['a'] ) ) ? $aActions['a'] : $config['start_page'];
else
  $iContent = null;

$oFF =& FlatFiles::getInstance( );
$oTpl =& TplParser::getInstance( DIR_TEMPLATES, $config['embed_php'] );
$oFF->cacheFilesIndexes( $config_db );

$oImage =& Images::getInstance( );
$oPage =& Pages::getInstance( );
$content  = null;

$sKeywords    = $config['keywords'];
$sDescription = $config['description'];
ob_start( 'changeCharset' );

if( isset( $aActions ) && is_file( 'actions_client/'.$aActions['f'].'.php' ) )
  require 'actions_client/'.$aActions['f'].'.php';

if( empty( $content ) )
  $content .= $oTpl->tbHtml( 'messages.tpl', 'ERROR' );

if( !isset( $bBlockPage ) ){
  $sMenu1 = $oPage->throwMenu( 'menu_1.tpl', 1, $iContent, 0 );
}

echo $oTpl->tbHtml( 'container.tpl', 'HEAD' ).$oTpl->tbHtml( 'container.tpl', 'BODY' ).$content.$oTpl->tbHtml( 'container.tpl', 'FOOT' );

ob_end_flush( );
?>