%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/www_bck/varak.net_bck/trenink.varak.net/www/
Upload File :
Create Path :
Current File : //data/www_bck/varak.net_bck/trenink.varak.net/www/index.php

<?php
ob_start();
include "../bootstrap.php";


$action = $_GET['action'];
$id = isset($_GET['id']) ? $_GET['id'] : false;

$smarty->assign('id', $id);
//$smarty->assign('isAdmin', $_SESSION['isAdmin']);

$shooters = dibi::query("SELECT [id], [name] FROM [shooters] ORDER BY [name]");
$smarty->assign('shooters', $shooters);
$stages = dibi::query("SELECT DISTINCT [name] FROM [stages] ORDER BY [name]");
$smarty->assign('stages', $stages);
$divisions = dibi::query("SELECT DISTINCT [division] FROM [best_scores] ORDER BY [division]");
$smarty->assign('divisions', $divisions);

$template = "index.tpl";

switch($action)
{
    case 'index':
    {
        include "../app/index.php";
        $template = "index.tpl";
        break;
    }
    case 'import':
    {
        $template = "import.tpl";
        break;
    }
    case 'import-process':
    {
        include "../app/import-process.php";
        $template = "error.tpl";
        break;
    }
    case 'shooter':
    {
        include "../app/shooter.php";
        $template = "shooter.tpl";
        break;
    }
    case 'stage':
    {
        include "../app/stage.php";
        $template = "stage.tpl";
        break;
    }
    case 'division':
    {
        include "../app/division.php";
        $template = "shooter.tpl";
        break;
    }
    case 'match':
    {
        include "../app/match.php";
        $template = "match.tpl";
        break;
    }
    case 'shooter-stage':
    {
        include "../app/shooter-stage.php";
        $template = "shooter-stage.tpl";
        break;
    }

    default:
    {
        include "../app/index.php";
        $template = "index.tpl";
        break;
    }
}

$smarty->assign('queries', dibi::$numOfQueries);
$smarty->assign("queryTime", dibi::$totalTime);
if(trim($template))
    $smarty->display($template);

$ret = ob_get_clean();
header("X-Original-Content-Lenght: " . strlen($ret));
// Gzip/Deflate/Bzip2 compression
if(stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "bzip2"))
{
    $ret = bzcompress($ret, 9);
    header("Content-Encoding: bzip2");
}
elseif(stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip"))
{
    $ret = gzencode($ret, 9);
    header("Content-Encoding: gzip");
}
elseif (stristr($_SERVER["HTTP_ACCEPT_ENCODING"], "deflate"))
{
    $ret = gzdeflate($ret, 9);
    header("Content-Encoding: deflate");
}

header("Content-length: " . strlen($ret));
echo $ret;

Zerion Mini Shell 1.0