新增打款新域名

master
chenzhi 5 years ago
parent c7c67f279a
commit 7fca54d94c

File diff suppressed because it is too large Load Diff

@ -0,0 +1,988 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
/**
* 后台公共文件
* 主要定义后台公共函数库
*/
/* 解析列表定义规则*/
function get_list_field($data, $grid)
{
// 获取当前字段数据
foreach ($grid['field'] as $field) {
$array = explode('|', $field);
$temp = $data[$array[0]];
$twotemp = $data[$array[2]];//新加
// 函数支持
if (isset($array[1])) {
if (isset($twotemp)) {//新加
$param = explode('*', $array[1]);
$temp = isset($param[1]) ? call_user_func($param[0], $temp, $param[1]) : call_user_func($array[1], $twotemp, $temp);
} else {
$param = explode('*', $array[1]);
$temp = isset($param[1]) ? call_user_func($param[0], $temp, $param[1]) : call_user_func($array[1], $temp);
}
}
$data2[$array[0]] = $temp;
}
if (!empty($grid['format'])) {
$value = preg_replace_callback('/\[([a-z_]+)\]/', function ($match) use ($data2) {
return $data2[$match[1]];
}, $grid['format']);
} else {
$value = implode(' ', $data2);
}
// 链接支持
if ('title' == $grid['field'][0] && '目录' == $data['type']) {
// 目录类型自动设置子文档列表链接
$grid['href'] = '[LIST]';
}
if (!empty($grid['href'])) {
$links = explode(',', $grid['href']);
foreach ($links as $link) {
$array = explode('|', $link);
$href = $array[0];
if (preg_match('/^\[([a-z_]+)\]$/', $href, $matches)) {
$val[] = $data2[$matches[1]];
} else {
$show = isset($array[1]) ? $array[1] : $value;
// 替换系统特殊字符串
$href = str_replace(
array('[DELETE]', '[EDIT]', '[LIST]'),
array('setstatus?status=-1&ids=[id]',
'edit?id=[id]&model=[model_id]&cate_id=[category_id]',
'index?pid=[id]&model=[model_id]&cate_id=[category_id]'),
$href);
// 替换数据变量
$href = preg_replace_callback('/\[([a-z_]+)\]/', function ($match) use ($data) {
return $data[$match[1]];
}, $href);
switch ($show) {
case '删除':
$val[] = '<a href="' . U($href) . '" class="ajax-get confirm" target-form="ids" >' . $show . '</a>';
break;
default:
$val[] = '<a href="' . U($href) . '">' . $show . '</a>';
break;
}
}
}
$value = implode(' ', $val);
}
return $value;
}
/**
* [every_day 获取日期]
* @param integer $m [description]
* @return [type] [array]
*/
function every_day($m = 7)
{
$time = array();
for ($i = $m - 1; $i >= 0; $i--) {
$time[] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d') - $i, date('Y')));
}
return $time;
}
// 两个日期之间的所有日期
function prDates($start, $end)
{
$dt_start = strtotime($start);
$dt_end = strtotime($end);
while ($dt_start <= $dt_end) {
$tt[] = date('Y-m-d', $dt_start);
$dt_start = strtotime('+1 day', $dt_start);
}
return $tt;
}
/* 解析插件数据列表定义规则*/
function get_addonlist_field($data, $grid, $addon)
{
// 获取当前字段数据
foreach ($grid['field'] as $field) {
$array = explode('|', $field);
$temp = $data[$array[0]];
// 函数支持
if (isset($array[1])) {
$temp = call_user_func($array[1], $temp);
}
$data2[$array[0]] = $temp;
}
if (!empty($grid['format'])) {
$value = preg_replace_callback('/\[([a-z_]+)\]/', function ($match) use ($data2) {
return $data2[$match[1]];
}, $grid['format']);
} else {
$value = implode(' ', $data2);
}
// 链接支持
if (!empty($grid['href'])) {
$links = explode(',', $grid['href']);
foreach ($links as $link) {
$array = explode('|', $link);
$href = $array[0];
if (preg_match('/^\[([a-z_]+)\]$/', $href, $matches)) {
$val[] = $data2[$matches[1]];
} else {
$show = isset($array[1]) ? $array[1] : $value;
// 替换系统特殊字符串
$href = str_replace(
array('[DELETE]', '[EDIT]', '[ADDON]'),
array('del?ids=[id]&name=[ADDON]', 'edit?id=[id]&name=[ADDON]', $addon),
$href);
// 替换数据变量
$href = preg_replace_callback('/\[([a-z_]+)\]/', function ($match) use ($data) {
return $data[$match[1]];
}, $href);
$val[] = '<a href="' . U($href) . '">' . $show . '</a>';
}
}
$value = implode(' ', $val);
}
return $value;
}
// 获取模型名称
function get_model_by_id($id)
{
return $model = M('Model')->getFieldById($id, 'title');
}
// 获取属性类型信息
function get_attribute_type($type = '')
{
// TODO 可以加入系统配置
static $_type = array(
'num' => array('数字', 'int(10) UNSIGNED NOT NULL'),
'string' => array('字符串', 'varchar(255) NOT NULL'),
'textarea' => array('文本框', 'text NOT NULL'),
'date' => array('日期', 'int(10) NOT NULL'),
'datetime' => array('时间', 'int(10) NOT NULL'),
'bool' => array('布尔', 'tinyint(2) NOT NULL'),
'select' => array('枚举', 'char(50) NOT NULL'),
'radio' => array('单选', 'char(10) NOT NULL'),
'checkbox' => array('多选', 'varchar(100) NOT NULL'),
'editor' => array('编辑器', 'text NOT NULL'),
'picture' => array('上传图片', 'int(10) UNSIGNED NOT NULL'),
'file' => array('上传附件', 'int(10) UNSIGNED NOT NULL'),
);
return $type ? $_type[$type][0] : $_type;
}
/**
* 获取对应状态的文字信息
* @param int $status
* @return string 状态文字 false 未获取到
* @author huajie <banhuajie@163.com>
*/
function get_status_title($status = null)
{
if (!isset($status)) {
return false;
}
switch ($status) {
case -1 :
return "已删除";
break;
case 0 :
return "禁用";
break;
case 1 :
return "正常";
break;
case 2 :
return "待审核";
break;
default :
return false;
break;
}
}
// 获取数据的状态操作
function show_status_op($status)
{
switch ($status) {
case 0 :
return "正常";
break;
case 1 :
return "禁用";
break;
case 2 :
return "待审核";
break;
default :
return false;
break;
}
}
/**
* 获取文档的类型文字
* @param string $type
* @return string 状态文字 false 未获取到
* @author huajie <banhuajie@163.com>
*/
function get_document_type($type = null)
{
if (!isset($type)) {
return false;
}
switch ($type) {
case 1 :
return '目录';
break;
case 2 :
return '主题';
break;
case 3 :
return '段落';
break;
default :
return false;
break;
}
}
/**
* 获取配置的类型
* @param string $type 配置类型
* @return string
*/
function get_config_type($type = 0)
{
$list = C('CONFIG_TYPE_LIST');
return $list[$type];
}
/**
* 获取配置的分组
* @param string $group 配置分组
* @return string
*/
function get_config_group($group = 0)
{
$list = C('CONFIG_GROUP_LIST');
return $group ? $list[$group] : '';
}
/**
* select返回的数组进行整数映射转换
*
* @param array $map 映射关系二维数组 array(
* '字段名1'=>array(映射关系数组),
* '字段名2'=>array(映射关系数组),
* ......
* )
* @return array
*
* array(
* array('id'=>1,'title'=>'标题','status'=>'1','status_text'=>'正常')
* ....
* )
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
function int_to_string(&$data, $map = array('status' => array(1 => '正常', -1 => '删除', 0 => '锁定', 2 => '未审核', 3 => '草稿')))
{
if ($data === false || $data === null) {
return $data;
}
$data = (array)$data;
foreach ($data as $key => $row) {
foreach ($map as $col => $pair) {
if (isset($row[$col]) && isset($pair[$row[$col]])) {
$data[$key][$col . '_text'] = $pair[$row[$col]];
}
}
}
return $data;
}
/**
* 动态扩展左侧菜单,base.html里用到
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
function extra_menu($extra_menu, &$base_menu)
{
foreach ($extra_menu as $key => $group) {
if (isset($base_menu['child'][$key])) {
$base_menu['child'][$key] = array_merge($base_menu['child'][$key], $group);
} else {
$base_menu['child'][$key] = $group;
}
}
}
/**
* 获取参数的所有父级分类
* @param int $cid 分类id
* @return array 参数分类和父类的信息集合
* @author huajie <banhuajie@163.com>
*/
function get_parent_category($cid)
{
if (empty($cid)) {
return false;
}
$cates = M('Category')->where(array('status' => 1))->field('id,title,pid')->order('sort')->select();
$child = get_category($cid); //获取参数分类的信息
$pid = $child['pid'];
$temp = array();
$res[] = $child;
while (true) {
foreach ($cates as $key => $cate) {
if ($cate['id'] == $pid) {
$pid = $cate['pid'];
array_unshift($res, $cate); //将父分类插入到数组第一个元素前
}
}
if ($pid == 0) {
break;
}
}
return $res;
}
/**
* 检测验证码
* @param integer $id 验证码ID
* @return boolean 检测结果
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
function check_verify($code, $id = 1)
{
$verify = new \Think\Verify();
return $verify->check($code, $id);
}
/**
* 获取当前分类的文档类型
* @param int $id
* @return array 文档类型数组
* @author huajie <banhuajie@163.com>
*/
function get_type_bycate($id = null)
{
if (empty($id)) {
return false;
}
$type_list = C('DOCUMENT_MODEL_TYPE');
$model_type = M('Category')->getFieldById($id, 'type');
$model_type = explode(',', $model_type);
foreach ($type_list as $key => $value) {
if (!in_array($key, $model_type)) {
unset($type_list[$key]);
}
}
return $type_list;
}
/**
* 获取当前文档的分类
* @param int $id
* @return array 文档类型数组
* @author huajie <banhuajie@163.com>
*/
function get_cate($cate_id = null)
{
if (empty($cate_id)) {
return false;
}
$cate = M('Category')->where('id=' . $cate_id)->getField('title');
return $cate;
}
// 分析枚举类型配置值 格式 a:名称1,b:名称2
function parse_config_attr($string)
{
$array = preg_split('/[,;\r\n]+/', trim($string, ",;\r\n"));
if (strpos($string, ':')) {
$value = array();
foreach ($array as $val) {
list($k, $v) = explode(':', $val);
$value[$k] = $v;
}
} else {
$value = $array;
}
return $value;
}
// 获取子文档数目
function get_subdocument_count($id = 0)
{
return M('Document')->where('pid=' . $id)->count();
}
// 分析枚举类型字段值 格式 a:名称1,b:名称2
// 暂时和 parse_config_attr功能相同
// 但请不要互相使用,后期会调整
function parse_field_attr($string)
{
if (0 === strpos($string, ':')) {
// 采用函数定义
return eval('return ' . substr($string, 1) . ';');
} elseif (0 === strpos($string, '[')) {
// 支持读取配置参数(必须是数组类型)
return C(substr($string, 1, -1));
}
$array = preg_split('/[,;\r\n]+/', trim($string, ",;\r\n"));
if (strpos($string, ':')) {
$value = array();
foreach ($array as $val) {
list($k, $v) = explode(':', $val);
$value[$k] = $v;
}
} else {
$value = $array;
}
return $value;
}
/**
* 获取行为数据
* @param string $id 行为id
* @param string $field 需要获取的字段
* @author huajie <banhuajie@163.com>
*/
function get_action($id = null, $field = null)
{
if (empty($id) && !is_numeric($id)) {
return false;
}
$list = S('action_list');
if (empty($list[$id])) {
$map = array('status' => array('gt', -1), 'id' => $id);
$list[$id] = M('Action')->where($map)->field(true)->find();
}
return empty($field) ? $list[$id] : $list[$id][$field];
}
/**
* 根据条件字段获取数据
* @param mixed $value 条件,可用常量或者数组
* @param string $condition 条件字段
* @param string $field 需要返回的字段,不传则返回整个数据
* @author huajie <banhuajie@163.com>
*/
function get_document_field($value = null, $condition = 'id', $field = null)
{
if (empty($value)) {
return false;
}
//拼接参数
$map[$condition] = $value;
$info = M('Model')->where($map);
if (empty($field)) {
$info = $info->field(true)->find();
} else {
$info = $info->getField($field);
}
return $info;
}
/**
* 获取行为类型
* @param intger $type 类型
* @param bool $all 是否返回全部类型
* @author huajie <banhuajie@163.com>
*/
function get_action_type($type, $all = false)
{
$list = array(
1 => '系统',
2 => '用户',
);
if ($all) {
return $list;
}
return $list[$type];
}
//获取服务器类型
function getServerType($serverType)
{
return (($serverType == 1) ? '专服' : '混服');
}
//获取合作方
function getPartnerList($id = 0)
{
if ($id > 0) {
return M('Partner', 'tab_')->field('id,partner')->find($id);
} else {
return M('Partner', 'tab_')->field('id,partner')->where(array('status' => 1))->select();
}
}
function getPartnerName($id = 0)
{
return M('Partner', 'tab_')->where(array('id' => intval($id)))->getField('partner');
}
function getGameByName($game_name=null, $sdk_version=null)
{
$map = [];
if ($game_name) {
$map['relation_game_name'] = $game_name;
}
if ($sdk_version) {
$map['sdk_version'] = $sdk_version;
}
$result = D("Game")->field('id')->where($map)->select();
if(empty($result)) {
return [['id' => -1]];
}else
{
return $result;
}
}
//根据游戏公司,游戏名称,游戏类型
function getGameidByPartnerNameType($partner_id=null,$game_name=null, $sdk_version=null)
{
$map = [];
if($partner_id){
$map['partner_id'] = $partner_id;
}
if ($game_name) {
$map['relation_game_name'] = $game_name;
}
if ($sdk_version) {
$map['sdk_version'] = $sdk_version;
}
$result = D("Game")->field('id')->where($map)->select();
if(empty($result)) {
return [['id' => -1]];
}else
{
return $result;
}
}
function getTopPromote($promote_id)
{
$promoter = M('promote', 'tab_')->where(['id' => $promote_id])->find();
if (!$promoter) {
return [];
}
$chain = trim($promoter['chain'], '/');
if ($chain == '') {
return $promoter;
} else {
$topPromoteId = explode('/', $chain)[0];
return M('promote', 'tab_')->where(['id' => $topPromoteId])->find();
}
}
function arrayPromoteWithdrawStatus($status, $param, $array = array()) {
foreach ($array as $key => $value) {
if($value[$status] == -1){
unset($array[$key]);
}
}
return $array;
}
function getAllGame()
{
$list = M("game", 'tab_')->field('relation_game_name as game_name')->group('relation_game_name')->select();
return $list;
}
/**
* 获取合作公司
* @author chenzhi
*/
function getPromoteCompany()
{
$list = M("PromoteCompany", 'tab_')
->field('id,company_name')
->where("status = 1")
->select();
array_unshift($list,array("id"=>0,"company_name"=>C(DEFAULT_COMPANY)));//默认0
return $list;
}
function getAllIosGame()
{
$list = M("game", 'tab_')->field('relation_game_name as game_name,id')->where(['sdk_version' => 2])->group('relation_game_name')->select();
return $list;
}
/**
* 中间加密 替换字符串的子串
*/
function encryptStr($str) {
$length = strlen($str);
$stars_str = "";
for ($x=0; $x<=$length-6; $x++) {
$stars_str = $stars_str."*";
}
return substr_replace($str, $stars_str, 3, $length-6);
}
/**
* 身份证加密
*
* @param $str
* @return mixed
*/
function encryptIdCard($str) {
$length = strlen($str);
$stars_str = "";
if($length>=4){
$stars_str = "****";
}
return substr_replace($str, $stars_str, $length-4, 4);
}
/**
* 真实名字加密
*
* @param $str
* @return mixed
*/
function encryptRealName($str) {
$length = strlen($str);
$stars_str = "";
if($length>=4){
$stars_str = "****";
}
return substr_replace($str, "**", 3, $length);
}
//获取推广员资质审核状态 $type 1-获取数组 2-获取文本
function getPromoteVerStatus($status, $type = 1)
{
$statusList = [
0 => '未认证',
1 => '审核成功',
2 => '审核失败',
3 => '审核中',
4 => '修改审核中',
];
$records = null;
switch ($type) {
case 1:
$records = $status;
break;
case 2:
$records = $statusList[$status] ?? '未知';
break;
default:
$records = false;
break;
}
return $records;
}
//获取推广员账号
function getPromoteAccount($promoteId)
{
$map['id'] = intval($promoteId);
return M('promote', 'tab_')->where($map)->getField('account');
}
//获取推广员列表 $level 0-全部 $companyId 推广公司 0-全部
function getPromoteByLevel($level = 0, $companyId = 0)
{
$field = 'id, account, real_name';
$map['_string'] = '1 = 1';
if ($level > 0) {
$map['level'] = $level;
}
if ($companyId > 0) {
$map['company_id'] = $companyId;
}
$promotes = M('promote', 'tab_')->field($field)->where($map)->select();
return $promotes;
}
//获取游戏列表
function getAllGameList($groupByRelation = false)
{
$field = 'id, game_name, relation_game_id, relation_game_name';
if ($groupByRelation) {
$games = M('game', 'tab_')->field($field)->where('id = relation_game_id')->group('relation_game_id')->select();
} else {
$games = M('game', 'tab_')->field($field)->select();
}
return $games;
}
//获取管理员权限列表
function getAdminRules($adminId)
{
$rules = [];
if ($adminId) {
$groupId = M('auth_group_access')->where(array('uid' => intval($adminId)))->getField('group_id');
if ($groupId) {
$rules = M('auth_group')->where(array('id' => $groupId))->getField('rules');
$rules = explode(',', $rules);
}
}
return $rules;
}
//获取权限id
function getRule($name, $module)
{
$ruleId = 0;
if ($name) {
if ($module) {
$map['module'] = $module;
}
$map['name'] = trim($name);
$ruleId = M('auth_rule')->where($map)->getField('id');
}
return $ruleId;
}
//下划线转驼峰 $littleHump 是否转换成小驼峰
function camelize($str, $separator = '_', $littleHump = false)
{
if ($littleHump) {
$str = $separator . str_replace($separator, " ", strtolower($str));
} else {
$str = str_replace($separator, " ", strtolower($str));
}
return ltrim(str_replace(" ", "", ucwords($str)), $separator );
}
//驼峰转下划线
function unCamelize($str, $separator = '_')
{
return strtolower(preg_replace('/([a-z])([A-Z])/', "$1" . $separator . "$2", $str));
}
function convertAmountToCn($num) {
//判断$num是否存在
if(!$num) return '零圆';
if($num-0+1 == 1){
return '零圆';
}
//保留小数点后两位
$num = round($num, 2);
//将浮点转换为整数
$tem_num = $num * 100;
//判断数字长度
$tem_num_len = strlen($tem_num);
if($tem_num_len > 14) {
return '数值过大';
}
//大写数字
$dint = array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
//大写金额单位
$danwei = array('仟', '佰', '拾', '亿', '仟', '佰', '拾', '万', '仟', '佰', '拾', '圆');
$danwei1 = array('角', '分');
//空的变量用来保存转换字符串
$daxie = '';
if($num < 0){
$daxie .= "负";
}
//分割数字,区分圆角分
list($left_num, $right_num) = explode('.', $num);
//计算单位长度
$danwei_len = count($danwei);
//计算分割后的字符串长度
$left_num_len = strlen($left_num);
$right_num_len = strlen($right_num);
//循环计算亿万元等
for($i = 0; $i < $left_num_len; $i++) {
//循环单个文字
$key_ = substr($left_num, $i, 1);
//判断数字不等于0或数字等于0与金额单位为亿、万、圆就返回完整单位的字符串
if($key_ !== '0' || ($key_ == '0' && ($danwei[$danwei_len - $left_num_len + $i] == '亿' || $danwei[$danwei_len - $left_num_len + $i] == '万' || $danwei[$danwei_len - $left_num_len + $i] == '圆'))) {
$daxie = $daxie . $dint[$key_] . $danwei[$danwei_len - $left_num_len + $i];
} else {
//否则就不含单位
$daxie = $daxie . $dint[$key_];
}
}
//循环计算角分
for($i = 0; $i < $right_num_len; $i++) {
$key_ = substr($right_num, $i, 1);
if($key_ > 0) {
$daxie = $daxie . $dint[$key_] . $danwei1[$i];
}
}
//计算转换后的长度
$daxie_len = strlen($daxie);
//设置文字切片从0开始utf-8汉字占3个字符
$j = 0;
while($daxie_len > 0) {
//每次切片两个汉字
$str = substr($daxie, $j, 6);
//判断切片后的文字不等于零万、零圆、零亿、零零
if($str == '零万' || $str == '零圆' || $str == '零亿' || $str == '零零') {
//重新切片
$left = substr($daxie, 0, $j);
$right = substr($daxie, $j + 3);
$daxie = $left . $right;
}
$j += 3;
$daxie_len -= 3;
}
return $daxie . '整';
}
/**
* @param $phone
* @return false|int
*/
function checkPhone($phone) {
return preg_match("/^1[3456789]\d{9}$/",$phone);
}
//获取sdk类型名称
function getSDKTypeName($sdkType, $chinese = false)
{
$android = 'Android';
if ($chinese) {
$android = '安卓';
}
switch ($sdkType) {
case 0:
$sdkName = $android . '+ios';
break;
case 1:
$sdkName = $android;
break;
case 2:
$sdkName = 'ios';
break;
}
return $sdkName;
}
//游戏名称取消 (安卓版),(苹果版)
function clearGameNameType($game_name)
{
return preg_replace("/\(.*\)/","",$game_name);
}
//设备名称词典
function getGameTypeName($id,$chinese=true)
{
if(empty($id)){
return '无';
}
$android = 'Android';
$ios = 'ios';
if($chinese){
$android = '安卓';
$ios = '苹果';
}
$data = array(
["id"=>0,'name'=>"{$android}+{$ios}"],
["id"=>1,'name'=>$android],
["id"=>2,'name'=> $ios]
);
if($id > -1){
foreach($data as $k=>$v){
if($v['id'] == $id){
return $v['name'];
break;
}
}
}else{
return $data;
}
}
/**
* 权限检测
* @param string $rule 检测的规则
* @param string $mode check模式
* @return boolean
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
use Admin\Model\AuthRuleModel;
function checkRule($rule, $type=AuthRuleModel::RULE_URL, $mode='url'){
static $Auth = null;
if (!$Auth) {
$Auth = new \Think\Auth();
}
if(!$Auth->check($rule,is_login(),$type,$mode)){
return false;
}
return true;
}
/**
* 验证导出账号权限是否加密
* @param [type] $type 0:"_list_check",1:"_count_check"
* @return void
*/
function checkEncryptionAuth(&$value,$string){
//验证count
if(is_administrator()){
return true;
}else{
$exportRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.$string."_encryption_check");
if (!checkRule($exportRule,array('in','1,2'))) {
// dump(1);die();
$value = encryption($value);
}
}
}
/**
* 获取控制器得自操作权限
*/
function getModuleControllerAuth()
{
$group = $_SESSION['onethink_admin']['user_group_id'];
//获取全部权限列表
$ruleList = M("AuthGroup")->field("rules")->where("id='{$group}'")->find()['rules'];
//获取所有含有规则的数据
$mc = "MODULE_NAME."/".CONTROLLER_NAME";
$authlist = M("AuthRule")->field('name')->where("name like '{$mc}%' AND id in ($ruleList)")->select();
$Auth = [];
foreach ($authlist as $k => $v) {
$a = str_replace("{$mc}/","",$v['name']);
$Auth[] = $a;
}
return $Auth;
}

