Beispiel #1
0
function wmysql_adminlist($method, $array)
{
    is_array($array) ? $param = $array : die('None array');
    $_GET = get_url_array();
    switch ($method) {
        case 'list':
            form("open");
            html($param['name']);
            $result = wmysql("page", "get", $param['sql'], $param['recsheet'], $_GET[$param['level']]);
            if (mysql_num_rows($result) > 0) {
                html("<table cellspacing='3px'><tr>");
                foreach ($param['description'] as $el) {
                    html("<td>" . $el . "</td>");
                }
                html("</tr>");
                while ($row = mysql_fetch_assoc($result)) {
                    html("<tr><td>");
                    form("input", array("type" => 'checkbox', "name" => 'arr[]', "value" => $row['id']));
                    html("</td>");
                    foreach ($param['getparam'] as $key) {
                        html("<td>" . $row[$key] . "</td>");
                    }
                    html("<td><a href='" . href(THIS, $param['level'] - 1, "edit", $row['id']) . "'>" . icon("edit", 20) . "</a></td>");
                    html("</tr>");
                }
                html("</table>");
            } else {
                if (intval($_GET[$param['level']]) > 1) {
                    die(header("location:" . href(THIS, $param['level'] - 1)));
                }
            }
            if ($page = wmysql("page", "draw", $param['level'] - 1)) {
                html("<br>Страницы: " . $page);
                html("&nbsp;&nbsp;Выбрать все на этой странице<input type='checkbox' \r\n        onChange='for(i in this.form.elements)this.form.elements[i].checked = this.checked'>");
                form("label");
            }
            form("input", array("type" => 'submit', "name" => 'qq', "value" => 'Удалить'));
            html("или <a href='" . href(THIS, $param['level'] - 1, "add") . "'>Добавить" . icon("add", 16) . "</a>");
            form("close");
            return;
        case 'delrec':
            foreach ($param['array'] as $value) {
                $value = mysql_escape_string($value);
                $condition = true;
                if ($param['condition']) {
                    $result = mysql_query($param['condition'] . " '" . $value . "'");
                    $condition = mysql_result($result, 0) == 0 ? true : false;
                    print_r(mysql_fetch_assoc($result));
                }
                if ($condition) {
                    mysql_query($param['true'] . " '" . $value . "'");
                }
            }
            die(header("location:" . href(THIS)));
            return;
    }
}
Beispiel #2
0
<?php

session_start();
header("Content-Type: text/html; charset=utf-8");
$title = 'Настройка Gliss engine';
define(PROTECT, 1);
define(GLISS_DIR, str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']));
require GLISS_DIR . 'engine.php';
$global = GET_ENV();
$times = RECEIVE_TIME();
$GET = get_url_array();
$_LOADER['follow'] = GLISS_DIR . 'adjustment/gliss_admin.php';
$_LOADER['cmps'] = @file($_LOADER['follow']);
if ($_LOADER['cmps']) {
    unset($_LOADER['cmps'][0]);
    $_LOADER['count'] = count($_LOADER['cmps']);
    while ($_LOADER['cmp'] < $_LOADER['count']) {
        $_LOADER['cmp']++;
        $_LOADER['cmp_path'] = GLISS_DIR . 'cmpnnt/' . trim($_LOADER['cmps'][$_LOADER['cmp']]);
        if (is_file($_LOADER['cmp_path'])) {
            require_once $_LOADER['cmp_path'];
        } else {
            die('<b>No Found</b> "' . $_LOADER['cmp_path'] . '"');
        }
    }
} else {
    die('<b>No Found</b> "' . $_LOADER['follow'] . '"');
}
Beispiel #3
0
function get_block()
{
    list($_BLOCK['name'], $_BLOCK['level']) = func_get_args();
    $_BLOCK['path'] = GLISS_DIR . 'appendix/' . $_BLOCK['name'];
    if (is_file($_BLOCK['path'] . '/block.php') && $_BLOCK['name']) {
        static $GET;
        if (!$GET) {
            $GET = get_url_array();
        }
        $local = get_var($_BLOCK['path'] . '/adjustment.php');
        include $_BLOCK['path'] . '/block.php';
    } else {
        echo '<pre>Блок "' . $_BLOCK['name'] . '" не подключен!</pre>';
    }
}