include "../library/admin.admin.php"; $adminid = $_GET["adminid"]; $action = $_GET["action"]; $preurl = $_GET["url"]; //检查权限超管权限,不是超管不能进行此项管理 if (getlogininfo("adminrole") == NULL || getlogininfo("adminrole") != "0") { die(gettext_r("noRight")); } switch ($action) { case "delete": //至少保留一个超管 try { getresult("begin"); getresult("delete from I_admin where id=" . $adminid); //echo getresultRow(getresult("select * from I_admin where adminrole=0")); if (getresultRow(getresult("select * from I_admin where adminrole=0")) < 1) { getresult("rollback"); throw new Exception(gettext_r("superManagerLeastOne")); } getresult("commit"); getresult("end"); die("<script type='text/javascript'>alert(\"" . gettext_r("delete") . gettext_r("success") . "\");window.location='admin_admin.php'</script>"); } catch (Exception $e) { echo $e->getMessage(); die("<script type='text/javascript'>alert(\"" . gettext_r("delete") . gettext_r("fail") . "\");history.back(-1)</script>"); } break; case "add": if ($_POST["submmit"] == gettext_r("submit")) { $adminname = trim($_POST["adminname"]); $tempresult = getresult("select * from I_admin where adminname='{$adminname}'");
:</td> <td class='attributeinput'><input value="<?php echo $keywords; ?> " type="text" name="keywords" /></td> </tr> <tr> <td class='label'><?php echo gettext_r("indextempalte"); ?> :</td> <td class='attributeinput'> <?php echo "<select name='indextemplate'>"; $indextemplateresult = getresult("select id,templatename from I_template where templatetype=3"); while (list($id, $templatename) = getresultRow($indextemplateresult)) { if ($id == $indextemplate) { echo "<option selected=\"selected\" value='{$id}'>{$templatename}</option>\n"; } else { echo "<option value='{$id}'>{$templatename}</option>\n"; } } echo " </select>\n"; ?> </td> </tr> <tr> <td class='label'><?php echo gettext_r("copyRight"); ?> :</td>
echo " </select></td></tr>\n"; echo "\t<tr><td class='label'>" . gettext_r("article") . gettext_r("template") . ":</td><td class='attributeinput'><select name=\"articletemplate\">\n"; //文章模板列表 $articletemplatelist = getresult("select id,templatename from I_template where templatetype=2"); while (list($id, $templatename) = getresultRow($articletemplatelist)) { if ($id == $articletemplateid) { echo "<option selected=\"selected\" value='{$id}'>{$templatename}</option>\n"; } else { echo "<option value='{$id}'>{$templatename}</option>\n"; } } echo " </select></td></tr>\n"; echo "\t<tr><td class='label'>" . gettext_r("search") . gettext_r("template") . ":</td><td class='attributeinput'><select name=\"searchtemplate\">\n"; //搜索模板列表 $articletemplatelist = getresult("select id,templatename from I_template where templatetype=4"); while (list($id, $templatename) = getresultRow($articletemplatelist)) { if ($id == $articletemplateid) { echo "<option selected=\"selected\" value='{$id}'>{$templatename}</option>\n"; } else { echo "<option value='{$id}'>{$templatename}</option>\n"; } } echo " </select></td></tr>\n"; echo "\t<tr><td class='label'>" . gettext_r("ifLock") . ":</td><td>"; if ($isopen == 0) { echo gettext_r("yes") . "<input type=\"radio\" value=\"0\" name=\"isopen\" checked=\"checked\" />" . gettext_r("no") . "<input type=\"radio\" value=\"1\" name=\"isopen\" />"; } else { echo gettext_r("yes") . "<input type=\"radio\" value=\"0\" name=\"isopen\" />" . gettext_r("no") . "<input type=\"radio\" value=\"1\" name=\"isopen\" checked=\"checked\" />"; } echo "</td></tr>\n"; echo "\t<tr><td></td><td><input type=\"submit\" value=\"" . gettext_r("submit") . "\" name=\"submmit\" /><input type=\"reset\" onclick=\"history.back(-1)\" value=\"" . gettext_r("back") . "\" /></td></tr>";
<?php include_once "../conn.php"; include_once "../library/basefunction.php"; include_once "../lang/envinit.php"; $functionarray = translatefunctioncode($_SESSION["functioncode"]); echo "<div style=\"float: left;\" id=\"function_menu\" class=\"sdmenu\">\n"; //操作菜单 $query = "select id,columnname from I_column where parentid = 0"; $result = getresult($query); //$count = getresultNumrows($result); while (list($id, $columnname) = getresultRow($result)) { //echo getlogininfo("adminrole"); if ($functionarray[$id] != NULL || getlogininfo("adminrole") === "0") { echo "<div>\n"; echo " <span>{$columnname}" . gettext_r("manage") . "</span>\n"; echo " <div>\n"; echo " <a target=\"main\" href=\"admin_article.php?action=add&columnid=" . $id . "\">" . gettext_r("add") . gettext_r("article") . "</a>\n"; echo " <a target=\"main\" href=\"admin_article.php?columnid=" . $id . "\">" . gettext_r("article") . gettext_r("manage") . "</a>\n"; if ($functionarray[$id] === "2" || getlogininfo("adminrole") === "0") { echo " <a target=\"main\" href=\"admin_column.php?columnid=" . $id . "\">" . gettext_r("column") . gettext_r("manage") . "</a>\n"; } echo " <a target=\"main\" href=\"admin_comment.php?columnid=" . $id . "\">" . gettext_r("comment") . gettext_r("manage") . "</a>\n"; if ($functionarray[$id] === "2" || getlogininfo("adminrole") === "0") { echo " <a target=\"main\" href=\"admin_field.php?columnid=" . $id . "\">" . gettext_r("field") . gettext_r("manage") . "</a>\n"; } echo " </div>\n"; echo "</div>\n"; } } //用户管理