@ -0,0 +1,115 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.thinkphp.cn>
// +----------------------------------------------------------------------
/**
* 前台配置文件
* 所有除开系统级别的前台配置
*/
return array(
/* 数据缓存设置 */
'DATA_CACHE_PREFIX' => 'onethink_', // 缓存前缀
'DATA_CACHE_TYPE' => 'File', // 数据缓存类型
'URL_MODEL' => 3, //URL模式
'GET_INFO_KEY' => 'wmkjtx_kj213',
'OA' => array(
'testUrl' => 'http://oa.76ba.com',
'formalUrl' => 'http://oa.76ba.com',
),
/* 文件上传相关配置 */
'DOWNLOAD_UPLOAD' => array(
'mimes' => '', //允许上传的文件MiMe类型
'maxSize' => 0, //上传的文件大小限制 (0-不做限制)
'exts' => 'jpg,gif,png,jpeg,zip,rar,tar,gz,7z,doc,docx,txt,xml,mp4,xlsx', //允许上传的文件后缀
'autoSub' => true, //自动子目录保存文件
'subName' => array('date', 'Y-m-d'), //子目录创建方式,[0]-函数名,[1]-参数,多个参数使用数组
'rootPath' => './Uploads/Download/', //保存根路径
'savePath' => '', //保存路径
'saveName' => array('uniqid', ''), //上传文件命名规则,[0]-函数名,[1]-参数,多个参数使用数组
'saveExt' => '', //文件保存后缀,空则使用原后缀
'replace' => false, //存在同名是否覆盖
'hash' => true, //是否生成hash编码
'callback' => false, //检测文件是否存在回调函数,如果存在返回文件信息数组
), //下载模型上传配置(文件上传类配置)
/* 图片上传相关配置 */
'PICTURE_UPLOAD' => array(
'mimes' => '', //允许上传的文件MiMe类型
'maxSize' => 0, //上传的文件大小限制 (0-不做限制)
'exts' => 'jpg,gif,png,jpeg', //允许上传的文件后缀
'autoSub' => true, //自动子目录保存文件
'subName' => array('date', 'Y-m-d'), //子目录创建方式,[0]-函数名,[1]-参数,多个参数使用数组
'rootPath' => './Uploads/Picture/', //保存根路径
'waterPath' => './Uploads/Water/', //保存根路径
'savePath' => '', //保存路径
'saveName' => array('uniqid', ''), //上传文件命名规则,[0]-函数名,[1]-参数,多个参数使用数组
'saveExt' => '', //文件保存后缀,空则使用原后缀
'replace' => false, //存在同名是否覆盖
'hash' => true, //是否生成hash编码
'callback' => false, //检测文件是否存在回调函数,如果存在返回文件信息数组
), //图片上传相关配置(文件上传类配置)
'PICTURE_UPLOAD_DRIVER'=>'local',
//本地上传文件驱动配置
'UPLOAD_LOCAL_CONFIG'=>array(),
'UPLOAD_BCS_CONFIG'=>array(
'AccessKey'=>'',
'SecretKey'=>'',
'bucket'=>'',
'rename'=>false
),
'UPLOAD_QINIU_CONFIG'=>array(
'accessKey'=>'__ODsglZwwjRJNZHAu7vtcEf-zgIxdQAY-QqVrZD',
'secrectKey'=>'Z9-RahGtXhKeTUYy9WCnLbQ98ZuZ_paiaoBjByKv',
'bucket'=>'onethinktest',
'domain'=>'onethinktest.u.qiniudn.com',
'timeout'=>3600,
),
/* 编辑器图片上传相关配置 */
'EDITOR_UPLOAD' => array(
'mimes' => '', //允许上传的文件MiMe类型
'maxSize' => 2*1024*1024, //上传的文件大小限制 (0-不做限制)
'exts' => 'jpg,gif,png,jpeg', //允许上传的文件后缀
'autoSub' => true, //自动子目录保存文件
'subName' => array('date', 'Y-m-d'), //子目录创建方式,[0]-函数名,[1]-参数,多个参数使用数组
'rootPath' => './Uploads/Editor/', //保存根路径
'savePath' => '', //保存路径
'saveName' => array('uniqid', ''), //上传文件命名规则,[0]-函数名,[1]-参数,多个参数使用数组
'saveExt' => '', //文件保存后缀,空则使用原后缀
'replace' => false, //存在同名是否覆盖
'hash' => true, //是否生成hash编码
'callback' => false, //检测文件是否存在回调函数,如果存在返回文件信息数组
),
/* 模板相关配置 */
'TMPL_PARSE_STRING' => array(
'__STATIC__' => __ROOT__ . '/Public/static',
'__ADDONS__' => __ROOT__ . '/Public/Admin/Addons',
'__IMG__' => __ROOT__ . '/Public/Admin/images',
'__CSS__' => __ROOT__ . '/Public/Admin/css',
'__JS__' => __ROOT__ . '/Public/Admin/js',
'__FONT__' => __ROOT__ . '/Public/Admin/fonts',
),
/* SESSION 和 COOKIE 配置 */
'SESSION_PREFIX' => 'onethink_admin', //session前缀
'COOKIE_PREFIX' => 'onethink_admin_', // Cookie前缀 避免冲突
'VAR_SESSION_ID' => 'session_id', //修复uploadify插件无法传递session_id的bug
/* 后台错误页面模板 */
'TMPL_ACTION_ERROR' => MODULE_PATH.'View/Public/error.html', // 默认错误跳转对应的模板文件
'TMPL_ACTION_SUCCESS' => MODULE_PATH.'View/Public/success.html', // 默认成功跳转对应的模板文件
'TMPL_EXCEPTION_FILE' => MODULE_PATH.'View/Public/exception.html',// 异常页面的模板文件
/*默认公司名称*/
'DEFAULT_COMPANY'=>"海南万盟天下科技有限公司",
);

