本文整理汇总了PHP中admin::getTypeID方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::getTypeID方法的具体用法?PHP admin::getTypeID怎么用?PHP admin::getTypeID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::getTypeID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defaultAction
function defaultAction()
{
$db = new sql();
$db->connect();
$chid = $this->chid;
include "lib/pagination.class.php";
include "lib/orderby.class.php";
$adminConfig = admin::adminConfig();
$orderBy = new orderBy("?chid=" . $this->chid . "&", array("library" => "№", "time" => "Дата", "name" => "Заголовок", "short_text" => "Подзаголовок", "author" => "Автор"), array("library" => "desc"), $this->field, $this->order);
$pagination = new pagination($orderBy->urlForPage(), $this->page, $adminConfig["recPerPage"], '', "library", "id");
$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() . " " . $pagination->limit());
$page = $this->page ? "&page=" . $this->page : "";
while ($data = $db->fetch_array($res)) {
$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");
$typeAuthorsID = admin::getTypeID("authors");
while ($data1 = $db->fetch_array($res1)) {
$data["fio"] .= "<li><a href=\"?chid={$typeAuthorsID}&action=edit&id={$data1['id']}\">" . $data1["lastname"] . ($data1["firstname"] ? " " . $data1["firstname"] : "") . ($data1["secondname"] ? " " . $data1["secondname"] : "") . "</a></li>";
}
$data["date"] = $data["time"] ? @date("d.m.Y", $data["time"]) : "";
$data["fio"] = $data["fio"] ? "<ul>" . $data["fio"] . "</ul>" : "";
eval('$libraryTR.="' . admin::template("libraryTR") . '";');
}
$pageBar = $pagination->bar();
$th = $orderBy->bar();
eval('$content="' . admin::template("libraryMain") . '";');
$this->elements["content"] = $content;
}
示例2: wrongAdd
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;
}
}