Ejemplo n.º 1
0
 function defaultAction()
 {
     $db = new sql();
     $db->connect();
     $chid = $this->chid;
     include "lib/pagination.class.php";
     include "lib/orderby.class.php";
     $adminConfig = admin::adminConfig();
     for ($i = 1; $i < 4; $i++) {
         $voteTR = "";
         $orderBy = new orderBy("?chid=" . $this->chid . "&", array("id" => "№", "time" => "Дата", "name" => "Заголовок", "company" => "Компания", "gsum" => "Средний бал", "gcount" => "Проголосовало"), array("gsum" => "desc"), $this->field[$i], $this->order[$i], array("field[{$i}]", "order[{$i}]"));
         $pagination = new pagination($orderBy->urlForPage(), $this->page, $adminConfig["recPerPage"], '', "projects", "id");
         $res = $db->query("select projects.id, name, company, category_name, date, sum(IF(grade is null,0, grade))/count(IF(grade is null,0, grade)) as gsum, count(grade) as gcount FROM (projects LEFT JOIN categories ON projects.category = categories.category_id) left join votes on projects.id=votes.id where category={$i} group by projects.id, name, company, category_name, date " . $orderBy->orderByQuery() . " " . $pagination->limit());
         $page = $this->page ? "&page=" . $this->page : "";
         while ($data = $db->fetch_array($res)) {
             $data["date"] = date("d.m.Y", $data["date"]);
             eval('$voteTR.="' . admin::template("voteTR") . '";');
         }
         $pageBar = $pagination->bar();
         $th = $orderBy->bar();
         eval('$content.="' . admin::template("voteMain") . '";');
         $content .= "<br>";
     }
     $this->elements["content"] = $content;
 }
Ejemplo n.º 2
0
 function defaultAction()
 {
     global $HTTP_SERVER_VARS;
     include "./lib/config.inc.php";
     $db = new sql();
     $db->connect();
     $result = $db->query('SELECT VERSION() AS version');
     if ($result != FALSE && $db->num_rows($result) > 0) {
         $row = $db->fetch_array($result);
         $match = $row['version'];
     } else {
         $result = $db->query('SHOW VARIABLES LIKE \'version\'');
         if ($result != FALSE && $db->num_rows($result) > 0) {
             $row = $db->fetch_array($result);
             $match = $row[1];
         }
     }
     $this->MYSQL_VER = $match;
     $this->PHP_OS = PHP_OS;
     $this->PHP_VERSION = PHP_VERSION;
     $this->CMS = $admin_config["name"] . " " . $admin_config["version"];
     $this->AUTHOR = $admin_config["author"];
     $this->HOME_PAGE = $admin_config["home_page"];
     $content = admin::template("info", $this);
     $this->elements["content"] = $content;
 }
Ejemplo n.º 3
0
 function addParam()
 {
     $chid = $this->chid;
     extract($this->POST);
     eval('$conf="' . admin::template("confNew", "param", array("name" => "EXISTS", "descr" => "EXISTS")) . '";');
     $this->elements["content"] = $conf;
 }
Ejemplo n.º 4
0
 function defaultAction()
 {
     $dirs = explode("/", $this->dir);
     if ($this->dir) {
         $localBreadCrumbs = "<a href=\"?chid=" . $this->chid . "\">" . $this->root . "</a>";
     } else {
         $localBreadCrumbs = $this->root;
     }
     for ($i = 1; $i < sizeof($dirs); $i++) {
         $path .= "/" . $dirs[$i];
         if ($i == sizeof($dirs) - 1) {
             $localBreadCrumbs .= "/<b>" . $dirs[$i] . "</b>";
         } else {
             $localBreadCrumbs .= "/<a href=\"?chid=" . $this->chid . "&dir=" . $path . "\">" . $dirs[$i] . "</a>";
         }
     }
     if ($handle = opendir($this->global_dir)) {
         while (false !== ($file = readdir($handle))) {
             if (is_dir($this->global_dir . "/{$file}")) {
                 $file = "/" . $file;
             }
             $fa[] = $file;
         }
         natcasesort($fa);
         clearstatcache();
         foreach ($fa as $key => $value) {
             $pi = pathinfo($value);
             $ext = $pi["extension"];
             $stat = stat($this->global_dir . "/" . $value);
             if ($value !== "/.") {
                 $ii++;
                 if (substr($value, 0, 1) == "/") {
                     if ($value == "/..") {
                         $va = explode("/", $this->dir);
                         array_pop($va);
                         $dir1 = implode("/", $va);
                         $value1 = "";
                         $folder_tr .= "<tr id=\"tr" . $ii . "\" class=\"default\"><td></td><td><a href=\"?chid=" . $this->chid . "&dir={$dir1}\">{$value}</a></td><td>Папка</td><td></td><td></td></tr>\n";
                     } else {
                         $dir1 = $dir;
                         $value1 = $value;
                         $folder_tr .= "<tr id=\"tr" . $ii . "\" class=\"default\" onclick=\"return CheckTR(this);\"><td align=\"center\"><input type=\"Checkbox\" value=\"{$value}\" id=\"cb" . $ii . "\" onclick=\"return CheckCB(this);\" name=ids class=\"check\"></td><td><a href=\"?chid=" . $this->chid . "&dir={$this->dir}{$value1}\">{$value}</a></td><td>Папка</td><td></td><td></td></tr>\n";
                     }
                 } else {
                     $files_tr .= "<tr id=\"tr" . $ii . "\" class=\"default\" onclick=\"return CheckTR(this);\"><td align=\"center\"><input type=\"Checkbox\" id=\"cb" . $ii . "\" value=\"{$value}\" onclick=\"return CheckCB(this);\" name=ids class=\"check\"></td><td><a href=\"" . $this->root . $this->dir . "/{$value}\" target=\"_blank\">{$value}</a></td><td>" . $this->_getType($this->global_dir . "/" . $value, $ext) . "</td><td>" . number_format($stat[7] / 1000, 2, ',', ' ') . " КБ</td><td>" . date("d.m.Y H:i", $stat[9]) . "</td></tr>\n";
                 }
             }
         }
         $files_tr = $folder_tr . $files_tr;
         closedir($handle);
         eval('$content="' . admin::template("files") . '";');
     }
     $this->elements["content"] = $content;
 }