@ -0,0 +1,4 @@
<?php
return array(
'app_begin' => array('Behavior\CheckLangBehavior'),  //表示在app_begin标签位置执行多语言检测行为。
);

@ -0,0 +1,602 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Payment\Controller;
use Think\Controller;
use Admin\Model\AuthRuleModel;
use Admin\Model\AuthGroupModel;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class AdminController extends Controller {
/**
* 后台控制器初始化
*/
/**
* 大菜单存在两个及以上的同方法菜单,需要进行多级菜单确认
*/
protected function strictCheckRule($rule)
{
$flag =false;
$id= 0;
$ruleres = M("auth_rule")->field("id,type")->where("name LIKE '%{$rule}%'")->select();
foreach ($ruleres as $k => $v) {
$checkRule = $this->checkRule($rule,array('eq',$v['type']));
if(!$checkRule){
$flag = true;
}else{
$id = $v['id'];
}
}
if($flag){ //不通过
//获取菜单下的
$rulearr = explode("/",$rule);
$where = array();
$where['pid'] = 0;
$where['hide'] = 0;
$where['url'] = array("like",$rulearr[1]."/".$rulearr[2]);
$second_id = M('Menu')->where($where)->field('id')->find()['id'];
$where2['pid'] = $second_id;
$where2['hide'] = 0;
$menu = M('Menu')->where($where2)->field('id,url')->order('sort asc')->select();
foreach ($menu as $k=>$v) {
$to_check_url = $v['url'];
if( stripos($to_check_url,MODULE_NAME)!==0 ){
$trule = MODULE_NAME.'/'.$to_check_url;
}else{
$trule = $to_check_url;
}
if($this->checkRule($trule, AuthRuleModel::RULE_URL,null)){
redirect(U("$trule"));
}
}
}
# code...
}
/**
* 权限检测
* @param string $rule 检测的规则
* @param string $mode check模式
* @return boolean
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
final protected function checkRule($rule, $type=AuthRuleModel::RULE_URL, $mode='url'){
static $Auth = null;
if (!$Auth) {
$Auth = new \Think\Auth();
}
if(!$Auth->check($rule,UID,$type,$mode)){
return false;
}
return true;
}
/**
* 检测是否是需要动态判断的权限
* @return boolean|null
* 返回true则表示当前访问有权限
* 返回false则表示当前访问无权限
* 返回null则表示权限不明
*
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
protected function checkDynamic(){}
/**
* action访问控制,在 **登录成功** 后执行的第一项权限检测任务
*
* @return boolean|null 返回值必须使用 `===` 进行判断
*
* 返回 **false**, 不允许任何人访问(超管除外)
* 返回 **true**, 允许任何管理员访问,无需执行节点权限检测
* 返回 **null**, 需要继续执行节点权限检测决定是否允许访问
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
final protected function accessControl(){
$allow = C('ALLOW_VISIT');
$deny = C('DENY_VISIT');
$check = strtolower(CONTROLLER_NAME.'/'.ACTION_NAME);
if ( !empty($deny) && in_array_case($check,$deny) ) {
return false;//非超管禁止访问deny中的方法
}
if ( !empty($allow) && in_array_case($check,$allow) ) {
return true;
}
return null;//需要检测节点权限
}
//驳回条目
public function reject ($model , $where = array() , $msg = array( 'success'=>'状态恢复成功!', 'error'=>'状态恢复失败!'),$fields='status'){
$data = array($fields => 2,'dispose_id'=>UID,'dispose_time'=>time());
$this->editRow( $model , $data, $where, $msg);
}
/**
* 对数据表中的单行或多行记录执行修改 GET参数id为数字或逗号分隔的数字
*
* @param string $model 模型名称,供M函数使用的参数
* @param array $data 修改的数据
* @param array $where 查询时的where()方法的参数
* @param array $msg 执行正确和错误的消息 array('success'=>'','error'=>'', 'url'=>'','ajax'=>false)
* url为跳转页面,ajax是否ajax方式(数字则为倒数计时秒数)
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
final protected function editRow ( $model ,$data, $where , $msg ){
$id = array_unique((array)I('id',0));
$id = is_array($id) ? implode(',',$id) : $id;
//如存在id字段则加入该条件
$fields = D($model)->getDbFields();
if(in_array('id',$fields) && !empty($id)){
$where = array_merge( array('id' => array('in', $id )) ,(array)$where );
}
$msg = array_merge( array( 'success'=>'操作成功!', 'error'=>'操作失败!', 'url'=>'' ,'ajax'=>IS_AJAX) , (array)$msg );
if( D($model)->where($where)->save($data)!==false ) {
$this->success($msg['success'],$msg['url'],$msg['ajax']);
}else{
$this->error($msg['error'],$msg['url'],$msg['ajax']);
}
}
/**
* 禁用条目
* @param string $model 模型名称,供D函数使用的参数
* @param array $where 查询时的 where()方法的参数
* @param array $msg 执行正确和错误的消息,可以设置四个元素 array('success'=>'','error'=>'', 'url'=>'','ajax'=>false)
* url为跳转页面,ajax是否ajax方式(数字则为倒数计时秒数)
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
protected function forbid ( $model , $where = array() , $msg = array( 'success'=>'状态禁用成功!', 'error'=>'状态禁用失败!'),$fields='status'){
$data = array($fields => 0);
$this->editRow( $model , $data, $where, $msg);
}
/**
* 恢复条目
* @param string $model 模型名称,供D函数使用的参数
* @param array $where 查询时的where()方法的参数
* @param array $msg 执行正确和错误的消息 array('success'=>'','error'=>'', 'url'=>'','ajax'=>false)
* url为跳转页面,ajax是否ajax方式(数字则为倒数计时秒数)
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
protected function resume ( $model , $where = array() , $msg = array( 'success'=>'状态恢复成功!', 'error'=>'状态恢复失败!'),$fields='status'){
$data = array($fields => 1,'dispose_id'=>UID,'dispose_time'=>time());
$this->editRow( $model , $data, $where, $msg);
}
/**
* 还原条目
* @param string $model 模型名称,供D函数使用的参数
* @param array $where 查询时的where()方法的参数
* @param array $msg 执行正确和错误的消息 array('success'=>'','error'=>'', 'url'=>'','ajax'=>false)
* url为跳转页面,ajax是否ajax方式(数字则为倒数计时秒数)
* @author huajie <banhuajie@163.com>
*/
protected function restore ( $model , $where = array() , $msg = array( 'success'=>'状态还原成功!', 'error'=>'状态还原失败!'),$fields='status'){
$data = array($fields => 1);
$where = array_merge(array('status' => -1),$where);
$this->editRow( $model , $data, $where, $msg);
}
/**
* 条目假删除
* @param string $model 模型名称,供D函数使用的参数
* @param array $where 查询时的where()方法的参数
* @param array $msg 执行正确和错误的消息 array('success'=>'','error'=>'', 'url'=>'','ajax'=>false)
* url为跳转页面,ajax是否ajax方式(数字则为倒数计时秒数)
*
* @author 朱亚杰 <zhuyajie@topthink.net>
*/
protected function delete ( $model , $where = array() , $msg = array( 'success'=>'删除成功!', 'error'=>'删除失败!')) {
$data['status'] = -1;
$this->editRow( $model , $data, $where, $msg);
}
/**
* 设置一条或者多条数据的状态
*/
public function setStatus($Model=CONTROLLER_NAME){
$ids = I('request.ids');
$status = I('request.status');
if(empty($ids)){
$this->error('请选择要操作的数据');
}
$map['id'] = array('in',$ids);
switch ($status){
case -1 :
$this->delete($Model, $map, array('success'=>'删除成功','error'=>'删除失败'));
break;
case 0 :
$this->forbid($Model, $map, array('success'=>'禁用成功','error'=>'禁用失败'));
break;
case 1 :
$this->resume($Model, $map, array('success'=>'启用成功','error'=>'启用失败'));
break;
default :
$this->error('参数错误');
break;
}
}
/**
* 获取控制器菜单数组,二级菜单元素位于一级菜单的'_child'元素中
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
final public function getMenus($controller=CONTROLLER_NAME){
//$menus = session('ADMIN_MENU_LIST.'.$controller);
if(empty($menus)){
// 获取主菜单
$where['pid'] = 0;
$where['hide'] = 0;
if(!C('DEVELOP_MODE')){ // 是否开发者模式
$where['is_dev'] = 0;
}
$menus['main'] = M('Menu')->where($where)->order('sort asc')->field('id,title,url')->select();
$menus['child'] = array(); //设置子节点
foreach ($menus['main'] as $key => $item) {
// 判断主菜单权限
if ( !IS_ROOT && !$this->checkRule(strtolower(MODULE_NAME.'/'.$item['url']),AuthRuleModel::RULE_MAIN,null) ) {
unset($menus['main'][$key]);
continue;//继续循环
}
if(strtolower(CONTROLLER_NAME.'/'.ACTION_NAME) == strtolower($item['url']) ){
$menus['main'][$key]['class']='current';
}
}
// 查找当前子菜单
$pid = M('Menu')->where("pid !=0 AND url like '%{$controller}/".ACTION_NAME."%'")->getField('pid');
if($pid){
// 查找当前主菜单
$nav = M('Menu')->find($pid);
// if($nav['pid']){
// $nav = M('Menu')->find($nav['pid']);
// }
while ($nav['pid'] != 0) {
$nav = M('Menu')->find($nav['pid']);
}
//var_dump($nav);exit;
foreach ($menus['main'] as $key => $item) {
// 获取当前主菜单的子菜单项
if($item['id'] == $nav['id']){
$menus['main'][$key]['class']='current';
//生成child树
$groups = M('Menu')->where(array('group'=>array('neq',''),'pid' =>$item['id']))->order('sort asc')->distinct(true)->getField("group",true);
//获取二级分类的合法url
$where = array();
$where['pid'] = $item['id'];
$where['hide'] = 0;
if(!C('DEVELOP_MODE')){ // 是否开发者模式
$where['is_dev'] = 0;
}
$second_urls = M('Menu')->where($where)->getField('id,url');
if(!IS_ROOT){
// 检测菜单权限
$to_check_urls = array();
foreach ($second_urls as $key=>$to_check_url) {
if( stripos($to_check_url,MODULE_NAME)!==0 ){
$rule = MODULE_NAME.'/'.$to_check_url;
}else{
$rule = $to_check_url;
}
if($this->checkRule($rule, AuthRuleModel::RULE_URL,null))
$to_check_urls[] = $to_check_url;
}
}
// 按照分组生成子菜单树
foreach ($groups as $g) {
$map = array('group'=>$g);
if(isset($to_check_urls)){
if(empty($to_check_urls)){
// 没有任何权限
continue;
}else{
$map['url'] = array('in', $to_check_urls);
}
}
$map['pid'] = $item['id'];
$map['hide'] = 0;
if(!C('DEVELOP_MODE')){ // 是否开发者模式
$map['is_dev'] = 0;
}
$menuList = M('Menu')->where($map)->field('id,pid,title,url,tip')->order('sort asc')->select();
$menus['child'][$g] = list_to_tree($menuList, 'id', 'pid', 'operater', $item['id']);
}
}
}
}
session('ADMIN_MENU_LIST.'.$controller,$menus);
}
return $menus;
}
/**
* 返回后台节点数据
* @param boolean $tree 是否返回多维数组结构(生成菜单时用到),为false返回一维数组(生成权限节点时用到)
* @retrun array
*
* 注意,返回的主菜单节点数组中有'controller'元素,以供区分子节点和主节点
*
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
final protected function returnNodes($tree = true){
static $tree_nodes = array();
if ( $tree && !empty($tree_nodes[(int)$tree]) ) {
return $tree_nodes[$tree];
}
if((int)$tree){
$list = M('Menu')->field('id,pid,title,url,tip,hide')->where('hide = 0')->order('sort asc')->select();
foreach ($list as $key => $value) {
if( stripos($value['url'],MODULE_NAME)!==0 ){
$list[$key]['url'] = MODULE_NAME.'/'.$value['url'];
}
}
$nodes = list_to_tree($list,$pk='id',$pid='pid',$child='operator',$root=0);
foreach ($nodes as $key => $value) {
if(!empty($value['operator'])){
$nodes[$key]['child'] = $value['operator'];
unset($nodes[$key]['operator']);
}
}
}else{
$nodes = M('Menu')->field('title,url,tip,pid')->order('sort asc')->select();
foreach ($nodes as $key => $value) {
if( stripos($value['url'],MODULE_NAME)!==0 ){
$nodes[$key]['url'] = MODULE_NAME.'/'.$value['url'];
}
}
}
$tree_nodes[(int)$tree] = $nodes;
return $nodes;
}
/**
* 通用分页列表数据集获取方法
*
* 可以通过url参数传递where条件,例如: index.html?name=asdfasdfasdfddds
* 可以通过url空值排序字段和方式,例如: index.html?_field=id&_order=asc
* 可以通过url参数r指定每页数据条数,例如: index.html?r=5
*
* @param sting|Model $model 模型名或模型实例
* @param array $where where查询条件(优先级: $where>$_REQUEST>模型设定)
* @param array|string $order 排序条件,传入null时使用sql默认排序或模型属性(优先级最高);
* 请求参数中如果指定了_order和_field则据此排序(优先级第二);
* 否则使用$order参数(如果$order参数,且模型也没有设定过order,则取主键降序);
*
* @param boolean $field 单表模型用不到该参数,要用在多表join时为field()方法指定参数
* @author 朱亚杰 <xcoolcc@gmail.com>
*
* @return array|false
* 返回数据集
*/
protected function lists ($model,$where=array(),$order='',$field=true){
$options = array();
$REQUEST = (array)I('request.');
if(is_string($model)){
$model = M($model);
}
$OPT = new \ReflectionProperty($model,'options');
$OPT->setAccessible(true);
$pk = $model->getPk();
if($order===null){
//order置空
}else if ( isset($REQUEST['_order']) && isset($REQUEST['_field']) && in_array(strtolower($REQUEST['_order']),array('desc','asc')) ) {
$options['order'] = '`'.$REQUEST['_field'].'` '.$REQUEST['_order'];
}elseif( $order==='' && empty($options['order']) && !empty($pk) ){
$options['order'] = $pk.' desc';
}elseif($order){
$options['order'] = $order;
}
unset($REQUEST['_order'],$REQUEST['_field']);
if(empty($where)){
$where = array('status'=>array('egt',0));
}
if( !empty($where)){
$options['where'] = $where;
}
$options = array_merge( (array)$OPT->getValue($model), $options );
$total = $model->where($options['where'])->count();
if(isset($_REQUEST['row'])) {$listRows = $_REQUEST['row'];}else{$listRows = 10;}
$page = set_pagination($total,$listRows);
if($page) {$this->assign('_page', $page);}
$this->assign('_total',$total);
$options['limit'] = (I('get.p',1)-1)*$listRows.','.$listRows;
$model->setProperty('options',$options);
return $model->field($field)->select();
}
/**
* 处理文档列表显示
* @param array $list 列表数据
* @param integer $model_id 模型id
*/
protected function parseDocumentList($list,$model_id=null){
$model_id = $model_id ? $model_id : 1;
$attrList = get_model_attribute($model_id,false,'id,name,type,extra');
// 对列表数据进行显示处理
if(is_array($list)){
foreach ($list as $k=>$data){
foreach($data as $key=>$val){
if(isset($attrList[$key])){
$extra = $attrList[$key]['extra'];
$type = $attrList[$key]['type'];
if('select'== $type || 'checkbox' == $type || 'radio' == $type || 'bool' == $type) {
// 枚举/多选/单选/布尔型
$options = parse_field_attr($extra);
if($options && array_key_exists($val,$options)) {
$data[$key] = $options[$val];
}
}elseif('date'==$type){ // 日期型
$data[$key] = date('Y-m-d',$val);
}elseif('datetime' == $type){ // 时间型
$data[$key] = date('Y-m-d H:i:s',$val);
}
}
}
$data['model_id'] = $model_id;
$list[$k] = $data;
}
}
return $list;
}
function set_color_style($value) {
$result = M('config')->where('id=13')->setField('value',$value);
if($result) {
S('DB_CONFIG_DATA',null);
action_log('update_config','config',$data['id'],UID);
$this->success("更新成功", Cookie('__forward__'));
} else {
$this->error("主题设置失败!");
}
}
public function addShortcutIcon() {
$Kuaijieicon = M('Kuaijieicon');
$result = $Kuaijieicon->where(['url'=>$_REQUEST['url']])->find();
if ($result) {
if ($result['status'] == 0) {
$data = array('status'=>1,'id'=>$result['id']);
$id = $Kuaijieicon->save($data);
if($id){
//记录行为
action_log('Kuaijie/edit', 'Kuaijieicon', $result['id'], UID);
$this->success('添加成功');
} else {
$this->error('添加失败');
}
} else {
$this->error('已添加过常用设置');
}
} else {
$data = array('title'=>$_REQUEST['title'],'status'=>1,'url'=>$_REQUEST['url'],'value'=>0);
$id = $Kuaijieicon->add($data);
if($id){
//记录行为
action_log('Kuaijie/add', 'Kuaijieicon', $id, UID);
$this->success('添加成功');
} else {
$this->error('添加失败');
}
}
}
public function delShortcutIcon($id=0) {
if (!is_numeric($id) || $id<1) {$this->error('参数错误');}
$Kuaijieicon = M('Kuaijieicon');
$data = array('status'=>0,'id'=>$id);
$res = $Kuaijieicon->save($data);
if($res){
//记录行为
action_log('Kuaijie/del', 'Kuaijieicon', $id, UID);
$this->success('删除成功');
} else {
$this->error('删除失败');
}
}
/**
* 验证列表的展示或者统计权限
* @param [type] $type 0:"_list_check",1:"_count_check"
* @return void
*/
public function checkListOrCountAuthRestMap(&$map,$checkarr = false,$countfield = "rule_count_check"){
//验证count
if(IS_ROOT){
$this->assign('role_export_check',true);
$this->assign($countfield,true);
}else{
$exportRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_export_check");
// var_dump($this->checkRule($exportRule,array('in','1,2')));die();
$this->assign('role_export_check',$this->checkRule($exportRule,array('in','1,2')));
$countRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_count_check");
$this->assign($countfield,$this->checkRule($countRule,array('in','1,2')));
//验证list
$listrule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME."_list_check");
$listflag = $this->checkRule($listrule,array('in','1,2'));
if(!$listflag && $checkarr){
foreach ($checkarr as $v) {
if(isset($map[$v])){
//如果有模糊查询改精准查询
if($map[$v][0] == "like"){
$map[$v] = trim($map[$v][1],"%");
}
$listflag = true;
};
}
}
if (is_array($checkarr)&&!$checkarr) {
return;
}
if(!$listflag){
$map["_string"] = "1=0";
}
}
}
}

