123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406 |
- <?php
- namespace app\admin;
- class Base extends \app\system\Base
- {
- public $siteurl;
- function initialize()
- {
- $_var_0 = "http://" . $_SERVER["HTTP_HOST"];
- $this->siteurl = is_ssl() ? str_replace("http://", "https://", $_var_0) : $_var_0;
- $_var_1 = db("config")->where("name", "IN_BUILD")->value("value");
- if ($_var_1 > IN_BUILD) {
- $_var_2 = db("config")->select();
- $_var_3 = ["<?php"];
- foreach ($_var_2 as $_var_4 => $_var_5) {
- if ($_var_5["name"] == "IN_STAT") {
- $_var_5["value"] = base64_encode($_var_5["value"]);
- }
- $_var_3[] = "define('" . $_var_5["name"] . "','" . $_var_5["value"] . "');";
- }
- $_var_6 = IN_ROOT . "source/system/my.php";
- file_put_contents($_var_6, implode("\n", $_var_3));
- }
- }
- function Administrator($_var_7)
- {
- if (!isAdminLogin()) {
- $this->ShowMessage("未登录或登录已过期,请重新登录管理中心!", $_SERVER["PHP_SELF"], "infotitle3", 3000, 0);
- }
- setcookie("in_adminexpire", $_COOKIE["in_adminexpire"], time() + 36000);
- $_var_8 = explode(",", $_COOKIE["in_permission"]);
- $_var_9 = false;
- for ($_var_10 = 0; $_var_10 < count($_var_8); $_var_10++) {
- if ($_var_8[$_var_10] == $_var_7) {
- $_var_9 = true;
- }
- }
- if (!$_var_9) {
- $this->ShowMessage("权限不够,无法进入此页面!", "?c=body", "infotitle3", 3000, 0);
- }
- }
- function header($exclude = [])
- {
- if (in_array($this->action, $exclude)) {
- return null;
- }
- ?><!DOCTYPE html >
- <html lang="">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=<?php echo IN_CHARSET;?>"/>
- <meta http-equiv="x-ua-compatible" content="ie=7"/>
- <title><?php echo IN_NAME;?></title>
- <link rel="stylesheet" href="/xinadmin/lib/layui/css/layui.css">
- <link rel="stylesheet" href="/static/pack/layui/css/layui.css" media="all">
- <link href="/static/admincp/css/main.css" rel="stylesheet" type="text/css"/>
- <script src="/static/pack/layer/jquery.js"></script>
- <script src="/static/pack/layui/layui.js"></script>
- <script src="/static/pack/layer/lib.js"></script>
- <script src="/static/pack/layer/confirm-lib.js"></script>
-
- <style type="text/css">
- .itemtitle h3 {
- float: left;
- margin-right: 20px;
- line-height: 30px;
- width: 100px;
- display: block;
- text-align: center;
- text-decoration: none;
- margin-right: 1px;
- padding: 0px;
- background: #1f282d;
- border: 1px solid #fff;
- color: #fbf9f9;
- }
- .x-nav {
- padding: 0px 20px;
- position: relative;
- z-index: 99;
- border-bottom: 1px solid rgb(229, 229, 229);
- line-height: 39px;
- height: 49px;
- overflow: hidden;
- }
- </style>
- </head>
- <body><?php
- }
- function nav3()
- {
- $_var_11 = SafeRequest("c", "get");
- function getTitle($_var_12)
- {
- if (empty($_var_12["pid"]) && empty($_var_12["name"])) {
- return "";
- }
- $_var_13 = db("action")->where("id", $_var_12["pid"])->find();
- return getTitle($_var_13) . " - " . $_var_12["name"];
- }
- $_var_14 = db("action")->where("c", $_var_11)->where("a", $this->action)->where("pid", "<>", "0")->find();
- $_var_15 = IN_NAME . "管理中心 - " . getTitle($_var_14);
- if ($_var_14) {
- $_var_16 = db("action")->where("pid", $_var_14["pid"])->where("status", "1")->select();
- $_var_17 = db("action")->where("pid", $_var_14["id"])->where("status", "1")->select();
- if (count($_var_16)) {
- ?> <script>
- parent.document.title = "<?php echo $_var_15;?>";
- if (parent.$('#admincpnav'))
- parent.$('#admincpnav').innerHTML = "<?php echo $_var_15;?>";
- </script>
-
-
-
- <div class="x-nav">
-
- <a class="layui-btn layui-btn-primary layui-btn-small" style="line-height:1.6em;margin-top:3px;float:left" href="javascript:location.replace(location.href);" title="刷新">
- <i class="layui-icon" style="line-height:38px">ဂ</i></a>
- </div>
-
- <?php
- }
- if (count($_var_17)) {
- ?> <table class="tb tb2">
- <tr>
- <td>
- <?php
- foreach ($_var_17 as $_var_18 => $_var_19) {
- ?> <a href="?c=<?php echo $_var_19["c"];?>&a=<?php echo $_var_19["a"];?><?php echo $_var_19["p"] ? "&" . $_var_19["p"] : "";?>">
- <input type="button" value="<?php echo $_var_19["name"];?>" class="btn"/></a>
- <?php
- }
- ?> </td>
- </tr>
- </table>
- <?php
- }
- }
- }
- function searchForm($mark = '', $before = '', $middle = '', $after = '')
- {
- ?> <form name="btnsearch" method="get" action="<?php echo $_SERVER["PHP_SELF"];?>">
- <?php
- if ($mark) {
- ?> <table class="tb tb2">
-
- <tr>
- <td class="tipsblock">
- <ul>
- <li><?php echo $mark;?></li>
- </ul>
- </td>
- </tr>
- </table>
- <?php
- }
- ?> <table class="tb tb2">
- <tr>
- <td>
- <?php
- if ($before) {
- $before();
- }
- ?> <input type="hidden" name="c" value="<?php echo $this->module;?>">
- <input type="hidden" name="a" value="<?php echo $this->action;?>">
- 关键词:<input class="txt" x-webkit-speech type="search" name="search" value="<?php
- if (isset($this->search)) {
- ?><?php echo $this->search;?><?php
- }
- ?>"/>
- <?php
- if ($middle) {
- $middle();
- }
- ?> 时间:<input class="txt" type="text" name="start_time" id="start_time">-
- <input class="txt" type="text" name="end_time" id="end_time">
- <input type="button" value="搜索" class="layui-btn layui-btn-sm layui-btn-normal" onclick="document.btnsearch.submit();"/>
- <input class="layui-btn layui-btn-sm layui-btn-normal" type="reset" value="重置">
- <?php
- if ($after) {
- $after();
- }
- ?> </td>
- </tr>
- </table>
- </form>
- <?php
- }
- function mapTime($field, $isInt = false, &$map = [])
- {
- $this->start_time = SafeRequest("start_time", "get");
- $this->start_time && ($map[] = [$field, ">=", $isInt ? strtotime($this->start_time) . "" : $this->start_time]);
- $this->end_time = SafeRequest("end_time", "get");
- $_var_20 = strtotime("+1days", strtotime($this->end_time));
- $_var_21 = date("Y-m-d", $_var_20);
- $this->end_time && ($map[] = [$field, "<=", $isInt ? $_var_20 : $_var_21]);
- }
- function render($_var_22, $_var_23 = false)
- {
- if ($_var_22) {
- $_var_22 = "<table class=\"tb tb2\"><tr><td>" . $_var_22 . "</td></tr></table>";
- }
- if ($_var_23) {
- echo $_var_22;
- }
- return $_var_22;
- }
- function footer($exclude = [])
- {
- if (in_array($this->action, $exclude)) {
- return null;
- }
- $_var_24 = $_var_25 = "";
- if (isset($this->start_time)) {
- $_var_24 = $this->start_time;
- $_var_24 = is_numeric($_var_24) ? date("Y-m-d", $_var_24) : $_var_24;
- }
- if (isset($this->end_time)) {
- $_var_25 = $this->end_time;
- $_var_25 = is_numeric($_var_25) ? date("Y-m-d", $_var_25) : $_var_25;
- }
- ?> <script>
- layui.use(['laydate', 'layer'], function () {
- var laydate = layui.laydate;
- layer = layui.layer;
- //执行一个laydate实例
- laydate.render({
- elem: '#start_time', //指定元素
- type: 'date',
- value: "<?php echo $_var_24;?>"
- });
- //执行一个laydate实例
- laydate.render({
- elem: '#end_time', //指定元素
- type: 'date',
- value: "<?php echo $_var_25;?>"
- });
- });
- var pop = {
- up: function (scrolling, text, url, width, height, top) {
- layer.open({
- type: 2,
- maxmin: true,
- title: text,
- content: [url, scrolling],
- area: [width, height],
- offset: top,
- shade: false
- });
- }
- };
- function CheckAll(form) {
- for (var i = 0; i < form.elements.length; i++) {
- var e = form.elements[i];
- if (e.name != 'chkall') {
- e.checked = form.chkall.checked;
- }
- }
- all_save(form);
- }
- function all_save(form) {
- if (form.chkall.checked) {
- layer.tips('删除操作不可逆,请谨慎操作!', '#chkall', {
- tips: 3
- });
- }
- }
- /**
- * @return {boolean}
- */
- function CheckForm() {
- if (document.form.in_adminname.value == "") {
- layer.msg("登录帐号不能为空,请填写!", {icon: 1, time: 2000});
- document.form.in_adminname.focus();
- return false;
- } else {
- return true;
- }
- }
- function del_msg(href) {
- layer.confirm('删除操作不可逆,确认继续?', {
- btn: ['确认', '取消'] //按钮
- }, function () {
- location.href = href;
-
-
- });
- }
- //删除管理员确定窗口
- function del_msg1(href) {
- layer.confirm('删除操作不可逆,确认继续?', {
- btn: ['确认', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'GET',
- url: href,
- dataType: 'json',
- success: function (str) {
- if (str.status == "1") {
- layer.alert(str.msg,function(){
- window.location.reload();
- });
- }
- }
- });
-
-
-
- });
- }
- //删除应用
- function del_msgyy(href) {
- layer.confirm('确定删除此应用?', {
- btn: ['确认', '取消'] //按钮
- }, function () {
- location.href = href;
- });
- }
- //删除授权码
- function del_msgsqm(href) {
- layer.confirm('确定删除此授权码?', {
- btn: ['确认', '取消'] //按钮
- }, function () {
- location.href = href;
- });
- }
-
- //删除会员
- function del_msghy(href) {
- layer.confirm('确定删除此会员?', {
- btn: ['确认', '取消'] //按钮
- }, function () {
- location.href = href;
- });
- }
- function dosearch() {
- document.btnsearch.submit();
- }
- </script>
- </body></html><?php
- }
- function kindeditor()
- {
- ?> <link rel="stylesheet" href="/static/pack/kindeditor/themes/default/default.css"/>
- <script charset="utf-8" src="/static/pack/kindeditor/kindeditor-all-min.js"></script>
- <script charset="utf-8" src="/static/pack/kindeditor/lang/zh-CN.js"></script>
- <script>
- var editor;
- KindEditor.ready(function (K) {
- editor = K.create('textarea[name="content"]', {
- // allowFileManager: true,
- uploadJson: '/upload/index/kindeditor',
- themeType: 'simple',
- afterBlur: function () {
- this.sync();
- }
- });
- });
- </script>
- <?php
- }
- function editemplate($_var_26 = '')
- {
- ?><div class="container"><?php echo $this->nav3();?><table class="tb tb2"><?php echo $_var_26;?></table></div><?php
- }
- function mainjump()
- {
- ?><meta http-equiv="Content-Type" content="text/html; charset=<?php echo IN_CHARSET;?>" /><style type="text/css">body{background:#F2F9FD;}</style><?php
- }
- function Menu_App()
- {
- global $develop_auth;
- $_var_27 = "<li><a href=\"" . (is_ssl() ? str_replace("http://", "https://", $develop_auth) : $develop_auth) . "\" hidefocus=\"true\" target=\"main\"><em onclick=\"menuNewwin(this)\" title=\"新窗口打开\"></em>应用中心</a></li>";
- $_var_28 = "<li><a href=\"?c=module\" hidefocus=\"true\" target=\"main\"><em onclick=\"menuNewwin(this)\" title=\"新窗口打开\"></em>所有应用</a></li>";
- $_var_29 = "";
- $_var_30 = db("plugin")->where("in_type>0")->order("in_addtime desc")->select();
- foreach ($_var_30 as $_var_31) {
- $_var_29 = $_var_29 . "<li><a href=\"plugin.php/" . $_var_31["in_dir"] . "/" . $_var_31["in_file"] . "/\" hidefocus=\"true\" target=\"main\"><em onclick=\"menuNewwin(this)\" title=\"新窗口打开\"></em>" . $_var_31["in_name"] . "</a></li>";
- }
- return $_var_27 . $_var_28 . $_var_29;
- }
- function ShowMessage1($in_msg, $in_url, $in_style, $in_time, $in_type)
- {
- ?><script>layer.alert("<?php echo $in_msg ?>"); window.location.reload();</script><?php
- exit;
- }
- function ShowMessage($in_msg, $in_url, $in_style, $in_time, $in_type)
- {
- if ($in_type == 1) {
- ?><div class="container"><div class="infobox"><h4 class="<?php echo $in_style;?>"><?php echo $in_msg;?></h4><script type="text/javascript">setTimeout("location.href='<?php echo $in_url;?>';",<?php echo $in_time;?>);</script><p class="marginbot"><a href="<?php echo $in_url;?>" class="lightlink">3秒后返回,可点击这里立即返回</a></p></div></div><?php
- } elseif ($in_type == 2) {
- ?><div class="container"><h3>提示</h3><div class="infobox"><h4 class="<?php echo $in_style;?>"><?php echo $in_msg;?></h4><script type="text/javascript">setTimeout("<?php echo $in_url;?>",<?php echo $in_time;?>);</script><p class="marginbot"><a href="javascript:history.go(-1);" class="lightlink">如果您的浏览器没有自动跳转,请点击这里</a></p></div></div><?php
- } else {
- ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=<?php echo IN_CHARSET;?>" /><meta http-equiv="x-ua-compatible" content="ie=7" /><title>提示信息</title><link href="<?php echo IN_PATH;?>static/admincp/css/main.css" rel="stylesheet" type="text/css" /></head><body><div class="container"><h3>提示</h3><div class="infobox"><h4 class="<?php echo $in_style;?>"><?php echo $in_msg;?></h4><script type="text/javascript">setTimeout("location.href='<?php echo $in_url;?>';",<?php echo $in_time;?>);</script><p class="marginbot"><a href="<?php echo $in_url;?>" class="lightlink">如果您的浏览器没有自动跳转,请点击这里</a></p></div></div><?php
- }
- ?></body></html><?php
- exit;
- }
- }
|