Ejemplo n.º 5
0
 function edit()
 {
     $db = new sql();
     $db->connect();
     $res = $db->query("select * from news where id=" . $this->id);
     $data = $db->fetch_array($res);
     $data["text"] = htmlspecialchars($data["text"]);
     $select = admin::getDateSelectOptions($data["time"]);
     $chid = $this->chid;
     $action = "appendEdit";
     $header = "Редактирование";
     eval("\$content=\"" . admin::template("newsAdd", "FORMPOST", array("fields[title]" => "EXISTS")) . "\";");
     $this->elements["content"] = $content;
 }
Ejemplo n.º 6
0
 function edit()
 {
     $db = new sql();
     $db->connect();
     $res = $db->query("select * from projects where id=" . $this->id);
     $data = $db->fetch_array($res);
     $data["date"] = date("d.m.Y", $data["date"]);
     //$data["end"]=date("d.m.Y", $data["end"]);
     $category_selected[$data["category"]] = " selected";
     $chid = $this->chid;
     $action = "appendEdit";
     $header = "Редактирование";
     eval("\$content=\"" . admin::template("projectsAdd", "FORMPOST", array("fields[url]" => "EXISTS", "fields[title]" => "EXISTS")) . "\";");
     $this->elements["content"] = $content;
 }
Ejemplo n.º 7
0
    function edit()
    {
        $db = new sql();
        $db->connect();
        $res = $db->query("select * from users where id=" . $this->id);
        $data = $db->fetch_array($res);
        $data["description"] = htmlspecialchars($data["description"]);
        $chid = $this->chid;
        $action = "appendEdit";
        $id = '<tr>
			<td>№</td>
			<td><input maxlength="14" name="fields[id]" size="14" value="' . $this->id . '" readonly="readonly" style="width: auto;" value="' . $this->id . '"></td>
		</tr>';
        $header = "Редактирование";
        eval("\$content=\"" . admin::template("usersEdit", "FORMPOST", array("fields[login]" => "EXISTS", "fields[name]" => "EXISTS", "confirm" => "EQUAL fields[pass]", "fields[email]" => "EMAIL")) . "\";");
        $this->elements["content"] = $content;
    }
Ejemplo n.º 8
0
 function wrongAdd()
 {
     session_start();
     if ($_SESSION["fields"]) {
         foreach ($_SESSION["wrongFields"] as $key => $value) {
             $message .= "<p class=\"error\">" . $value . "</p>";
         }
         $data = $_SESSION["fields"];
         $select = admin::getDateSelectOptions($data["time"]);
         $chid = $this->chid;
         $action = "appendAdd";
         $db = new sql();
         $db->connect();
         $res = $db->query("select * from types order by id");
         while ($data1 = $db->fetch_array($res)) {
             $i++;
             $types .= "<option" . ($data["type"] == $data1["id"] ? " selected" : "") . " value=\"{$data1['id']}\">{$data1['title']}</option>";
         }
         $ts[$data["type"]] = " selected";
         $true = $data["type"] == 4 ? " && true" : " && false";
         $data = $_SESSION["fields"];
         $header = "Добавление";
         $lid = $this->lid;
         $library["chid"] = admin::getTypeID("library");
         eval("\$content=\"" . admin::template("itemAdd", "FORMPOST", array("fields[title]" => "EXISTS", "fields[url]" => "EXISTS")) . "\";");
         $this->elements["content"] = $content;
     }
 }