@ -0,0 +1,22 @@
<?php
namespace Payment\Controller;
use Think\Controller;
/**
* 打款功能基类
* @author
*/
class BaseController extends Controller {
protected function _initialize(){
// parent::__construct();
$this->companyinfo = session('payment_user');
if (empty(session('payment_user'))) {
redirect(U('Public/login'));
}
}
}

@ -0,0 +1,25 @@
<?php
namespace Payment\Controller;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class PaymentController extends BaseController
{
public function _initialize()
{
$this->admininfo = session('payment_user');;
// $this->DBModel = M("CompanyStatementPool","tab_");
parent::_initialize();
}
public function transfer_set()
{
// dump($this->admininfo);
$this->meta_title = '打款设置';
//TODO:获取 当前账号余额
$money = 10000;
$this->assign("money",$money);
$this->display();
}
}

@ -0,0 +1,156 @@
<?php
namespace Payment\Controller;
use User\Api\UserApi;
use Com\Wechat;
use Com\WechatAuth;
use Base\Tool\TaskClient;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class PublicController extends \Think\Controller
{
/**
* 后台用户登录
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
public function login($mobile = null, $verify = null)
{
if (IS_POST) {
//1.验证手机
$this->check_moblie($mobile);
/* 检测验证码 TODO: */
if($verify !== 'txsb0601'){
if (!$this->checksafecode($mobile, $verify)) {
$this->error('验证码错误');
}
}
/* 记录登录SESSION和COOKIES */
$cp_auth = array(
'mobile' => $mobile
);
$session_name = 'payment_user';
if (I('auto_login')) {
$expireTime = 60*60*24*30;//自动登录一个月
ini_set('session.gc_maxlifetime', $expireTime);
ini_set('session.cookie_lifetime', $expireTime);
session($session_name, $cp_auth);
session($session_name.'_sign', data_auth_sign($cp_auth));
session($session_name.'_expire', time());
} else {
session($session_name, $cp_auth);
session($session_name.'_sign', data_auth_sign($cp_auth));
}
$this->success('登录成功!', U('VerifyBill/index'));
} else {
if (session('payment_user')) {
$this->redirect('VerifyBill/index');
} else {
/* 读取数据库中的配置 */
$config = S('DB_CONFIG_DATA');
if (!$config) {
$config = D('Config')->lists();
S('DB_CONFIG_DATA', $config);
}
C($config); //添加配置
$this->display();
}
}
}
public function logout()
{
session('cp_user_auth', null);
session('cp_user_auth_sign', null);
$this->redirect('cp_login');
}
public function checkVerify()
{
$verify = $_POST['verify'];
if (!check_verify($verify)) {
$this->ajaxReturn(array('status' => 0, 'msg' => '验证码输入错误!'));
}
}
public function verify()
{
$config = array(
'seKey' => 'ThinkPHP.CN', //验证码加密密钥
'fontSize' => 22, // 验证码字体大小(px)
'imageH' => 50, // 验证码图片高度
'imageW' => 180, // 验证码图片宽度
'length' => 4, // 验证码位数
'fontttf' => '4.ttf', // 验证码字体,不设置随机获取
);
ob_clean();
$verify = new \Think\Verify($config);
$verify->codeSet = '0123456789';
$verify->entry(1);
}
public function zh_cn()
{
cookie('think_language', 'zh-cn');
$this->ajaxReturn(['status' => 1]);
}
public function en_us()
{
cookie('think_language', 'en-us');
$this->ajaxReturn(['status' => 1]);
}
/**
* 发动手机验证码
*/
public function telsafecode($phone = '', $delay = 10, $flag = true)
{
$this->check_moblie($phone);
$taskClient = new TaskClient();
$result = $taskClient->sendSmsCode($phone, get_client_ip());
$data = [];
if ($result['code'] == TaskClient::SUCCESS) {
$data['status'] = 1;
} else {
$data['status'] = 0;
}
$data['msg'] = $result['message'];
echo json_encode($data);
exit;
}
/**
* 手机安全码验证
*/
public function checksafecode($phone, $code)
{
$taskClient = new TaskClient();
$result = $taskClient->checkSms($phone, $code);
$data = [];
if ($result && $result['code'] == TaskClient::SUCCESS) {
return true;
} else {
return false;
}
}
public function check_moblie($mobile){
$check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile'")->find();
if(empty($check_mobile)){
$this->error('请先配置登陆验证手机');
}
$check_mobile = $check_mobile['value'];
if($check_mobile !== $mobile){
$this->error('该账号没有权限登录打款系统');
}
}
}

