Example #1
0
function render($template, $data = array())
{
    global $config, $route;
    # Create routing variables
    $requests = requests();
    $controller = get_controller();
    $template = "views/{$controller}/{$template}.php";
    # Setting route variables
    for ($i = 0; $i < count($route); $i++) {
        ${$route}[$i] = $requests[$i];
    }
    # Setting data params variables
    foreach ($data as $key => $value) {
        ${$key} = $value;
    }
    if (file_exists($template)) {
        include "template/index.php";
    } else {
        echo "<span style='color:#900'>View missing! Create - {$template}</span><br />";
    }
}
Example #2
0
if ($user->AsSquidAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["service"])) {
    service();
    exit;
}
if (isset($_GET["service-search"])) {
    service_search();
    exit;
}
if (isset($_GET["requests"])) {
    requests();
    exit;
}
if (isset($_GET["requests-search"])) {
    requests_search();
    exit;
}
tabs();
function tabs()
{
    $sock = new sockets();
    $tpl = new templates();
    $INSTALLED = trim($sock->getFrameWork("squid.php?kaspersky-is-installed=yes"));
    if ($INSTALLED != "TRUE") {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{not_installed}"));
        return;
Example #3
0
function template($file, $data = array())
{
    global $config, $route;
    $requests = requests();
    $template = "views/templates/{$file}";
    for ($i = 0; $i < count($route); $i++) {
        ${$route}[$i] = $requests[$i];
    }
    foreach ($data as $key => $value) {
        ${$key} = $value;
    }
    if (file_exists($template)) {
        header("Content-type: text/html");
        include $template;
    } else {
        respond("Template missing at {$template}", 500, "text");
    }
}