全局代码进行格式优化

This commit is contained in:
cloud 2020-12-07 02:16:43 +08:00
parent fe837f0df5
commit 7d2668700b
51 changed files with 3925 additions and 3532 deletions

View File

@ -7,7 +7,8 @@ load::own_class('../traits/tlist');
load::own_class('../traits/tfield'); load::own_class('../traits/tfield');
//表格 //表格
class backups extends appadmin { class backups extends appadmin
{
//备份字段 //备份字段
private $bsign = true; private $bsign = true;
@ -33,7 +34,8 @@ class backups extends appadmin {
private $bacfield = ''; //查询字段 private $bacfield = ''; //查询字段
private $bacpages = 500; //每页查询条数 private $bacpages = 500; //每页查询条数
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
$this->form = $_M['form']; $this->form = $_M['form'];
@ -49,7 +51,8 @@ class backups extends appadmin {
use tlist; use tlist;
//表格数据 //表格数据
public function doindex() { public function doindex()
{
global $_M; global $_M;
self::csvtitle(); self::csvtitle();
$this->bacname = '广告位'; $this->bacname = '广告位';
@ -100,7 +103,8 @@ class backups extends appadmin {
} }
//判断语句组合 //判断语句组合
protected function bactable() { protected function bactable()
{
global $_M; global $_M;
$this->bactable = self::td_sqlk(); $this->bactable = self::td_sqlk();
$this->bacfield = self::td_field(); $this->bacfield = self::td_field();
@ -121,7 +125,8 @@ class backups extends appadmin {
} }
//计算总数 //计算总数
protected function tabletotal() { protected function tabletotal()
{
global $_M; global $_M;
$countsql = " SELECT COUNT(*) FROM {$this->bactable} {$this->bacconds} "; $countsql = " SELECT COUNT(*) FROM {$this->bactable} {$this->bacconds} ";
if ($this->multi_table) $countsql = " SELECT count(*) FROM (SELECT {$this->bacfield} FROM {$this->bactable} {$this->bacconds}) num "; if ($this->multi_table) $countsql = " SELECT count(*) FROM (SELECT {$this->bacfield} FROM {$this->bactable} {$this->bacconds}) num ";
@ -131,7 +136,8 @@ class backups extends appadmin {
} }
//获取获取 //获取获取
protected function tabledata($pages) { protected function tabledata($pages)
{
global $_M; global $_M;
$cursize = $pages * $this->bacpages; $cursize = $pages * $this->bacpages;
//SQL查询 //SQL查询
@ -156,7 +162,8 @@ class backups extends appadmin {
# 导入导出数组(保持和导入格式一样) # 导入导出数组(保持和导入格式一样)
protected function csvtitle() { protected function csvtitle()
{
global $_M, $_YW; global $_M, $_YW;
$this->title = self::{'tf_' . $this->tname}(); $this->title = self::{'tf_' . $this->tname}();
$this->keys = array_keys($this->title); $this->keys = array_keys($this->title);
@ -164,7 +171,8 @@ class backups extends appadmin {
} }
//生成文件名 //生成文件名
public function csvname() { public function csvname()
{
global $_M, $_YW; global $_M, $_YW;
$date = date('Ymd', time()); $date = date('Ymd', time());
$filename = iconv("utf-8", "GBK", $this->bacname . $_M['lang'] . $date); $filename = iconv("utf-8", "GBK", $this->bacname . $_M['lang'] . $date);
@ -173,7 +181,8 @@ class backups extends appadmin {
} }
//对数组的值进行转码并返回(一维数组) //对数组的值进行转码并返回(一维数组)
public function arrzbm($arr, $u, $g) { public function arrzbm($arr, $u, $g)
{
global $_M, $_YW; global $_M, $_YW;
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
$newarr[ $k ] = iconv($u, $g, $v); $newarr[ $k ] = iconv($u, $g, $v);
@ -182,7 +191,8 @@ class backups extends appadmin {
} }
//删除html元素 //删除html元素
public function striptags($array = []) { public function striptags($array = [])
{
global $_M, $_YW; global $_M, $_YW;
$ret = []; $ret = [];
foreach ($array as $key => $str) { foreach ($array as $key => $str) {

View File

@ -1,10 +1,13 @@
<?php <?php
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
//接口初始化
class dzadsod extends appadmin {
public function __construct() { //接口初始化
class dzadsod extends appadmin
{
public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
parent::appnav(); parent::appnav();
@ -12,7 +15,8 @@ class dzadsod extends appadmin {
} }
public function __destruct() { public function __destruct()
{
global $_M, $_YW; global $_M, $_YW;
if ($this->destruct) { if ($this->destruct) {
if (empty($this->appshow)) $this->appshow = 'app/' . $this->tname; if (empty($this->appshow)) $this->appshow = 'app/' . $this->tname;
@ -23,7 +27,8 @@ class dzadsod extends appadmin {
/** /**
* 综合设置 * 综合设置
*/ */
public function dodzadsod() { public function dodzadsod()
{
global $_M; global $_M;
//统计总数 //统计总数
$this->input['num'] = $this->cloud->summary(); $this->input['num'] = $this->cloud->summary();
@ -35,4 +40,5 @@ class dzadsod extends appadmin {
} }
} }
?> ?>

View File

@ -258,4 +258,5 @@ class info_on extends appadmin
} }
} }
?> ?>

View File

@ -1,5 +1,6 @@
<?php <?php
defined('IN_MET') or exit ('No permission'); defined('IN_MET') or exit ('No permission');
//2.0 //2.0
class install class install
{ {
@ -15,7 +16,8 @@ class install
private $display; private $display;
private $mlangok; private $mlangok;
public function __construct() { public function __construct()
{
global $_M; global $_M;
do { do {
$this->appno = mt_rand(2001, 9999); //应用编号 $this->appno = mt_rand(2001, 9999); //应用编号
@ -34,7 +36,8 @@ class install
} }
//安装主方法 //安装主方法
public function dosql() { public function dosql()
{
global $_M; global $_M;
$stall = self::sqlone('applist', " m_name='{$this->m_name}' "); $stall = self::sqlone('applist', " m_name='{$this->m_name}' ");
if (!$stall) { if (!$stall) {
@ -47,7 +50,8 @@ class install
} }
//执行APP相关的表数据插入 //执行APP相关的表数据插入
private function appsql() { private function appsql()
{
global $_M; global $_M;
$time = time(); $time = time();
//注册应用 //注册应用
@ -86,7 +90,8 @@ class install
} }
//公共查询方法 //公共查询方法
private function sqlone($tname,$where = '') { private function sqlone($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
if (!$where) { if (!$where) {
@ -96,11 +101,13 @@ class install
} }
//公共写入方法 //公共写入方法
private function addsql($tname,$field = '') { private function addsql($tname, $field = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
DB::query("INSERT INTO {$table} SET {$field}"); DB::query("INSERT INTO {$table} SET {$field}");
} }
} }
?> ?>

View File

@ -9,7 +9,9 @@ load::own_func('appcmp');
* 配置 * 配置
* 包含其他功能初始化 * 包含其他功能初始化
*/ */
class select extends appadmin {
class select extends appadmin
{
/* /*
* @$querys string 搜索内容 * @$querys string 搜索内容
@ -44,7 +46,8 @@ class select extends appadmin {
//返回的数组 //返回的数组
private $data = []; private $data = [];
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
//指定表 //指定表
@ -66,7 +69,8 @@ class select extends appadmin {
} }
# select2 选项字段处理 # select2 选项字段处理
private function select_fiend($val) { private function select_fiend($val)
{
global $_M, $_YW; global $_M, $_YW;
$strarr = stringto_array($this->fiend, '|'); $strarr = stringto_array($this->fiend, '|');
foreach ($strarr as $value) { foreach ($strarr as $value) {
@ -76,7 +80,8 @@ class select extends appadmin {
} }
# allnone 默认选项全部处理 # allnone 默认选项全部处理
private function allnone() { private function allnone()
{
global $_M, $_YW; global $_M, $_YW;
// 若不需要显示‘全部’值,则直接返回空 // 若不需要显示‘全部’值,则直接返回空
// 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值 // 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值
@ -97,7 +102,8 @@ class select extends appadmin {
} }
# 当未搜索到值是否将搜索结果设置为可选值 # 当未搜索到值是否将搜索结果设置为可选值
private function children() { private function children()
{
global $_M, $_YW; global $_M, $_YW;
// 判断是否要将搜索内容设置为可选值 // 判断是否要将搜索内容设置为可选值
if (empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false; if (empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false;
@ -112,7 +118,8 @@ class select extends appadmin {
} }
# querys 处理 # querys 处理
private function querys() { private function querys()
{
global $_M, $_YW; global $_M, $_YW;
if (strlen($this->querys) == 0) return false; if (strlen($this->querys) == 0) return false;
switch ($this->tname) { switch ($this->tname) {
@ -144,7 +151,8 @@ class select extends appadmin {
} }
# condition 处理 # condition 处理
private function condition() { private function condition()
{
global $_M, $_YW; global $_M, $_YW;
if (empty($this->condition)) return false; if (empty($this->condition)) return false;
// 进行处理 // 进行处理
@ -161,7 +169,8 @@ class select extends appadmin {
} }
# 选项值的组成样式 # 选项值的组成样式
private function valuet($val) { private function valuet($val)
{
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
@ -196,7 +205,8 @@ class select extends appadmin {
} }
//编号字段,根据此字段进行编号处理 //编号字段,根据此字段进行编号处理
private function charter() { private function charter()
{
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
@ -229,7 +239,8 @@ class select extends appadmin {
// 查看场所名称列表 // 查看场所名称列表
public function doselect() { public function doselect()
{
global $_M, $_YW; global $_M, $_YW;
//判断条件 //判断条件
self::querys(); self::querys();

View File

@ -7,7 +7,8 @@ load::own_class('../traits/tlist');
load::own_class('../traits/tfield'); load::own_class('../traits/tfield');
//表格 //表格
class table_ajax extends appadmin { class table_ajax extends appadmin
{
//非备份,正常字段即可 //非备份,正常字段即可
private $bsign = false; private $bsign = false;
@ -23,7 +24,8 @@ class table_ajax extends appadmin {
private $own_name_info; private $own_name_info;
private $own_name_table; private $own_name_table;
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
$this->form = $_M['form']; $this->form = $_M['form'];
@ -36,7 +38,8 @@ class table_ajax extends appadmin {
} }
//表格数据 //表格数据
public function doindex() { public function doindex()
{
global $_M; global $_M;
//加载表格数据获取类 //加载表格数据获取类
$table = load::own_class('tabledata', 'new'); $table = load::own_class('tabledata', 'new');
@ -69,7 +72,8 @@ class table_ajax extends appadmin {
* 【列出】 * 【列出】
* 返回数据数组 * 返回数据数组
*/ */
private function sqlarr($data = []) { private function sqlarr($data = [])
{
global $_M; global $_M;
// if(in_array($this->tname,$this->k_name)){ // if(in_array($this->tname,$this->k_name)){
foreach ($data as $val) { foreach ($data as $val) {
@ -86,7 +90,8 @@ class table_ajax extends appadmin {
* 【新行】 * 【新行】
* 新增行分发 * 新增行分发
*/ */
public function do_table_add_list(){ public function do_table_add_list()
{
global $_M; global $_M;
$val = ['id' => 'new-' . $this->form['new_id'], 'p_type' => $this->form['p_type']]; $val = ['id' => 'new-' . $this->form['new_id'], 'p_type' => $this->form['p_type']];
if (in_array($this->tname, $this->k_name)) { if (in_array($this->tname, $this->k_name)) {
@ -99,7 +104,8 @@ class table_ajax extends appadmin {
* 【新行】 * 【新行】
* 生成文件新增行 * 生成文件新增行
*/ */
private function addlist($val) { private function addlist($val)
{
global $_M; global $_M;
$metinfo = ''; $metinfo = '';
foreach ($this->list as $v) { foreach ($this->list as $v) {
@ -112,7 +118,8 @@ class table_ajax extends appadmin {
use tlist; use tlist;
//公用的输出 //公用的输出
protected function output($val,$checked = '') { protected function output($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
$array = self::{$this->tname}($val, $checked); $array = self::{$this->tname}($val, $checked);
$this->list = array(); $this->list = array();

View File

@ -4,7 +4,8 @@ defined('IN_MET') or exit ('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
//表格 //表格
class table_off extends appadmin { class table_off extends appadmin
{
//获取的ID //获取的ID
private $allid; private $allid;
@ -47,7 +48,8 @@ class table_off extends appadmin {
} }
//主方法 //主方法
public function doindex(){ public function doindex()
{
global $_M, $_YW; global $_M, $_YW;
$this->allid = array_filter(explode(',', $_M['form']['all_id'])); $this->allid = array_filter(explode(',', $_M['form']['all_id']));
switch ($_M['form']['submit_type']) { switch ($_M['form']['submit_type']) {
@ -79,7 +81,8 @@ class table_off extends appadmin {
} }
//保存 //保存
private function save() { private function save()
{
global $_M, $_YW; global $_M, $_YW;
foreach ($this->allid as $id) { foreach ($this->allid as $id) {
if ($id) { if ($id) {
@ -99,7 +102,8 @@ class table_off extends appadmin {
} }
//删除 //删除
private function delet() { private function delet()
{
global $_M, $_YW; global $_M, $_YW;
foreach ($this->allid as $id) { foreach ($this->allid as $id) {
if ($id) { if ($id) {
@ -117,7 +121,8 @@ class table_off extends appadmin {
} }
//调整广告位状态 //调整广告位状态
private function enable($type = true) { private function enable($type = true)
{
global $_M, $_YW; global $_M, $_YW;
$enable = $_M['form']['submit_type'] == 'enableon' || $_M['form']['submit_type'] == 'enable_on' ? 1 : 0; $enable = $_M['form']['submit_type'] == 'enableon' || $_M['form']['submit_type'] == 'enable_on' ? 1 : 0;
$fid = $type ? 'e_vid' : 'id'; $fid = $type ? 'e_vid' : 'id';
@ -132,7 +137,8 @@ class table_off extends appadmin {
} }
//ajax单独调整 //ajax单独调整
private function typeonoff() { private function typeonoff()
{
global $_M, $_YW; global $_M, $_YW;
$field = $_M['form']['field']; $field = $_M['form']['field'];
$special = "ABS({$field}-1)"; $special = "ABS({$field}-1)";
@ -151,7 +157,8 @@ class table_off extends appadmin {
} }
//保存信息 //保存信息
private function info($id) { private function info($id)
{
global $_M, $_YW; global $_M, $_YW;
$lang = ''; $lang = '';
switch ($this->tname) { switch ($this->tname) {
@ -171,7 +178,8 @@ class table_off extends appadmin {
} }
//删除其他的关联表 //删除其他的关联表
private function todel($id) { private function todel($id)
{
global $_M, $_YW; global $_M, $_YW;
$ret = true; $ret = true;
switch ($this->tname) { switch ($this->tname) {
@ -223,7 +231,8 @@ class table_off extends appadmin {
} }
// 删除排期广告位编号 // 删除排期广告位编号
private function del_elevator($num) { private function del_elevator($num)
{
$dellist = []; $dellist = [];
if (!is_array($num)) $num = [$num]; if (!is_array($num)) $num = [$num];
$num = array_unique($num); $num = array_unique($num);
@ -283,4 +292,5 @@ class table_off extends appadmin {
} }
} }
?> ?>

View File

@ -3,7 +3,8 @@ defined('IN_MET') or exit ('No permission');
load::own_class('appadmin'); load::own_class('appadmin');
class table_on extends appadmin { class table_on extends appadmin
{
// 表格标题 // 表格标题
private $table_theme; // 等待完善 private $table_theme; // 等待完善
@ -129,7 +130,6 @@ class table_on extends appadmin {
} }
} }
?> ?>

View File

@ -117,7 +117,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>合同到期通知</label></dt> <dt><label class='form-control-label'>合同到期通知</label></dt>
<dd> <dd>
<input type="text" name="h_noticeday" placeholder="输入天数,限于数字" value="{$data.data.h_noticeday}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="h_noticeday" placeholder="输入天数,限于数字" value="{$data.data.h_noticeday}"
data-plugin='tokenfield' data-delimiter=','/>
<span class="text-help m-l-10">可设置多个通知天数,输入完成一个回车后再输入下一个</span> <span class="text-help m-l-10">可设置多个通知天数,输入完成一个回车后再输入下一个</span>
</dd> </dd>
</dl> </dl>
@ -138,7 +139,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>合同备注</label></dt> <dt><label class='form-control-label'>合同备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="h_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.h_text}</textarea> <textarea name="h_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.h_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -575,6 +575,7 @@ ul.panel-actions>li:first-child {
.panel > .list-group, .panel > .panel-collapse > .list-group { .panel > .list-group, .panel > .panel-collapse > .list-group {
margin-bottom: 0 margin-bottom: 0
} }
.panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item, .panel > .panel-body > .list-group .list-group-item { .panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item, .panel > .panel-body > .list-group .list-group-item {
border-width: 1px 0; border-width: 1px 0;
border-radius: 0 border-radius: 0
@ -1119,15 +1120,24 @@ ul.panel-actions>li:first-child {
} }
/*自定义样式*/ /*自定义样式*/
html, body{height: 100%;} html, body {
.app-sub-nav .nav-tabs{border-bottom:none;} height: 100%;
.btn-cursor-pointer{cursor:pointer;} }
.app-sub-nav .nav-tabs {
border-bottom: none;
}
.btn-cursor-pointer {
cursor: pointer;
}
/*把脑残替换的恢复过来*/ /*把脑残替换的恢复过来*/
.form-inline .form-group { .form-inline .form-group {
margin-right: 20px; margin-right: 20px;
} }
@media (min-width: 480px) { @media (min-width: 480px) {
.form-inline .form-group, .form-inline .form-control { .form-inline .form-group, .form-inline .form-control {
display: inline-block; display: inline-block;
@ -1136,27 +1146,33 @@ html, body{height: 100%;}
vertical-align: middle; vertical-align: middle;
} }
} }
/*在帮脑残修复一下*/ /*在帮脑残修复一下*/
table .form-inline .form-group { table .form-inline .form-group {
margin-right: 0px; margin-right: 0px;
} }
@media (min-width: 480px) { @media (min-width: 480px) {
table .form-inline .form-group, table .form-inline .form-control { table .form-inline .form-group, table .form-inline .form-control {
display: block; display: block;
width: 100%; width: 100%;
} }
} }
.modal-open .select2-container { .modal-open .select2-container {
z-index: auto !important; z-index: auto !important;
} }
/*CSS*/ /*CSS*/
@media (min-width: 767px) { @media (min-width: 767px) {
.metadmin-fmbx dl .city-css .form-control { .metadmin-fmbx dl .city-css .form-control {
width: auto; width: auto;
} }
.metadmin-fmbx dl .city-css .form-control { .metadmin-fmbx dl .city-css .form-control {
width: auto; width: auto;
} }
.appmain #showmap { .appmain #showmap {
width: 60%; width: 60%;
} }
@ -1194,6 +1210,7 @@ table .form-inline .form-group {
-webkit-box-shadow: none; -webkit-box-shadow: none;
box-shadow: none; box-shadow: none;
} }
.page-profile .card-footer { .page-profile .card-footer {
padding: 0px; padding: 0px;
border-radius: .215rem; border-radius: .215rem;
@ -1218,8 +1235,17 @@ table .form-inline .form-group {
} }
/*表格头部排序样式*/ /*表格头部排序样式*/
.orderby-arrow.desc:before{ content: '\2193'; font-weight: bold; margin-left: 5px;} .orderby-arrow.desc:before {
.orderby-arrow.asc:before{ content: '\2191'; font-weight: bold; margin-left: 5px;} content: '\2193';
font-weight: bold;
margin-left: 5px;
}
.orderby-arrow.asc:before {
content: '\2191';
font-weight: bold;
margin-left: 5px;
}
.metadmin-main table td .loader-ellipsis { .metadmin-main table td .loader-ellipsis {
width: 0.45em; width: 0.45em;
@ -1236,28 +1262,35 @@ li.village-list-item > button.close{
font-size: 1.2rem; font-size: 1.2rem;
outline: none; outline: none;
} }
.filterList li.village-list-item > button.close { .filterList li.village-list-item > button.close {
margin-top: 10px; margin-top: 10px;
} }
li.village-list-item > button.close:hover { li.village-list-item > button.close:hover {
color: #f2353c; color: #f2353c;
} }
li.village-list-item > h5 { li.village-list-item > h5 {
font-weight: 600 !important; font-weight: 600 !important;
display: inline-block !important; display: inline-block !important;
margin-bottom: .5rem; margin-bottom: .5rem;
} }
li.village-list-item > p { li.village-list-item > p {
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
.villageList li.village-list-item > h5 { .villageList li.village-list-item > h5 {
cursor: pointer cursor: pointer
} }
.btn-group-toggle-menu { .btn-group-toggle-menu {
left: -49px !important; left: -49px !important;
padding: 5px; padding: 5px;
min-width: 120px; min-width: 120px;
} }
.btn-group-toggle-menu a, .btn-group-toggle-menu button { .btn-group-toggle-menu a, .btn-group-toggle-menu button {
display: inherit; display: inherit;
border-radius: 0; border-radius: 0;

View File

@ -47,7 +47,8 @@ $met_title = $data['met_title'];
required data-fv-notEmpty-message="不能为空"></select> required data-fv-notEmpty-message="不能为空"></select>
</div> </div>
<div class="form-group clearfix"> <div class="form-group clearfix">
<input type="text" name="c_address" value="{$data.data.c_address}" placeholder="请输入详细地址" class="form-control" <input type="text" name="c_address" value="{$data.data.c_address}" placeholder="请输入详细地址"
class="form-control"
required data-fv-notEmpty-message="不能为空"> required data-fv-notEmpty-message="不能为空">
</div> </div>
</dd> </dd>
@ -64,14 +65,16 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>联系电话</label></dt> <dt><label class='form-control-label'>联系电话</label></dt>
<dd> <dd>
<input type="text" name="c_tel" value="{$data.data.c_tel}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="c_tel" value="{$data.data.c_tel}" data-plugin='tokenfield'
data-delimiter=','/>
<span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span> <span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="c_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.c_text}</textarea> <textarea name="c_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.c_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -22,28 +22,32 @@ $met_title = $data['met_title'];
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="今天空闲的广告位总数,包含禁用的广告位">广告位空闲数 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="今天空闲的广告位总数,包含禁用的广告位">广告位空闲数 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.vlease}</strong> <strong class="profile-stat-count">{$data.num.vlease}</strong>
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="今天正在排期中的广告位">广告位排期中 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="今天正在排期中的广告位">广告位排期中 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.vendday}</strong> <strong class="profile-stat-count">{$data.num.vendday}</strong>
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="7天内即将到期的广告位总数">7天内到期 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="7天内即将到期的广告位总数">7天内到期 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.vprerow}</strong> <strong class="profile-stat-count">{$data.num.vprerow}</strong>
<span data-toggle="tooltip" <span data-toggle="tooltip"
data-placement="bottom" data-placement="bottom"
data-trigger="hover" data-trigger="hover"
data-original-title="投放开始时间大于今天的广告位">广告位预排数 <i class="icon fa-question-circle" aria-hidden="true"></i></span> data-original-title="投放开始时间大于今天的广告位">广告位预排数 <i class="icon fa-question-circle"
aria-hidden="true"></i></span>
</div> </div>
<div class="col-xs-1"> <div class="col-xs-1">
<strong class="profile-stat-count">{$data.num.contract}</strong> <strong class="profile-stat-count">{$data.num.contract}</strong>
@ -102,12 +106,15 @@ $met_title = $data['met_title'];
<small>包含根据设置的到期提醒天数内的订单以及订单投放结束到期的订单符合条件的数据展示3天</small> <small>包含根据设置的到期提醒天数内的订单以及订单投放结束到期的订单符合条件的数据展示3天</small>
</h3> </h3>
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist" data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable"> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist"
data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable">
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody> <tbody>
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -69,7 +69,8 @@ $met_title = $data['met_title'];
<dt><label class='form-control-label'>是否启用</label></dt> <dt><label class='form-control-label'>是否启用</label></dt>
<dd class="form-group"> <dd class="form-group">
<div class="radio-custom radio-primary radio-inline"> <div class="radio-custom radio-primary radio-inline">
<input type="radio" id="e_enable0" name="e_enable" value='0' data-checked='{$data.data.e_enable}' <input type="radio" id="e_enable0" name="e_enable" value='0'
data-checked='{$data.data.e_enable}'
required data-fv-notEmpty-message='不能为空'/> required data-fv-notEmpty-message='不能为空'/>
<label for="e_enable0">禁用</label> <label for="e_enable0">禁用</label>
</div> </div>
@ -82,14 +83,16 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>自主标签</label></dt> <dt><label class='form-control-label'>自主标签</label></dt>
<dd> <dd>
<input type="text" name="e_label" placeholder="输入标签" value="{$data.data.e_label}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="e_label" placeholder="输入标签" value="{$data.data.e_label}"
data-plugin='tokenfield' data-delimiter=','/>
<span class="text-help m-l-10">自定义广告位相关标签,可设置多个</span> <span class="text-help m-l-10">自定义广告位相关标签,可设置多个</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="e_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.e_text}</textarea> <textarea name="e_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.e_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -14,7 +14,8 @@ $met_title = $data['app']['appname'];
<div class="topimg"> <div class="topimg">
<div class="topimg-image"> <div class="topimg-image">
<div class="avatar"> <div class="avatar">
<img class="img-circle img-bordered img-bordered-info" src="{$data.app.icon}" alt="image"> <img class="img-circle img-bordered img-bordered-info" src="{$data.app.icon}"
alt="image">
</div> </div>
</div> </div>
<div class="topimg-body p-10 p-l-5"> <div class="topimg-body p-10 p-l-5">
@ -33,7 +34,8 @@ $met_title = $data['app']['appname'];
</div> </div>
</div> </div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="appmodal" aria-hidden="true" data-keyboard="false" data-backdrop="false" role="dialog" tabindex="-1"> <div class="modal fade" id="appmodal" aria-hidden="true" data-keyboard="false" data-backdrop="false" role="dialog"
tabindex="-1">
<div class="modal-dialog modal-center"> <div class="modal-dialog modal-center">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">

View File

@ -7,9 +7,7 @@
}; };
//扩展方法 //扩展方法
appmap.prototype = { appmap.prototype = {};
};
//外部入口 //外部入口
$.fn.maps = function () { $.fn.maps = function () {

View File

@ -1,18 +0,0 @@
//用来阻止广告位重复添加的
(function($){
//内部初始化入口
var appmap = function(){
};
//扩展方法
appmap.prototype = {
};
//外部入口
$.fn.maps = function () {
};
})(jQuery);

View File

@ -56,7 +56,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="k_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.k_text}</textarea> <textarea name="k_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.k_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -8,7 +8,8 @@ $met_title = $data['met_title'];
<!--二级导航--> <!--二级导航-->
{$data.nav_sub} {$data.nav_sub}
<div class="metadmin-fmbx"> <div class="metadmin-fmbx">
<h3 class='example-title'>订单信息:<span class="text-help">{$data.data.h_cid}{$data.data.l_hnumber}</span></h3> <h3 class='example-title'>订单信息:<span class="text-help">{$data.data.h_cid}{$data.data.l_hnumber}</span>
</h3>
<dl class="col-md-6 col-lg-6 col-6"> <dl class="col-md-6 col-lg-6 col-6">
<dt><label class='form-control-label'>投放计划名称</label></dt> <dt><label class='form-control-label'>投放计划名称</label></dt>
<dd class="form-group"> <dd class="form-group">
@ -65,7 +66,8 @@ $met_title = $data['met_title'];
<dl class="col-md-4 col-lg-4 col-4"> <dl class="col-md-4 col-lg-4 col-4">
<dt><label class='form-control-label'>投放计划备注</label></dt> <dt><label class='form-control-label'>投放计划备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="l_text" rows="3" placeholder='备注描述' class='form-control m-r-10'>{$data.data.l_text}</textarea> <textarea name="l_text" rows="3" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.l_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>
@ -86,12 +88,15 @@ $met_title = $data['met_title'];
<!--头部搜索--> <!--头部搜索-->
{$data.table.search} {$data.table.search}
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tables-list" data-table-ajaxurl="{$data.table.ajaxurl}" data-table-pagelength='15' data-plugin="selectable"> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tables-list"
data-table-ajaxurl="{$data.table.ajaxurl}" data-table-pagelength='15' data-plugin="selectable">
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody data-colspan="{$data.table.tdcol}"> <tbody data-colspan="{$data.table.tdcol}">
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -11,12 +11,15 @@ $met_title = $data['met_title'];
<!--头部搜索--> <!--头部搜索-->
{$data.table.search} {$data.table.search}
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist" data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable"> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-10" id="tableslist"
data-table-ajaxurl="{$data.url.ajaxurl}" data-table-pagelength='15' data-plugin="selectable">
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody data-colspan="{$data.table.tdcol}"> <tbody data-colspan="{$data.table.tdcol}">
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -34,7 +34,8 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>场所地址</label></dt> <dt><label class='form-control-label'>场所地址</label></dt>
<dd> <dd>
<div data-plugin="select-linkage" data-select-url="{$data.url.city}" class="city-css city-js form-group"> <div data-plugin="select-linkage" data-select-url="{$data.url.city}"
class="city-css city-js form-group">
<select name="v_province" class="form-control m-r-5 prov" data-checked="{$data.data.v_province}" <select name="v_province" class="form-control m-r-5 prov" data-checked="{$data.data.v_province}"
required data-fv-notEmpty-message="不能为空"></select> required data-fv-notEmpty-message="不能为空"></select>
<select name="v_city" class="form-control m-r-5 city" data-checked="{$data.data.v_city}" <select name="v_city" class="form-control m-r-5 city" data-checked="{$data.data.v_city}"
@ -75,7 +76,8 @@ $met_title = $data['met_title'];
</dd> </dd>
</dl> </dl>
<!-- Modal 百度地图JS V3--> <!-- Modal 百度地图JS V3-->
<script type="text/javascript" src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak={$data.mapkey}"></script> <script type="text/javascript"
src="https://api.map.baidu.com/api?type=webgl&v=1.0&ak={$data.mapkey}"></script>
<div class="modal fade" id="appmaps" aria-hidden="true" data-keyboard="false" role="dialog" tabindex="-1"> <div class="modal fade" id="appmaps" aria-hidden="true" data-keyboard="false" role="dialog" tabindex="-1">
<div class="modal-dialog modal-center modal-lg"> <div class="modal-dialog modal-center modal-lg">
<div class="modal-content"> <div class="modal-content">

View File

@ -27,14 +27,16 @@ $met_title = $data['met_title'];
<dl> <dl>
<dt><label class='form-control-label'>联系电话</label></dt> <dt><label class='form-control-label'>联系电话</label></dt>
<dd> <dd>
<input type="text" name="w_tel" value="{$data.data.w_tel}" data-plugin='tokenfield' data-delimiter=','/> <input type="text" name="w_tel" value="{$data.data.w_tel}" data-plugin='tokenfield'
data-delimiter=','/>
<span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span> <span class="text-help m-l-10">可备注多个联系电话,输入完成一个回车后再输入下一个</span>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label class='form-control-label'>备注</label></dt> <dt><label class='form-control-label'>备注</label></dt>
<dd class="form-group"> <dd class="form-group">
<textarea name="w_text" rows="5" placeholder='备注描述' class='form-control m-r-10'>{$data.data.w_text}</textarea> <textarea name="w_text" rows="5" placeholder='备注描述'
class='form-control m-r-10'>{$data.data.w_text}</textarea>
<span class="text-help">简短文字描述备注。</span> <span class="text-help">简短文字描述备注。</span>
</dd> </dd>
</dl> </dl>

View File

@ -3,13 +3,15 @@ defined('IN_MET') or exit ('No permission');
load::sys_func('file'); load::sys_func('file');
class uninstall { class uninstall
{
private $appno; //应用NO值 private $appno; //应用NO值
private $m_name; //应用文件夹 private $m_name; //应用文件夹
private $del_dirs = []; //需要删除的文件夹,以根目录为准 private $del_dirs = []; //需要删除的文件夹,以根目录为准
public function __construct() { public function __construct()
{
global $_M; global $_M;
$this->appno = $_M['form']['no']; //获取NO $this->appno = $_M['form']['no']; //获取NO
@ -25,7 +27,8 @@ class uninstall {
} }
public function dodel() { public function dodel()
{
global $_M; global $_M;
//删除一些提前删除的内容 //删除一些提前删除的内容
@ -40,7 +43,8 @@ class uninstall {
} }
//优先执行代码[推荐] //优先执行代码[推荐]
private function firstsql() { private function firstsql()
{
global $_M; global $_M;
//查询应用的文件夹 //查询应用的文件夹
$mname = self::sqlone('applist'); $mname = self::sqlone('applist');
@ -51,7 +55,8 @@ class uninstall {
} }
//删除自定义表 //删除自定义表
private function zdysql() { private function zdysql()
{
global $_M; global $_M;
//公用表 //公用表
$cloud = ['cloud_config']; $cloud = ['cloud_config'];
@ -78,7 +83,8 @@ class uninstall {
} }
//删除固定的app表 //删除固定的app表
private function appsql() { private function appsql()
{
global $_M; global $_M;
//删除栏目接口表 //删除栏目接口表
self::delsql('ifcolumn'); self::delsql('ifcolumn');
@ -109,14 +115,16 @@ class uninstall {
} }
//删除应用文件夹 //删除应用文件夹
private function delfile() { private function delfile()
{
foreach ($this->del_dirs as $dir) { foreach ($this->del_dirs as $dir) {
if (file_exists(PATH_WEB . $dir) && $dir != null) deldir(PATH_WEB . $dir); if (file_exists(PATH_WEB . $dir) && $dir != null) deldir(PATH_WEB . $dir);
} }
} }
//对公用配置表卸载处理 //对公用配置表卸载处理
private function cloud($tname) { private function cloud($tname)
{
global $_M; global $_M;
$where = "m_name='{$this->m_name}'"; $where = "m_name='{$this->m_name}'";
if (self::sqlcounter($tname, $where) > 0) { if (self::sqlcounter($tname, $where) > 0) {
@ -128,7 +136,8 @@ class uninstall {
} }
//公共查询方法 //公共查询方法
private function sqlone($tname,$where = '') { private function sqlone($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
if (!$where) { if (!$where) {
@ -138,7 +147,8 @@ class uninstall {
} }
//公共查询方法 //公共查询方法
private function sqlcounter($tname,$where = '') { private function sqlcounter($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
if ($where) { if ($where) {
@ -148,7 +158,8 @@ class uninstall {
} }
//公共删除数据 //公共删除数据
private function delsql($tname,$where = '') { private function delsql($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
if (!$where) { if (!$where) {
@ -158,11 +169,13 @@ class uninstall {
} }
//公共删除表 //公共删除表
private function deltablesql($tname) { private function deltablesql($tname)
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
DB::query("DROP TABLE `{$table}`"); DB::query("DROP TABLE `{$table}`");
} }
} }
?> ?>

View File

@ -7,7 +7,8 @@ load::own_func('appcmp');
load::own_class('../traits/appcmp'); load::own_class('../traits/appcmp');
//后台类 //后台类
class appadmin extends admin{ class appadmin extends admin
{
# URL上c的值 # URL上c的值
public $u_urlc; public $u_urlc;
@ -24,7 +25,8 @@ class appadmin extends admin{
public $cloud; public $cloud;
# 初始化 # 初始化
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
@ -41,7 +43,8 @@ class appadmin extends admin{
use appcmp; use appcmp;
//调试使用 //调试使用
public function bug() { public function bug()
{
$this->destruct = false; $this->destruct = false;
} }
@ -50,7 +53,8 @@ class appadmin extends admin{
* @$select string 最终菜单选项 * @$select string 最终菜单选项
* @$title string 当前页面标题 * @$title string 当前页面标题
*/ */
public function appnav($select = '',$title = '') { public function appnav($select = '', $title = '')
{
global $_M, $_YW; global $_M, $_YW;
if (is_array($select)) list($select, $title) = $select; if (is_array($select)) list($select, $title) = $select;
//当前的CA组合 //当前的CA组合
@ -150,7 +154,8 @@ class appadmin extends admin{
} }
//导航NAME和URL //导航NAME和URL
private function nav_para($key,$info,$glpara){ private function nav_para($key, $info, $glpara)
{
global $_M, $_YW; global $_M, $_YW;
//合并c和a //合并c和a
list($c, $a) = stringto_array($key, '__'); list($c, $a) = stringto_array($key, '__');
@ -166,7 +171,8 @@ class appadmin extends admin{
#URL上c的值 a的值 #URL上c的值 a的值
#$appshow 全局模板文件,指整个文件的模板 #$appshow 全局模板文件,指整个文件的模板
public function point($c,$a,$appshow = '') { public function point($c, $a, $appshow = '')
{
global $_M, $_YW; global $_M, $_YW;
$this->u_urlc = $c; $this->u_urlc = $c;
$this->u_urla = $a; $this->u_urla = $a;
@ -175,7 +181,8 @@ class appadmin extends admin{
#URL处理 #URL处理
#$appshow 单独定义模板 某个方法内定义 #$appshow 单独定义模板 某个方法内定义
public function appurl($tname = '',$query = [],$appshow = '') { public function appurl($tname = '', $query = [], $appshow = '')
{
global $_M, $_YW; global $_M, $_YW;
//数据库表简写 //数据库表简写
$this->tname = empty($tname) ? self::tname() : $tname; $this->tname = empty($tname) ? self::tname() : $tname;
@ -197,7 +204,8 @@ class appadmin extends admin{
} }
//权限 //权限
private function adminop() { private function adminop()
{
global $_M, $_YW; global $_M, $_YW;
$admin_op = background_privilege(); $admin_op = background_privilege();
$adminop = array_filter(explode('-', $admin_op['admin_op'])); $adminop = array_filter(explode('-', $admin_op['admin_op']));
@ -221,14 +229,16 @@ class appadmin extends admin{
} }
//添加设置参数HTML //添加设置参数HTML
public function setparahtml($ptype = 0,&$html) { public function setparahtml($ptype = 0, &$html)
{
global $_M, $_YW; global $_M, $_YW;
$addparaurl = $_M['url']['own_name'] . 'c=table_on&a=dopara&p_type=' . $ptype; $addparaurl = $_M['url']['own_name'] . 'c=table_on&a=dopara&p_type=' . $ptype;
$html .= '<span class="text-help m-l-10"><a target="_blank" href="' . $addparaurl . '">设置选项</a></span>'; $html .= '<span class="text-help m-l-10"><a target="_blank" href="' . $addparaurl . '">设置选项</a></span>';
} }
//参数单选组成 //参数单选组成
public function para_radio($para,$name,$checked,&$html,$exists = false) { public function para_radio($para, $name, $checked, &$html, $exists = false)
{
global $_M, $_YW; global $_M, $_YW;
$html = ''; $html = '';
$first = 'data-checked="' . $checked . '" required data-fv-notEmpty-message="不能为空"'; $first = 'data-checked="' . $checked . '" required data-fv-notEmpty-message="不能为空"';
@ -249,7 +259,8 @@ class appadmin extends admin{
} }
//参数多选组成 //参数多选组成
public function para_checkbox($para,$name,$checked,&$html,$exists = false) { public function para_checkbox($para, $name, $checked, &$html, $exists = false)
{
global $_M, $_YW; global $_M, $_YW;
$html = ''; $html = '';
$first = 'data-checked="' . $checked . '" required data-fv-notEmpty-message="不能为空" '; // data-delimiter="," 因为暂时无效 $first = 'data-checked="' . $checked . '" required data-fv-notEmpty-message="不能为空" '; // data-delimiter="," 因为暂时无效
@ -270,35 +281,40 @@ class appadmin extends admin{
} }
//参数处理 //参数处理
public function translate($p_type = 0) { public function translate($p_type = 0)
{
global $_M, $_YW; global $_M, $_YW;
$para = self::paralist($p_type); $para = self::paralist($p_type);
return array_combine(array_column($para, 'p_value'), array_column($para, 'p_name')); return array_combine(array_column($para, 'p_value'), array_column($para, 'p_name'));
} }
//场所名称 //场所名称
public function villagelist($id,$key = 'v_name') { public function villagelist($id, $key = 'v_name')
{
global $_M, $_YW; global $_M, $_YW;
$village = $this->tsql->table('village')->where(['id' => $id])->one(); $village = $this->tsql->table('village')->where(['id' => $id])->one();
return $village[ $key ]; return $village[ $key ];
} }
//公司名称 //公司名称
public function customerlist($id,$key = 'c_allname') { public function customerlist($id, $key = 'c_allname')
{
global $_M, $_YW; global $_M, $_YW;
$customer = $this->tsql->table('customer')->where(['id' => $id])->one(); $customer = $this->tsql->table('customer')->where(['id' => $id])->one();
return $customer[ $key ]; return $customer[ $key ];
} }
//相关人员 //相关人员
public function workerslist($id,$key = 'w_name') { public function workerslist($id, $key = 'w_name')
{
global $_M, $_YW; global $_M, $_YW;
$workers = $this->tsql->table('workers')->where(['id' => $id])->one(); $workers = $this->tsql->table('workers')->where(['id' => $id])->one();
return $key == false ? $workers : $workers[ $key ]; return $key == false ? $workers : $workers[ $key ];
} }
//返回广告位对照地址 //返回广告位对照地址
public function e_address($elevator) { public function e_address($elevator)
{
global $_M, $_YW; global $_M, $_YW;
//门口方位 //门口方位
$e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno']]); $e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno']]);
@ -310,7 +326,8 @@ class appadmin extends admin{
} }
//字段颜色 //字段颜色
public function state_color($state,$array = []) { public function state_color($state, $array = [])
{
global $_M, $_YW; global $_M, $_YW;
$color = ['red-600', 'green-600', 'purple-600']; $color = ['red-600', 'green-600', 'purple-600'];
$str = count($array) > 0 ? $array : ['无效', '有效']; $str = count($array) > 0 ? $array : ['无效', '有效'];
@ -318,14 +335,16 @@ class appadmin extends admin{
} }
//字体颜色 //字体颜色
public function str_color($state,$str,$weight = 'unset') { public function str_color($state, $str, $weight = 'unset')
{
global $_M, $_YW; global $_M, $_YW;
$color = ['red-600', 'green-600', 'cyan-600', 'blue-600']; $color = ['red-600', 'green-600', 'cyan-600', 'blue-600'];
return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>'; return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>';
} }
//标签形式的分割显示 //标签形式的分割显示
public function tab_tokenfield($ver,$type = 0,$decollator = ',',$length = 0) { public function tab_tokenfield($ver, $type = 0, $decollator = ',', $length = 0)
{
global $_M, $_YW; global $_M, $_YW;
$class = ['tag-default', 'tag-primary', 'tag-warning']; $class = ['tag-default', 'tag-primary', 'tag-warning'];
$array = stringto_array($ver, $decollator); $array = stringto_array($ver, $decollator);
@ -339,7 +358,8 @@ class appadmin extends admin{
} }
//广告位的合同编号 //广告位的合同编号
public function e_state($title) { public function e_state($title)
{
global $_M, $_YW; global $_M, $_YW;
$class = ['tag-danger', 'tag-primary']; $class = ['tag-danger', 'tag-primary'];
$title = $title > 0 ? '已租赁' : '空置'; $title = $title > 0 ? '已租赁' : '空置';
@ -348,7 +368,8 @@ class appadmin extends admin{
} }
//参数的对应值获取 //参数的对应值获取
public function paralist($p_type = 0) { public function paralist($p_type = 0)
{
global $_M, $_YW; global $_M, $_YW;
$this->tsql->table('para') $this->tsql->table('para')
->where(is_array($p_type) ? $p_type : ['p_type' => $p_type]) ->where(is_array($p_type) ? $p_type : ['p_type' => $p_type])
@ -358,7 +379,8 @@ class appadmin extends admin{
} }
//转化字符串形式 //转化字符串形式
public function strchange($strarr = []) { public function strchange($strarr = [])
{
global $_M, $_YW; global $_M, $_YW;
foreach ($strarr as $val) { foreach ($strarr as $val) {
if ($val != null) $idstr[] = "'{$val}'"; if ($val != null) $idstr[] = "'{$val}'";
@ -367,7 +389,8 @@ class appadmin extends admin{
} }
//广告位状态变更 //广告位状态变更
public function type_onoff($field,$value,$id,$array = ['无效','有效']) { public function type_onoff($field, $value, $id, $array = ['无效', '有效'])
{
global $_M, $_YW; global $_M, $_YW;
$color = ['tag-danger', 'tag-success']; $color = ['tag-danger', 'tag-success'];
$url = $_M['url']['own_name'] . "c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax"; $url = $_M['url']['own_name'] . "c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax";
@ -375,7 +398,8 @@ class appadmin extends admin{
} }
//处理多选的ID //处理多选的ID
public function where_id(&$where) { public function where_id(&$where)
{
global $_M, $_YW; global $_M, $_YW;
$allid = array_filter(stringto_array($_M['form']['all_id'], ',')); $allid = array_filter(stringto_array($_M['form']['all_id'], ','));
if ($allid) { if ($allid) {
@ -395,7 +419,8 @@ class appadmin extends admin{
} }
// 对现有广告位进行裂变,已经不再需要 // 对现有广告位进行裂变,已经不再需要
public function fission() { public function fission()
{
global $_M, $_YW; global $_M, $_YW;
//获取所有广告位 //获取所有广告位
$elevator = $this->tsql->table('elevator')->all(); $elevator = $this->tsql->table('elevator')->all();
@ -429,7 +454,8 @@ class appadmin extends admin{
} }
//对字符串处理 //对字符串处理
public function e_number(&$num,$neweaps,$type = false) { public function e_number(&$num, $neweaps, $type = false)
{
global $_M, $_YW; global $_M, $_YW;
if ($type) $neweaps++; if ($type) $neweaps++;
//新的编号 //新的编号

View File

@ -6,7 +6,8 @@ load::sys_class('web');
load::own_class('../traits/appcmp'); load::own_class('../traits/appcmp');
//前台类 //前台类
class appweb extends web { class appweb extends web
{
//开始时间 //开始时间
public $time; public $time;
@ -25,7 +26,8 @@ class appweb extends web {
public $postdata = []; public $postdata = [];
public $tem_id = ''; public $tem_id = '';
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
self::cmp_load(); self::cmp_load();
@ -44,21 +46,24 @@ class appweb extends web {
use appcmp; use appcmp;
//生成CSS //生成CSS
public function metcss() { public function metcss()
{
global $_M, $_YW; global $_M, $_YW;
$metcss = PATH_APP_FILE . 'web/templates/met/css/metinfo.css'; $metcss = PATH_APP_FILE . 'web/templates/met/css/metinfo.css';
if (!file_exists($metcss)) self::merge_css(); if (!file_exists($metcss)) self::merge_css();
} }
//前台常用信息 //前台常用信息
protected function basics() { protected function basics()
{
global $_M, $_YW; global $_M, $_YW;
$this->input['appcore'] .= ' data-m_name="' . $this->m_name . '" '; $this->input['appcore'] .= ' data-m_name="' . $this->m_name . '" ';
$this->input['appcore'] .= ' data-own_name="' . $_M['url']['own_name'] . '" '; $this->input['appcore'] .= ' data-own_name="' . $_M['url']['own_name'] . '" ';
} }
//合同内容 //合同内容
public function postdata($type,$arr) { public function postdata($type, $arr)
{
global $_M, $_YW; global $_M, $_YW;
//清理缓存 //清理缓存
$this->postdata = []; $this->postdata = [];
@ -176,40 +181,41 @@ class appweb extends web {
} }
//参数处理 //参数处理
public function translate($p_type = 0) { public function translate($p_type = 0)
{
global $_M, $_YW; global $_M, $_YW;
$para = self::paralist($p_type); $para = self::paralist($p_type);
return array_combine(array_column($para, 'p_value'), array_column($para, 'p_name')); return array_combine(array_column($para, 'p_value'), array_column($para, 'p_name'));
} }
//场所名称 //场所名称
public function villagelist($id,$key = 'v_name') { public function villagelist($id, $key = 'v_name')
{
global $_M, $_YW; global $_M, $_YW;
$village = $this->tsql->table('village')->where(['id' => $id])->one(); $village = $this->tsql->table('village')->where(['id' => $id])->one();
return $village[ $key ]; return $village[ $key ];
} }
//公司名称 //公司名称
public function customerlist($id,$key = 'c_allname') { public function customerlist($id, $key = 'c_allname')
{
global $_M, $_YW; global $_M, $_YW;
$customer = $this->tsql->table('customer')->where(['id' => $id])->one(); $customer = $this->tsql->table('customer')->where(['id' => $id])->one();
return $customer[ $key ]; return $customer[ $key ];
} }
//相关人员 //相关人员
public function workerslist($id,$key = 'w_name') { public function workerslist($id, $key = 'w_name')
{
global $_M, $_YW; global $_M, $_YW;
$workers = $this->tsql->table('workers')->where(['id' => $id])->one(); $workers = $this->tsql->table('workers')->where(['id' => $id])->one();
return $key == false ? $workers : $workers[ $key ]; return $key == false ? $workers : $workers[ $key ];
} }
//返回广告位对照地址 //返回广告位对照地址
public function e_address($elevator) { public function e_address($elevator)
{
global $_M, $_YW; global $_M, $_YW;
//门口方位 //门口方位
$e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno']]); $e_bno = self::paralist(['p_type' => 3, 'p_value' => $elevator['e_bno']]);
@ -221,7 +227,8 @@ class appweb extends web {
} }
//字段颜色 //字段颜色
public function state_color($state,$array = []) { public function state_color($state, $array = [])
{
global $_M, $_YW; global $_M, $_YW;
$color = ['red-600', 'green-600', 'purple-600']; $color = ['red-600', 'green-600', 'purple-600'];
$str = count($array) > 0 ? $array : ['无效', '有效']; $str = count($array) > 0 ? $array : ['无效', '有效'];
@ -229,14 +236,16 @@ class appweb extends web {
} }
//字体颜色 //字体颜色
public function str_color($state,$str,$weight = 'unset') { public function str_color($state, $str, $weight = 'unset')
{
global $_M, $_YW; global $_M, $_YW;
$color = ['red-600', 'green-600', 'cyan-600', 'blue-600']; $color = ['red-600', 'green-600', 'cyan-600', 'blue-600'];
return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>'; return '<font class="' . $color[ $state ] . ' font-weight-' . $weight . '">' . $str . '</font>';
} }
//标签形式的分割显示 //标签形式的分割显示
public function tab_tokenfield($ver,$type = 0,$decollator = ',',$length = 0) { public function tab_tokenfield($ver, $type = 0, $decollator = ',', $length = 0)
{
global $_M, $_YW; global $_M, $_YW;
$class = ['tag-default', 'tag-primary', 'tag-warning']; $class = ['tag-default', 'tag-primary', 'tag-warning'];
$array = stringto_array($ver, $decollator); $array = stringto_array($ver, $decollator);
@ -250,7 +259,8 @@ class appweb extends web {
} }
//广告位的合同编号 //广告位的合同编号
public function e_state($title) { public function e_state($title)
{
global $_M, $_YW; global $_M, $_YW;
$class = ['tag-danger', 'tag-primary']; $class = ['tag-danger', 'tag-primary'];
$title = $title > 0 ? '已租赁' : '空置'; $title = $title > 0 ? '已租赁' : '空置';
@ -259,7 +269,8 @@ class appweb extends web {
} }
//参数的对应值获取 //参数的对应值获取
public function paralist($p_type = 0) { public function paralist($p_type = 0)
{
global $_M, $_YW; global $_M, $_YW;
$this->tsql->table('para') $this->tsql->table('para')
->where(is_array($p_type) ? $p_type : ['p_type' => $p_type]) ->where(is_array($p_type) ? $p_type : ['p_type' => $p_type])
@ -269,7 +280,8 @@ class appweb extends web {
} }
//转化字符串形式 //转化字符串形式
public function strchange($strarr = []) { public function strchange($strarr = [])
{
global $_M, $_YW; global $_M, $_YW;
foreach ($strarr as $val) { foreach ($strarr as $val) {
if ($val != null) $idstr[] = "'{$val}'"; if ($val != null) $idstr[] = "'{$val}'";
@ -278,7 +290,8 @@ class appweb extends web {
} }
//广告位状态变更 //广告位状态变更
public function type_onoff($field,$value,$id,$array = ['无效','有效']) { public function type_onoff($field, $value, $id, $array = ['无效', '有效'])
{
global $_M, $_YW; global $_M, $_YW;
$color = ['tag-danger', 'tag-success']; $color = ['tag-danger', 'tag-success'];
$url = $_M['url']['own_name'] . "c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax"; $url = $_M['url']['own_name'] . "c=table_off&a=doindex&submit_type=typeonoff&field={$field}&all_id={$id}&tname={$this->tname}&method=ajax";
@ -286,7 +299,8 @@ class appweb extends web {
} }
//处理多选的ID //处理多选的ID
public function where_id(&$where) { public function where_id(&$where)
{
global $_M, $_YW; global $_M, $_YW;
$allid = array_filter(stringto_array($_M['form']['all_id'], ',')); $allid = array_filter(stringto_array($_M['form']['all_id'], ','));
if ($allid) { if ($allid) {
@ -306,7 +320,8 @@ class appweb extends web {
} }
// 对现有广告位进行裂变,已经不再需要 // 对现有广告位进行裂变,已经不再需要
public function fission() { public function fission()
{
global $_M, $_YW; global $_M, $_YW;
//获取所有广告位 //获取所有广告位
$elevator = $this->tsql->table('elevator')->all(); $elevator = $this->tsql->table('elevator')->all();
@ -340,7 +355,8 @@ class appweb extends web {
} }
//对字符串处理 //对字符串处理
public function e_number(&$num,$neweaps,$type = false) { public function e_number(&$num, $neweaps, $type = false)
{
global $_M, $_YW; global $_M, $_YW;
if ($type) $neweaps++; if ($type) $neweaps++;
//新的编号 //新的编号

View File

@ -3,11 +3,13 @@
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
//所有公用方法 //所有公用方法
class cloud{ class cloud
{
public $tsql; public $tsql;
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
$this->tsql = load::own_class('tsql', 'new'); $this->tsql = load::own_class('tsql', 'new');
} }
@ -17,7 +19,8 @@ class cloud{
* @param array $back 输出字符串或数组 * @param array $back 输出字符串或数组
* @param string $callback ajax的回调函数的名称 * @param string $callback ajax的回调函数的名称
*/ */
public function jsoncallback($back, $callback = 'callback') { public function jsoncallback($back, $callback = 'callback')
{
global $_M; global $_M;
header('Content-type: application/x-javascript'); header('Content-type: application/x-javascript');
$callback = $_M['form'][ $callback ]; $callback = $_M['form'][ $callback ];
@ -26,7 +29,8 @@ class cloud{
} }
//城市信息 //城市信息
public function citydata() { public function citydata()
{
global $_M, $_YW; global $_M, $_YW;
$dirfile = PATH_APP_FILE . 'public/js/city/city.min.json'; $dirfile = PATH_APP_FILE . 'public/js/city/city.min.json';
if (!file_exists($dirfile)) { if (!file_exists($dirfile)) {
@ -66,7 +70,8 @@ class cloud{
echo $citystr; echo $citystr;
} }
public function city_url() { public function city_url()
{
global $_M, $_YW; global $_M, $_YW;
$dirfile = PATH_APP_FILE . 'public/js/city/city.min.json'; $dirfile = PATH_APP_FILE . 'public/js/city/city.min.json';
if (file_exists($dirfile)) { if (file_exists($dirfile)) {
@ -78,7 +83,8 @@ class cloud{
} }
//计算时间相差天数 //计算时间相差天数
public function summary() { public function summary()
{
global $_M, $_YW; global $_M, $_YW;
$summoney = $this->tsql->table('contract')->qfield(" Sum(h_tprice) as tprice ")->where(" h_tprice IS NOT NULL ")->one(); $summoney = $this->tsql->table('contract')->qfield(" Sum(h_tprice) as tprice ")->where(" h_tprice IS NOT NULL ")->one();
return [ return [
@ -115,7 +121,6 @@ class cloud{
} }
} }
?> ?>

View File

@ -7,15 +7,18 @@ defined('IN_MET') or exit('No permission');
/** /**
* 表格数据获取类 * 表格数据获取类
*
* @param array $rearray 表格数组返回数组 * @param array $rearray 表格数组返回数组
*/ */
class tabledata { class tabledata
{
protected $rearray; protected $rearray;
public $error; public $error;
/** /**
* 获取表查询数据 * 获取表查询数据
*
* @param string $table 表名 * @param string $table 表名
* @param string $field 表字段 * @param string $field 表字段
* @param string $where where条件 * @param string $where where条件
@ -23,7 +26,8 @@ class tabledata {
* @param string $sql 自定义SQL语句 * @param string $sql 自定义SQL语句
* @return array 查询数据 * @return array 查询数据
*/ */
public function getdata($table, $field = '*', $where = '', $order = '', $sql = '',$multi_table = false) { public function getdata($table, $field = '*', $where = '', $order = '', $sql = '', $multi_table = false)
{
global $_M; global $_M;
//dump( $_M['form']); //dump( $_M['form']);
/* 获取表格ajax传递的参数 */ /* 获取表格ajax传递的参数 */
@ -93,9 +97,11 @@ class tabledata {
/** /**
* 把处理后的数组已json方式输出到页面上供AJAX读取。 * 把处理后的数组已json方式输出到页面上供AJAX读取。
*
* @param array $rdata 需要转成json的数组 * @param array $rdata 需要转成json的数组
*/ */
public function rdata($rdata) { public function rdata($rdata)
{
if ($rdata) { if ($rdata) {
$this->rarray['data'] = $rdata; $this->rarray['data'] = $rdata;
} else { } else {

View File

@ -3,7 +3,8 @@
defined('IN_MET') or exit('No permission'); defined('IN_MET') or exit('No permission');
# 数据结构处理 # 数据结构处理
class tsql { class tsql
{
private $sql = []; private $sql = [];
private $m_name = M_NAME; private $m_name = M_NAME;
@ -12,13 +13,15 @@ class tsql {
private $query; private $query;
private $multi_table = false; //采用分组才会采用子查询计算总数 private $multi_table = false; //采用分组才会采用子查询计算总数
public function __construct() { public function __construct()
{
global $_M; global $_M;
self::table_unset(); self::table_unset();
} }
# 清空 # 清空
public function table_unset() { public function table_unset()
{
global $_M; global $_M;
unset($this->sql, $this->special, $this->ufield); unset($this->sql, $this->special, $this->ufield);
return $this; return $this;
@ -26,7 +29,8 @@ class tsql {
# 数据库 # 数据库
# $sign false 不添加应用文件名前缀 # $sign false 不添加应用文件名前缀
public function table($tname,$sign = true) { public function table($tname, $sign = true)
{
global $_M; global $_M;
self::table_unset(); self::table_unset();
$this->sql['table'] = self::full_table_name($tname, $sign); $this->sql['table'] = self::full_table_name($tname, $sign);
@ -38,7 +42,8 @@ class tsql {
# $join 数据库连接方式 # $join 数据库连接方式
# $sign false 不添加应用文件名前缀 # $sign false 不添加应用文件名前缀
# #
public function tables($tname = [],$join = '',$sign = true) { public function tables($tname = [], $join = '', $sign = true)
{
global $_M; global $_M;
list($name, $ab) = $tname; list($name, $ab) = $tname;
$table = self::full_table_name($name, $sign); $table = self::full_table_name($name, $sign);
@ -48,7 +53,8 @@ class tsql {
# 需要特殊处理的值例如counts+1 等类似的 或者执行函数 # 需要特殊处理的值例如counts+1 等类似的 或者执行函数
# 传入的为特殊处理的值,并 非字段名 # 传入的为特殊处理的值,并 非字段名
public function special($_special) { public function special($_special)
{
global $_M; global $_M;
$this->special = is_array($_special) ? $_special : [$_special]; $this->special = is_array($_special) ? $_special : [$_special];
return $this; return $this;
@ -56,7 +62,8 @@ class tsql {
# 需要删除的字段,仅支持约束条件下 # 需要删除的字段,仅支持约束条件下
# 目前仅用于adup()时的 unique() 方法 # 目前仅用于adup()时的 unique() 方法
public function ufield($_field = '') { public function ufield($_field = '')
{
global $_M; global $_M;
$this->ufield = is_array($_field) ? $_field : [$_field]; $this->ufield = is_array($_field) ? $_field : [$_field];
return $this; return $this;
@ -64,7 +71,8 @@ class tsql {
# 查询字段 # 查询字段
# 查询或者多条插入信息 # 查询或者多条插入信息
public function qfield($_field = '*') { public function qfield($_field = '*')
{
global $_M; global $_M;
if (is_array($_field)) $_field = arrayto_string($_field, ','); if (is_array($_field)) $_field = arrayto_string($_field, ',');
$this->sql['field'] = $_field; $this->sql['field'] = $_field;
@ -73,7 +81,8 @@ class tsql {
# 插入更新字段 # 插入更新字段
# $sign 单条插入或者更新设置其他值查询或者多条插入信息时使用qfield() # $sign 单条插入或者更新设置其他值查询或者多条插入信息时使用qfield()
public function field($_field = '') { public function field($_field = '')
{
global $_M; global $_M;
if (is_array($_field)) $_field = self::field_arr($_field); if (is_array($_field)) $_field = self::field_arr($_field);
$this->sql['field'] = $_field; $this->sql['field'] = $_field;
@ -81,7 +90,8 @@ class tsql {
} }
# 分组查询 $_having 同where 一样 # 分组查询 $_having 同where 一样
public function group($_group = '',$_having = '') { public function group($_group = '', $_having = '')
{
global $_M; global $_M;
if (is_array($_group)) $_group = arrayto_string($_group, ','); if (is_array($_group)) $_group = arrayto_string($_group, ',');
@ -95,7 +105,8 @@ class tsql {
} }
# 查询条件 # 查询条件
public function where($_where = '1=1') { public function where($_where = '1=1')
{
global $_M; global $_M;
if (is_array($_where)) $_where = self::where_arr($_where); if (is_array($_where)) $_where = self::where_arr($_where);
if (!empty($_where)) $this->sql['where'] = " WHERE " . $_where; if (!empty($_where)) $this->sql['where'] = " WHERE " . $_where;
@ -103,14 +114,16 @@ class tsql {
} }
# 排序条件 # 排序条件
public function order($_order = 'id DESC') { public function order($_order = 'id DESC')
{
global $_M; global $_M;
$this->sql['order'] = " ORDER BY " . $_order; $this->sql['order'] = " ORDER BY " . $_order;
return $this; return $this;
} }
# 单独值,用于 多条信息插入,或者约束插入更新 # 单独值,用于 多条信息插入,或者约束插入更新
public function values($_values = '') { public function values($_values = '')
{
global $_M; global $_M;
if (is_array($_values)) $_values = self::values_arr($_values); if (is_array($_values)) $_values = self::values_arr($_values);
$this->sql['values'] = $_values; $this->sql['values'] = $_values;
@ -118,7 +131,8 @@ class tsql {
} }
# 约束条件下的UPDATE # 约束条件下的UPDATE
public function unique($_unique = '') { public function unique($_unique = '')
{
global $_M; global $_M;
if (is_array($_unique)) { if (is_array($_unique)) {
$_unique = self::field_del($_unique); $_unique = self::field_del($_unique);
@ -129,14 +143,16 @@ class tsql {
} }
# 查询条数限制 # 查询条数限制
public function limit($_limit = '30',$_start = '0') { public function limit($_limit = '30', $_start = '0')
{
global $_M; global $_M;
$this->sql['limit'] = " LIMIT {$_start}," . $_limit; $this->sql['limit'] = " LIMIT {$_start}," . $_limit;
return $this; return $this;
} }
# 删除 # 删除
public function del($_where) { public function del($_where)
{
global $_M; global $_M;
if (empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if (!empty($_where) && empty($this->sql['where'])) self::where($_where); if (!empty($_where) && empty($this->sql['where'])) self::where($_where);
@ -147,7 +163,8 @@ class tsql {
} }
# 单条修改 # 单条修改
public function upd() { public function upd()
{
global $_M; global $_M;
if (empty($this->sql['table']) || empty($this->sql['field'])) return false; if (empty($this->sql['table']) || empty($this->sql['field'])) return false;
$this->query = "UPDATE {$this->sql['table']} SET {$this->sql['field']} {$this->sql['where']} "; $this->query = "UPDATE {$this->sql['table']} SET {$this->sql['field']} {$this->sql['where']} ";
@ -157,7 +174,8 @@ class tsql {
} }
# 单条新增 # 单条新增
public function add($_field) { public function add($_field)
{
global $_M; global $_M;
if (!empty($_field) && empty($this->sql['field'])) self::field($_field); if (!empty($_field) && empty($this->sql['field'])) self::field($_field);
if (empty($this->sql['table']) || empty($this->sql['field'])) return false; if (empty($this->sql['table']) || empty($this->sql['field'])) return false;
@ -171,7 +189,8 @@ class tsql {
# field 字段需要查询类型的 qfield() # field 字段需要查询类型的 qfield()
# $data 一维二维都可以key = field # $data 一维二维都可以key = field
# $sign false 并且也没有单独调用unique()是多条信息插入, true 为是约束更新插入 # $sign false 并且也没有单独调用unique()是多条信息插入, true 为是约束更新插入
public function adup($data = [],$sign = true) { public function adup($data = [], $sign = true)
{
global $_M; global $_M;
if (empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if (is_array($data)) { if (is_array($data)) {
@ -199,7 +218,8 @@ class tsql {
} }
# 查询单条 # 查询单条
public function one() { public function one()
{
global $_M; global $_M;
if (empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if (empty($this->sql['field'])) $this->sql['field'] = '*'; if (empty($this->sql['field'])) $this->sql['field'] = '*';
@ -209,7 +229,8 @@ class tsql {
} }
# 查询更多条数 # 查询更多条数
public function all($key = 'id') { public function all($key = 'id')
{
global $_M; global $_M;
if (empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
if (empty($this->sql['field'])) $this->sql['field'] = '*'; if (empty($this->sql['field'])) $this->sql['field'] = '*';
@ -224,7 +245,8 @@ class tsql {
} }
# 获取表结构 # 获取表结构
public function show() { public function show()
{
global $_M; global $_M;
if (empty($this->sql['table'])) return false; if (empty($this->sql['table'])) return false;
$this->query = "SHOW FULL COLUMNS FROM .{$this->sql['table']}"; $this->query = "SHOW FULL COLUMNS FROM .{$this->sql['table']}";
@ -240,7 +262,8 @@ class tsql {
# 条数统计 # 条数统计
# field 采用查询方法 qfield # field 采用查询方法 qfield
# $multi_table 若是采用分组了计算方式要调整为 子查询计算总条数 # $multi_table 若是采用分组了计算方式要调整为 子查询计算总条数
public function count($_field = '*') { public function count($_field = '*')
{
global $_M; global $_M;
if (empty($this->sql['table'])) return 0; if (empty($this->sql['table'])) return 0;
if (empty($this->sql['field'])) $this->sql['field'] = "COUNT({$_field})"; if (empty($this->sql['field'])) $this->sql['field'] = "COUNT({$_field})";
@ -253,25 +276,29 @@ class tsql {
} }
# 获取刚才插入的信息ID # 获取刚才插入的信息ID
public function id() { public function id()
{
global $_M; global $_M;
return DB::insert_id(); return DB::insert_id();
} }
# 错误信息(对查询是无效的) # 错误信息(对查询是无效的)
public function error() { public function error()
{
global $_M; global $_M;
return DB::error(); return DB::error();
} }
# 返回完整数据库名 # 返回完整数据库名
public function full_table_name($tname,$sign = true) { public function full_table_name($tname, $sign = true)
{
global $_M; global $_M;
return $sign == true ? $_M['table'][ $this->m_name . '_' . $tname ] : $_M['table'][ $tname ]; return $sign == true ? $_M['table'][ $this->m_name . '_' . $tname ] : $_M['table'][ $tname ];
} }
# 字段删除方法 # 字段删除方法
public function field_del($array = []) { public function field_del($array = [])
{
global $_M; global $_M;
foreach ($this->ufield as $val) { foreach ($this->ufield as $val) {
unset($array[ $val ]); unset($array[ $val ]);
@ -281,7 +308,8 @@ class tsql {
# where条件的转换 # where条件的转换
# 仅是值等于的处理,例如某个字段判断为不等于或者其他的方法,切勿使用数组传递 # 仅是值等于的处理,例如某个字段判断为不等于或者其他的方法,切勿使用数组传递
public function where_arr($arr) { public function where_arr($arr)
{
global $_M; global $_M;
$and = []; $and = [];
foreach ($arr as $key => $val) { foreach ($arr as $key => $val) {
@ -311,7 +339,8 @@ class tsql {
} }
# 入库字段转换 # 入库字段转换
public function field_arr($arr) { public function field_arr($arr)
{
global $_M; global $_M;
$str = []; $str = [];
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
@ -326,7 +355,8 @@ class tsql {
} }
# 单独值的字符串转换 # 单独值的字符串转换
public function values_arr($arr) { public function values_arr($arr)
{
global $_M; global $_M;
$str = []; $str = [];
foreach ($arr as $val) { foreach ($arr as $val) {
@ -346,7 +376,8 @@ class tsql {
# 约束条件新增的语句更新值的规则(最后一段) # 约束条件新增的语句更新值的规则(最后一段)
# 数组key值为字段名非数字 说明是要单独处理的值 # 数组key值为字段名非数字 说明是要单独处理的值
public function unique_arr($arr) { public function unique_arr($arr)
{
global $_M; global $_M;
$str = []; $str = [];
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
@ -360,7 +391,8 @@ class tsql {
} }
# 通过数据库整理出该数据库的字段一般是净化form提交的字段避免一个一个组装 # 通过数据库整理出该数据库的字段一般是净化form提交的字段避免一个一个组装
public function tfield($form,$tablename = '') { public function tfield($form, $tablename = '')
{
global $_M; global $_M;
if (!empty($tablename)) { if (!empty($tablename)) {
if (is_array($tablename)) $tablename = [$tablename, true]; if (is_array($tablename)) $tablename = [$tablename, true];
@ -376,7 +408,8 @@ class tsql {
} }
# 查看刚才执行过的sql语句方便核查sql语句 # 查看刚才执行过的sql语句方便核查sql语句
public function query() { public function query()
{
global $_M; global $_M;
return $this->query; return $this->query;
} }

View File

@ -2,12 +2,13 @@
//兼容函数array_column PHP5.5+ //兼容函数array_column PHP5.5+
if (!function_exists('array_column')) { if (!function_exists('array_column')) {
function array_column($input, $columnKey, $indexKey = NULL) { function array_column($input, $columnKey, $indexKey = NULL)
{
$columnKeyIsNumber = (is_numeric($columnKey)) ? TRUE : FALSE; $columnKeyIsNumber = (is_numeric($columnKey)) ? TRUE : FALSE;
$indexKeyIsNull = (is_null($indexKey)) ? TRUE : FALSE; $indexKeyIsNull = (is_null($indexKey)) ? TRUE : FALSE;
$indexKeyIsNumber = (is_numeric($indexKey)) ? TRUE : FALSE; $indexKeyIsNumber = (is_numeric($indexKey)) ? TRUE : FALSE;
$result = array(); $result = array();
foreach ((array) $input AS $key => $row) { foreach ((array)$input as $key => $row) {
if ($columnKeyIsNumber) { if ($columnKeyIsNumber) {
$tmp = array_slice($row, $columnKey, 1); $tmp = array_slice($row, $columnKey, 1);
$tmp = (is_array($tmp) && !empty($tmp)) ? current($tmp) : NULL; $tmp = (is_array($tmp) && !empty($tmp)) ? current($tmp) : NULL;
@ -32,7 +33,8 @@ if (!function_exists('array_column')) {
# 计算时间差 # 计算时间差
# $begin_time 起始日期 # $begin_time 起始日期
# $end_time 结束日期 一般指当前日期 # $end_time 结束日期 一般指当前日期
function timediff($begin_time, $end_time,$type) { function timediff($begin_time, $end_time, $type)
{
$time = $end_time - $begin_time; $time = $end_time - $begin_time;
switch ($type) { switch ($type) {
case 'year': case 'year':
@ -88,7 +90,8 @@ function timediff($begin_time, $end_time,$type) {
} }
//获取汉子的首字母 //获取汉子的首字母
function getstrcharter($str) { function getstrcharter($str)
{
global $_M, $_YW; global $_M, $_YW;
if (empty($str)) return ''; if (empty($str)) return '';
$fchar = ord($str{0}); $fchar = ord($str{0});

View File

@ -4,7 +4,8 @@
* 表格数据显示,以及数据导出公用处理方案 * 表格数据显示,以及数据导出公用处理方案
*/ */
trait tdata { trait tdata
{
//sql语句采用分组查询后调整为true 使用子查询计算总条数 //sql语句采用分组查询后调整为true 使用子查询计算总条数
public $multi_table = false; public $multi_table = false;
@ -24,7 +25,8 @@ trait tdata {
private $village_whereid = ''; private $village_whereid = '';
// 计算社区类型地图选择返回被选中的小区ID // 计算社区类型地图选择返回被选中的小区ID
private function fun_sqlk_vid(){ private function fun_sqlk_vid()
{
global $_M, $_YW; global $_M, $_YW;
$idArr = $vidArr = []; $idArr = $vidArr = [];
if (is_array($this->form['vtype'])) { if (is_array($this->form['vtype'])) {
@ -47,8 +49,10 @@ trait tdata {
} }
return $idArr; return $idArr;
} }
//表名 //表名
public function td_sqlk() { public function td_sqlk()
{
global $_M, $_YW; global $_M, $_YW;
//当天日期时间 //当天日期时间
$curdate = date('Y-m-d', time()); $curdate = date('Y-m-d', time());
@ -186,7 +190,8 @@ trait tdata {
} }
//字段 //字段
public function td_field() { public function td_field()
{
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'elevators': case 'elevators':
@ -220,7 +225,8 @@ trait tdata {
* 同时满足条件的非OR * 同时满足条件的非OR
*/ */
public function td_search($link = true) { public function td_search($link = true)
{
global $_M, $_YW; global $_M, $_YW;
//默认input字段为link搜索 //默认input字段为link搜索
if ($link) if ($link)
@ -254,7 +260,8 @@ trait tdata {
} }
//OR 内容搜索 //OR 内容搜索
public function td_search_or($orfield, $search_field = []) { public function td_search_or($orfield, $search_field = [])
{
global $_M, $_YW; global $_M, $_YW;
//判断是否为链表查询 //判断是否为链表查询
$join_field = array_combine($orfield, count($search_field) > 0 ? $search_field : $orfield); $join_field = array_combine($orfield, count($search_field) > 0 ? $search_field : $orfield);
@ -281,7 +288,8 @@ trait tdata {
} }
//时间区间 //时间区间
public function td_time_search($field, $search_field = []) { public function td_time_search($field, $search_field = [])
{
global $_M, $_YW; global $_M, $_YW;
list($start, $end) = $field; list($start, $end) = $field;
//判断是否为链表查询 //判断是否为链表查询
@ -310,7 +318,8 @@ trait tdata {
//获取重叠的时间区间 //获取重叠的时间区间
// $search_field 开始时间和结束时间的字段互相调换,结束的字段在前面 // $search_field 开始时间和结束时间的字段互相调换,结束的字段在前面
public function td_time_orsearch($field, $search_field = []) { public function td_time_orsearch($field, $search_field = [])
{
global $_M, $_YW; global $_M, $_YW;
list($start, $end) = $field; list($start, $end) = $field;
//判断是否为链表查询 //判断是否为链表查询
@ -342,7 +351,8 @@ trait tdata {
* SQL判断语句$where .= $this->search(); * SQL判断语句$where .= $this->search();
*/ */
public function td_where() { public function td_where()
{
global $_M, $_YW; global $_M, $_YW;
$where = " 1=1 "; $where = " 1=1 ";
switch ($this->tname) { switch ($this->tname) {
@ -469,7 +479,8 @@ trait tdata {
} }
//分组查询 //分组查询
public function td_groupby(&$where) { public function td_groupby(&$where)
{
global $_M; global $_M;
$this->multi_table = true; $this->multi_table = true;
switch ($this->tname) { switch ($this->tname) {
@ -501,7 +512,8 @@ trait tdata {
* SQL排序方式语句 * SQL排序方式语句
*/ */
public function td_order() { public function td_order()
{
global $_M; global $_M;
switch ($this->tname) { switch ($this->tname) {
case 'applan': case 'applan':

View File

@ -4,7 +4,8 @@
* 表格列表的结果处理 * 表格列表的结果处理
*/ */
trait tlist { trait tlist
{
//按钮组 //按钮组
protected $btn = []; protected $btn = [];
@ -23,7 +24,8 @@ trait tlist {
//公用删除 //公用删除
//$query 主要用来替换删除按钮的值 //$query 主要用来替换删除按钮的值
protected function btn_group($val, $checked, $query = []) { protected function btn_group($val, $checked, $query = [])
{
global $_M, $_YW; global $_M, $_YW;
if (empty($checked)) { if (empty($checked)) {
if ($query !== false) { if ($query !== false) {
@ -67,7 +69,8 @@ trait tlist {
} }
//整合 //整合
private function assemble($key, $base, $val, $checked, $query = []) { private function assemble($key, $base, $val, $checked, $query = [])
{
global $_M, $_YW; global $_M, $_YW;
//搜索处理 //搜索处理
foreach ($this->search_input as $vs) { foreach ($this->search_input as $vs) {
@ -86,7 +89,8 @@ trait tlist {
} }
//广告位详细地址转换 //广告位详细地址转换
protected function eaddress(&$val, $_address = 'e_address', $sign = false) { protected function eaddress(&$val, $_address = 'e_address', $sign = false)
{
global $_M, $_YW; global $_M, $_YW;
//门口方位 //门口方位
if (empty(self::$para['e_bno'])) if (empty(self::$para['e_bno']))
@ -116,7 +120,8 @@ trait tlist {
// | 各表处理 // | 各表处理
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
//广告位统计 //广告位统计
protected function elevator($val, $checked = '') { protected function elevator($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_elevator(); $key = self::tf_elevator();
@ -159,7 +164,8 @@ trait tlist {
} }
//场所统计 //场所统计
protected function village($val, $checked = '') { protected function village($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_village(); $key = self::tf_village();
@ -198,7 +204,8 @@ trait tlist {
} }
//广告合同关联表 //广告合同关联表
protected function schedule($val, $checked = '', $base = []) { protected function schedule($val, $checked = '', $base = [])
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_schedule(); $key = self::tf_schedule();
@ -219,7 +226,8 @@ trait tlist {
} }
//合同归档 //合同归档
protected function contract($val, $checked = '') { protected function contract($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_contract(); $key = self::tf_contract();
@ -279,7 +287,8 @@ trait tlist {
} }
//公司资料 //公司资料
protected function customer($val, $checked = '') { protected function customer($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_customer(); $key = self::tf_customer();
@ -305,7 +314,8 @@ trait tlist {
} }
//企业联系人 //企业联系人
protected function workers($val, $checked = '') { protected function workers($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_workers(); $key = self::tf_workers();
@ -334,7 +344,8 @@ trait tlist {
} }
//参数统计 //参数统计
protected function para($val, $checked = '') { protected function para($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_para(); $key = self::tf_para();
@ -405,7 +416,8 @@ trait tlist {
} }
//投放计划 //投放计划
protected function launch($val, $checked = '') { protected function launch($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_launch(); $key = self::tf_launch();
@ -450,7 +462,8 @@ trait tlist {
} }
//广告位统计 //广告位统计
protected function applan($val, $checked = '') { protected function applan($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_applan(); $key = self::tf_applan();
@ -528,7 +541,8 @@ trait tlist {
} }
//广告位统计 //广告位统计
protected function elevators($val, $checked = '') { protected function elevators($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_elevators(); $key = self::tf_elevators();
@ -571,7 +585,8 @@ trait tlist {
} }
//场所统计展示 //场所统计展示
protected function villages($val, $checked = '') { protected function villages($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_villages(); $key = self::tf_villages();
@ -615,7 +630,8 @@ trait tlist {
} }
//场所统计展示 //场所统计展示
protected function noticeday($val, $checked = '', $base = []) { protected function noticeday($val, $checked = '', $base = [])
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_noticeday(); $key = self::tf_noticeday();
@ -669,7 +685,8 @@ trait tlist {
} }
//前台巡查 //前台巡查
protected function patrol($val, $checked = '') { protected function patrol($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_patrol(); $key = self::tf_patrol();
@ -689,7 +706,8 @@ trait tlist {
} }
//参数统计 //参数统计
protected function keylist($val, $checked = '') { protected function keylist($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
//获取字段 //获取字段
$key = self::tf_keylist(); $key = self::tf_keylist();

View File

@ -21,7 +21,8 @@ define("UPD_LOCK_FILE", PATH_APP_FILE."config/update.lock");
//更新文件存在要清除 //更新文件存在要清除
define("APP_UPDATE_DIR", PATH_APP_FILE . "update"); define("APP_UPDATE_DIR", PATH_APP_FILE . "update");
class index extends admin { class index extends admin
{
# 验证类型 # 验证类型
private $method; private $method;
@ -36,7 +37,8 @@ class index extends admin {
# 初始化 # 初始化
public function __construct() { public function __construct()
{
global $_M; global $_M;
parent::__construct(); parent::__construct();
$this->time = time(); $this->time = time();
@ -48,7 +50,8 @@ class index extends admin {
/** /**
* 检测入口 * 检测入口
*/ */
public function doindex() { public function doindex()
{
global $_M; global $_M;
if (!file_exists(INS_LOCK_FILE) || $_M['form']['check']) { if (!file_exists(INS_LOCK_FILE) || $_M['form']['check']) {
//应用信息 //应用信息
@ -76,7 +79,8 @@ class index extends admin {
 + doappcheck : 用来进行应用的各项检测入口  + doappcheck : 用来进行应用的各项检测入口
 +-------------------------------------------------------------------------------------------  +-------------------------------------------------------------------------------------------
*/ */
public function doappcheck() { public function doappcheck()
{
global $_M; global $_M;
$this->ac_session = new session(); $this->ac_session = new session();
$this->method = $_M['form']['type']; $this->method = $_M['form']['type'];
@ -95,7 +99,8 @@ class index extends admin {
 + download : 应用文件的下载入口  + download : 应用文件的下载入口
 +-------------------------------------------------------------------------------------------  +-------------------------------------------------------------------------------------------
*/ */
public function download() { public function download()
{
global $_M; global $_M;
(new download($this->ac_appcore))->download($_M['form']['data']); (new download($this->ac_appcore))->download($_M['form']['data']);
echo $this->ac_appcore->resmsg(false); echo $this->ac_appcore->resmsg(false);
@ -107,7 +112,8 @@ class index extends admin {
 + domodal : 应用模态框数据处理入口  + domodal : 应用模态框数据处理入口
 +-------------------------------------------------------------------------------------------  +-------------------------------------------------------------------------------------------
*/ */
public function domodal() { public function domodal()
{
global $_M; global $_M;
$this->ac_session = new session(); $this->ac_session = new session();
switch ($_M['form']['type']) { switch ($_M['form']['type']) {
@ -136,7 +142,8 @@ class index extends admin {
 +-------------------------------------------------------------------------------------------  +-------------------------------------------------------------------------------------------
*/ */
public function doajax() { public function doajax()
{
global $_M; global $_M;
/* /*
* 查询API访问时间 * 查询API访问时间
@ -256,7 +263,8 @@ class index extends admin {
# 服务端通信检测 # 服务端通信检测
# 通过加密进行处理可防止数据丢失,防止某些敏感参数被过滤掉 # 通过加密进行处理可防止数据丢失,防止某些敏感参数被过滤掉
protected function server() { protected function server()
{
global $_M; global $_M;
//数据准备 //数据准备
$server = self::curljson($this->ac_appcore->met_web_app()); $server = self::curljson($this->ac_appcore->met_web_app());
@ -274,7 +282,8 @@ class index extends admin {
# 网站环境检测 # 网站环境检测
# 环境不存在中间值,要么支持,要么不支持 # 环境不存在中间值,要么支持,要么不支持
protected function system() { protected function system()
{
global $_M; global $_M;
//读取缓存 //读取缓存
$system = $this->ac_session->get('system'); $system = $this->ac_session->get('system');
@ -292,7 +301,8 @@ class index extends admin {
} }
# 应用授权检测 # 应用授权检测
protected function accredit() { protected function accredit()
{
global $_M; global $_M;
//数据准备 //数据准备
$post = $this->ac_appcore->met_web_app(); $post = $this->ac_appcore->met_web_app();
@ -317,7 +327,8 @@ class index extends admin {
} }
#文件指纹对比 #文件指纹对比
protected function appfile() { protected function appfile()
{
global $_M; global $_M;
//清空需要删的参数 //清空需要删的参数
$this->ac_session->del('repair'); $this->ac_session->del('repair');
@ -377,7 +388,8 @@ class index extends admin {
} }
# 微信公众号 # 微信公众号
protected function weqrcode() { protected function weqrcode()
{
global $_M; global $_M;
//缓存 //缓存
$wechat = $this->ac_session->get('wechat'); $wechat = $this->ac_session->get('wechat');
@ -405,7 +417,8 @@ class index extends admin {
} }
# 在线更新检测 # 在线更新检测
protected function update() { protected function update()
{
global $_M; global $_M;
$this->ac_session->del('dllist'); $this->ac_session->del('dllist');
$this->ac_session->del('newapp'); $this->ac_session->del('newapp');
@ -467,7 +480,8 @@ class index extends admin {
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// 文件修复列表 // 文件修复列表
protected function appfile_modal() { protected function appfile_modal()
{
global $_M; global $_M;
$download = new download($this->ac_appcore); $download = new download($this->ac_appcore);
$download->download('filelist|check'); $download->download('filelist|check');
@ -501,7 +515,8 @@ EOT;
} }
//微信公众号二维码 //微信公众号二维码
protected function weqrcode_modal() { protected function weqrcode_modal()
{
global $_M; global $_M;
$this->method = 'qrcode'; $this->method = 'qrcode';
$weqrcode = self::curljson($this->ac_appcore->met_all(), false, 25, 'wx'); $weqrcode = self::curljson($this->ac_appcore->met_all(), false, 25, 'wx');
@ -520,7 +535,8 @@ EOT;
} }
//微信公众号轮询 //微信公众号轮询
protected function wechat_modal() { protected function wechat_modal()
{
global $_M; global $_M;
$sign = random(6); $sign = random(6);
sleep(1); sleep(1);
@ -553,7 +569,8 @@ EOT;
} }
//在线更新 //在线更新
protected function update_modal() { protected function update_modal()
{
global $_M; global $_M;
$newapp = $this->ac_session->get('newapp'); $newapp = $this->ac_session->get('newapp');
return [ return [
@ -567,7 +584,8 @@ EOT;
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
# 需要格式化掉的数据防止二次使用时错误 # 需要格式化掉的数据防止二次使用时错误
private function del_cache() { private function del_cache()
{
global $_M; global $_M;
$this->ac_session->del('applist'); $this->ac_session->del('applist');
$this->ac_session->del('system'); $this->ac_session->del('system');
@ -581,7 +599,8 @@ EOT;
} }
# 记录各项检查结果 # 记录各项检查结果
private function result() { private function result()
{
global $_M; global $_M;
$code = false; $code = false;
$ckitem = $this->ac_session->get('ckitem'); $ckitem = $this->ac_session->get('ckitem');
@ -593,7 +612,8 @@ EOT;
} }
# 将返回信息转为JSON数据 # 将返回信息转为JSON数据
private function curljson($post = [],$type = false,$timeout = 15,$sign = 'ck' ) { private function curljson($post = [], $type = false, $timeout = 15, $sign = 'ck')
{
global $_M; global $_M;
return (new curls($this->ac_appcore))->apiurl($this->method, $sign) return (new curls($this->ac_appcore))->apiurl($this->method, $sign)
->apipost($post) ->apipost($post)
@ -602,7 +622,8 @@ EOT;
} }
# 应用内容呈现 # 应用内容呈现
protected function show($file, $data){ protected function show($file, $data)
{
global $_M; global $_M;
$view = load::sys_class('engine', 'new'); $view = load::sys_class('engine', 'new');
require_once $view->dodisplay($file, $data); require_once $view->dodisplay($file, $data);
@ -619,7 +640,8 @@ EOT;
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author QQ: 415420792 // | Author QQ: 415420792
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
class appcore{ class appcore
{
# 应用文件名 # 应用文件名
private $m_name; private $m_name;
@ -635,13 +657,15 @@ class appcore{
private $resmsg = []; private $resmsg = [];
# 初始化 # 初始化
public function __construct() { public function __construct()
{
global $_M; global $_M;
$this->m_name = M_NAME; $this->m_name = M_NAME;
} }
# 获取应用入口 # 获取应用入口
public function get_app_url() { public function get_app_url()
{
global $_M; global $_M;
$settings = file_exists(INS_LOCK_FILE) ? json_decode(file_get_contents(INS_LOCK_FILE), true) : []; $settings = file_exists(INS_LOCK_FILE) ? json_decode(file_get_contents(INS_LOCK_FILE), true) : [];
if (empty($settings['url'])) { if (empty($settings['url'])) {
@ -654,7 +678,8 @@ class appcore{
} }
# 站点信息和应用信息 # 站点信息和应用信息
public function met_web_app() { public function met_web_app()
{
global $_M; global $_M;
return [ return [
'web' => self::met_web(), 'web' => self::met_web(),
@ -663,7 +688,8 @@ class appcore{
} }
# 获取站点信息以及权限查询 # 获取站点信息以及权限查询
public function met_all() { public function met_all()
{
global $_M; global $_M;
$met = self::met_web_app(); $met = self::met_web_app();
$met['aop'] = self::met_aop(); $met['aop'] = self::met_aop();
@ -671,7 +697,8 @@ class appcore{
} }
# 站点信息查询 # 站点信息查询
public function met_web() { public function met_web()
{
global $_M; global $_M;
// 站点信息 // 站点信息
$name = ['met_weburl', 'met_webname', 'metcms_v', 'met_keywords', 'met_description', 'met_skin_user']; $name = ['met_weburl', 'met_webname', 'metcms_v', 'met_keywords', 'met_description', 'met_skin_user'];
@ -690,7 +717,8 @@ class appcore{
} }
# 应用信息查询 # 应用信息查询
public function met_app() { public function met_app()
{
global $_M; global $_M;
//应用信息 //应用信息
if (!empty($this->m_name)) { if (!empty($this->m_name)) {
@ -701,7 +729,8 @@ class appcore{
} }
# 下载权限处理需求 # 下载权限处理需求
public function met_adl() { public function met_adl()
{
global $_M; global $_M;
//应用信息 //应用信息
if (!empty($this->m_name)) { if (!empty($this->m_name)) {
@ -714,7 +743,8 @@ class appcore{
} }
# 公众号关注管理员权限 # 公众号关注管理员权限
public function met_aop() { public function met_aop()
{
global $_M; global $_M;
$admin = admin_information(); $admin = admin_information();
//管理员权限 //管理员权限
@ -728,7 +758,8 @@ class appcore{
} }
# 对resmsg 初始化 # 对resmsg 初始化
public function newres() { public function newres()
{
global $_M; global $_M;
$this->resmsg = []; $this->resmsg = [];
return $this; return $this;
@ -737,7 +768,8 @@ class appcore{
# 提示信息返回 # 提示信息返回
# $type true 为数组false 为json # $type true 为数组false 为json
# $unset true 清空避免重复使用出现问题 false 暂时不清空 # $unset true 清空避免重复使用出现问题 false 暂时不清空
public function resmsg($type = true,$unset = false) { public function resmsg($type = true, $unset = false)
{
global $_M; global $_M;
//检测值是否存在 //检测值是否存在
if (strlen($this->resmsg['key']) == 0) self::locmsg(4012); if (strlen($this->resmsg['key']) == 0) self::locmsg(4012);
@ -751,7 +783,8 @@ class appcore{
} }
# 正确结果返回 # 正确结果返回
public function sucmsg($msg,$code = 1) { public function sucmsg($msg, $code = 1)
{
global $_M; global $_M;
$this->resmsg['key'] = $code; $this->resmsg['key'] = $code;
$this->resmsg['text'] = self::fontcolor($code, $msg); $this->resmsg['text'] = self::fontcolor($code, $msg);
@ -759,7 +792,8 @@ class appcore{
} }
# 多种结果返回 # 多种结果返回
public function vagmsg($code,$msg = []) { public function vagmsg($code, $msg = [])
{
global $_M; global $_M;
$text = ''; $text = '';
foreach ($msg as $val) { foreach ($msg as $val) {
@ -774,7 +808,8 @@ class appcore{
# 错误结果返回 # 错误结果返回
# $code 这个是错误的编码 # $code 这个是错误的编码
# $msg 错误的信息提示 # $msg 错误的信息提示
public function errmsg($coding,$msg,$code = 0) { public function errmsg($coding, $msg, $code = 0)
{
global $_M; global $_M;
$this->resmsg['key'] = $code; $this->resmsg['key'] = $code;
$this->resmsg['text'] = self::fontcolor(0, "{$coding}{$msg}"); $this->resmsg['text'] = self::fontcolor(0, "{$coding}{$msg}");
@ -784,7 +819,8 @@ class appcore{
# 返回本地编码信息 # 返回本地编码信息
# $code 状态 # $code 状态
# $msg 错误的信息提示 # $msg 错误的信息提示
public function locmsg($msg = [],$code = 0) { public function locmsg($msg = [], $code = 0)
{
global $_M; global $_M;
if (!empty($msg)) self::codemsg($msg); if (!empty($msg)) self::codemsg($msg);
$this->resmsg['key'] = $code; $this->resmsg['key'] = $code;
@ -796,7 +832,8 @@ class appcore{
# $modal 模态框的内容 # $modal 模态框的内容
# $code 校验结果状态 # $code 校验结果状态
# $error 错误信息提示 提示码以及需要增加的文字 # $error 错误信息提示 提示码以及需要增加的文字
public function modalmsg($modal = [], $error = [],$code = 0) { public function modalmsg($modal = [], $error = [], $code = 0)
{
global $_M; global $_M;
self::locmsg($error, $code); self::locmsg($error, $code);
$this->resmsg['modal'] = $modal; $this->resmsg['modal'] = $modal;
@ -804,14 +841,16 @@ class appcore{
} }
# 替换key # 替换key
public function msgkey($key = 4) { public function msgkey($key = 4)
{
global $_M; global $_M;
$this->resmsg['key'] = $key; $this->resmsg['key'] = $key;
return $this; return $this;
} }
# 使用本地错误代码替换返回信息内的text # 使用本地错误代码替换返回信息内的text
public function msgtext($error = []) { public function msgtext($error = [])
{
global $_M; global $_M;
self::codemsg($error); self::codemsg($error);
$this->resmsg['text'] = self::fontcolor($this->resmsg['key'], $this->tipmsg['errmsg']); $this->resmsg['text'] = self::fontcolor($this->resmsg['key'], $this->tipmsg['errmsg']);
@ -820,14 +859,16 @@ class appcore{
# text # text
# $type true 覆盖false 为拼接 # $type true 覆盖false 为拼接
public function msgmeet($text,$type = false) { public function msgmeet($text, $type = false)
{
global $_M; global $_M;
$this->resmsg['text'] = $type ? $text : $this->resmsg['text'] . $text; $this->resmsg['text'] = $type ? $text : $this->resmsg['text'] . $text;
return $this; return $this;
} }
# 对提示文字的HTML处理 # 对提示文字的HTML处理
private function fontcolor($code,$text) { private function fontcolor($code, $text)
{
global $_M; global $_M;
// 红、绿、黄 // 红、绿、黄
$color = ['#E9595B', '#36AB7A', '#EC9940', '#76838f', '#2a333c']; $color = ['#E9595B', '#36AB7A', '#EC9940', '#76838f', '#2a333c'];
@ -836,13 +877,15 @@ class appcore{
# 错误提示语返回字符串格式 # 错误提示语返回字符串格式
# $type true 字符串false 为JSON # $type true 字符串false 为JSON
public function coderes($type = true) { public function coderes($type = true)
{
global $_M; global $_M;
return $type ? $this->tipmsg['errmsg'] : json_encode($this->tipmsg, JSON_UNESCAPED_UNICODE); return $type ? $this->tipmsg['errmsg'] : json_encode($this->tipmsg, JSON_UNESCAPED_UNICODE);
} }
# 错误代码信息 # 错误代码信息
public function codemsg($coding,$text = '') { public function codemsg($coding, $text = '')
{
global $_M; global $_M;
if (is_array($coding)) list($coding, $text) = $coding; if (is_array($coding)) list($coding, $text) = $coding;
$msg = [ $msg = [
@ -880,7 +923,8 @@ class appcore{
# 密钥获取和保存 # 密钥获取和保存
# $mode true是读取 false是保存 # $mode true是读取 false是保存
public function mysql_config($arr = [],$mode = true) { public function mysql_config($arr = [], $mode = true)
{
global $_M; global $_M;
list($key, $val) = $arr; list($key, $val) = $arr;
$table = $_M['table']['cloud_config']; $table = $_M['table']['cloud_config'];
@ -895,7 +939,8 @@ class appcore{
} }
// 获取客户端IP // 获取客户端IP
public function get_client_ip(){ public function get_client_ip()
{
$arr_ip_header = [ $arr_ip_header = [
// 非常见 // 非常见
'HTTP_CDN_SRC_IP', 'HTTP_CDN_SRC_IP',
@ -921,7 +966,8 @@ class appcore{
* @param array $back 输出字符串或数组 * @param array $back 输出字符串或数组
* @param string $callback ajax的回调函数的名称 * @param string $callback ajax的回调函数的名称
*/ */
public function jsoncallback($back, $callback = 'callback') { public function jsoncallback($back, $callback = 'callback')
{
global $_M; global $_M;
header('Content-type: application/x-javascript'); header('Content-type: application/x-javascript');
$callback = $_M['form'][ $callback ]; $callback = $_M['form'][ $callback ];
@ -930,7 +976,8 @@ class appcore{
} }
//删除更新文件夹 //删除更新文件夹
public function del_update_dir() { public function del_update_dir()
{
global $_M; global $_M;
@clearstatcache(); @clearstatcache();
//检测文件是否存在,删除缓存的file //检测文件是否存在,删除缓存的file
@ -948,7 +995,8 @@ class appcore{
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author QQ: 415420792 // | Author QQ: 415420792
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
class curls{ class curls
{
# 应用主方法 # 应用主方法
private $appcore; private $appcore;
@ -966,7 +1014,8 @@ class curls{
private $headers = []; private $headers = [];
# 初始化 # 初始化
public function __construct($appcore) { public function __construct($appcore)
{
global $_M; global $_M;
$this->appcore = $appcore; $this->appcore = $appcore;
// 选择执行URL提交的数据对数据的处理提交服务端数据的处理返回结果 // 选择执行URL提交的数据对数据的处理提交服务端数据的处理返回结果
@ -986,7 +1035,8 @@ class curls{
} }
# URL选择 # URL选择
public function apiurl($method,$type = 'ck') { public function apiurl($method, $type = 'ck')
{
global $_M; global $_M;
$this->apiurl = $this->urlarr[ $type ] . $method; $this->apiurl = $this->urlarr[ $type ] . $method;
$this->scheme = self::purl($this->apiurl, 'scheme'); $this->scheme = self::purl($this->apiurl, 'scheme');
@ -995,7 +1045,8 @@ class curls{
# 数据处理 # 数据处理
# $ende true加密 false 不执行加密 # $ende true加密 false 不执行加密
public function apipost($post,$ende = true) { public function apipost($post, $ende = true)
{
global $_M; global $_M;
$this->data = $post; $this->data = $post;
// 若要采用非默认密钥这里设置false,单独调用加密方法 // 若要采用非默认密钥这里设置false,单独调用加密方法
@ -1005,7 +1056,8 @@ class curls{
# 对数据加密 # 对数据加密
# $str 加密数据 $key 加密密钥 # $str 加密数据 $key 加密密钥
public function auth_encode($key = null) { public function auth_encode($key = null)
{
global $_M; global $_M;
if (!empty($key)) $this->apikey = $key; if (!empty($key)) $this->apikey = $key;
if (is_array($this->data)) self::arrjson(false); if (is_array($this->data)) self::arrjson(false);
@ -1014,7 +1066,8 @@ class curls{
} }
# 授权查询 授权代码结束 # 授权查询 授权代码结束
public function curls($timeout = 15) { public function curls($timeout = 15)
{
global $_M; global $_M;
if (get_extension_funcs('curl') && function_exists('curl_init') && function_exists('curl_setopt') && function_exists('curl_exec') && function_exists('curl_close')) { if (get_extension_funcs('curl') && function_exists('curl_init') && function_exists('curl_setopt') && function_exists('curl_exec') && function_exists('curl_close')) {
$curl = curl_init(); $curl = curl_init();
@ -1045,7 +1098,8 @@ class curls{
# 对数据解密 # 对数据解密
# $str 加密数据 $key 加密密钥 # $str 加密数据 $key 加密密钥
public function auth_decode($key = null) { public function auth_decode($key = null)
{
global $_M; global $_M;
if (!empty($key)) $this->apikey = $key; if (!empty($key)) $this->apikey = $key;
$this->data = authcode($this->data, 'DECODE', $this->apikey); $this->data = authcode($this->data, 'DECODE', $this->apikey);
@ -1054,7 +1108,8 @@ class curls{
# 数据格式转换 # 数据格式转换
# $type true 转为数组 false 转为json # $type true 转为数组 false 转为json
public function arrjson($type = true) { public function arrjson($type = true)
{
global $_M; global $_M;
$this->data = $type ? json_decode($this->data, true) : json_encode($this->data, JSON_UNESCAPED_UNICODE); $this->data = $type ? json_decode($this->data, true) : json_encode($this->data, JSON_UNESCAPED_UNICODE);
return $this; return $this;
@ -1062,7 +1117,8 @@ class curls{
# 返回的数据处理 # 返回的数据处理
# $type true 返回源数据false 返回数组 # $type true 返回源数据false 返回数组
public function resdata($type = false) { public function resdata($type = false)
{
global $_M; global $_M;
if ($type == false) self::arrjson(); if ($type == false) self::arrjson();
return $this->data; return $this->data;
@ -1071,7 +1127,8 @@ class curls{
# 单独处理数据的加密和解密 # 单独处理数据的加密和解密
# $type true 加密false 解密 # $type true 加密false 解密
# $post 有数据则执行无数据则直接返回postr # $post 有数据则执行无数据则直接返回postr
public function postr($post = null,$key = null,$type = true) { public function postr($post = null, $key = null, $type = true)
{
global $_M; global $_M;
self::apipost($post, false); self::apipost($post, false);
if ($type) { if ($type) {
@ -1083,7 +1140,8 @@ class curls{
} }
# 授权密钥解密 # 授权密钥解密
public function apikey_decode($appkey = []) { public function apikey_decode($appkey = [])
{
global $_M; global $_M;
list($apikey, $domian, $m_name, $addtime) = $appkey; list($apikey, $domian, $m_name, $addtime) = $appkey;
$domian = self::purl($domian); $domian = self::purl($domian);
@ -1091,7 +1149,8 @@ class curls{
} }
# 分析网址 # 分析网址
public function purl($url,$type = 'host') { public function purl($url, $type = 'host')
{
global $_M; global $_M;
$url = url_standard($url); $url = url_standard($url);
$array = parse_url($url); $array = parse_url($url);
@ -1110,38 +1169,45 @@ class curls{
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author QQ: 415420792 // | Author QQ: 415420792
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
class session{ class session
{
# 应用文件名 # 应用文件名
private $se_m_name = M_NAME; private $se_m_name = M_NAME;
public function __construct() { public function __construct()
{
global $_M; global $_M;
self::start(); self::start();
} }
public function start(){ public function start()
{
$ip = self::getip(); $ip = self::getip();
session_id(md5($_SERVER['HTTP_USER_AGENT'] . $this->se_m_name . $ip)); session_id(md5($_SERVER['HTTP_USER_AGENT'] . $this->se_m_name . $ip));
session_start(); session_start();
} }
public function set($name, $value){ public function set($name, $value)
{
self::start(); self::start();
$_SESSION[ $name ] = $value; $_SESSION[ $name ] = $value;
} }
public function get($name){ public function get($name)
{
self::start(); self::start();
return $_SESSION[ $name ]; return $_SESSION[ $name ];
} }
public function del($name){ public function del($name)
{
self::start(); self::start();
unset($_SESSION[ $name ]); unset($_SESSION[ $name ]);
} }
public function getip() { public function getip()
{
$unknown = 'unknown'; $unknown = 'unknown';
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] && strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'], $unknown)) { if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] && strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'], $unknown)) {
$pro = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $pro = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
@ -1163,7 +1229,8 @@ class session{
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author QQ: 415420792 // | Author QQ: 415420792
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
class dirfinger { class dirfinger
{
# 应用所在目录 # 应用所在目录
private $appfile; private $appfile;
@ -1177,7 +1244,8 @@ class dirfinger {
private $dllist = []; private $dllist = [];
# 初始化 # 初始化
public function __construct() { public function __construct()
{
global $_M; global $_M;
$this->appfile = PATH_APP_FILE; $this->appfile = PATH_APP_FILE;
$this->skipfile = []; $this->skipfile = [];
@ -1191,7 +1259,8 @@ class dirfinger {
} }
# 对比指纹入口 # 对比指纹入口
public function fingers($fingers = []) { public function fingers($fingers = [])
{
global $_M; global $_M;
//指纹对比 //指纹对比
self::fingerprint_check($fingers); self::fingerprint_check($fingers);
@ -1204,7 +1273,8 @@ class dirfinger {
} }
//删除应用文件以外的文件 //删除应用文件以外的文件
public function del_appfile($fingers = [], $dir = '') { public function del_appfile($fingers = [], $dir = '')
{
global $_M; global $_M;
$files = scandir($this->appfile . $dir); $files = scandir($this->appfile . $dir);
foreach ($files as $file) { foreach ($files as $file) {
@ -1226,7 +1296,8 @@ class dirfinger {
} }
# 应用指纹校验 # 应用指纹校验
private function fingerprint_check($flist = ''){ private function fingerprint_check($flist = '')
{
global $_M; global $_M;
foreach ($flist as $key => $val) { foreach ($flist as $key => $val) {
//文件路径 //文件路径
@ -1258,7 +1329,8 @@ class dirfinger {
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author QQ: 415420792 // | Author QQ: 415420792
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
class download{ class download
{
#传送的数据 #传送的数据
private $modal; private $modal;
@ -1282,7 +1354,8 @@ class download{
private $cksign; private $cksign;
# 初始化 # 初始化
public function __construct($appcore) { public function __construct($appcore)
{
global $_M; global $_M;
$this->appfile = PATH_APP_FILE; $this->appfile = PATH_APP_FILE;
$this->appupdir = APP_UPDATE_DIR; $this->appupdir = APP_UPDATE_DIR;
@ -1294,7 +1367,8 @@ class download{
} }
# 下载更新入口 # 下载更新入口
public function download($data) { public function download($data)
{
global $_M; global $_M;
//执行方法,进度 //执行方法,进度
list($cksign, $method, $step, $rate, $total) = explode('|', $data); list($cksign, $method, $step, $rate, $total) = explode('|', $data);
@ -1344,7 +1418,8 @@ class download{
} }
# 检测应用版本是否存在 # 检测应用版本是否存在
public function app_file_check() { public function app_file_check()
{
global $_M; global $_M;
//检测文件是否存在,删除缓存的file //检测文件是否存在,删除缓存的file
if (file_exists($this->appupdir)) { if (file_exists($this->appupdir)) {
@ -1395,7 +1470,8 @@ class download{
} }
# APP文件下载 # APP文件下载
public function app_file_dl($step) { public function app_file_dl($step)
{
global $_M; global $_M;
//获取缓存信息 //获取缓存信息
$filelist = self::app_get_file(); $filelist = self::app_get_file();
@ -1437,7 +1513,8 @@ class download{
} }
# 自动更新处理 # 自动更新处理
public function app_file_core() { public function app_file_core()
{
global $_M; global $_M;
//进行文件移动覆盖,成功则返回相关信息 //进行文件移动覆盖,成功则返回相关信息
if (movedir($this->appupfile, $this->appfile)) { if (movedir($this->appupfile, $this->appfile)) {
@ -1453,7 +1530,8 @@ class download{
} }
# 手动文件更新 # 手动文件更新
public function app_file_repair() { public function app_file_repair()
{
global $_M; global $_M;
//进行文件复制,成功则返回相关信息 //进行文件复制,成功则返回相关信息
if (copydir($this->appupfile, $this->appfile)) { if (copydir($this->appupfile, $this->appfile)) {
@ -1468,7 +1546,8 @@ class download{
} }
# 文件全新安装 # 文件全新安装
public function app_file_install() { public function app_file_install()
{
global $_M; global $_M;
$bool = false; $bool = false;
//文件移动 //文件移动
@ -1487,20 +1566,23 @@ class download{
} }
# 读取本地文件 # 读取本地文件
public function app_get_file() { public function app_get_file()
{
global $_M; global $_M;
return file_exists($this->appdllist) ? json_decode(file_get_contents($this->appdllist), true) : []; return file_exists($this->appdllist) ? json_decode(file_get_contents($this->appdllist), true) : [];
} }
# 读取本地文件 # 读取本地文件
public function app_update_ver() { public function app_update_ver()
{
global $_M; global $_M;
$newapp = $this->ac_session->get('newapp'); $newapp = $this->ac_session->get('newapp');
return $newapp['v_ver']; return $newapp['v_ver'];
} }
# 获取下载权限 # 获取下载权限
private function statekey() { private function statekey()
{
global $_M; global $_M;
$state = false; $state = false;
//解密 //解密
@ -1519,7 +1601,8 @@ class download{
} }
# 模态框数据 modal # 模态框数据 modal
private function modal($step = '',$method) { private function modal($step = '', $method)
{
global $_M; global $_M;
if (strlen($step) > 0) $this->modal['data']['step'] = $step; if (strlen($step) > 0) $this->modal['data']['step'] = $step;
if (strlen($method) > 0) $this->modal['data']['method'] = $method; if (strlen($method) > 0) $this->modal['data']['method'] = $method;
@ -1529,7 +1612,8 @@ class download{
} }
# CURL # CURL
private function curljson($post = [],$type = false,$timeout = 60,$sign = 'dl') { private function curljson($post = [], $type = false, $timeout = 60, $sign = 'dl')
{
global $_M; global $_M;
return (new curls($this->ac_appcore))->apiurl($this->method, $sign) return (new curls($this->ac_appcore))->apiurl($this->method, $sign)
->apipost($post) ->apipost($post)
@ -1538,7 +1622,8 @@ class download{
} }
# 文件导入 # 文件导入
private function _require() { private function _require()
{
global $_M; global $_M;
$dir = $this->appupdir . '/update.class.php'; $dir = $this->appupdir . '/update.class.php';
$para = []; $para = [];

View File

@ -5,7 +5,8 @@
* 应用支持php5.4+ * 应用支持php5.4+
*/ */
trait appcmp { trait appcmp
{
# 应用文件名 # 应用文件名
public $m_name = M_NAME; public $m_name = M_NAME;
@ -25,7 +26,8 @@ trait appcmp {
require_once $view->dodisplay($file, $data); require_once $view->dodisplay($file, $data);
} }
protected function check_auth() { protected function check_auth()
{
global $_M, $_YW; global $_M, $_YW;
self::cmp_a(); self::cmp_a();
$exetime = time(); $exetime = time();
@ -53,7 +55,8 @@ trait appcmp {
} }
# 加载方法 # 加载方法
public function loadp($str = '') { public function loadp($str = '')
{
global $_M, $_YW; global $_M, $_YW;
$arr = explode(",", $str); $arr = explode(",", $str);
foreach ($arr as $val) { foreach ($arr as $val) {
@ -62,13 +65,15 @@ trait appcmp {
} }
# 批量加载 # 批量加载
public function cmp_load() { public function cmp_load()
{
global $_M, $_YW; global $_M, $_YW;
self::loadp('cmp_k,cmp_c,cmp_t'); self::loadp('cmp_k,cmp_c,cmp_t');
} }
# 获取完整数据库 # 获取完整数据库
public function cmp_k() { public function cmp_k()
{
global $_M, $_YW; global $_M, $_YW;
//全局 //全局
$globaltablename = ['cloud_config']; $globaltablename = ['cloud_config'];
@ -84,7 +89,8 @@ trait appcmp {
} }
# 配置信息 # 配置信息
public function cmp_c($lang = '') { public function cmp_c($lang = '')
{
global $_M, $_YW; global $_M, $_YW;
$_YW['n'] = $this->m_name; $_YW['n'] = $this->m_name;
if (empty($lang)) $lang = $_M['lang']; if (empty($lang)) $lang = $_M['lang'];
@ -96,19 +102,22 @@ trait appcmp {
} }
# 应用信息 # 应用信息
public function cmp_a() { public function cmp_a()
{
global $_M, $_YW; global $_M, $_YW;
$_YW['app'] = DB::get_one("SELECT * FROM {$_M['table']['applist']} WHERE m_name='{$this->m_name}' "); $_YW['app'] = DB::get_one("SELECT * FROM {$_M['table']['applist']} WHERE m_name='{$this->m_name}' ");
} }
# 栏目信息 # 栏目信息
public function cmp_ac() { public function cmp_ac()
{
global $_M, $_YW; global $_M, $_YW;
$_YW['app']['column'] = DB::get_one("SELECT * FROM {$_M['table']['column']} WHERE module='{$_YW['app']['no']}' AND lang='{$_M['lang']}' "); $_YW['app']['column'] = DB::get_one("SELECT * FROM {$_M['table']['column']} WHERE module='{$_YW['app']['no']}' AND lang='{$_M['lang']}' ");
} }
# 语言文字 # 语言文字
public function cmp_t() { public function cmp_t()
{
global $_M, $_YW; global $_M, $_YW;
$file = PATH_APP_FILE . 'lang/' . $_M['lang'] . '.php'; $file = PATH_APP_FILE . 'lang/' . $_M['lang'] . '.php';
if (!file_exists($file)) { if (!file_exists($file)) {
@ -118,14 +127,16 @@ trait appcmp {
} }
# 单条配置语句入库 # 单条配置语句入库
public function addconsql($name, $val = '',$lang) { public function addconsql($name, $val = '', $lang)
{
global $_M, $_YW; global $_M, $_YW;
if (empty($lang)) $lang = $_M['lang']; if (empty($lang)) $lang = $_M['lang'];
DB::query("INSERT INTO {$_M['table']['cloud_config']} (name,lang,m_name,value) VALUES ('{$name}','{$lang}','{$this->m_name}','{$val}') ON DUPLICATE KEY UPDATE value='{$val}' "); DB::query("INSERT INTO {$_M['table']['cloud_config']} (name,lang,m_name,value) VALUES ('{$name}','{$lang}','{$this->m_name}','{$val}') ON DUPLICATE KEY UPDATE value='{$val}' ");
} }
# 信息JQ弹出并刷新当前页面 # 信息JQ弹出并刷新当前页面
public function scriptgo($info) { public function scriptgo($info)
{
global $_M; global $_M;
$this->destruct = false; $this->destruct = false;
echo "<script>alert('{$info}');history.go(-1);</script>"; echo "<script>alert('{$info}');history.go(-1);</script>";
@ -133,19 +144,22 @@ trait appcmp {
} }
//表简称 //表简称
public function tname() { public function tname()
{
global $_M, $_YW; global $_M, $_YW;
return substr($_M['form']['a'], 2); return substr($_M['form']['a'], 2);
} }
//时间格式化 //时间格式化
public function data_time($time) { public function data_time($time)
{
global $_M, $_YW; global $_M, $_YW;
return $time ? date('Y-m-d H:i:s', $time) : ''; return $time ? date('Y-m-d H:i:s', $time) : '';
} }
//字符截取 //字符截取
public function sub_str($str) { public function sub_str($str)
{
global $_M, $_YW; global $_M, $_YW;
return strlen($str) > 0 ? substr($str, 0, 8) . '...' : ''; return strlen($str) > 0 ? substr($str, 0, 8) . '...' : '';
} }
@ -155,7 +169,8 @@ trait appcmp {
* @param array $back 输出字符串或数组 * @param array $back 输出字符串或数组
* @param string $callback ajax的回调函数的名称 * @param string $callback ajax的回调函数的名称
*/ */
public function jsoncallback($back, $callback = 'callback') { public function jsoncallback($back, $callback = 'callback')
{
global $_M; global $_M;
header('Content-type: application/x-javascript'); header('Content-type: application/x-javascript');
$callback = $_M['form'][ $callback ]; $callback = $_M['form'][ $callback ];
@ -164,7 +179,8 @@ trait appcmp {
} }
# 分析网址 # 分析网址
public function parse_url($url,$type = 'host') { public function parse_url($url, $type = 'host')
{
global $_M; global $_M;
$url = url_standard($url); $url = url_standard($url);
$array = parse_url($url); $array = parse_url($url);
@ -172,14 +188,16 @@ trait appcmp {
} }
//URL参数处理防止URL拼接错误 //URL参数处理防止URL拼接错误
public function http_build_query($url,$arr) { public function http_build_query($url, $arr)
{
global $_M, $_YW; global $_M, $_YW;
if (!in_array(substr($url, -1), ['&', '?'])) $url .= '&'; if (!in_array(substr($url, -1), ['&', '?'])) $url .= '&';
return $url . http_build_query($arr); return $url . http_build_query($arr);
} }
//前端CSS合并 //前端CSS合并
public function merge_css($addcss = '') { public function merge_css($addcss = '')
{
global $_M, $_YW; global $_M, $_YW;
$cssfile = PATH_APP_FILE . 'public/css/webcss.css'; $cssfile = PATH_APP_FILE . 'public/css/webcss.css';
if (!file_exists($cssfile)) return false; if (!file_exists($cssfile)) return false;

View File

@ -3,8 +3,10 @@ defined('IN_MET') or exit('No permission');
//更新文件的模板 //更新文件的模板
load::sys_class('admin'); load::sys_class('admin');
load::sys_func('file'); load::sys_func('file');
//不继承APP //不继承APP
class update extends admin{ class update extends admin
{
//应用信息 //应用信息
private $app; private $app;
@ -24,7 +26,8 @@ class update extends admin{
private $fixed_name; private $fixed_name;
# 初始化 # 初始化
public function __construct() { public function __construct()
{
global $_M; global $_M;
parent::__construct(); parent::__construct();
//安装锁信息,应用入口信息 //安装锁信息,应用入口信息
@ -39,7 +42,8 @@ class update extends admin{
} }
//需要传递值 //需要传递值
public function set($app) { public function set($app)
{
global $_M; global $_M;
$this->app = $app; $this->app = $app;
$this->appno = $app['no']; $this->appno = $app['no'];
@ -50,7 +54,8 @@ class update extends admin{
} }
//修改数据库版本 //修改数据库版本
public function start() { public function start()
{
global $_M; global $_M;
if (file_exists(INS_LOCK_FILE)) { if (file_exists(INS_LOCK_FILE)) {
switch ($this->newver) { switch ($this->newver) {
@ -92,7 +97,8 @@ class update extends admin{
*/ */
// 1.1 版本 // 1.1 版本
public function update_1_1() { public function update_1_1()
{
global $_M; global $_M;
// 对一个表新增字段 // 对一个表新增字段
} }
@ -110,7 +116,8 @@ class update extends admin{
*/ */
//数据库创建 //数据库创建
protected function table_field() { protected function table_field()
{
global $_M; global $_M;
// 场所资料库 // 场所资料库
$zdytable['village'] = " `id` int(11) NOT NULL AUTO_INCREMENT, $zdytable['village'] = " `id` int(11) NOT NULL AUTO_INCREMENT,
@ -281,7 +288,8 @@ class update extends admin{
} }
//mysql 触发器 //mysql 触发器
protected function trigger() { protected function trigger()
{
global $_M; global $_M;
//新增schedule 表的更新触发器 //新增schedule 表的更新触发器
$table_name = self::split_table_name('schedule', true); $table_name = self::split_table_name('schedule', true);
@ -336,7 +344,8 @@ class update extends admin{
} }
//mysql 视图 //mysql 视图
protected function tview() { protected function tview()
{
global $_M; global $_M;
//查询到期合同以及根据设置的到期天数提醒 //查询到期合同以及根据设置的到期天数提醒
$sequence = self::split_table_name('sequence', true); $sequence = self::split_table_name('sequence', true);
@ -385,7 +394,8 @@ class update extends admin{
} }
//默认配置 //默认配置
protected function default_config() { protected function default_config()
{
global $_M; global $_M;
//正常升级 //正常升级
$config = [ $config = [
@ -398,7 +408,8 @@ class update extends admin{
} }
//系统表 //系统表
protected function systable() { protected function systable()
{
global $_M; global $_M;
//访问入口固定为app/index.php?n=XXX&c=XXX&a=XXX //访问入口固定为app/index.php?n=XXX&c=XXX&a=XXX
//定时处理入口 //定时处理入口
@ -418,7 +429,8 @@ class update extends admin{
*/ */
//应用数据表创建 //应用数据表创建
protected function inssql() { protected function inssql()
{
global $_M; global $_M;
$tables = self::table_field(); $tables = self::table_field();
$table = $tname = []; $table = $tname = [];
@ -460,13 +472,15 @@ class update extends admin{
} }
//修改版本号 //修改版本号
protected function upver() { protected function upver()
{
global $_M; global $_M;
DB::query("UPDATE {$_M['table']['applist']} SET ver='{$this->newver}' WHERE no='{$this->appno}' AND m_name='{$this->m_name}' "); DB::query("UPDATE {$_M['table']['applist']} SET ver='{$this->newver}' WHERE no='{$this->appno}' AND m_name='{$this->m_name}' ");
} }
//创建安装锁 //创建安装锁
protected function install_lock() { protected function install_lock()
{
global $_M; global $_M;
if (!file_exists(INS_LOCK_FILE)) makefile(INS_LOCK_FILE); if (!file_exists(INS_LOCK_FILE)) makefile(INS_LOCK_FILE);
file_put_contents(INS_LOCK_FILE, json_encode($this->appinfo, JSON_UNESCAPED_UNICODE)); file_put_contents(INS_LOCK_FILE, json_encode($this->appinfo, JSON_UNESCAPED_UNICODE));
@ -486,7 +500,8 @@ class update extends admin{
*/ */
//公共查询方法 //公共查询方法
private function sqlone($tname,$where = '') { private function sqlone($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
if (!$where) $where = "no='{$this->appno}'"; if (!$where) $where = "no='{$this->appno}'";
@ -494,7 +509,8 @@ class update extends admin{
} }
//公共查询方法 //公共查询方法
private function sqlall($tname,$where = '') { private function sqlall($tname, $where = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
if (!$where) $where = "no='{$this->appno}'"; if (!$where) $where = "no='{$this->appno}'";
@ -502,14 +518,16 @@ class update extends admin{
} }
//公共写入方法 //公共写入方法
private function addsql($tname,$field = '') { private function addsql($tname, $field = '')
{
global $_M; global $_M;
$table = $_M['table'][ $tname ]; $table = $_M['table'][ $tname ];
DB::query("INSERT INTO {$table} SET {$field}"); DB::query("INSERT INTO {$table} SET {$field}");
} }
//拼接完整数据库名 //拼接完整数据库名
private function split_table_name($name,$all = false) { private function split_table_name($name, $all = false)
{
global $_M; global $_M;
//公用表 //公用表
$global_table = ['cloud_config', 'nwechat_user']; $global_table = ['cloud_config', 'nwechat_user'];
@ -526,7 +544,8 @@ class update extends admin{
*/ */
//创建前台入口API形式 //创建前台入口API形式
protected function column_api() { protected function column_api()
{
global $_M; global $_M;
$file = self::sqlall('ifcolumn_addfile'); $file = self::sqlall('ifcolumn_addfile');
$dir = PATH_WEB . $this->fixed_name; $dir = PATH_WEB . $this->fixed_name;
@ -548,7 +567,8 @@ class update extends admin{
} }
//创建栏目信息 //创建栏目信息
protected function column() { protected function column()
{
global $_M; global $_M;
$name = array('cn' => '加盟店', 'en' => 'Join store query', 'tc' => '加盟店'); $name = array('cn' => '加盟店', 'en' => 'Join store query', 'tc' => '加盟店');
foreach (array('cn', 'en', 'tc') as $k => $v) { foreach (array('cn', 'en', 'tc') as $k => $v) {

View File

@ -59,7 +59,8 @@ class index extends appweb
} }
//获取doajaxcl //获取doajaxcl
public function doajaxcl() { public function doajaxcl()
{
global $_M, $_YW; global $_M, $_YW;
parent::jsoncallback([]); parent::jsoncallback([]);
} }

View File

@ -9,7 +9,9 @@ load::own_func('appcmp');
* 配置 * 配置
* 包含其他功能初始化 * 包含其他功能初始化
*/ */
class select extends appweb {
class select extends appweb
{
/* /*
* @$querys string 搜索内容 * @$querys string 搜索内容
@ -46,7 +48,8 @@ class select extends appweb {
//返回的数组 //返回的数组
private $data = []; private $data = [];
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
// 过滤 // 过滤
@ -73,7 +76,8 @@ class select extends appweb {
} }
# select2 选项字段处理 # select2 选项字段处理
private function select_fiend($val) { private function select_fiend($val)
{
global $_M, $_YW; global $_M, $_YW;
$strarr = stringto_array($this->fiend, '|'); $strarr = stringto_array($this->fiend, '|');
foreach ($strarr as $value) { foreach ($strarr as $value) {
@ -83,7 +87,8 @@ class select extends appweb {
} }
# allnone 默认选项全部处理 # allnone 默认选项全部处理
private function allnone() { private function allnone()
{
global $_M, $_YW; global $_M, $_YW;
// 若不需要显示‘全部’值,则直接返回空 // 若不需要显示‘全部’值,则直接返回空
// 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值 // 0 为不显示‘全部’,同时也在未搜索到结果的情况下 不 设置为可选值
@ -104,7 +109,8 @@ class select extends appweb {
} }
# 当未搜索到值是否将搜索结果设置为可选值 # 当未搜索到值是否将搜索结果设置为可选值
private function children() { private function children()
{
global $_M, $_YW; global $_M, $_YW;
// 判断是否要将搜索内容设置为可选值 // 判断是否要将搜索内容设置为可选值
if (empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false; if (empty($this->allnone) || $this->allnone == '2' || strlen($this->querys) == 0) return false;
@ -119,7 +125,8 @@ class select extends appweb {
} }
# querys 处理 # querys 处理
private function querys() { private function querys()
{
global $_M, $_YW; global $_M, $_YW;
$curdate = date('Y-m-d', time()); $curdate = date('Y-m-d', time());
switch ($this->source) { switch ($this->source) {
@ -164,7 +171,8 @@ class select extends appweb {
} }
# condition 处理 # condition 处理
private function condition() { private function condition()
{
global $_M, $_YW; global $_M, $_YW;
if (empty($this->condition)) return false; if (empty($this->condition)) return false;
// 进行处理 // 进行处理
@ -181,7 +189,8 @@ class select extends appweb {
} }
# 选项值的组成样式 # 选项值的组成样式
private function valuet($val) { private function valuet($val)
{
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
@ -212,7 +221,8 @@ class select extends appweb {
} }
//编号字段,根据此字段进行编号处理 //编号字段,根据此字段进行编号处理
private function charter() { private function charter()
{
global $_M, $_YW; global $_M, $_YW;
switch ($this->tname) { switch ($this->tname) {
case 'village': case 'village':
@ -242,7 +252,8 @@ class select extends appweb {
// 查看场所名称列表 // 查看场所名称列表
public function doselect() { public function doselect()
{
global $_M, $_YW; global $_M, $_YW;
//判断条件 //判断条件
self::querys(); self::querys();

View File

@ -7,7 +7,8 @@ load::own_class('../traits/tlist');
load::own_class('../traits/tfield'); load::own_class('../traits/tfield');
//表格 //表格
class table_ajax extends appweb { class table_ajax extends appweb
{
# 过滤方法名 # 过滤方法名
private $ado = ['doindex']; private $ado = ['doindex'];
@ -26,7 +27,8 @@ class table_ajax extends appweb {
private $own_name_info; private $own_name_info;
private $own_name_table; private $own_name_table;
public function __construct() { public function __construct()
{
global $_M, $_YW; global $_M, $_YW;
parent::__construct(); parent::__construct();
// 过滤 // 过滤
@ -45,7 +47,8 @@ class table_ajax extends appweb {
} }
//表格数据 //表格数据
public function doindex() { public function doindex()
{
global $_M; global $_M;
//加载表格数据获取类 //加载表格数据获取类
$table = load::own_class('tabledata', 'new'); $table = load::own_class('tabledata', 'new');
@ -78,7 +81,8 @@ class table_ajax extends appweb {
* 【列出】 * 【列出】
* 返回数据数组 * 返回数据数组
*/ */
private function sqlarr($data = []) { private function sqlarr($data = [])
{
global $_M; global $_M;
// if(in_array($this->tname,$this->k_name)){ // if(in_array($this->tname,$this->k_name)){
foreach ($data as $val) { foreach ($data as $val) {
@ -95,7 +99,8 @@ class table_ajax extends appweb {
* 【新行】 * 【新行】
* 新增行分发 * 新增行分发
*/ */
public function do_table_add_list(){ public function do_table_add_list()
{
global $_M; global $_M;
$val = ['id' => 'new-' . $this->form['new_id'], 'p_type' => $this->form['p_type']]; $val = ['id' => 'new-' . $this->form['new_id'], 'p_type' => $this->form['p_type']];
if (in_array($this->tname, $this->k_name)) { if (in_array($this->tname, $this->k_name)) {
@ -108,7 +113,8 @@ class table_ajax extends appweb {
* 【新行】 * 【新行】
* 生成文件新增行 * 生成文件新增行
*/ */
private function addlist($val) { private function addlist($val)
{
global $_M; global $_M;
$metinfo = ''; $metinfo = '';
foreach ($this->list as $v) { foreach ($this->list as $v) {
@ -121,7 +127,8 @@ class table_ajax extends appweb {
use tlist; use tlist;
//公用的输出 //公用的输出
protected function output($val,$checked = '') { protected function output($val, $checked = '')
{
global $_M, $_YW; global $_M, $_YW;
$array = self::{$this->tname}($val, $checked); $array = self::{$this->tname}($val, $checked);
$this->list = array(); $this->list = array();

View File

@ -3,6 +3,7 @@
.form-inline .form-group { .form-inline .form-group {
margin-right: 20px; margin-right: 20px;
} }
@media (min-width: 480px) { @media (min-width: 480px) {
.form-inline .form-group, .form-inline .form-control { .form-inline .form-group, .form-inline .form-control {
display: inline-block; display: inline-block;
@ -11,27 +12,45 @@
vertical-align: middle; vertical-align: middle;
} }
} }
/*在帮脑残修复一下*/ /*在帮脑残修复一下*/
table .form-inline .form-group { table .form-inline .form-group {
margin-right: 0px; margin-right: 0px;
} }
@media (min-width: 480px) { @media (min-width: 480px) {
table .form-inline .form-group, table .form-inline .form-control { table .form-inline .form-group, table .form-inline .form-control {
display: block; display: block;
width: 100%; width: 100%;
} }
} }
.cloudweb input[name="gotopage"] { .cloudweb input[name="gotopage"] {
display: inline-block !important; display: inline-block !important;
} }
.cloudweb .gotopage { .cloudweb .gotopage {
display: none; display: none;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.cloudweb div.m-y-80{margin-top: 0px!important;} .cloudweb div.m-y-80 {
div.dataTables_paginate .paginate_button>a{padding: .429rem .780rem;} margin-top: 0px !important;
.form-inline .form-group{margin-right: 0px;} }
.cloudweb select[name="e_vid"]{max-width: auto;}
.cloudweb .input-group .select2-container--default{width: 100%!important;} div.dataTables_paginate .paginate_button > a {
padding: .429rem .780rem;
}
.form-inline .form-group {
margin-right: 0px;
}
.cloudweb select[name="e_vid"] {
max-width: auto;
}
.cloudweb .input-group .select2-container--default {
width: 100% !important;
}
} }

View File

@ -14,7 +14,8 @@ $data['page_title'] = $data['app']['column']['name'] . $data['page_title'];
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">密钥</span> <span class="input-group-addon">密钥</span>
<input type="password" class="form-control" placeholder="输入身份密钥" name="check" autocomplete="off"> <input type="password" class="form-control" placeholder="输入身份密钥" name="check"
autocomplete="off">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="submit" class="btn btn-primary">提交</button> <button type="submit" class="btn btn-primary">提交</button>
</span> </span>

View File

@ -60,7 +60,8 @@ $(function () {
}, },
select2: function (drawdt) { select2: function (drawdt) {
// drawdt true 执行默认操作 false 不执行 // drawdt true 执行默认操作 false 不执行
var $self = this,select = []; var $self = this,
select = [];
//选择器 //选择器
M['plugin']['select2'] = [ M['plugin']['select2'] = [
M['url']['static2_vendor'] + 'select2/select2.min.css', M['url']['static2_vendor'] + 'select2/select2.min.css',

View File

@ -14,12 +14,15 @@ $data['page_title'] = $data['app']['column']['name'] . $data['page_title'];
<!--头部搜索--> <!--头部搜索-->
{$data.table.search} {$data.table.search}
</div> </div>
<table class="dataTable table table-bordered table-hover table-striped w-full m-t-5" id='test-table' data-table-ajaxurl="{$data.url}" data-table-pagelength='15'> <table class="dataTable table table-bordered table-hover table-striped w-full m-t-5" id='test-table'
data-table-ajaxurl="{$data.url}" data-table-pagelength='15'>
<thead>{$data.table.thead}</thead> <thead>{$data.table.thead}</thead>
<tbody> <tbody>
<tr> <tr>
<td colspan="{$data.table.tdcol}"> <td colspan="{$data.table.tdcol}">
<div class="h-50 vertical-align text-xs-center"><div class="loader vertical-align-middle loader-default"></div></div> <div class="h-50 vertical-align text-xs-center">
<div class="loader vertical-align-middle loader-default"></div>
</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>