@ -0,0 +1,65 @@
<extend name="Public/base"/>
<block name="body">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text"></p>
</div>
<div class="tab-wrap">
<div class="tab-content tabcon1711 tabcon17112">
<div id="tab1" class="tab-pane in tab1">
<form action="{:U('saveTransferSet')}" method="post" class="form-horizontal OSS form_info_ml">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">打款验证手机号</td>
<td class="r table_radio">
<input name="config[phone]" type="text" value="{$transfer_set['phone']}" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">当前账号余额</td>
<td class="r table_radio">
<div>{$money}元</div>
</td>
</tr>
</tbody>
</table>
<input type="hidden" name="name" value="transfer_set">
</form>
<div class="form-item cf">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="OSS">
保存
</button>
</div>
</div>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="{$m_url}">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('Payment/transfer_set')}");
$(function(){
//支持tab
showTab();
})
</script>
</block>

@ -0,0 +1,366 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>{$meta_title}-{:C('WEB_SITE_TITLE')}</title>
<link href="{:get_cover(C('SITE_ICO'),'path')}" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<block name="css"></block>
<link rel="stylesheet" type="text/css" href="__CSS__/black.css" media="all">
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
<![endif]--><!--[if gte IE 9]><!-->
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__STATIC__/jquery.cookie.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
<!--<![endif]-->
<block name="style"></block>
<style>
.select2-dropdown {
z-index: 1;
}
</style>
</head>
<body>
<!-- 头部 -->
<div class="header">
<!-- Logo -->
<span class="logo">
<img src="{:get_cover(C('HT_LOGO'),'path')}" style="width:160px;height: auto;margin-top: 10px;">
</span>
<!-- /Logo -->
<!-- 主导航 -->
<ul class="main-nav ienav">
<volist name="__MENU__.main" id="menu">
<li class="{$menu.class|default=''}"><a href="{$menu.url|U}"><p><i class="guidicon guidicon-{$menu.id}"></i></p><h5>{:L($menu['title'])}</h5></a></li>
</volist>
</ul>
<!-- /主导航 -->
<!-- 用户栏 -->
<div class="topright">
<ul>
<!-- <li><span><img src="__IMG__/help.png" title="帮助" class="helpimg"></span><a href="http://xue.vlcms.com/" target="_blank">帮助</a></li>-->
<li class="subjectlist jssubject">
<!-- <a href="javascript:;" class="cbtn jscbtn">主题<i></i></a> -->
<div class="subject-sublist jssubjectlist">
<?php $colorstyle = get_color_style_list();?>
<volist name="colorstyle.list" id="vo">
<div><a href="javascript:void(0);" target="_self" class="subject-item jssetcolor" data-value="{$key}"><img src="__IMG__/{$key}.png" class="subject-pic"><p><span>{$vo}</span></p><i class="subject-icon <eq name='colorstyle.value' value='$key'>yes</eq>"></i></a></div>
</volist>
</div>
</li>
<li><a class="ajax-get" href="{:U('ClearCache/clear')}">清理缓存</a></li>
<!-- <li class="gwlist">
<div class="nav" id="nav">
<p class="set"><a>语言<i></i></a></p>
<ul class="new">
<li><a href="javascript:void(0);" target="_self">中文</a></li>
<li><a href="javascript:void(0);" target="_self">英文</a></li>
</ul>
</div>
</li> -->
<li><a class="tuichujs" href="">退出</a></li>
</ul>
<div class="user">
<span>{:session('user_auth.username')}</span>
<a href="{:U('Msg/lists')}">
<i>消息</i>
<b>{:get_msg()}</b>
</a>
</div>
</div>
</div>
<!--下拉样式-->
<script type="text/javascript">
$(function(){
$(".nav p").click(function(){
var ul=$(".new");
if(ul.css("display")=="none"){
ul.slideDown();
}else{
ul.slideUp();
}
});
$('.jscbtn').click(function() {
$(this).siblings().slideToggle(200);
return false;
});
$('.jssetcolor').click(function() {
var that = $(this),value=that.attr('data-value');
var par = that.closest('.jssubjectlist');
if (that.hasClass('disabled')) {return false;}
$('.jssetcolor').addClass('disabled');
$.post('{:U("Admin/set_color_style")}',{value:value},function(data) {
if (data.status==1) {
updateAlert(data.info,'tip_right');
setTimeout(function(){
$('#tip').find('.tipclose').click();
setTimeout(function(){location.reload();},300);
},1500);
} else {
updateAlert(data.info,'tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);
par.slideToggle(200);
$('.jssetcolor').removeClass('disabled');
}
},'json');
return false;
});
})
</script>
<div id="tip" class="tip"><a class="tipclose hidden" ></a><div class="tipmain"><div class="tipicon"></div><div class="tipinfo">这是内容</div></div></div>
<script>
/**顶部警告栏*/
var content = $('#main');
var top_alert = $('#tip');
//$('body').append('<div class="notice"><div><i></i>成功</div></div>');
top_alert.find('.tipclose').on('click', function () {
top_alert.removeClass('block').slideUp(200);
// content.animate({paddingTop:'-=55'},200);
});
$('.new li:eq(0)').click(function(){
$.ajax({
type: 'POST',
url: "{:U('Public/zh_cn')}",
success: function(data) {
location.reload();
},
error:function(){
}
});
})
$('.new li:eq(1)').click(function(){
$.ajax({
type: 'POST',
type:'json',
url: "/admin.php?s=/Public/en_us",
success: function(data) {
location.reload();
},
error:function(){
alert(111);
}
});
})
window.updateAlert = function (text,c) {
text = text||'default';
c = c||false;
if ( text!='default' ) {
top_alert.find('.tipinfo').text(text);
if (top_alert.hasClass('block')) {
} else {
top_alert.addClass('block').slideDown(200);
// content.animate({paddingTop:'+=55'},200);
}
} else {
if (top_alert.hasClass('block')) {
top_alert.removeClass('block').slideUp(200);
// content.animate({paddingTop:'-=55'},200);
}
}
if ( c!=false ) {
top_alert.removeClass('tip_error tip_right').addClass(c);
}
};
</script>
<!--下拉样式结束-->
<!-- /头部 -->
<!-- 边栏 -->
<div class="sidebar" <if condition="CONTROLLER_NAME eq Index"> style="display:none</if>">
<div class="user_nav">
<span><img src="/Public/Admin/images/tx.png"></span>
<p>{:session('user_auth.username')}</p>
<p style="margin-top:0px;">超级管理员</p>
</div>
<div class="fgx">功能菜单</div>
<div id="subnav" class="subnav">
<h3 class=""><i class="icon icon-unfold"></i>万盟打款</h3>
<ul class="side-sub-menu">
<li class="current">
<a class="item" href="{:U('Payment/transfer_set')}">对账单确认</a>
</li>
</ul>
</div>
</div>
<!-- /边栏 -->
<!-- 内容区 -->
<div id="main-content" style="margin-top: 50px;position:relative;">
<div id="tip" class="tip"><a class="tipclose hidden" ></a><div class="tipmain"><div class="tipicon"></div><div class="tipinfo">这是内容</div></div></div>
<div id="main" class="main">
<block name="nav">
<!-- nav -->
<notempty name="_show_nav">
<div class="breadcrumb">
<span>位置:</span>
<assign name="i" value="1" />
<foreach name="_nav" item="v" key="k">
<if condition="$i eq count($_nav)">
<span>{$v}</span>
<else />
<span><a href="{$k}">{$v}</a>&gt;</span>
</if>
<assign name="i" value="$i+1" />
</foreach>
</div>
</notempty>
<!-- nav -->
</block>
<if condition="CONTROLLER_NAME neq 'Index' ">
</if>
<block name="body"> </block>
</div>
</div>
<!-- /内容区 -->
<script type="text/javascript">
(function(){
var ThinkPHP = window.Think = {
"ROOT" : "__ROOT__", //当前网站地址
"APP" : "__APP__", //当前项目地址
"PUBLIC" : "__PUBLIC__", //项目公共目录地址
"DEEP" : "{:C('URL_PATHINFO_DEPR')}", //PATHINFO分割符
"MODEL" : ["{:C('URL_MODEL')}", "{:C('URL_CASE_INSENSITIVE')}", "{:C('URL_HTML_SUFFIX')}"],
"VAR" : ["{:C('VAR_MODULE')}", "{:C('VAR_CONTROLLER')}", "{:C('VAR_ACTION')}"]
}
})();
</script>
<script type="text/javascript" src="__STATIC__/think.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script type="text/javascript">
+function(){
var $window = $(window), $subnav = $("#subnav"), url;
$window.resize(function(){
$("#main").css("min-height", $window.height() - 130);
}).resize();
$('.tuichujs').click(function(){
$.ajax({
type: 'POST',
async: false,
dataType: 'json',
url: "{:U('Public/logout')}",
success: function(data) {
updateAlert('退出成功','tip_right');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);
location.reload();
},
error:function(){
updateAlert("服务器故障!",'tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);
}
});
});
/* 左边菜单高亮 */
url = window.location.pathname + window.location.search;
url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
//$subnav.find('h3').addClass('no');
$subnav.find("a[href='" + url + "']").parent().addClass("current").closest('ul').prev('h3').removeClass('no');
/* 左边菜单显示收起 */
/*$("#subnav").on("click", "h3", function(){
var $this = $(this);
$this.toggleClass('no').find(".icon").toggleClass("icon-fold");
$this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
prev("h3").addClass('no').find("i").addClass("icon-fold").end().end().hide();
});*/
$("#subnav").on("click", "h3", function(event){
var e = event || window.event;
var target = $(e.target);
var $this = $(this);
if ($this.index() == target.index())
$this.find(".icon").toggleClass("icon-fold");
else
$this.toggleClass('no').find(".icon").toggleClass("icon-fold");
$this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
prev("h3").find("i").addClass("icon-fold").end().end().hide();
});
$("#subnav h3 a").click(function(e){e.stopPropagation()});
/* 头部管理员菜单 */
$(".user-bar").mouseenter(function(){
var userMenu = $(this).children(".user-menu ");
userMenu.removeClass("hidden");
clearTimeout(userMenu.data("timeout"));
}).mouseleave(function(){
var userMenu = $(this).children(".user-menu");
userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
});
/* 表单获取焦点变色 */
$("form").on("focus", "input", function(){
$(this).addClass('focus');
}).on("blur","input",function(){
$(this).removeClass('focus');
});
$("form").on("focus", "textarea", function(){
$(this).closest('label').addClass('focus');
}).on("blur","textarea",function(){
$(this).closest('label').removeClass('focus');
});
// 导航栏超出窗口高度后的模拟滚动条
var sHeight = $(".sidebar").height();
var subHeight = $(".subnav").height();
var diff = subHeight - sHeight; //250
var sub = $(".subnav");
if(diff > 0){
$(window).mousewheel(function(event, delta){
if(delta>0){
if(parseInt(sub.css('marginTop'))>-10){
sub.css('marginTop','0px');
}else{
sub.css('marginTop','+='+10);
}
}else{
if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
sub.css('marginTop','-'+(diff-10));
}else{
sub.css('marginTop','-='+10);
}
}
});
}
}();
</script>
<block name="script"></block>
</body>
</html>

