<?php
/*
* Quick.Cart by OpenSolution.org
* www.opensolution.org
*/
extract( $_GET );
session_start( );

if( !isset( $p ) || $p == '' )
  $p  = '';

if( strstr( $p, 'Gallery' ) ){
  $bGallery   = true;
  $sBlockPage = '_GALLERY';
}

require './libraries/jcode.php';
require 'config/general.php';
require DB_CONFIG_LANG;
require 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.'FotoJobs.php';
require_once DIR_LIBRARIES.'FlatFiles.php';
require_once DIR_LIBRARIES.'Trash.php';
ob_start( 'changeCharset' );

if( isset( $sWord ) && !empty( $sWord ) )
  $sWord = trim( JcodeConvert(htmlspecialchars( changeSpecialChars( stripslashes( $sWord ) ) ) ,0,1));      //for japanese

/*
* Add-ons functions 
*/
if( filesize( DIR_PLUGINS.'plugins.php' ) > 30 )
  require_once DIR_PLUGINS.'plugins.php';

require_once DIR_CORE.'other.php';
require_once DIR_CORE.'preferences.php';

require_once DIR_PLUGINS.'edit/htmleditor.php';

$tpl    = new TplParser;
$oFoto  = new FotoJobs;
$oFF    = new FlatFiles;

$tpl->setDir( TPL.'admin/' );
$oFoto->setRatio( $config['foto_jobs_ratio'] );

/*
* Login 
*/
loginActions( $p, 'bUserQC' );

$content = null;

/*
* Add-ons actions
*/
if( filesize( DIR_PLUGINS.'actions_admin.php' ) > 30 )
  require_once DIR_PLUGINS.'actions_admin.php';

getAction( $p, 'actions_admin/' );  

if( is_file( $sActionFile ) )
  require $sActionFile;

if( !isset( $sBlockPage ) )
  $sBlockPage = null;

echo $tpl->tbHtml( 'page.tpl', 'HEAD'.$sBlockPage ).$content.$tpl->tbHtml( 'page.tpl', 'FOOT'.$sBlockPage );
ob_end_flush( );
?>