Ejemplo n.º 9
0
 function showAuthorSelectJS()
 {
     $db = new sql();
     $db->connect();
     $res = $db->query("select id, firstname, secondname, lastname from authors order by lastname, firstname, secondname");
     while ($data = $db->fetch_array($res)) {
         $i++;
         $chid = $this->chid;
         $data["fio"] = $data["lastname"] . ($data["firstname"] ? " " . $data["firstname"] : "") . ($data["secondname"] ? " " . $data["secondname"] : "");
         eval('$authorsJSline.="' . admin::template("authorsJSline") . '";');
     }
     eval('$content="' . admin::template("authorsJS") . '";');
     echo $content;
 }
Ejemplo n.º 10
0
                } else {
                    $dir1 = $dir;
                    $value1 = $value;
                }
                $image_manager_tr .= "<tr><td><b><a href=\"im.php?dir={$dir1}{$value1}&fake=" . time() . "\" onClick=\"javascript:parent.UPLOAD.document.NEWIMAGE.path.value='{$dir1}{$value1}';\">{$value}</a></td><td>" . $lang["Folder"] . "</b></td></tr>\n";
            } else {
                $size = getimagesize("{$d}/" . urldecode($value));
                $fs = stat("{$d}/" . urldecode($value));
                $a = print_copy_link("{$d}/" . $value, urldecode($value));
                $image_manager_tr .= "<tr><td>" . $a . "</td><td align=\"right\">" . $fs[7] / 1000 . "K</td></tr>\n";
            }
        }
    }
    closedir($handle);
    chdir("../");
    eval('$image_manager="' . admin::template("im") . '";');
    echo $image_manager;
}
function print_copy_link($path, $name)
{
    global $server_path, $HTTP_SERVER_VARS;
    $imgsize = GetImageSize(urldecode($path));
    $width = $imgsize[0];
    $height = $imgsize[1];
    $path = ereg_replace("/+", "/", $path);
    $path = ereg_replace(admin::getDocumentRoot(), "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . "", $path);
    //$name=ereg_replace("\....$","",$name); // remove the extension in the name
    //$name=ucfirst(ereg_replace("_"," ",$name)); // replace underscores by spaces and capitalize
    $str .= "<a href=\"#\" onClick=\"top.document.forms[0].elements['ImgUrl'].value='{$path}';";
    $str .= "top.document.forms[0].elements['ImgWidth'].value={$width};";
    $str .= "top.document.forms[0].elements['ImgHeight'].value={$height};";
Ejemplo n.º 11
0
 function librarySelectI()
 {
     if (!$this->page) {
         $this->page = 1;
     }
     $db = new sql();
     $db->connect();
     include "lib/orderby.class.php";
     $orderBy = new orderBy("?chid=" . $this->chid . "&", array("library" => "№", "time" => "Дата", "name" => "Заголовок", "short_text" => "Подзаголовок", "author" => "Автор"), array("library" => "desc"), $this->field, $this->order);
     $adminConfig = admin::adminConfig();
     //echo "select library.id as library, name, short_text, time, authors.lastname as author FROM (library LEFT JOIN library_authors ON library.id = library_authors.library) LEFT JOIN authors ON library_authors.author = authors.id GROUP BY library.id".$orderBy->orderByQuery()." limit ".(($this->page-1)*$adminConfig["recPerPage"]).", ".$adminConfig["recPerPage"];
     $res = $db->query("select library.id as library, name, short_text, time, authors.lastname as author FROM (library LEFT JOIN library_authors ON library.id = library_authors.library) LEFT JOIN authors ON library_authors.author = authors.id GROUP BY library.id" . $orderBy->orderByQuery() . " limit " . ($this->page - 1) * $adminConfig["recPerPage"] . ", " . $adminConfig["recPerPage"]);
     while ($data = $db->fetch_array($res)) {
         $i++;
         $data["date"] = date("d.m.Y", $data["time"]);
         $data["name"] = admin::null2nbsp($data["name"]);
         $data["short_text"] = admin::null2nbsp($data["short_text"]);
         $res1 = $db->query("select id, firstname, secondname, lastname from library_authors left join authors on library_authors.author = authors.id where library_authors.library=" . $data["library"] . " order by lastname, firstname, secondname");
         while ($data1 = $db->fetch_array($res1)) {
             $data["fio"] .= "<li>" . $data1["lastname"] . ($data1["firstname"] ? " " . $data1["firstname"] : "") . ($data1["secondname"] ? " " . $data1["secondname"] : "") . "</li>";
         }
         $data["fio"] = admin::null2nbsp($data["fio"]);
         $checked = $data["library"] == $this->id || !$this->id && $i == 1 ? " checked" : "";
         eval("\$librarySelectITR.=\"" . admin::template("librarySelectITR") . "\";");
     }
     eval("\$content=\"" . admin::template("librarySelectI") . "\";");
     $this->elements["content"] = $content;
 }
Ejemplo n.º 12
0
 function show_Users()
 {
     $db = new sql();
     $db->connect();
     $res = $db->query("select * from subs_lists where id={$this->id}");
     $data = $db->fetch_array($res);
     $listName = $data["title"];
     $res = $db->query("select * from subs_users left join subs_subscribed on subs_users.id=subs_subscribed.sid where lid={$this->id}");
     if ($this->field) {
         $page = "&field={$this->field}";
     }
     if ($this->order) {
         $page .= "&order={$this->order}";
     }
     if ($this->page) {
         $page .= "&page={$this->page}";
     }
     while ($data = $db->fetch_array($res)) {
         $i++;
         eval('$subscribeUsersTR.="' . admin::template("subscribeUsersTR") . '";');
     }
     eval('$content="' . admin::template("subscribeUsersMain") . '";');
     $this->elements["content"] = $content;
 }
Ejemplo n.º 13
0
<?php

header("Content-type: text/html; charset=windows-1251");
include_once "lib/adm.class.php";
$field = urldecode($_GET["f"]);
eval("\$content=\"" . admin::template("ve") . "\";");
echo $content;
Ejemplo n.º 14
0
        break;
    case 'select':
        $db->connect();
        $res = $db->query("show columns from {$table}");
        $caption = "Выбор свойств полей";
        $action = "create";
        $content = "<input type=\"hidden\" name=\"table\" value=\"{$table}\">";
        $content .= "<table cellspacing=\"0\" cellpadding=\"5\">\n";
        $content .= "<th>Поле</th><th>Описание</th><th>Выводить в общем списке</th><th>Выводить в свойствах</th><th>Обязательное</th><th><nobr>E-mail</nobr></th><th>Дата</th>\n";
        $res = $db->query("show columns from {$table}");
        while ($data = $db->fetch_array($res)) {
            $content .= "<tr><td><strong>" . $data["Field"] . "</strong></td><td><input type=\"text\" name=\"name[" . $data["Field"] . "]\"></td>" . ($data["Extra"] == "auto_increment" ? "\n" : "<td><input type=\"checkbox\" name=\"list[" . $data["Field"] . "]\" value=\"1\"></td><td><input type=\"checkbox\" name=\"prop[" . $data["Field"] . "]\" value=\"1\" checked></td><td><input type=\"checkbox\" name=\"req[" . $data["Field"] . "]\" value=\"1\"></td><td><input type=\"checkbox\" name=\"email[" . $data["Field"] . "]\" value=\"1\"></td><td><input type=\"checkbox\" name=\"date[" . $data["Field"] . "]\" value=\"1\"></td></tr>\n");
        }
        $content .= "</table>";
        eval('$content="' . admin::template("wizard") . '";');
        echo $content;
        break;
    default:
        $db->connect();
        $res = $db->query("show tables");
        $action = "select";
        $caption = "Вас приветствует мастер создания классов!";
        $content = "Выберите таблицу <select name=\"table\">";
        while ($data = $db->fetch_array($res)) {
            $content .= "<option value=\"" . $data["Tables_in_" . $DB["dbName"]] . "\">" . $data["Tables_in_" . $DB["dbName"]] . "</option>";
        }
        $content .= "</select>";
        eval('$content="' . admin::template("wizard") . '";');
        echo $content;
        break;
}
Ejemplo n.º 15
0
// rfc2616 - Section 14.21
header('Last-Modified: ' . $GLOBALS['now']);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
// HTTP/1.1
header('Pragma: no-cache');
// HTTP/1.0
include_once "../lib/adm.class.php";
define("_QUERY", "select id, pid, title, url from chapters");
define("_LANG", "{$lng}");
$db = new sql();
$db->connect();
$form_action = "add.php?pid={$pid}&lid={$lid}";
$cid = $id;
$open_nodes = get_open_nodes($id);
$options = get_tree(0, $open_nodes);
eval("\$content=\"" . admin::template("links", "", "", "../") . "\";");
//eval('$item="'.$tpl->get("main").'";');
echo $content;
function get_open_nodes($id)
{
    $db = new sql();
    $db->connect();
    if ($id) {
        $res = $db->query(_QUERY . " where id={$id} order by sortorder");
        while ($db->num_rows($res) > 0) {
            $data = $db->fetch_array($res);
            $open_nodes[$data["id"]] = true;
            $res = $db->query(_QUERY . " where id=" . $data["pid"]);
        }
    }
    return $open_nodes;