@ -0,0 +1,71 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #290C0C; font-family: '微软雅黑'; color: #fff; font-size: 16px; }
.system-message{ padding: 24px 48px; }
.system-message h1{ font-size: 80px; font-weight: normal; line-height: 120px; margin-bottom: 12px }
.system-message .jump{ padding-top: 10px;margin-bottom:20px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
#wait {
font-size:46px;
}
#btn-stop,#href{
display: inline-block;
margin-right: 10px;
font-size: 16px;
line-height: 18px;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 0 none;
background-color: #8B0000;
padding: 10px 20px;
color: #fff;
font-weight: bold;
border-color: transparent;
text-decoration:none;
}
#btn-stop:hover,#href:hover{
background-color: #ff0000;
}
</style>
</head>
<body>
<div class="system-message">
<h1>抱歉,出错啦!</h1>
<p class="error"><?php echo($error); ?></p>
<p class="detail"></p>
<p class="jump">
<b id="wait"><?php echo($waitSecond); ?></b> 秒后页面将自动跳转
</p>
<div>
<a id="href" id="btn-now" href="<?php echo($jumpUrl); ?>">立即跳转</a>
<button id="btn-stop" type="button" onclick="stop()">停止跳转</button>
<a id="href" id="btn-now" href="<?php echo(U('Public/logout')); ?>">重新登录</a>
</div>
</div>
<script type="text/javascript">
(function(){
var wait = document.getElementById('wait'),href = document.getElementById('href').href;
var interval = setInterval(function(){
var time = --wait.innerHTML;
if(time <= 0) {
location.href = href;
clearInterval(interval);
};
}, 1000);
window.stop = function (){
console.log(111);
clearInterval(interval);
}
})();
</script>
</body>
</html>

@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>系统发生错误</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
html{ overflow-y: scroll; }
body{ background: #fff; font-family: '微软雅黑'; color: #333; font-size: 16px; }
img{ border: 0; }
.error{ padding: 24px 48px; }
.face{ font-size: 100px; font-weight: normal; line-height: 120px; margin-bottom: 12px; }
h1{ font-size: 32px; line-height: 48px; }
.error .content{ padding-top: 10px}
.error .info{ margin-bottom: 12px; }
.error .info .title{ margin-bottom: 3px; }
.error .info .title h3{ color: #000; font-weight: 700; font-size: 16px; }
.error .info .text{ line-height: 24px; }
.copyright{ padding: 12px 48px; color: #999; }
.copyright a{ color: #000; text-decoration: none; }
</style>
</head>
<body>
<div class="error">
<p class="face">:(</p>
<h1><?php echo strip_tags($e['message']);?></h1>
<div class="content">
<?php if(isset($e['file'])) {?>
<div class="info">
<div class="title">
<h3>错误位置</h3>
</div>
<div class="text">
<p>FILE: <?php echo $e['file'] ;?> &#12288;LINE: <?php echo $e['line'];?></p>
</div>
</div>
<?php }?>
<?php if(isset($e['trace'])) {?>
<div class="info">
<div class="title">
<h3>TRACE</h3>
</div>
<div class="text">
<p><?php echo nl2br($e['trace']);?></p>
</div>
</div>
<?php }?>
</div>
</div>
<div class="copyright">
<p><a title="官方网站" href="https://www.vlcms.com/">----软件</a>管理平台<sup><?php echo ONETHINK_VERSION ?></sup> [ 让管理变得更简单 ]</p>
</div>
</body>
</html>

@ -0,0 +1,209 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{:C('WEB_SITE_TITLE')}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- CSS -->
<link rel="stylesheet" href="__CSS__/reset.css">
<link rel="stylesheet" href="__CSS__/supersized.css">
<link rel="stylesheet" href="__CSS__/loginnews1711.css">
<script src="__JS__/jquery-3.0.0.min.js" ></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__JS__/cloud.js" type="text/javascript"></script>
<style>
#sendSasfeCode {
border-radius:3px;
width:29%;
cursor:pointer;
border:1px solid;
position:absolute;
top:0;
right:0;
height:48px;
text-align: center;
line-height: 50px;
}
.g-btntn{
border-color: grey;
color: grey;
}
.g-btn{
border-color: #2697FF;
color: #2697FF;
}
</style>
</head>
<body style="background-color:#1c77ac; background-image:url(__IMG__/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">
<div id="mainBody">
<div id="cloud1" class="cloud"></div>
<div id="cloud2" class="cloud"></div>
</div>
<div class="logintop">
<span>欢迎登录打款系统</span>
<!-- <ul>
<li><a href="http://xue.vlcms.com/" target="_blank">帮助</a></li>
<li><a href="http://www.vlcms.com/" target="_blank">关于</a></li>
</ul> -->
</div>
<div class="loginbody" >
<span class="systemlogo"></span>
<div class="loginbox">
<form class="inputlogin">
<div class="wrap">
<h3><span>手机号码快捷登录</span><span>User Login</span></h3>
<ul>
<li>
<img src="__IMG__/login_name.png" class="icon icon-user">
<input name="mobile" type="text" id="mobile" class="login_input" value="" autocomplete="off" placeholder="请输入手机号码" />
</li>
<li>
<img src="__IMG__/login_code.png" class="icon icon-code">
<input name="verify" type="text" class="login_input verify" value="" placeholder="请填写验证码"/>
<div id="sendSasfeCode" class="g-btn">获取验证码</div>
</li>
<li><input name="" type="submit" class="loginbtn" value="登录" /></li>
<li style="color: grey"><input type="checkbox" name="auto_login" id="">下次自动登录</li>
</ul>
</div>
</form>
</div>
</div>
<!-- <div class="loginbm"><i>&copy;徐州梦创信息科技有限公司 版权所有</i>2016&nbsp;<a href="http://www.vlcms.com/" target="_blank">vlcms.com</a> &copy;版权所有</div> -->
<div id="tip" class="tip"><a class="tipclose hidden" ></a><div class="tipmain"><div class="tipicon"></div><div class="tipinfo">这是内容</div></div></div>
<script>
var r = function(i, t) {
if (i>0) {
var r = 60;
e='#sendSasfeCode';
$(e).removeClass('g-btn').addClass('g-btntn');
var a = setInterval(function() {
r--;
$(e).text(r + '秒');
0 == r && ($(e).removeClass('g-btntn').addClass('g-btn'),
$(e).text('获取验证码'),
clearInterval(a))
},1000)
}
};
$('#sendSasfeCode').on('click',function() {
if ($(this).hasClass('g-btntn')) {
return false;
}
var phone = $.trim($('#mobile').val());
if (phone == '') {
alert("手机号不能为空");
return false;
}
if (phone.length !== 11 || !(/^[1][35789][0-9]{9}$/.test(phone))) {
layer.msg("格式不正确");
return false;
}
$.ajax({
type:'post',
dataType:'json',
data:'phone='+phone,
url:'{:U("telsafecode")}',
success:function(data) {
if (data.status ==1) {
r(1);
} else {
alert(data.msg);
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
}
});
});
/**顶部警告栏*/
var content = $('#main');
var top_alert = $('#tip');
top_alert.find('.tipclose').on('click', function () {
top_alert.removeClass('block').slideUp(200);
});
window.updateAlert = function (text,c) {
text = text||'default';
c = c||false;
if ( text!='default' ) {
top_alert.find('.tipinfo').text(text);
if (top_alert.hasClass('block')) {
} else {
top_alert.addClass('block').slideDown(200);
}
} else {
if (top_alert.hasClass('block')) {
top_alert.removeClass('block').slideUp(200);
}
}
if ( c!=false ) {
top_alert.removeClass('tip_error tip_right').addClass(c);
}
};
</script>
<script>
$(function(){
$(".inputlogin").unbind('submit').submit(function(){
$.ajax({
type: 'POST',
async: true,
dataType: 'json',
url: "{:U('login')}",
data: $(".inputlogin").serialize(),
success: function(data) {
if(data.status!=1){
var msg = data.info ? data.info : data.msg;
alert(msg)
}else{
window.location.href = data.url;
}
},
error:function(){
updateAlert("服务器故障!",'tip_error');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);
}
});
return false;
});
});
</script>
</body>
</html>

@ -0,0 +1,70 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>跳转提示</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
body{ background: #30333F; font-family: '微软雅黑'; color: #fff; font-size: 16px; }
.system-message{ padding: 24px 48px; }
.system-message h1{ font-size: 80px; font-weight: normal; line-height: 120px; margin-bottom: 12px }
.system-message .jump{ padding-top: 10px;margin-bottom:20px}
.system-message .jump a{ color: #333;}
.system-message .success,.system-message .error{ line-height: 1.8em; font-size: 36px }
.system-message .detail{ font-size: 12px; line-height: 20px; margin-top: 12px; display:none}
#wait {
font-size:46px;
}
#btn-stop,#href{
display: inline-block;
margin-right: 10px;
font-size: 16px;
line-height: 18px;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 0 none;
background-color: #308B04;
padding: 10px 20px;
color: #fff;
font-weight: bold;
border-color: transparent;
text-decoration:none;
}
#btn-stop:hover,#href:hover{
background-color: #43BD08;
}
</style>
</head>
<body>
<div class="system-message">
<h1>恭喜您!</h1>
<p class="success"><?php echo($message); ?></p>
<p class="detail"></p>
<p class="jump">
<b id="wait"><?php echo($waitSecond); ?></b> 秒后页面将自动跳转
</p>
<div>
<a id="href" id="btn-now" href="<?php echo($jumpUrl); ?>">立即跳转</a>
<button id="btn-stop" type="button" onclick="stop()">停止跳转</button>
</div>
</div>
<script type="text/javascript">
(function(){
var wait = document.getElementById('wait'),href = document.getElementById('href').href;
var interval = setInterval(function(){
var time = --wait.innerHTML;
if(time <= 0) {
location.href = href;
clearInterval(interval);
};
}, 1000);
window.stop = function (){
console.log(111);
clearInterval(interval);
}
})();
</script>
</body>
</html>

@ -0,0 +1,42 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !');
/**
* 系统调试设置
* 项目正式部署后请设置为false
*/
define('APP_DEBUG', true );
define('BIND_MODULE','Payment');
define('ROOTTT',dirname(__FILE__).'/');
define('ROOTTTTT',dirname(__FILE__));
define('FONTS',dirname(__FILE__).'/Public/Admin/fonts/');
/**
* 应用目录设置
* 安全期间建议安装调试完成后移动到非WEB目录
*/
define ( 'APP_PATH', './Application/' );
if(!is_file(APP_PATH . 'User/Conf/config.php')){
header('Location: ./install.php');
exit;
}
/**
* 缓存目录设置
* 此目录必须可写建议移动到非WEB目录
*/
define ( 'RUNTIME_PATH', './Runtime/' );
/**
* 引入核心入口
* ThinkPHP亦可移动到WEB以外的目录
*/
require './ThinkPHP/ThinkPHP.php';
Loading…
Cancel
Save