root 5 роки тому
коміт
5530534517
100 змінених файлів з 5092 додано та 0 видалено
  1. 96 0
      SignatureHelper.php
  2. 121 0
      admin/common/attachurl.php
  3. 291 0
      admin/common/bootstrap.sys.inc.php
  4. 400 0
      admin/common/common.func.php
  5. 93 0
      admin/common/template.func.php
  6. 163 0
      admin/index.php
  7. 101 0
      admin/source/site/entry.ctrl.php
  8. 125 0
      admin/source/user/login.ctrl.php
  9. 12 0
      admin/source/user/logout.ctrl.php
  10. 7 0
      admin/source/utility/__init.php
  11. 8 0
      admin/themes/default/common/footer-base.html
  12. 33 0
      admin/themes/default/common/footer-cms.html
  13. 54 0
      admin/themes/default/common/footer-gw.html
  14. 48 0
      admin/themes/default/common/footer.html
  15. 46 0
      admin/themes/default/common/header-base.html
  16. 136 0
      admin/themes/default/common/header-cms.html
  17. 147 0
      admin/themes/default/common/header-gw.html
  18. 219 0
      admin/themes/default/common/header.html
  19. 8 0
      admin/themes/default/common/message.html
  20. 227 0
      admin/themes/default/user/login.html
  21. BIN
      bgtu.jpg
  22. 174 0
      cert/WxPay.Api.php
  23. 703 0
      cert/WxPay.Data.php
  24. 13 0
      cert/WxPay.Exception.php
  25. 85 0
      cert/WxPay.Notify.php
  26. 0 0
      cert/apiclient_cert_1.pem
  27. 0 0
      cert/apiclient_cert_10.pem
  28. 26 0
      cert/apiclient_cert_133.pem
  29. 26 0
      cert/apiclient_cert_16.pem
  30. 26 0
      cert/apiclient_cert_2.pem
  31. 0 0
      cert/apiclient_cert_249.pem
  32. 0 0
      cert/apiclient_cert_261.pem
  33. 26 0
      cert/apiclient_cert_33.pem
  34. 26 0
      cert/apiclient_cert_5.pem
  35. 0 0
      cert/apiclient_cert_69.pem
  36. 0 0
      cert/apiclient_cert_91.pem
  37. 0 0
      cert/apiclient_key_1.pem
  38. 0 0
      cert/apiclient_key_10.pem
  39. 28 0
      cert/apiclient_key_133.pem
  40. 28 0
      cert/apiclient_key_16.pem
  41. 28 0
      cert/apiclient_key_2.pem
  42. 0 0
      cert/apiclient_key_249.pem
  43. 0 0
      cert/apiclient_key_261.pem
  44. 28 0
      cert/apiclient_key_33.pem
  45. 28 0
      cert/apiclient_key_5.pem
  46. 0 0
      cert/apiclient_key_69.pem
  47. 0 0
      cert/apiclient_key_91.pem
  48. 19 0
      cert/rootca.pem
  49. 1 0
      developer.cer
  50. 23 0
      errorCode.php
  51. 503 0
      hong.php
  52. BIN
      icon-custom.jpg
  53. BIN
      icon.jpg
  54. BIN
      img/1.jpeg
  55. 963 0
      inc/func/core.php
  56. 1 0
      inc/upload/tcsj.jpeg
  57. 1 0
      inc/upload/tcsj1.jpeg
  58. BIN
      inc/upload/tcsj10.jpeg
  59. BIN
      inc/upload/tcsj100.jpeg
  60. 1 0
      inc/upload/tcsj101.jpeg
  61. BIN
      inc/upload/tcsj102.jpeg
  62. BIN
      inc/upload/tcsj103.jpeg
  63. BIN
      inc/upload/tcsj104.jpeg
  64. BIN
      inc/upload/tcsj105.jpeg
  65. BIN
      inc/upload/tcsj106.jpeg
  66. BIN
      inc/upload/tcsj107.jpeg
  67. BIN
      inc/upload/tcsj108.jpeg
  68. BIN
      inc/upload/tcsj109.jpeg
  69. BIN
      inc/upload/tcsj11.jpeg
  70. BIN
      inc/upload/tcsj110.jpeg
  71. BIN
      inc/upload/tcsj111.jpeg
  72. BIN
      inc/upload/tcsj112.jpeg
  73. BIN
      inc/upload/tcsj113.jpeg
  74. BIN
      inc/upload/tcsj114.jpeg
  75. BIN
      inc/upload/tcsj115.jpeg
  76. BIN
      inc/upload/tcsj116.jpeg
  77. BIN
      inc/upload/tcsj118.jpeg
  78. BIN
      inc/upload/tcsj119.jpeg
  79. BIN
      inc/upload/tcsj12.jpeg
  80. BIN
      inc/upload/tcsj120.jpeg
  81. BIN
      inc/upload/tcsj121.jpeg
  82. BIN
      inc/upload/tcsj122.jpeg
  83. BIN
      inc/upload/tcsj123.jpeg
  84. BIN
      inc/upload/tcsj124.jpeg
  85. BIN
      inc/upload/tcsj125.jpeg
  86. BIN
      inc/upload/tcsj126.jpeg
  87. BIN
      inc/upload/tcsj127.jpeg
  88. BIN
      inc/upload/tcsj128.jpeg
  89. BIN
      inc/upload/tcsj129.jpeg
  90. BIN
      inc/upload/tcsj130.jpeg
  91. BIN
      inc/upload/tcsj131.jpeg
  92. BIN
      inc/upload/tcsj132.jpeg
  93. BIN
      inc/upload/tcsj133.jpeg
  94. BIN
      inc/upload/tcsj134.jpeg
  95. BIN
      inc/upload/tcsj135.jpeg
  96. BIN
      inc/upload/tcsj136.jpeg
  97. BIN
      inc/upload/tcsj137.jpeg
  98. BIN
      inc/upload/tcsj138.jpeg
  99. BIN
      inc/upload/tcsj139.jpeg
  100. BIN
      inc/upload/tcsj14.jpeg

+ 96 - 0
SignatureHelper.php

xqd
@@ -0,0 +1,96 @@
+<?php
+
+
+/**
+ * 签名助手 2017/11/19
+ *
+ * Class SignatureHelper
+ */
+class SignatureHelper {
+
+    /**
+     * 生成签名并发起请求
+     *
+     * @param $accessKeyId string AccessKeyId (https://ak-console.aliyun.com/)
+     * @param $accessKeySecret string AccessKeySecret
+     * @param $domain string API接口所在域名
+     * @param $params array API具体参数
+     * @param $security boolean 使用https
+     * @param $method boolean 使用GET或POST方法请求,VPC仅支持POST
+     * @return bool|\stdClass 返回API接口调用结果,当发生错误时返回false
+     */
+    public function request($accessKeyId, $accessKeySecret, $domain, $params, $security=false, $method='POST') {
+        $apiParams = array_merge(array (
+            "SignatureMethod" => "HMAC-SHA1",
+            "SignatureNonce" => uniqid(mt_rand(0,0xffff), true),
+            "SignatureVersion" => "1.0",
+            "AccessKeyId" => $accessKeyId,
+            "Timestamp" => gmdate("Y-m-d\TH:i:s\Z"),
+            "Format" => "JSON",
+        ), $params);
+        ksort($apiParams);
+
+        $sortedQueryStringTmp = "";
+        foreach ($apiParams as $key => $value) {
+            $sortedQueryStringTmp .= "&" . $this->encode($key) . "=" . $this->encode($value);
+        }
+
+        $stringToSign = "${method}&%2F&" . $this->encode(substr($sortedQueryStringTmp, 1));
+
+        $sign = base64_encode(hash_hmac("sha1", $stringToSign, $accessKeySecret . "&",true));
+
+        $signature = $this->encode($sign);
+
+        $url = ($security ? 'https' : 'http')."://{$domain}/";
+
+        try {
+            $content = $this->fetchContent($url, $method, "Signature={$signature}{$sortedQueryStringTmp}");
+            return json_decode($content);
+        } catch( \Exception $e) {
+            return false;
+        }
+    }
+
+    private function encode($str)
+    {
+        $res = urlencode($str);
+        $res = preg_replace("/\+/", "%20", $res);
+        $res = preg_replace("/\*/", "%2A", $res);
+        $res = preg_replace("/%7E/", "~", $res);
+        return $res;
+    }
+
+    private function fetchContent($url, $method, $body) {
+        $ch = curl_init();
+
+        if($method == 'POST') {
+            curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
+            curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
+        } else {
+            $url .= '?'.$body;
+        }
+
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
+            "x-sdk-client" => "php/2.0.0"
+        ));
+
+        if(substr($url, 0,5) == 'https') {
+            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+        }
+
+        $rtn = curl_exec($ch);
+
+        if($rtn === false) {
+            // 大多由设置等原因引起,一般无法保障后续逻辑正常执行,
+            // 所以这里触发的是E_USER_ERROR,会终止脚本执行,无法被try...catch捕获,需要用户排查环境、网络等故障
+            trigger_error("[CURL_" . curl_errno($ch) . "]: " . curl_error($ch), E_USER_ERROR);
+        }
+        curl_close($ch);
+
+        return $rtn;
+    }
+}

+ 121 - 0
admin/common/attachurl.php

xqd
@@ -0,0 +1,121 @@
+<?php
+
+/**
+
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+
+ */
+
+defined('IN_IA') or exit('Access Denied');
+
+
+
+//load()->web('common');
+
+//load()->web('template');
+
+//load()->func('file');
+
+//load()->func('tpl');
+
+//load()->model('account');
+
+//load()->model('setting');
+
+//load()->model('user');
+
+//load()->model('permission');
+
+load()->model('attachment');
+
+//load()->classs('oauth2/oauth2client');
+
+
+
+$_W['token'] = token();
+
+/*$session = json_decode(authcode($_GPC['__session']), true);
+
+if (is_array($session)) {
+
+	$user = user_single(array('uid'=>$session['uid']));
+
+	if (is_array($user) && $session['hash'] === md5($user['password'] . $user['salt'])) {
+
+		$_W['uid'] = $user['uid'];
+
+		$_W['username'] = $user['username'];
+
+		$user['currentvisit'] = $user['lastvisit'];
+
+		$user['currentip'] = $user['lastip'];
+
+		$user['lastvisit'] = $session['lastvisit'];
+
+		$user['lastip'] = $session['lastip'];
+
+		$_W['user'] = $user;
+
+		$_W['isfounder'] = user_is_founder($_W['uid']);
+
+		unset($founders);
+
+	} else {
+
+		isetcookie('__session', false, -100);
+
+	}
+
+	unset($user);
+
+}
+
+unset($session);
+
+
+
+if (!empty($_GPC['__uniacid'])) {
+
+	$_W['uniacid'] = intval($_GPC['__uniacid']);
+
+} else {
+
+	$_W['uniacid'] = uni_account_last_switch();
+
+}
+
+
+
+if (!empty($_W['uniacid'])) {
+
+	$_W['uniaccount'] = $_W['account'] = uni_fetch($_W['uniacid']);
+
+	if (empty($_W['account'])) {
+
+		unset($_W['uniacid']);
+
+	}
+
+	$_W['acid'] = $_W['account']['acid'];
+
+	$_W['weid'] = $_W['uniacid'];
+
+}
+
+
+
+if (!empty($_W['uid'])) {
+
+	$_W['highest_role'] = permission_account_user_role($_W['uid']);
+
+	$_W['role'] = permission_account_user_role($_W['uid'], $_W['uniacid']);
+
+}
+
+$_W['template'] = !empty($_W['setting']['basic']['template']) ? $_W['setting']['basic']['template'] : 'default';
+*/
+$_W['attachurl'] = attachment_set_attach_url();
+
+//load()->func('compat.biz');

+ 291 - 0
admin/common/bootstrap.sys.inc.php

xqd
@@ -0,0 +1,291 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+load()->model('user');
+load()->func('tpl');
+if (file_exists(IA_ROOT . '/framework/model/permission.mod.php')) {
+	load()->model('permission');
+} else {
+
+	function permission_build() {
+		global $_W;
+		$we7_file_permission = require IA_ROOT . '/web/common/permission.inc.php';
+		$permission_frames = require IA_ROOT . '/web/common/frames.inc.php';
+		if (!in_array($_W['role'], array(ACCOUNT_MANAGE_NAME_OPERATOR, ACCOUNT_MANAGE_NAME_MANAGER)) || empty($_W['uniacid'])) {
+			return $we7_file_permission;
+		}
+
+		$cachekey = cache_system_key("permission:{$_W['uniacid']}:{$_W['uid']}");
+		$cache = cache_load($cachekey);
+		if (!empty($cache)) {
+			return $cache;
+		}
+		$permission_exist = permission_account_user_permission_exist($_W['uid'], $_W['uniacid']);
+		if (empty($permission_exist)) {
+			$we7_file_permission['platform'][$_W['role']] = array('platform*');
+			$we7_file_permission['site'][$_W['role']] = array('site*');
+			$we7_file_permission['mc'][$_W['role']] = array('mc*');
+			$we7_file_permission['profile'][$_W['role']] = array('profile*');
+			$we7_file_permission['module'][$_W['role']] = array('manage-account', 'display');
+			$we7_file_permission['wxapp'][$_W['role']] = array('display', 'payment', 'post', 'version');
+			cache_write($cachekey, $we7_file_permission);
+			return $we7_file_permission;
+		}
+		$user_account_permission = permission_account_user_menu($_W['uid'], $_W['uniacid'], PERMISSION_ACCOUNT);
+		$user_wxapp_permission = permission_account_user_menu($_W['uid'], $_W['uniacid'], PERMISSION_WXAPP);
+		$user_permission = array_merge($user_account_permission, $user_wxapp_permission);
+
+		$permission_contain = array('account', 'wxapp', 'system');
+		$section = array();
+		$permission_result = array();
+		foreach ($permission_frames as $key => $frames) {
+			if (!in_array($key, $permission_contain) || empty($frames['section'])) {
+				continue;
+			}
+			foreach ($frames['section'] as $frame_key => $frame) {
+				if (empty($frame['menu'])) {
+					continue;
+				}
+				$section[$key][$frame_key] = $frame['menu'];
+			}
+		}
+		$account = permission_get_nameandurl($section[$permission_contain[0]]);
+		$wxapp = permission_get_nameandurl($section[$permission_contain[1]]);
+		$system = permission_get_nameandurl($section[$permission_contain[2]]);
+		$permission_result = array_merge($account, $wxapp, $system);
+
+		foreach ($permission_result as $permission_val) {
+			if (in_array($permission_val['permission_name'], $user_permission)) {
+				$we7_file_permission[$permission_val['controller']][$_W['role']][] = $permission_val['action'];
+			}
+		}
+		cache_write($cachekey, $we7_file_permission);
+		return $we7_file_permission;
+	}
+
+	function permission_account_user_role($uid = 0, $uniacid = 0) {
+		global $_W;
+		load()->model('user');
+		$role = '';
+		$uid = empty($uid) ? $_W['uid'] : intval($uid);
+
+		if (user_is_founder($uid) && !user_is_vice_founder($uid)) {
+			return ACCOUNT_MANAGE_NAME_FOUNDER;
+		}
+
+		if (user_is_vice_founder($uid)) {
+			return ACCOUNT_MANAGE_NAME_VICE_FOUNDER;
+		}
+
+		if (!empty($uniacid)) {
+			$role = pdo_getcolumn('uni_account_users', array('uid' => $uid, 'uniacid' => $uniacid), 'role');
+			if ($role == ACCOUNT_MANAGE_NAME_OWNER) {
+				$role = ACCOUNT_MANAGE_NAME_OWNER;
+			} elseif ($role == ACCOUNT_MANAGE_NAME_VICE_FOUNDER) {
+				$role = ACCOUNT_MANAGE_NAME_VICE_FOUNDER;
+			} elseif ($role == ACCOUNT_MANAGE_NAME_MANAGER) {
+				$role = ACCOUNT_MANAGE_NAME_MANAGER;
+			} elseif ($role == ACCOUNT_MANAGE_NAME_OPERATOR) {
+				$role = ACCOUNT_MANAGE_NAME_OPERATOR;
+			} elseif ($role == ACCOUNT_MANAGE_NAME_CLERK) {
+				$role = ACCOUNT_MANAGE_NAME_CLERK;
+			}
+		} else {
+			$roles = pdo_getall('uni_account_users', array('uid' => $uid), array('role'), 'role');
+			$roles = array_keys($roles);
+			if (in_array(ACCOUNT_MANAGE_NAME_VICE_FOUNDER, $roles)) {
+				$role = ACCOUNT_MANAGE_NAME_VICE_FOUNDER;
+			} elseif (in_array(ACCOUNT_MANAGE_NAME_OWNER, $roles)) {
+				$role = ACCOUNT_MANAGE_NAME_OWNER;
+			} elseif (in_array(ACCOUNT_MANAGE_NAME_MANAGER, $roles)) {
+				$role = ACCOUNT_MANAGE_NAME_MANAGER;
+			} elseif (in_array(ACCOUNT_MANAGE_NAME_OPERATOR, $roles)) {
+				$role = ACCOUNT_MANAGE_NAME_OPERATOR;
+			} elseif (in_array(ACCOUNT_MANAGE_NAME_CLERK, $roles)) {
+				$role = ACCOUNT_MANAGE_NAME_CLERK;
+			}
+		}
+		$role = empty($role) ? ACCOUNT_MANAGE_NAME_OPERATOR : $role;
+		return $role;
+	}
+
+
+	function permission_account_user_permission_exist($uid = 0, $uniacid = 0) {
+		global $_W;
+		load()->model('user');
+		$uid = intval($uid) > 0 ? $uid : $_W['uid'];
+		$uniacid = intval($uniacid) > 0 ? $uniacid : $_W['uniacid'];
+		if (user_is_founder($uid)) {
+			return false;
+		}
+		if (FRAME == 'system') {
+			return true;
+		}
+		$is_exist = pdo_get('users_permission', array('uid' => $uid, 'uniacid' => $uniacid), array('id'));
+		if(empty($is_exist)) {
+			return false;
+		} else {
+			return true;
+		}
+	}
+
+
+	function permission_account_user($type = 'system') {
+		global $_W;
+		$user_permission = pdo_getcolumn('users_permission', array('uid' => $_W['uid'], 'uniacid' => $_W['uniacid'], 'type' => $type), 'permission');
+		if (!empty($user_permission)) {
+			$user_permission = explode('|', $user_permission);
+		} else {
+			$user_permission = array('account*', 'wxapp*');
+		}
+		$permission_append = frames_menu_append();
+		if (!empty($permission_append[$_W['role']])) {
+			$user_permission = array_merge($user_permission, $permission_append[$_W['role']]);
+		}
+		if (empty($_W['role']) && empty($_W['uniacid'])) {
+			$user_permission = array_merge($user_permission, $permission_append['operator']);
+		}
+		return (array)$user_permission;
+	}
+
+
+	function permission_account_user_menu($uid, $uniacid, $type) {
+		$user_menu_permission = array();
+
+		$uid = intval($uid);
+		$uniacid = intval($uniacid);
+		$type = trim($type);
+		if (empty($uid) || empty($uniacid) || empty($type)) {
+			return error(-1, '参数错误!');
+		}
+		$permission_exist = permission_account_user_permission_exist($uid, $uniacid);
+		if (empty($permission_exist)) {
+			return array('all');
+		}
+		if ($type == 'modules') {
+			$user_menu_permission = pdo_fetchall("SELECT * FROM " . tablename('users_permission') . " WHERE uniacid = :uniacid AND uid  = :uid AND type != '" . PERMISSION_ACCOUNT . "' AND type != '" . PERMISSION_WXAPP . "'", array(':uniacid' => $uniacid, ':uid' => $uid), 'type');
+		} else {
+			$module = uni_modules_by_uniacid($uniacid);
+			$module = array_keys($module);
+			if (in_array($type, $module) || in_array($type, array(PERMISSION_ACCOUNT, PERMISSION_WXAPP, PERMISSION_SYSTEM))) {
+				$menu_permission = pdo_getcolumn('users_permission', array('uniacid' => $uniacid, 'uid' => $uid, 'type' => $type), 'permission');
+				if (!empty($menu_permission)) {
+					$user_menu_permission = explode('|', $menu_permission);
+				}
+			}
+		}
+
+		return $user_menu_permission;
+	}
+
+
+	function permission_menu_name() {
+		load()->model('system');
+		$menu_permission = array();
+
+		$menu_list = system_menu_permission_list();
+		$middle_menu = array();
+		$middle_sub_menu = array();
+		if (!empty($menu_list)) {
+			foreach ($menu_list as $nav_id => $section) {
+				foreach ($section['section'] as $section_id => $section) {
+					if (!empty($section['menu'])) {
+						$middle_menu[] = $section['menu'];
+					}
+				}
+			}
+		}
+
+		if (!empty($middle_menu)) {
+			foreach ($middle_menu as $menu) {
+				foreach ($menu as $menu_val) {
+					$menu_permission[] = $menu_val['permission_name'];
+					if (!empty($menu_val['sub_permission'])) {
+						$middle_sub_menu[] = $menu_val['sub_permission'];
+					}
+				}
+			}
+		}
+
+		if (!empty($middle_sub_menu)) {
+			foreach ($middle_sub_menu as $sub_menu) {
+				foreach ($sub_menu as $sub_menu_val) {
+					$menu_permission[] = $sub_menu_val['permission_name'];
+				}
+			}
+		}
+		return $menu_permission;
+	}
+}
+
+if (!function_exists('uni_permission')) {
+function uni_permission($uid = 0, $uniacid = 0) {
+	global $_W;
+	$role = '';
+	$uid = empty($uid) ? $_W['uid'] : intval($uid);
+
+	$founders = explode(',', $_W['config']['setting']['founder']);
+	if (in_array($uid, $founders)) {
+		return ACCOUNT_MANAGE_NAME_FOUNDER;
+	}
+	if (!empty($uniacid)) {
+		$role = pdo_getcolumn('uni_account_users', array('uid' => $uid, 'uniacid' => $uniacid), 'role');
+		if ($role == ACCOUNT_MANAGE_NAME_OWNER) {
+			$role = ACCOUNT_MANAGE_NAME_OWNER;
+		} elseif ($role == ACCOUNT_MANAGE_NAME_MANAGER) {
+			$role = ACCOUNT_MANAGE_NAME_MANAGER;
+		} elseif ($role == ACCOUNT_MANAGE_NAME_OPERATOR) {
+			$role = ACCOUNT_MANAGE_NAME_OPERATOR;
+		}
+	} else {
+		$roles = pdo_getall('uni_account_users', array('uid' => $uid), array('role'), 'role');
+		$roles = array_keys($roles);
+		if (in_array(ACCOUNT_MANAGE_NAME_OWNER, $roles)) {
+			$role = ACCOUNT_MANAGE_NAME_OWNER;
+		} elseif (in_array(ACCOUNT_MANAGE_NAME_MANAGER, $roles)) {
+			$role = ACCOUNT_MANAGE_NAME_MANAGER;
+		} elseif (in_array(ACCOUNT_MANAGE_NAME_OPERATOR, $roles)) {
+			$role = ACCOUNT_MANAGE_NAME_OPERATOR;
+		}
+	}
+	return $role;
+}
+}
+$_W['token'] = token();
+$session = json_decode(base64_decode($_GPC['__session']), true);
+if(is_array($session)) {
+	$user = user_single(array('uid'=>$session['uid']));
+	if(is_array($user) && $session['hash'] == md5($user['password'] . $user['salt'])) {
+		$_W['uid'] = $user['uid'];
+		$_W['username'] = $user['username'];
+		$user['currentvisit'] = $user['lastvisit'];
+		$user['currentip'] = $user['lastip'];
+		$user['lastvisit'] = $session['lastvisit'];
+		$user['lastip'] = $session['lastip'];
+		$_W['user'] = $user;
+		$founders = explode(',', $_W['config']['setting']['founder']);
+		$_W['isfounder'] = in_array($_W['uid'], $founders);
+		unset($founders);
+	} else {
+		isetcookie('__session', false, -100);
+	}
+	unset($user);
+}
+unset($session);
+
+if(!empty($_GPC['__uniacid'])) {
+	$_W['uniacid'] = intval($_GPC['__uniacid']);
+	$_W['uniaccount'] = $_W['account'] = uni_fetch($_W['uniacid']);
+	$_W['acid'] = $_W['account']['acid'];
+	$_W['weid'] = $_W['uniacid'];
+	if(!empty($_W['uid'])) {
+		$_W['role'] = uni_permission($_W['uid'], $_W['uniacid']);
+	}
+}
+$_W['template'] = 'default';
+if(!empty($_W['setting']['basic']['template'])) {
+	$_W['template'] = $_W['setting']['basic']['template'];
+}
+load()->func('compat.biz');

+ 400 - 0
admin/common/common.func.php

xqd
@@ -0,0 +1,400 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+defined('IN_IA') or exit('Access Denied');
+
+function url($segment, $params = array()) {
+
+	list($controller, $action, $do) = explode('/', $segment);
+	$url = './city.php?';
+	if(!empty($controller)) {
+		$url .= "c={$controller}&";
+	}
+	if(!empty($action)) {
+		$url .= "a={$action}&";
+	}
+	if(!empty($do)) {
+		$url .= "do={$do}&";
+		
+	}
+	if(!empty($params)) {
+		$queryString = http_build_query($params, '', '&');
+		$url .= $queryString;
+	}
+	//echo $url;die;
+	return $url;
+
+//	return wurl($segment, $params);
+}
+
+function message($msg, $redirect = '', $type = '') {
+
+	global $_W, $_GPC;
+	if($redirect == 'refresh') {
+		$redirect = $_W['script_name'] . '?' . $_SERVER['QUERY_STRING'];
+	}
+	if($redirect == 'referer') {
+		$redirect = referer();
+	}
+	if($redirect == '') {
+		$type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'info';
+	} else {
+		$type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'success';
+	}
+	if ($_W['isajax'] || !empty($_GET['isajax']) || $type == 'ajax') {
+
+
+		if($type != 'ajax' && !empty($_GPC['target'])) {
+			exit("
+<script type=\"text/javascript\">
+parent.require(['jquery', 'util'], function($, util){
+	var url = ".(!empty($redirect) ? 'parent.location.href' : "''").";
+	var modalobj = util.message('".$msg."', '', '".$type."');
+	if (url) {
+		modalobj.on('hide.bs.modal', function(){\$('.modal').each(function(){if(\$(this).attr('id') != 'modal-message') {\$(this).modal('hide');}});top.location.reload()});
+	}
+});
+</script>");
+		} else {
+			$vars = array();
+			$vars['message'] = $msg;
+			$vars['redirect'] = $redirect;
+			$vars['type'] = $type;
+			exit(json_encode($vars));
+		}
+	}
+	if (empty($msg) && !empty($redirect)) {
+		header('location: '.$redirect);
+	}
+	$label = $type;
+	if($type == 'error') {
+		$label = 'danger';
+	}
+	if($type == 'ajax' || $type == 'sql') {
+		$label = 'warning';
+	}
+	include template('common/message', TEMPLATE_INCLUDEPATH);
+	exit();
+}
+
+
+function checklogin() {
+	global $_W;
+	if (empty($_W['uid'])) {
+		$url = url('user/login');
+		header('location:' . $url);
+	} else {
+		$account = pdo_fetch("SELECT * FROM " . tablename("zhtc_account") . " WHERE status=2 AND uid=:uid ORDER BY id DESC LIMIT 1", array(':uid' => $_W['uid']));
+		if (empty($account)) {
+			$url = url('user/login');
+			header('location:' . $url);
+
+		}
+	}
+	return true;
+}
+
+
+function checkaccount() {
+	global $_W;
+	if (empty($_W['uniacid'])) {
+		message('这项功能需要你选择特定公众号才能使用!', url('account/display'), 'info');
+	}
+}
+
+function url_params($url) {
+	$result = array();
+	if (empty($url)) {
+		return $result;
+	}
+	$components = parse_url($url);
+	$params = explode('&',$components['query']);
+	foreach ($params as $param) {
+		if (!empty($param)) {
+			$param_array = explode('=',$param);
+			$result[$param_array[0]] = $param_array[1];
+		}
+	}
+	return $result;
+}
+
+function buildframes($frame = array('platform')){
+	global $_W, $_GPC;
+	if($_W['role'] == 'clerk') {
+		return false;
+	}
+	$GLOBALS['top_nav'] = pdo_fetchall('SELECT name, title, append_title FROM ' . tablename('core_menu') . ' WHERE pid = 0 AND is_display = 1 ORDER BY displayorder DESC');
+	$ms = cache_load('system_frame');
+	if(empty($ms)) {
+		cache_build_frame_menu();
+		$ms = cache_load('system_frame');
+	}
+	load()->model('module');
+	$frames = array();
+	$modules = uni_modules(false);
+	$modules_temp = array_keys($modules);
+	$status = uni_user_permission_exist();
+	if(is_error($status)) {
+		$modules_temp = pdo_fetchall('SELECT type FROM ' . tablename('users_permission') . ' WHERE uniacid = :uniacid AND uid = :uid AND type != :type', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['uid'], ':type' => 'system'), 'type');
+		if(!empty($modules_temp)) {
+			$modules_temp = array_keys($modules_temp);
+		} else {
+			$modules = array();
+		}
+	}
+	if(!empty($modules)) {
+		$sysmods = system_modules();
+		foreach($modules as $m) {
+			if (empty($m['isdisplay'])) {
+				continue;
+			}
+			if(in_array($m['name'], $sysmods)) {
+				$_W['setting']['permurls']['modules'][] = $m['name'];
+				continue;
+			}
+			if(in_array($m['name'], $modules_temp)) {
+				if($m['enabled']) {
+					$frames[$m['type']][] = $m;
+				}
+				$_W['setting']['permurls']['modules'][] = $m['name'];
+			}
+		}
+	}
+	if(is_error($status)) {
+		$system = array();
+		$system = uni_user_permission('system');
+		if (!empty($system) || !empty($modules_temp)) {
+						foreach ($ms as $name => $section) {
+				$hassection = false;
+				foreach ($section as $i => $menus) {
+					$hasitems = false;
+					if(empty($menus['items'])) continue;
+					foreach ($menus['items'] as $j => $menu) {
+						if (!in_array($menu['permission_name'], $system)) {
+							unset($ms[$name][$i]['items'][$j]);
+						} else {
+							$hasitems = true;
+							$hassection = true;
+						}
+					}
+					if (!$hasitems) {
+						unset($ms[$name][$i]);
+					}
+				}
+				if (!$hassection) {
+					unset($ms[$name]);
+				} else {
+					$_W['setting']['permurls']['sections'][] = $name;
+				}
+			}
+		}
+	}
+	$types = module_types();
+	if(!empty($frames)) {
+		foreach($frames as $type => $fs) {
+			$items = array();
+			if(!empty($fs)) {
+				foreach($fs as $m) {
+					$items[] = array(
+						'title' => $m['title'],
+						'url' => url('home/welcome/ext', array('m' => $m['name']))
+					);
+				}
+			}
+			$ms['ext'][] = array(
+				'title' => $types[$type]['title'],
+				'items' => $items
+			);
+		}
+		if(is_error($status)) {
+			$_W['setting']['permurls']['sections'][] = 'ext';
+		}
+	}
+	$GLOBALS['ext_type'] = 0;
+	$m = trim($_GPC['m']);
+	$eid = intval($_GPC['eid']);
+	if(FRAME == 'ext' && (!empty($m) || !empty($eid)) && $GLOBALS['ext_type'] != 2) {
+		if(empty($_COOKIE['ext_type'])) {
+			setcookie('ext_type', 1, TIMESTAMP + 8640000, "/");
+			$_COOKIE['ext_type'] = 1;
+		}
+		$GLOBALS['ext_type'] = $_COOKIE['ext_type'];
+		if(empty($m)) {
+			$m = pdo_fetchcolumn('SELECT module FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
+		}
+		$module = module_fetch($m);
+		$entries = module_entries($m);
+		if(is_error($status)) {
+			$permission = uni_user_permission($m);
+			if($permission[0] != 'all') {
+				if(!in_array($m.'_rule', $permission)) {
+					unset($module['isrulefields']);
+				}
+				if(!in_array($m.'_settings', $permission)) {
+					unset($module['settings']);
+				}
+				if(!in_array($m.'_home', $permission)) {
+					unset($entries['home']);
+				}
+				if(!in_array($m.'_profile', $permission)) {
+					unset($entries['profile']);
+				}
+				if(!in_array($m.'_shortcut', $permission)) {
+					unset($entries['shortcut']);
+				}
+				if(!empty($entries['cover'])) {
+					foreach($entries['cover'] as $k => $row) {
+						if(!in_array($m.'_cover_'.$row['do'], $permission)) {
+							unset($entries['cover'][$k]);
+						}
+					}
+				}
+				if(!empty($entries['menu'])) {
+					foreach($entries['menu'] as $k => $row) {
+						if(!in_array($m.'_menu_'.$row['do'], $permission)) {
+							unset($entries['menu'][$k]);
+						}
+					}
+				}
+			}
+		}
+		$entries_filter = array_elements(array('cover', 'menu', 'mine'), $entries);
+		$navs = array(
+			array(
+				'title' => "模块列表",
+				'items' => array(
+					array(
+						'title' => "<i class='fa fa-reply-all'></i> &nbsp;&nbsp;返回模块列表",
+						'url' => url('home/welcome/ext', array('a' => 0)),
+					),
+					array(
+						'title' => "<i class='fa fa-reply-all'></i> &nbsp;&nbsp;返回{$module['title']}",
+						'url' => url('home/welcome/ext', array('m' => $m, 't' => 1)),
+					),
+				),
+			),
+		);
+		if($module['isrulefields'] || $module['settings']) {
+			$navs['rule'] = array(
+				'title' => "回复规则",
+			);
+			if($module['isrulefields']) {
+				$navs['rule']['items'][] = array(
+					'title' => "<i class='fa fa-comments'></i> &nbsp;&nbsp;回复规则列表",
+					'url' => url('platform/reply', array('m' => $m)),
+				);
+			}
+			if($module['settings']) {
+				$navs['rule']['items'][] = array(
+					'title' => "<i class='fa fa-cog'></i> &nbsp;&nbsp;参数设置",
+					'url' => url('profile/module/setting', array('m' => $m)),
+				);
+			}
+		}
+		if($entries['home'] || $entries['profile'] || $entries['shortcut']) {
+			$navs['nav'] = array(
+				'title' => "导航菜单",
+			);
+			if($entries['home']) {
+				$navs['nav']['items'][] = array(
+					'title' => "<i class='fa fa-home'></i> &nbsp;&nbsp;微站首页导航",
+					'url' => url('site/nav/home', array('m' => $m)),
+				);
+			}
+			if($entries['profile']) {
+				$navs['nav']['items'][] = array(
+					'title' => "<i class='fa fa-user'></i> &nbsp;&nbsp;个人中心导航",
+					'url' => url('site/nav/profile', array('m' => $m)),
+				);
+			}
+			if($entries['shortcut']) {
+				$navs['nav']['items'][] = array(
+					'title' => "<i class='fa fa-plane'></i> &nbsp;&nbsp;快捷菜单",
+					'url' => url('site/nav/shortcut', array('m' => $m)),
+				);
+			}
+		}
+		$menus = array(
+			'menu' => "业务菜单",
+			'cover' => "封面入口",
+			'mine' => "自定义菜单",
+		);
+
+		foreach($entries_filter as $key => $row) {
+			if(empty($row)) continue;
+			if(!isset($navs[$key])) {
+
+				$navs[$key] = array(
+					'title' => $menus[$key],
+				);
+			}
+			foreach($row as $li) {
+				$navs[$key]['items'][] = array(
+					'title' => "<i class='{$li["icon"]}'></i> &nbsp;&nbsp;{$li['title']}",
+					'url' => $li['url']
+				);
+			}
+		}
+	}
+	if($GLOBALS['ext_type'] == 1) {
+		$ms['ext'] = $navs;
+	} elseif($GLOBALS['ext_type'] == 3) {
+		$ms['ext'] = array_merge($navs, $ms['ext']);
+	}
+	return $ms;
+}
+
+function system_modules() {
+	return array(
+		'basic', 'news', 'music', 'userapi', 'recharge', 
+		'custom', 'images', 'video', 'voice', 'chats', 'wxcard', 'paycenter'
+	);
+}
+
+
+function filter_url($params) {
+	global $_W;
+	if(empty($params)) {
+		return '';
+	}
+	$query_arr = array();
+	$parse = parse_url($_W['siteurl']);
+	if(!empty($parse['query'])) {
+		$query = $parse['query'];
+		parse_str($query, $query_arr);
+	}
+	$params = explode(',', $params);
+	foreach($params as $val) {
+		if(!empty($val)) {
+			$data = explode(':', $val);
+			$query_arr[$data[0]] = trim($data[1]);
+		}
+	}
+	$query_arr['page'] = 1;
+	$query = http_build_query($query_arr);
+	return './index.php?' . $query;
+}
+
+
+function site_profile_perfect_tips(){
+	global $_W;
+	
+	if ($_W['isfounder'] && (empty($_W['setting']['site']) || empty($_W['setting']['site']['profile_perfect']))) {
+		if (!defined('SITE_PROFILE_PERFECT_TIPS')) {
+			$url = url('cloud/profile');
+			return <<<EOF
+$(function() {
+	var html = 
+		'<div id="siteinfo-tips" class="upgrade-tips">'+
+			'<a href="{$url}" target="_blank">请尽快完善您在微擎云服务平台的站点注册信息。</a>'+
+		'</div>';
+	$('body').prepend(html);
+});
+EOF;
+			define('SITE_PROFILE_PERFECT_TIPS', true);
+		}
+	}
+	return '';
+}

+ 93 - 0
admin/common/template.func.php

xqd
@@ -0,0 +1,93 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+defined('IN_IA') or exit('Access Denied');
+
+
+function template($filename, $flag = TEMPLATE_DISPLAY)
+{
+    global $_W;
+
+    $source = IA_ROOT . "/addons/zh_tcwq/admin/themes/default/{$filename}.html";
+    $compile = IA_ROOT . "/data/tpl/web/zh_tcwq/default/{$filename}.tpl.php";
+
+    if (!is_file($source)) {
+        exit("Error: template source '{$filename}' is not exist!");
+    }
+    if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
+        template_compile($source, $compile);
+    }
+    switch ($flag) {
+        case TEMPLATE_DISPLAY:
+        default:
+            extract($GLOBALS, EXTR_SKIP);
+            include $compile;
+            break;
+        case TEMPLATE_FETCH:
+            extract($GLOBALS, EXTR_SKIP);
+            ob_flush();
+            ob_clean();
+            ob_start();
+            include $compile;
+            $contents = ob_get_contents();
+            ob_clean();
+            return $contents;
+            break;
+        case TEMPLATE_INCLUDEPATH:
+            return $compile;
+            break;
+    }
+}
+
+
+function template_compile($from, $to, $inmodule = false)
+{
+    $path = dirname($to);
+    if (!is_dir($path)) {
+        load()->func('file');
+        mkdirs($path);
+    }
+    $content = template_parse(file_get_contents($from), $inmodule);
+    if (IMS_FAMILY == 'x' && !preg_match('/(footer|header|account\/welcome|login|register)+/', $from)) {
+        $content = str_replace('餐饮', '系统', $content);
+    }
+    file_put_contents($to, $content);
+}
+
+
+function template_parse($str, $inmodule = false)
+{
+    $str = preg_replace('/<!--{(.+?)}-->/s', '{$1}', $str);
+    $str = preg_replace('/{template\s+(.+?)}/', '<?php (!empty($this) && $this instanceof WeModuleSite || ' . intval($inmodule) . ') ? (include $this->template($1, TEMPLATE_INCLUDEPATH)) : (include template($1, TEMPLATE_INCLUDEPATH));?>', $str);
+    $str = preg_replace('/{php\s+(.+?)}/', '<?php $1?>', $str);
+    $str = preg_replace('/{if\s+(.+?)}/', '<?php if($1) { ?>', $str);
+    $str = preg_replace('/{else}/', '<?php } else { ?>', $str);
+    $str = preg_replace('/{else ?if\s+(.+?)}/', '<?php } else if($1) { ?>', $str);
+    $str = preg_replace('/{\/if}/', '<?php } ?>', $str);
+    $str = preg_replace('/{loop\s+(\S+)\s+(\S+)}/', '<?php if(is_array($1)) { foreach($1 as $2) { ?>', $str);
+    $str = preg_replace('/{loop\s+(\S+)\s+(\S+)\s+(\S+)}/', '<?php if(is_array($1)) { foreach($1 as $2 => $3) { ?>', $str);
+    $str = preg_replace('/{\/loop}/', '<?php } } ?>', $str);
+    $str = preg_replace('/{(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)}/', '<?php echo $1;?>', $str);
+    $str = preg_replace('/{(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff\[\]\'\"\$]*)}/', '<?php echo $1;?>', $str);
+    $str = preg_replace('/{url\s+(\S+)}/', '<?php echo url($1);?>', $str);
+    $str = preg_replace('/{url\s+(\S+)\s+(array\(.+?\))}/', '<?php echo url($1, $2);?>', $str);
+    $str = preg_replace('/{media\s+(\S+)}/', '<?php echo tomedia($1);?>', $str);
+    $str = preg_replace_callback('/<\?php([^\?]+)\?>/s', "template_addquote", $str);
+    $str = preg_replace('/{([A-Z_\x7f-\xff][A-Z0-9_\x7f-\xff]*)}/s', '<?php echo $1;?>', $str);
+    $str = str_replace('{##', '{', $str);
+    $str = str_replace('##}', '}', $str);
+    if (!empty($GLOBALS['_W']['setting']['remote']['type'])) {
+        $str = str_replace('</body>', "<script>$(function(){\$('img').attr('onerror', '').on('error', function(){if (!\$(this).data('check-src') && (this.src.indexOf('http://') > -1 || this.src.indexOf('https://') > -1)) {this.src = this.src.indexOf('{$GLOBALS['_W']['attachurl_local']}') == -1 ? this.src.replace('{$GLOBALS['_W']['attachurl_remote']}', '{$GLOBALS['_W']['attachurl_local']}') : this.src.replace('{$GLOBALS['_W']['attachurl_local']}', '{$GLOBALS['_W']['attachurl_remote']}');\$(this).data('check-src', true);}});});</script></body>", $str);
+    }
+    $str = "<?php defined('IN_IA') or exit('Access Denied');?>" . $str;
+    return $str;
+}
+
+function template_addquote($matchs)
+{
+    $code = "<?php {$matchs[1]}?>";
+    $code = preg_replace('/\[([a-zA-Z0-9_\-\.\x7f-\xff]+)\](?![a-zA-Z0-9_\-\.\x7f-\xff\[\]]*[\'"])/s', "['$1']", $code);
+    return str_replace('\\\"', '\"', $code);
+}

+ 163 - 0
admin/index.php

xqd
@@ -0,0 +1,163 @@
+<?php
+
+define('IN_SYS', true);
+define('IN_tcwq_ADMIN', true);
+require '../../../framework/bootstrap.inc.php';
+//require IA_ROOT . '/web/common/bootstrap.sys.inc.php';
+
+define('tcwq_ROOT', dirname(dirname(__FILE__)));
+define('IS_OPERATOR', true);
+require tcwq_ROOT . '/admin/common/bootstrap.sys.inc.php';
+require tcwq_ROOT . '/admin/common/template.func.php';
+require tcwq_ROOT . '/admin/common/common.func.php';
+$urls = parse_url($_W['siteroot']);
+$arr = explode('/', $urls['path']);
+do {
+	$val = array_pop($arr);
+} while ($val != 'addons');
+$path = implode('/', $arr);
+if(substr($path, -1) != '/') {
+	$path .= '/';
+}
+$urls['path'] = $path;
+$_W['siteroot'] = $urls['scheme'].'://'.$urls['host'].((!empty($urls['port']) && $urls['port']!='80') ? ':'.$urls['port'] : '').$urls['path'];
+
+//load()->web('common');
+//load()->web('template');
+
+if (empty($_W['isfounder']) && !empty($_W['user']) && $_W['user']['status'] == 1) {
+	message('您的账号正在审核或是已经被系统禁止,请联系网站管理员解决!');
+}
+$acl = array(
+	'user' => array(
+		'default' => 'login',
+		'direct' => array(
+			'login',
+			'register',
+			'logout',
+		),
+	),
+);
+if (($_W['setting']['copyright']['status'] == 1) && empty($_W['isfounder']) && $controller != 'cloud' && $controller != 'utility' && $controller != 'account') {
+	$_W['siteclose'] = true;
+	if ($controller == 'account' && $action == 'welcome') {
+		template('account/welcome');
+		exit;
+	}
+	if ($controller == 'user' && $action == 'login') {
+		if (checksubmit()) {
+			require _forward($controller, $action);
+		}
+		template('user/login');
+		exit;
+	}
+	isetcookie('__session', '', -10000);
+	message('站点已关闭,关闭原因:' . $_W['setting']['copyright']['reason'], url('account/welcome'), 'info');
+}
+
+$controllers = array();
+$handle = opendir(IA_ROOT . '/web/source/');
+if(!empty($handle)) {
+	while($dir = readdir($handle)) {
+		if($dir != '.' && $dir != '..') {
+			$controllers[] = $dir;
+		}
+	}
+}
+if(!in_array($controller, $controllers)) {
+	$controller = 'account';
+}
+$init = IA_ROOT . "/web/source/{$controller}/__init.php";
+if(is_file($init)) {
+	require $init;
+}
+
+$actions = array();
+$handle = opendir(IA_ROOT . '/web/source/' . $controller);
+if(!empty($handle)) {
+	while($dir = readdir($handle)) {
+		if($dir != '.' && $dir != '..' && strexists($dir, '.ctrl.php')) {
+			$dir = str_replace('.ctrl.php', '', $dir);
+			$actions[] = $dir;
+		}
+	}
+}
+if(empty($actions)) {
+	header('location: ?refresh');
+}
+if(!in_array($action, $actions)) {
+	$action = $acl[$controller]['default'];
+}
+if(!in_array($action, $actions)) {
+	$action = $actions[0];
+}
+
+$_W['page'] = array();
+$_W['page']['copyright'] = $_W['setting']['copyright'];
+
+if(is_array($acl[$controller]['direct']) && in_array($action, $acl[$controller]['direct'])) {
+		require _forward($controller, $action);
+	exit;
+}
+if(is_array($acl[$controller]['founder']) && in_array($action, $acl[$controller]['founder'])) {
+		if(!$_W['isfounder']) {
+		message('不能访问, 需要创始人权限才能访问.');
+	}
+}
+checklogin();
+if(!defined('IN_GW')) {
+//	checkaccount();
+	if(!in_array($_W['role'], array('manager', 'operator', 'founder', 'clerk'))) {
+//		message('您的账号没有访问此公众号的权限.');
+	}
+}
+require _forward($controller, $action);
+
+define('ENDTIME', microtime());
+if (empty($_W['config']['setting']['maxtimeurl'])) {
+	$_W['config']['setting']['maxtimeurl'] = 10;
+}
+if ((ENDTIME - STARTTIME) > $_W['config']['setting']['maxtimeurl']) {
+	$data = array(
+		'type' => '1',
+		'runtime' => ENDTIME - STARTTIME,
+		'runurl' => $_W['sitescheme'].$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
+		'createtime' => TIMESTAMP
+	);
+	pdo_insert('core_performance', $data);
+}
+
+function _forward($c, $a) {
+	$file = tcwq_ROOT . '/admin/source/' . $c . '/' . $a . '.ctrl.php';
+	return $file;
+}
+
+function _calc_current_frames(&$frames) {
+	global $controller, $action;
+	if(!empty($frames) && is_array($frames)) {
+		foreach($frames as &$frame) {
+			if(empty($frame['items'])) continue;
+			foreach($frame['items'] as &$fr) {
+				$query = parse_url($fr['url'], PHP_URL_QUERY);
+				parse_str($query, $urls);
+				if(empty($urls)) continue;
+				if(defined('ACTIVE_FRAME_URL')) {
+					$query = parse_url(ACTIVE_FRAME_URL, PHP_URL_QUERY);
+					parse_str($query, $get);
+				} else {
+					$get = $_GET;
+					$get['c'] = $controller;
+					$get['a'] = $action;
+				}
+				if(!empty($do)) {
+					$get['do'] = $do;
+				}
+
+				$diff = array_diff_assoc($urls, $get);
+				if(empty($diff)) {
+					$fr['active'] = ' active';
+				}
+			}
+		}
+	}
+}

+ 101 - 0
admin/source/site/entry.ctrl.php

xqd
@@ -0,0 +1,101 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+defined('IN_IA') or exit('Access Denied');
+load()->model('module');
+load()->model('extension');
+
+$eid = intval($_GPC['eid']);
+//echo $eid;die;
+if(!empty($eid)) {
+	$entry = module_entry($eid);
+} else {
+	$sql = 'SELECT * FROM ' . tablename('modules_bindings') . ' WHERE module = :module AND do = :do';
+	$entry = pdo_fetch($sql, array(':module' => trim($_GPC['m']), ':do' => trim($_GPC['do'])));
+	if (empty($entry)) {
+		$entry = array(
+			'module' => $_GPC['m'],
+			'do' => $_GPC['do'],
+			'state' => $_GPC['state'],
+			'direct' => $_GPC['direct']
+		);
+	}
+}
+if(empty($entry) || empty($entry['do'])) {
+	message('非法访问.');
+}
+
+if(!$entry['direct']) {
+	checklogin();
+	load()->model('module');
+	$module = module_fetch($entry['module']);
+	
+	if(empty($module)) {
+		message("访问非法, 没有操作权限. (module: {$entry['module']})");
+	}
+		// if($entry['entry'] == 'menu') {
+	// 	if (IMS_VERSION <= '1.5.3') {
+	// 		$permission = uni_user_module_permission_check($entry['module'] . '_menu_' . $entry['do'], $entry['module']);
+	// 	} else {
+	// 		$permission = permission_check_account_user_module($entry['module'] . '_menu_' . $entry['do'], $entry['module']);
+	// 	}
+	// } else {
+	// 	if (IMS_VERSION <= '1.5.3') {
+	// 		$permission = uni_user_module_permission_check($entry['module'] . '_rule', $entry['module']);
+	// 	} else {
+	// 		$permission = permission_check_account_user_module($entry['module'] . '_rule', $entry['module']);
+	// 	}
+	// }
+if ($entry['entry'] == 'menu') {
+		$permission = permission_check_account_user_module($entry['module'] . '_menu_' . $entry['do'], $entry['module']);
+	} else {
+		$permission = permission_check_account_user_module($entry['module'] . '_rule', $entry['module']);
+	}
+	if(!$permission) {
+		message('您没有权限进行该操作');
+	}
+	define('FRAME', 'ext');
+	define('CRUMBS_NAV', 1);
+	$ptr_title = $entry['title'];
+	$module_types = module_types();
+	if($_COOKIE['ext_type'] == 1) {
+		define('ACTIVE_FRAME_URL', url('site/entry/', array('eid' => $entry['eid'])));
+	} else {
+		define('ACTIVE_FRAME_URL', url('home/welcome/ext', array('m' => $entry['module'])));
+	}
+	//$frames = buildframes(array(FRAME));
+	$frames = $frames[FRAME];
+}
+
+if(!empty($entry['module']) && !empty($_W['founder'])) {
+	load()->model('extension');
+	if(ext_module_checkupdate($entry['module'])) {
+		message('系统检测到该模块有更新,请点击“<a href="' . url('extension/module/upgrade', array('m' => $entry['module'])) . '">更新模块</a>”后继续使用!', '', 'error');
+	}
+}
+
+$_GPC['__entry'] = $entry['title'];
+$_GPC['__state'] = $entry['state'];
+$_GPC['state'] = $entry['state'];
+$_GPC['m'] = $entry['module'];
+$_GPC['do'] = $entry['do'];
+
+if(!empty($_W['modules'][$entry['module']]['handles']) && (count($_W['modules'][$entry['module']]['handles']) > 1 || !in_array('text', $_W['modules'][$entry['module']]['handles']))) {
+	$handlestips = true;
+}
+$modules = uni_modules();
+$_W['current_module'] = $modules[$entry['module']];
+$site = WeUtility::createModuleSite($entry['module']);
+define('IN_MODULE', $entry['module']);
+if(!is_error($site)) {
+	$sysmodule = system_modules();
+	if(in_array($m, $sysmodule)) {
+		$site_urls = $site->getTabUrls();
+	}
+	$method = 'doWeb' . ucfirst($entry['do']);
+	exit($site->$method());
+}
+  
+exit("访问的方法 {$method} 不存在.");

+ 125 - 0
admin/source/user/login.ctrl.php

xqd
@@ -0,0 +1,125 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+defined('IN_IA') or exit('Access Denied');
+define('IN_GW', true);
+
+if(checksubmit() || $_W['isajax']) {
+	_login($_GPC['referer']);
+}
+
+$setting = $_W['setting'];
+template('user/login');
+function _login($forward = '') {
+	global $_GPC, $_W;
+	load()->model('user');
+	$member = array();
+	$username = trim($_GPC['username']);
+//	pdo_query('DELETE FROM'.tablename('users_failed_login'). ' WHERE lastupdate < :timestamp', array(':timestamp' => TIMESTAMP-300));
+//	$failed = pdo_get('users_failed_login', array('username' => $username, 'ip' => CLIENT_IP));
+//	if ($failed['count'] >= 5) {
+//		message('输入密码错误次数超过5次,请在5分钟后再登录',referer(), 'info');
+//	}
+//	$verify = trim($_GPC['verify']);
+//	if(empty($verify)) {
+//		message('请输入验证码');
+//	}
+//	$result = checkcaptcha($verify);
+//	if (empty($result)) {
+//		message('输入验证码错误');
+//	}
+	if(empty($username)) {
+		message('请输入要登录的用户名');
+	}
+	$member['username'] = $username;
+	$member['password'] = $_GPC['password'];
+	if(empty($member['password'])) {
+		message('请输入密码');
+	}
+	$record = user_single($member);
+	//$record = __user_single($username, $_GPC['password']);
+	
+	if(!empty($record)) {
+		if($record['status'] == 1) {
+			message('您的账号正在审核或是已经被系统禁止,请联系网站管理员解决!');
+		}
+
+		$account = pdo_fetch("SELECT * FROM " . tablename("zhtc_account") . " WHERE status=2 AND uid=:uid ORDER BY id DESC LIMIT 1", array(':uid' => $record['uid']));
+		if (!empty($account) && ($account['role']==1 or $account['role']==3)) {
+			$cityname = $account['cityname'];
+			$account_id = $account['uid'];
+			$_W['uniacid'] = $account['weid'];
+		} else {
+			message('您的账号正在审核或是已经被系统禁止或是无权限登入,请联系网站管理员解决!!!');
+		}
+
+		$founders = explode(',', $_W['config']['setting']['founder']);
+		$_W['isfounder'] = in_array($record['uid'], $founders);
+		if (empty($_W['isfounder'])) {
+			if (!empty($record['endtime']) && $record['endtime'] < TIMESTAMP) {
+				message('您的账号有效期限已过,请联系网站管理员解决!');
+			}
+		}
+		if (!empty($_W['siteclose']) && empty($_W['isfounder'])) {
+			message('站点已关闭,关闭原因:' . $_W['setting']['copyright']['reason']);
+		}
+		$cookie = array();
+		$cookie['uid'] = $record['uid'];
+		$cookie['lastvisit'] = $record['lastvisit'];
+		$cookie['lastip'] = $record['lastip'];
+		$cookie['hash'] = md5($record['password'] . $record['salt']);
+		$session = base64_encode(json_encode($cookie));
+		isetcookie('__session', $session, !empty($_GPC['rember']) ? 7 * 86400 : 0, true);
+		$status = array();
+		$status['uid'] = $record['uid'];
+		$status['lastvisit'] = TIMESTAMP;
+		$status['lastip'] = CLIENT_IP;
+		user_update($status);
+
+		$role = uni_permission($record['uid'], $_W['uniacid']);
+		isetcookie('__uniacid', $_W['uniacid'], 7 * 86400);
+		isetcookie('__uid', $record['uid'], 7 * 86400);
+
+		if($_W['role'] == 'clerk' || $role == 'clerk') {
+//				message('登陆成功', url('activity/desk', array('uniacid' => $record['uniacid'])), 'success');
+//			message("欢迎回来!,{$record['username']}!", url('site/entry/stores', array('m' => 'wpdc', 'storeid' => $storeid, 'do' => 'start')), 'success');
+		}
+
+//		if(empty($forward)) {
+//			$forward = $_GPC['forward'];
+//		}
+//		if(empty($forward)) {
+//			$forward = './index.php?c=account&a=display';
+//		}
+//		if ($record['uid'] != $_GPC['__uid']) {
+//			isetcookie('__uniacid', '', -7 * 86400);
+//			isetcookie('__uid', '', -7 * 86400);
+//		}
+//		pdo_delete('users_failed_login', array('id' => $failed['id']));
+//		message("欢迎回来,{$record['username']}。", $forward);
+
+		$data = array(
+			'lastvisit' => TIMESTAMP,
+			'lastip' => CLIENT_IP,
+		);
+		if($account['role']==1){
+			$do='start';
+		}
+		if($account['role']==3){
+			$do='sjstatistics';
+		}
+		pdo_update("zhtc_account", $data, array('id' => $record['id']));
+		//echo url('site/entry/stores', array('m' => 'zh_tcwq', 'city' => $cityname, 'do' => 'start'));die;
+		message("欢迎回来,{$record['username']}!", url('site/entry/stores', array('m' => 'zh_tcwq', 'city' => $cityname, 'account_id'=>$account_id,'do' =>$do)), 'success');
+	} else {
+		if (empty($failed)) {
+			pdo_insert('users_failed_login', array('ip' => CLIENT_IP, 'username' => $username, 'count' => '1', 'lastupdate' => TIMESTAMP));
+		} else {
+			pdo_update('users_failed_login', array('count' => $failed['count'] + 1, 'lastupdate' => TIMESTAMP), array('id' => $failed['id']));
+		}
+		message('登录失败,请检查您输入的用户名和密码!');
+	}
+}
+

+ 12 - 0
admin/source/user/logout.ctrl.php

xqd
@@ -0,0 +1,12 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+defined('IN_IA') or exit('Access Denied');
+isetcookie('__session', '', -10000);
+$forward = $_GPC['forward'];
+if(empty($forward)) {
+	$forward = './?refersh';
+}
+header('Location:' . url('user/login'));

+ 7 - 0
admin/source/utility/__init.php

xqd
@@ -0,0 +1,7 @@
+<?php
+/**
+ * [WeEngine System] Copyright (c) 2014 WE7.CC
+ * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
+ */
+
+define('IN_GW', true);

+ 8 - 0
admin/themes/default/common/footer-base.html

xqd
@@ -0,0 +1,8 @@
+	<script type="text/javascript">
+		require(['bootstrap']);
+		$('.js-clip').each(function(){
+			util.clip(this, $(this).attr('data-url'));
+		});
+	</script>
+</body>
+</html>

+ 33 - 0
admin/themes/default/common/footer-cms.html

xqd
@@ -0,0 +1,33 @@
+		</div>
+		<script type="text/javascript">
+			require(['bootstrap']);
+			{if $_W['uid']}
+				function checknotice() {
+					$.post("{php echo url('utility/notice')}", {}, function(data){
+						var data = $.parseJSON(data);
+						$('#notice-container').html(data.notices);
+						$('#notice-total').html(data.total);
+						if(data.total > 0) {
+							$('#notice-total').css('background', '#ff9900');
+						} else {
+							$('#notice-total').css('background', '');
+						}
+						setTimeout(checknotice, 60000);
+					});
+				}
+				checknotice();
+			{/if}
+		</script>
+		<div class="container-fluid footer" role="footer">
+			<div class="page-header"></div>
+			<span class="pull-left">
+				<p>{if empty($_W['setting']['copyright']['footerleft'])}Powered by <a href="http://www.xxx.cc"><b>餐饮</b></a> v{IMS_VERSION} &copy; 2014-2015 <a href="http://www.xxx.cc">www.we7.cc</a>{else}{$_W['setting']['copyright']['footerleft']}{/if}{if !empty($_W['setting']['copyright']['statcode'])}{$_W['setting']['copyright']['statcode']}{/if}</p>
+			</span>
+			<span class="pull-right">
+				<p>{if empty($_W['setting']['copyright']['footerright'])}<a href="http://www.xxx.cc">关于餐饮2
+				</a>&nbsp;&nbsp;<a href="http://bbs.we7.cc">餐饮论坛</a>&nbsp;&nbsp;<a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODAwMzEzOV8xNzEwOTZfNDAwMDgyODUwMl8yXw">联系客服</a>{else}{$_W['setting']['copyright']['footerright']}{/if}</p>
+			</span>
+		</div>
+		{if !empty($_W['setting']['copyright']['statcode'])}{$_W['setting']['copyright']['statcode']}{/if}
+	</body>
+</html>

+ 54 - 0
admin/themes/default/common/footer-gw.html

xqd
@@ -0,0 +1,54 @@
+			</div>
+		</div>
+		<script type="text/javascript">
+			require(['bootstrap']);
+			{if $_W['isfounder'] && !defined('IN_MESSAGE')}
+			function checkupgrade() {
+				require(['util'], function(util) {
+					if (util.cookie.get('checkupgrade_sys')) {
+						return;
+					}
+					$.getJSON("{url 'utility/checkupgrade/system'}", function(ret){
+						if (ret && ret.message && ret.message.upgrade == '1') {
+							$('body').prepend('<div id="upgrade-tips" class="upgrade-tips"><a href="./index.php?c=cloud&a=upgrade&">系统检测到新版本 '+ret.message.version+' ('+ ret.message.release +') ,请尽快更新!</a><span class="tips-close" style="background:#d03e14;" onclick="checkupgrade_hide();"><i class="fa fa-times-circle"></i></span></div>');
+							if ($('#upgrade-tips-module').size()) {
+								$('#upgrade-tips').css('top', '25px');
+							}
+						}
+					});
+				});
+			}
+
+			function checkupgrade_hide() {
+				require(['util'], function(util) {
+					util.cookie.set('checkupgrade_sys', 1, 3600);
+					$('#upgrade-tips').hide();
+				});
+			}
+			$(function(){
+				checkupgrade();
+			});
+			{/if}
+
+			{if $_W['uid']}
+				function checknotice() {
+					$.post("{php echo url('utility/notice')}", {}, function(data){
+						var data = $.parseJSON(data);
+						$('#notice-container').html(data.notices);
+						$('#notice-total').html(data.total);
+						if(data.total > 0) {
+							$('#notice-total').css('background', '#ff9900');
+						} else {
+							$('#notice-total').css('background', '');
+						}
+						setTimeout(checknotice, 60000);
+					});
+				}
+				checknotice();
+			{/if}
+		</script>
+	</div>
+			{if !empty($_W['setting']['copyright']['statcode'])}{$_W['setting']['copyright']['statcode']}{/if}
+
+</body>
+</html>

+ 48 - 0
admin/themes/default/common/footer.html

xqd
@@ -0,0 +1,48 @@
+			</div>
+		</div>
+	</div>
+	<script>
+		function subscribe(){
+			$.post("{url 'utility/subscribe'}", function(){
+				setTimeout(subscribe, 5000);
+			});
+		}
+		function sync() {
+			$.post("{url 'utility/sync'}", function(){
+				setTimeout(sync, 60000);
+			});
+		}
+		$(function(){
+			subscribe();
+			sync();
+		});
+		{if $_W['uid']}
+			function checknotice() {
+				$.post("{php echo url('utility/notice')}", {}, function(data){
+					var data = $.parseJSON(data);
+					$('#notice-container').html(data.notices);
+					$('#notice-total').html(data.total);
+					if(data.total > 0) {
+						$('#notice-total').css('background', '#ff9900');
+					} else {
+						$('#notice-total').css('background', '');
+					}
+					setTimeout(checknotice, 60000);
+				});
+			}
+			checknotice();
+		{/if}
+
+		{if defined('IN_MODULE')}
+		$.getJSON("{url 'utility/checkupgrade/module' array('m' => IN_MODULE)}", function(result) {
+			if (result.message.errno == -10) {
+				$('body').prepend('<div id="upgrade-tips-module" class="upgrade-tips"><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODAwMzEzOV8xNzEwOTZfNDAwMDgyODUwMl8yXw" target="_blank">' + result.message.message + '</a></div>');
+				if ($('#upgrade-tips').size()) {
+					$('#upgrade-tips-module').css('top', '25px');
+				}
+			}
+		});
+		{/if}
+		{php echo site_profile_perfect_tips();}
+	</script>
+{template 'common/footer-base'}

+ 46 - 0
admin/themes/default/common/header-base.html

xqd
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="zh-cn">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+	<title>商户后台</title>
+	<meta name="keywords" content="{if empty($_W['page']['copyright']['keywords'])}{else}{$_W['page']['copyright']['keywords']}{/if}" />
+	<meta name="description" content="{if empty($_W['page']['copyright']['description'])}{else}{$_W['page']['copyright']['description']}{/if}" />
+	<link rel="shortcut icon" href="{$_W['siteroot']}{$_W['config']['upload']['attachdir']}/{if !empty($_W['setting']['copyright']['icon'])}{$_W['setting']['copyright']['icon']}{else}images/global/wechat.jpg{/if}" />
+	<link href="{$_W['siteroot']}/web/resource/css/bootstrap.min.css" rel="stylesheet">
+	<link href="{$_W['siteroot']}/web/resource/css/font-awesome.min.css" rel="stylesheet">
+	<link href="{$_W['siteroot']}/web/resource/css/common.css" rel="stylesheet">
+
+	<script type="text/javascript">
+	if(navigator.appName == 'Microsoft Internet Explorer'){
+		if(navigator.userAgent.indexOf("MSIE 5.0")>0 || navigator.userAgent.indexOf("MSIE 6.0")>0 || navigator.userAgent.indexOf("MSIE 7.0")>0) {
+			alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
+		}
+	}
+	window.sysinfo = {
+		{if !empty($_W['uniacid'])}'uniacid': '{$_W['uniacid']}',{/if}
+		{if !empty($_W['acid'])}'acid': '{$_W['acid']}',{/if}
+		{if !empty($_W['openid'])}'openid': '{$_W['openid']}',{/if}
+		{if !empty($_W['uid'])}'uid': '{$_W['uid']}',{/if}
+		'siteroot': '{$_W['siteroot']}',
+		'siteurl': '{$_W['siteurl']}',
+		'attachurl': '{$_W['attachurl']}',
+		'attachurl_local': '{$_W['attachurl_local']}',
+		'attachurl_remote': '{$_W['attachurl_remote']}',
+		{if defined('MODULE_URL')}'MODULE_URL': '{MODULE_URL}',{/if}
+		'cookie' : {'pre': '{$_W['config']['cookie']['pre']}'},
+		'account' : {php echo json_encode($_W['account'])}
+	};
+	</script>
+	<script>var require = { urlArgs: 'v=20161011' };</script>
+	<script type="text/javascript" src="{$_W['siteroot']}/web/resource/js/lib/jquery-1.11.1.min.js"></script>
+	<script type="text/javascript" src="{$_W['siteroot']}/web/resource/js/app/util.js?v=20161011"></script>
+	<script type="text/javascript" src="{$_W['siteroot']}/web/resource/js/app/common.min.js?v=20161011"></script>
+	<script type="text/javascript" src="{$_W['siteroot']}/web/resource/js/require.js?v=20161011"></script>
+	<script type="text/javascript" src="{$_W['siteroot']}/web/resource/js/app/config.js?v=20161011"></script>
+
+</head>
+ <!-- <body style="background-color: #eee;background-image: url(https://15595755.kf5.com/attachments/download/4309568/0015a1d0ec49a7c0e90666d5e8f1f82/);"> -->
+ <body style="background-color: #eee;background-image: url(../addons/zh_tcwq/template/images/seller_login_bg.jpg);"> 
+ <!-- <body style="background-color: #1ABC9C;"> -->

+ 136 - 0
admin/themes/default/common/header-cms.html

xqd
@@ -0,0 +1,136 @@
+{template 'common/header-base'}
+	{if !empty($_W['uid'])}
+		{if !empty($_W['uniacid'])}
+			<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">
+				<div class="container-fluid">
+					<!-- <ul class="nav navbar-nav">
+						<li><a href="./?refresh"><i class="fa fa-reply-all"></i>返回系统</a></li>
+						{php global $top_nav;}
+						{loop $top_nav $nav}
+							{if !empty($_W['isfounder']) || empty($_W['setting']['permurls']['sections']) || in_array($nav['name'], $_W['setting']['permurls']['sections'])}<li{if FRAME == $nav['name']} class="active"{/if}><a href="{php echo url('home/welcome/' . $nav['name']);}"><i class="{$nav['append_title']}"></i>{$nav['title']}</a></li>{/if}
+						{/loop}
+						<li {if $action == 'emulator'}class="active"{/if}>
+							<a href="{php echo url('utility/emulator');}" target="_blank"><i class="fa fa-mobile"></i> 模拟测试</a>
+						</li>
+						{if IMS_FAMILY != 'x'}
+						<li><a href="http://bbs.we7.cc"><i class="fa fa-comment"></i>餐饮论坛</a></li>
+						<li><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODAwMzEzOV8xNzEwOTZfNDAwMDgyODUwMl8yXw"><i class="fa fa-suitcase"></i>联系客服</a></li>
+						{/if}
+					</ul> -->
+					<ul class="nav navbar-nav navbar-right">
+						<li class="dropdown topbar-notice">
+							<a type="button" data-toggle="dropdown">
+								<i class="fa fa-bell"></i>
+								<span class="badge" id="notice-total">0</span>
+							</a>
+							<div class="dropdown-menu" aria-labelledby="dLabel">
+								<div class="topbar-notice-panel">
+									<div class="topbar-notice-arrow"></div>
+									<div class="topbar-notice-head">
+										<span>系统公告</span>
+										<a href="{php echo url('article/notice-show/list');}" class="pull-right">更多公告>></a>
+									</div>
+									<div class="topbar-notice-body">
+										<ul id="notice-container"></ul>
+									</div>
+								</div>
+							</div>
+						</li>
+						<li class="dropdown">
+							<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-group"></i>{$_W['account']['name']} <b class="caret"></b></a>
+							<ul class="dropdown-menu">
+								{if $_W['role'] != 'operator'}
+								<li><a href="{url 'account/post' array('uniacid' => $_W['uniacid'])}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 编辑当前账号资料</a></li>
+								{/if}
+								<li><a href="{url 'account/display'}" target="_blank"><i class="fa fa-cogs fa-fw"></i> 管理其它公众号</a></li>
+								<li><a href="{url 'utility/emulator'}" target="_blank"><i class="fa fa-mobile fa-fw"></i> 模拟测试</a></li>
+							</ul>
+						</li>
+						<li class="dropdown">
+							<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-user"></i>{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if}) <b class="caret"></b></a>
+							<ul class="dropdown-menu">
+								<li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 我的账号</a></li>
+								{if $_W['role'] == 'founder'}
+								<li class="divider"></li>
+								<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-sitemap fa-fw"></i> 系统选项</a></li>
+								<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-cloud-download fa-fw"></i> 自动更新</a></li>
+								<li><a href="{url 'system/updatecache'}" target="_blank"><i class="fa fa-refresh fa-fw"></i> 更新缓存</a></li>
+								<li class="divider"></li>
+								{/if}
+								<li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
+							</ul>
+						</li>
+					</ul>
+				</div>
+			</div>
+		{else}
+			<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="z-index:1001;">
+				<div class="container-fluid">
+					<!-- <ul class="nav navbar-nav">
+						<li class="active"><a href="./?refresh"><i class="fa fa-cogs"></i>系统管理</a></li>
+						<li><a href="{url 'account/display'}" target="_blank"><i class="fa fa-share"></i>管理公众号</a></li>
+						{if IMS_FAMILY != 'x'}
+						<li><a href="http://bbs.we7.cc"><i class="fa fa-comment"></i>餐饮论坛</a></li>
+						<li><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODAwMzEzOV8xNzEwOTZfNDAwMDgyODUwMl8yXw"><i class="fa fa-suitcase"></i>联系客服</a></li>
+						{/if}
+					</ul> -->
+					<ul class="nav navbar-nav navbar-right">
+						<li class="dropdown">
+							<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-user"></i>{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if}) <b class="caret"></b></a>
+							<ul class="dropdown-menu">
+								<li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 我的账号</a></li>
+								{if $_W['role'] != 'operator'}
+								<li class="divider"></li>
+								<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-sitemap fa-fw"></i> 系统选项</a></li>
+								<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-cloud-download fa-fw"></i> 自动更新</a></li>
+								<li><a href="{url 'system/updatecache'}" target="_blank"><i class="fa fa-refresh fa-fw"></i> 更新缓存</a></li>
+								<li class="divider"></li>
+								{/if}
+								<li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
+							</ul>
+						</li>
+					</ul>
+				</div>
+			</div>
+		{/if}
+	{else}
+		<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="z-index:1001;">
+			<div class="container-fluid container">
+				<ul class="nav navbar-nav navbar-right">
+					<li class="active"><a href="{php echo url('user/register');}"><i class="fa fa-user"></i>注册</a></li>
+					<li><a href="{php echo url('user/login');}"><i class="fa fa-user-plus"></i>登陆</a></li>
+				</ul>
+			</div>
+		</div>
+	{/if}
+
+	<div class="container-fluid">
+		{if defined('IN_MESSAGE')}
+			<div class="jumbotron clearfix alert alert-{$label}">
+				<div class="row">
+					<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2">
+						<i class="fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i>
+					</div>
+					<div class="col-xs-12 col-sm-8 col-md-9 col-lg-10">
+						{if is_array($msg)}
+							<h2>MYSQL 错误:</h2>
+							<p>{php echo cutstr($msg['sql'], 300, 1);}</p>
+							<p><b>{$msg['error'][0]} {$msg['error'][1]}:</b>{$msg['error'][2]}</p>
+						{else}
+						<h2>{$caption}</h2>
+						<p>{$msg}</p>
+						{/if}
+						{if $redirect}
+						<p><a href="{$redirect}" class="alert-link">如果你的浏览器没有自动跳转,请点击此链接</a></p>
+						<script type="text/javascript">
+							setTimeout(function () {
+								 location.href = "{$redirect}";
+							}, 3000);
+						</script>
+						{else}
+							<p>[<a href="javascript:history.go(-1);" class="alert-link">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh" class="alert-link">首页</a>]</p>
+						{/if}
+					</div>
+				</div>
+			</div>
+		{/if}

+ 147 - 0
admin/themes/default/common/header-gw.html

xqd
@@ -0,0 +1,147 @@
+{template 'common/header-base'}
+<style type="text/css">
+	.xiaoren{width: 67px;height: 97px;position: fixed;right: 20%;bottom: 10%;z-index: 10;}
+	.xiaoren>img{width: 67px;height: 97px;}
+	.ygcheck{
+		margin-top: 15px;
+		display: inline-block;
+		width:100px;
+		height: 100px;
+	}
+	.jumbotron{background-color: rgba(0,0,0,0);border:none;}
+	.alert-success .alert-link,.alert-success{color: white;}
+</style>
+<div class="gw-container">
+	<!-- {if !empty($_W['uniacid']) && !defined('IN_MESSAGE')}
+	<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="z-index:1001; margin-bottom:0;">
+		<div class="container-fluid">
+			<ul class="nav navbar-nav">
+				<li class="active"><a href="./?refresh"><i class="fa fa-cogs"></i>系统管理</a></li>
+				<li><a href="{url 'home/welcome/platform'}" target="_blank"><i class="fa fa-share"></i>继续管理公众号({$_W['account']['name']})</a></li>
+				{if IMS_FAMILY != 'x'}
+				<li><a href="http://bbs.we7.cc"><i class="fa fa-comment"></i>餐饮论坛</a></li>
+				<li><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODAwMzEzOV8xNzEwOTZfNDAwMDgyODUwMl8yXw"><i class="fa fa-suitcase"></i>联系客服</a></li>
+				{/if}
+			</ul>
+			<ul class="nav navbar-nav navbar-right">
+				<li class="dropdown topbar-notice">
+					<a type="button" data-toggle="dropdown">
+						<i class="fa fa-bell"></i>
+						<span class="badge" id="notice-total">0</span>
+					</a>
+					<div class="dropdown-menu" aria-labelledby="dLabel">
+						<div class="topbar-notice-panel">
+							<div class="topbar-notice-arrow"></div>
+							<div class="topbar-notice-head">
+								<span>系统公告</span>
+								<a href="{php echo url('article/notice-show/list');}" class="pull-right">更多公告>></a>
+							</div>
+							<div class="topbar-notice-body">
+								<ul id="notice-container"></ul>
+							</div>
+						</div>
+					</div>
+				</li>
+				<li class="dropdown">
+					<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"  style="display:block; max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-group"></i>{$_W['account']['name']} <b class="caret"></b></a>
+					<ul class="dropdown-menu">
+						{if $_W['role'] != 'operator'}
+						<li><a href="{url 'account/post' array('uniacid' => $_W['uniacid'])}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 编辑当前账号资料</a></li>
+						{/if}
+						<li><a href="{url 'account/display'}" target="_blank"><i class="fa fa-cogs fa-fw"></i> 管理其它公众号</a></li>
+						<li><a href="{url 'utility/emulator'}" target="_blank"><i class="fa fa-mobile fa-fw"></i> 模拟测试</a></li>
+					</ul>
+				</li>
+				<li class="dropdown">
+					<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-user"></i>{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if}) <b class="caret"></b></a>
+					<ul class="dropdown-menu">
+						<li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 我的账号</a></li>
+						{if $_W['role'] == 'founder'}
+						<li class="divider"></li>
+						<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-sitemap fa-fw"></i> 系统选项</a></li>
+						<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-cloud-download fa-fw"></i> 自动更新</a></li>
+						<li><a href="{url 'system/updatecache'}" target="_blank"><i class="fa fa-refresh fa-fw"></i> 更新缓存</a></li>
+						<li class="divider"></li>
+						{/if}
+						<li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
+					</ul>
+				</li>
+			</ul>
+		</div>
+	</div>
+	{/if}
+	 -->
+	<div class="navbar navbar-static-top" role="navigation" style="padding-top:20px;">
+		<div class="container-fluid">
+			<!-- <a class="navbar-brand" href="./?refresh" {if !empty($_W['setting']['copyright']['blogo'])}style="background:url('{php echo tomedia($_W['setting']['copyright']['blogo']);}') no-repeat;"{/if}></a>
+			<ul class="nav navbar-nav pull-right" style="padding-top:10px;">
+				<a href="{url 'account/display'}" class="tile img-rounded{if $controller == 'account'} active{/if}">
+					<i class="fa fa-comments"></i>
+					<span>公众号管理</span>
+				</a>
+				<a href="{url 'system/welcome'}" class="tile img-rounded{if $system_activie == 1} active{/if}">
+					<i class="fa fa-sitemap"></i>
+					<span>系统</span>
+				</a>
+				{if $_W['isfounder'] == '1'}
+				{if $flow_master_info['status'] == 4 || IMS_FAMILY == 'v'}
+				<a href="{url 'system/content_provider/account_list'}" class="tile img-rounded{if $system_activie == 2} active{/if}">
+				{else}
+				<a href="{url 'system/content_provider/display'}" class="tile img-rounded{if $system_activie == 2} active{/if}">
+				{/if}
+					<i class="fa fa-sitemap"></i>
+					<span>广告联盟</span>
+				</a>
+				{/if}
+				{if $_W['uid']}
+				<a href="{url 'user/logout'}" class="tile img-rounded">
+					<i class="fa fa-sign-out"></i>
+					<span>退出</span>
+				</a>
+				{/if}
+			</ul> -->
+		</div>
+	</div>
+	
+	<div class="container-fluid">
+		{if defined('IN_MESSAGE')}
+		<div>
+		<!-- wi text-success wi-right-sign -->
+			<div class="jumbotron clearfix alert alert-{$label}">
+				<div class="row">
+					<div class="col-md-2 col-md-push-3">
+						<!-- <i class="ygcheck fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i> -->
+						<img src="../addons/zh_tcwq/template/images/duigoubai.png" class="ygcheck"/>
+					</div>
+					<div class="col-md-5 col-md-push-2">
+						{if is_array($msg)}
+							<h2>MYSQL 错误:</h2>
+							<p>{php echo cutstr($msg['sql'], 300, 1);}</p>
+							<p><b>{$msg['error'][0]} {$msg['error'][1]}:</b>{$msg['error'][2]}</p>
+						{else}
+						<h2>{$caption}</h2>
+						<p>{$msg}</p>
+						{/if}
+						{if $redirect}
+						<p><a href="{$redirect}" class="alert-link">如果你的浏览器没有自动跳转,请点击此链接</a></p>
+						<div class="xiaoren"><img src="../addons/zh_tcwq/template/images/stick.gif"></div>
+						<script type="text/javascript">
+							setTimeout(function () {
+								location.href = "{$redirect}";
+							}, 3000);
+						</script>
+						{else}
+							<p>[<a href="javascript:history.go(-1);" class="alert-link">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh" class="alert-link">首页</a>]</p>
+							<div class="xiaoren"><img src="../addons/zh_tcwq/template/images/stick.gif"></div>
+						{/if}
+					</div>
+				</div>
+			</div>
+		{else}
+		<div class="well">
+		{/if}
+<script>
+	var h = document.documentElement.clientHeight;
+	$(".gw-container").css('min-height',h);
+	{php echo site_profile_perfect_tips();}
+</script>

+ 219 - 0
admin/themes/default/common/header.html

xqd
@@ -0,0 +1,219 @@
+{template 'common/header-base'}
+<style>
+.navbar-inverse{background-color: rgba(0,0,0,0);border:none;}
+</style>
+	{if $_W['role'] != 'clerk'}
+	<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">
+		<div class="container-fluid">
+			 <ul class="nav navbar-nav">
+							<!-- <li><a href="./?refresh"><i class="fa fa-reply-all"></i>返回系统</a></li> -->
+						<!-- 	{php global $top_nav;}
+						{loop $top_nav $nav}
+							{if !empty($_W['isfounder']) || empty($_W['setting']['permurls']['sections']) || in_array($nav['name'], $_W['setting']['permurls']['sections'])}<li{if FRAME == $nav['name']} class="active"{/if}><a href="{php echo url('home/welcome/' . $nav['name']);}"><i class="{$nav['append_title']}"></i>{$nav['title']}</a></li>{/if}
+						{/loop}
+						<li {if $action == 'emulator'}class="active"{/if}>
+							<a href="{php echo url('utility/emulator');}" target="_blank"><i class="fa fa-mobile"></i> 模拟测试</a>
+						</li> -->
+						</ul>  
+			<ul class="nav navbar-nav navbar-right">
+				<!-- <li class="dropdown topbar-notice">
+					<a type="button" data-toggle="dropdown">
+						<i class="fa fa-bell"></i>
+						<span class="badge" id="notice-total">0</span>
+					</a>
+					<div class="dropdown-menu" aria-labelledby="dLabel">
+						<div class="topbar-notice-panel">
+							<div class="topbar-notice-arrow"></div>
+							 <div class="topbar-notice-head">
+								<span>系统公告</span>
+								<a href="{php echo url('article/notice-show/list');}" class="pull-right">更多公告>></a>
+							</div>
+							<div class="topbar-notice-body">
+								<ul id="notice-container"></ul>
+							</div> 
+						</div>
+					</div>
+				</li> -->
+				<!-- <li class="dropdown">
+					<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-group"></i>{$_W['account']['name']} <b class="caret"></b></a>
+				 <ul class="dropdown-menu">
+						{if $_W['role'] != 'operator'}
+						<li><a href="{url 'account/post' array('uniacid' => $_W['uniacid'])}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 编辑当前账号资料</a></li>
+						{/if}
+						<li><a href="{url 'account/display'}" target="_blank"><i class="fa fa-cogs fa-fw"></i> 管理其它公众号</a></li>
+						<li><a href="{url 'utility/emulator'}" target="_blank"><i class="fa fa-mobile fa-fw"></i> 模拟测试</a></li>
+					</ul> 
+				</li> -->
+				<!-- <li class="dropdown">
+				<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-user"></i>{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if}) <b class="caret"></b></a>
+				<ul class="dropdown-menu">
+					<li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 我的账号</a></li>
+					{if $_W['role'] == 'founder'}
+					<li class="divider"></li>
+					<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-sitemap fa-fw"></i> 系统选项</a></li>
+					<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-cloud-download fa-fw"></i> 自动更新</a></li>
+					<li><a href="{url 'system/updatecache'}" target="_blank"><i class="fa fa-refresh fa-fw"></i> 更新缓存</a></li>
+					<li class="divider"></li>
+					{/if}
+					<li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
+				</ul>
+							</li>  -->
+			</ul>
+		</div>
+	</div>
+	{if empty($_COOKIE['check_setmeal']) && !empty($_W['account']['endtime']) && ($_W['account']['endtime'] - TIMESTAMP < (6*86400))}
+		<div class="upgrade-tips" id="setmeal-tips">
+			<a href="{php echo url('user/edit', array('uid' => $_W['account']['uid']));}" target="_blank">
+				您的服务有效期限:{php echo date('Y-m-d', $_W['account']['starttime']);} ~ {php echo date('Y-m-d', $_W['account']['endtime']);}.
+				{if $_W['account']['endtime'] < TIMESTAMP}
+				目前已到期,请联系管理员续费
+				{else}
+				将在{php echo floor(($_W['account']['endtime'] - strtotime(date('Y-m-d')))/86400);}天后到期,请及时付费
+				{/if}
+			</a><span class="tips-close" style="background:#d03e14;" onclick="check_setmeal_hide();"><i class="fa fa-times-circle"></i></span>
+		</div>
+		<script>
+			function check_setmeal_hide() {
+				util.cookie.set('check_setmeal', 1, 1800);
+				$('#setmeal-tips').hide();
+				return false;
+			}
+		</script>
+	{/if}
+	{else}
+		<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">
+			<div class="container-fluid">
+				<ul class="nav navbar-nav">
+					<li><a href="{url 'activity/desk/index'}"><i class="fa fa-desktop"></i> 工作台首页</a></li>
+					<li><a href="javascript:;" class="login-qrcode"><i class="fa fa-qrcode"></i> 手机登录</a></li>
+					{if IMS_FAMILY != 'x'}
+						<li><a href="http://bbs.we7.cc"><i class="fa fa-comment"></i>餐饮论坛</a></li>
+						<li><a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODAwMzEzOV8xNzEwOTZfNDAwMDgyODUwMl8yXw"><i class="fa fa-suitcase"></i>联系客服</a></li>
+					{/if}
+				</ul>
+				<ul class="nav navbar-nav navbar-right">
+					<li><a href="javascript:;"><i class="fa fa-user"></i> {$_W['user']['name']} - {$_W['user']['store_name']}</a></li>
+					<li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 账号信息</a></li>
+					<li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
+				</ul>
+			</div>
+		</div>
+	{/if}
+	<div class="container-fluid">
+		{if defined('IN_MESSAGE')}
+		<div class="jumbotron clearfix alert alert-{$label}">
+			<div class="row">
+				<div class="col-xs-12 col-sm-3 col-lg-2">
+					<i class="fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i>
+				</div>
+				<div class="col-xs-12 col-sm-8 col-md-9 col-lg-10">
+					{if is_array($msg)}
+						<h2>MYSQL 错误:</h2>
+						<p>{php echo cutstr($msg['sql'], 300, 1);}</p>
+						<p><b>{$msg['error'][0]} {$msg['error'][1]}:</b>{$msg['error'][2]}</p>
+					{else}
+					<h2>{$caption}</h2>
+					<p>{$msg}</p>
+					{/if}
+					{if $redirect}
+					
+					<p><a href="{$redirect}">如果你的浏览器没有自动跳转,请点击此链接</a></p>
+					<script type="text/javascript">
+						setTimeout(function () {
+						/*	location.href = "{$redirect}";*/
+						}, 3000);
+					</script>
+					{else}
+						<p>[<a href="javascript:history.go(-1);">点击这里返回上一页</a>] &nbsp; <!-- [<a href="./?refresh">首页</a>] --></p>
+					{/if}
+				</div>
+		{else}
+		<div class="row">
+			{php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; _calc_current_frames($frames);}
+			{if !empty($frames)}
+				<div class="col-xs-12 col-sm-3 col-lg-2 big-menu">
+					<div id="search-menu">
+						<input class="form-control input-lg" style="border-radius:0; font-size:14px; height:43px;" type="text" placeholder="输入菜单名称可快速查找">
+					</div>
+					{if $GLOBALS['ext_type'] > 0}
+						<div class="btn-group">
+							<button class="btn {if $GLOBALS['ext_type'] == 1}btn-primary{else}btn-default{/if} ext-type" data-id="1">默认</button>
+							<button class="btn {if $GLOBALS['ext_type'] == 2}btn-primary{else}btn-default{/if} ext-type" data-id="2">系统</button>
+							<button class="btn {if $GLOBALS['ext_type'] == 3}btn-primary{else}btn-default{/if} ext-type" data-id="3">复合</button>
+						</div>
+					{/if}
+					{loop $frames $k $frame}
+					<div class="panel panel-default">
+						<div class="panel-heading">
+							<h4 class="panel-title">{$frame['title']}</h4>
+							<a class="panel-collapse collapsed" data-toggle="collapse" href="#frame-{$k}">
+								<i class="fa fa-chevron-circle-down"></i>
+							</a>
+						</div>
+						<ul class="list-group collapse in" id="frame-{$k}">
+							{loop $frame['items'] $link}
+							{if empty($link['is_permission'])}
+								{if !empty($link['append'])}
+								<li class="list-group-item{$link['active']}" onclick="window.location.href = '{$link['url']}';" style="cursor:pointer; overflow:hidden;" kw="{$link['title']}">
+									<a class="pull-right" href="{$link['append']['url']}">{$link['append']['title']}</a>
+									{$link['title']}
+								</li>
+								{else}
+								<a class="list-group-item{$link['active']}" href="{$link['url']}" kw="{$link['title']}">{$link['title']}</a>
+								{/if}
+							{/if}
+							{/loop}
+						</ul>
+					</div>
+					{/loop}
+					<script type="text/javascript">
+						require(['bootstrap'], function(){
+							$('.ext-type').click(function(){
+								var id = $(this).data('id');
+								util.cookie.del('ext_type');
+								util.cookie.set('ext_type', id, 8640000);
+								location.reload();
+								return false;
+							});
+
+							$('#search-menu input').keyup(function() {
+								var a = $(this).val();
+								$('.big-menu .list-group-item, .big-menu .panel-heading').hide();
+								$('.big-menu .list-group-item').each(function() {
+									$(this).css('border-left', '0');
+									if(a.length > 0 && $(this).attr('kw').indexOf(a) >= 0) {
+										$(this).parents(".panel").find('.panel-heading').show();
+										$(this).show().css('border-left', '3px #428bca double');
+									}
+								});
+								if(a.length == 0) {
+									$('.big-menu .list-group-item, .big-menu .panel-heading').show();
+								}
+							});
+						});
+					</script>
+				</div>
+				<div class="col-xs-12 col-sm-9 col-lg-10">
+					{if CRUMBS_NAV == 1}
+						{php global $module_types;global $module;global $ptr_title;}
+						<ol class="breadcrumb" style="padding:5px 0;">
+							<li><a href="{url 'home/welcome/ext'}"><i class="fa fa-cogs"></i> &nbsp; 扩展功能</a></li>
+							<li><a href="{url 'home/welcome/ext' array('m' => $module['name'])}">{$module_types[$module['type']]['title']}模块 - {$module['title']}</a></li>
+							<li class="active">{$ptr_title}</li>
+						</ol>
+					{elseif CRUMBS_NAV == 2}
+						{php global $module_types;global $module;global $ptr_title; global $site_urls; $m = $_GPC['m'];}
+						<ul class="nav nav-tabs">
+							<li><a href="{url 'platform/reply' array('m' => $m)}">管理{$module['title']}</a></li>
+							<li><a href="{url 'platform/reply/post' array('m' => $m)}"><i class="fa fa-plus"></i> 添加{$module['title']}</a></li>
+							{if !empty($site_urls)}
+								{loop $site_urls $site_url}
+									<li {if $_GPC['do'] == $site_url['do']} class="active"{/if}><a href="{$site_url['url']}"> {$site_url['title']}</a></li>
+								{/loop}
+							{/if}
+						</ul>
+					{/if}
+			{else}
+				<div class="col-xs-12 col-sm-12 col-lg-12">
+			{/if}
+		{/if}

+ 8 - 0
admin/themes/default/common/message.html

xqd
@@ -0,0 +1,8 @@
+{php define('IN_MESSAGE', true)}
+{if defined('IN_GW')}
+{template 'common/header-gw'}
+{template 'common/footer-gw'}
+{else}
+{template 'common/header'}
+{template 'common/footer'}
+{/if}

+ 227 - 0
admin/themes/default/user/login.html

xqd
@@ -0,0 +1,227 @@
+{template 'common/header-base'}
+<style>
+	@media screen and (max-width:767px){.login_wrap .panel.panel-default{width:90%; min-width:300px;}}
+	@media screen and (min-width:768px){.login_wrap .panel.panel-default{width:70%;}}
+	@media screen and (min-width:1200px){.login_wrap .panel.panel-default{width:50%;}}
+	body {
+		/*padding-top: 120px;
+		padding-bottom: 40px;*/
+		background-color: #27282d;
+	}
+
+/*———————————————第一个卡通样式———————————————*/
+.footer{
+    background:none !important;
+    color:#666;
+    position: fixed;
+    bottom: 0;
+    z-index: -100;
+    opacity: 1;
+    width: 100%;
+}
+.login_wrap{
+	width: 518px;
+	margin-left: 350px;
+}	
+.sellback{
+	width: 900px;
+	height: 440px;
+	background-color: white;
+	margin: 250px auto 0px;
+	background:url(../addons/zh_tcwq/template/images/container_bg0.png) no-repeat;
+}
+.warp_content{ width:270px; margin:0 auto; padding-top:20px;}
+.warp_content .title{ margin-top:38px; padding-left:40px;}
+.warp_content .title h3{ font-size:30px; color:#7f6f67; line-height:32px;}
+.warp_content .title span{
+	background:url(../addons/zh_tcwq/template/images/txt.png) 0 2px no-repeat;
+	height:12px;
+	display:block;
+	margin-top:5px;
+}
+.formInfo{ margin-top:20px; overflow:hidden;}
+.formInfo .formText{ margin-bottom:12px; position:relative; z-index:2;}
+.formInfo .formText .input-text{
+	border:0; height:40px;
+	padding:6px 28px 6px 42px;
+	width:270px;
+	border-radius:20px;
+	background-color: #f4f4f4;
+}
+.formInfo .formText input:focus{ outline:none;box-shadow:none;}
+.formInfo .formText .checked{ background-position:-109px -12px;}
+.formInfo .formText .login-icon{
+	background: url(../addons/zh_tcwq/template/images/login_icon.png) no-repeat;
+	position: absolute;
+	top: 13px;
+	left: 17px;
+	width: 14px;
+	height: 13px;
+	z-index: 9;
+}
+.formInfo .formText .login-icon-user{ background-position:-5px -8px;}
+.formInfo .formText .login-icon-pwd{ background-position:-3px -38px;}
+.formInfo .focus .login-icon-user{ background-position:-33px -8px;}
+.formInfo .focus .login-icon-pwd{ background-position:-31px -38px;}
+.formInfo .submitDiv{ font-size:0; padding-top:20px;}
+.formInfo .submitDiv .input-yzm{ border:0; height:28px; padding:6px 5px 6px 20px; background:#f4f4f4; border-radius:50px 0 0 50px; width:110px;}
+.formInfo .submitDiv .sub{ width: 135px;height: 40px;border: 0;background: #ff7c3a;color: #FFF;border-radius: 0 50px 50px 0;padding: 0;font-size: 16px;cursor: pointer;font-family: "Microsoft YaHei";}
+.formInfo .submitDiv .qp_sub{ width:100%; border-radius:50px;}
+
+/*———————————————第二个样式—————————————————*/
+.msection{
+	width: 100%;
+	height: 557px;
+	background-color: white;
+	margin-top: 165px;
+	background:url(../addons/zh_tcwq/template/images/u11_state0.png) no-repeat;
+	background-size: 2000px 360px;
+}
+.msecbox{width: 420px;margin: 0px auto;}
+.msecheader{width: 420px;height: 147px;text-align: center;margin-bottom: 20px;}
+.msecheader>img{width: 135px;height: 147px;}
+.mscontent{background-color: white;border-radius: 10px;margin: 0px auto;padding: 1px;width: 420px;height: 400px;}
+.msfutitle,.mstitle{text-align: center;font-family: "微软雅黑";color: #1ABC9C;margin-bottom: 0px;}
+.mstitle{font-size: 28px;margin-top: 35px;font-weight: bold;}
+.msfutitle{font-size: 20px;}
+.msbanner{border:1px solid #C0C0C0;padding: 5px;width: 300px;margin: 35px auto 20px;}
+.msbanner2>span,.msbanner>span{color: #CCCCCC;font-size: 26px;margin-left: 10px;}
+.msbanner2>input,.msbanner>input{width: 215px;height: 40px;margin-left: 10px;outline: none;border:none;}
+.msbanner2{border:1px solid #C0C0C0;padding: 5px;width: 300px;margin: 20px auto;}
+.msbanner3{margin: 0px auto;width: 300px;height: 50px;}
+.msbanner3>input{background-color: #1ABC9C;width: 300px;height: 50px;border:none;border-radius: 4px;color: white;font-size: 18px;}
+:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
+	color: #CCCCCC;
+}
+
+::-moz-placeholder { /* Mozilla Firefox 19+ */
+	color: #CCCCCC;
+}
+
+input:-ms-input-placeholder{
+	color: #CCCCCC;
+}
+
+input::-webkit-input-placeholder{
+	color: #CCCCCC;
+}
+</style>
+<div class="msection">
+	<div class="msecbox">
+		<div class="msecheader">
+			<img src="../addons/zh_tcwq/template/images/u270.png">
+		</div>
+		<form action="" method="post" role="form" id="form1" onsubmit="return formcheck();">
+			<div class="mscontent">
+				<p class="mstitle">站长后台业务管理系统</p>
+				<p class="msfutitle">Business Management System</p>
+				<div class="msbanner">
+					<span class="fa fa-user"></span>
+					<input type="text" name="username" autocomplete="off" placeholder="请输入用户名称">
+				</div>
+				<div class="msbanner2">
+					<span class="fa fa-unlock-alt"></span>
+					<input type="password" name="password" autocomplete="off" name="" placeholder="请输入密码">
+				</div>
+				<div class="msbanner3">
+					<input type="submit" id="submit" name="submit" value="登录" value="登 录" />
+					<input name="token" value="{$_W['token']}" type="hidden" />
+				</div>
+			</div>
+		</form>
+	</div>
+</div>
+
+
+<!-- —————————————第二套——————————— -->
+<!-- <div class="sellback">
+	<div class="login_wrap">
+		<div class="warp_content">
+            <div class="title">
+                <h3>商家管理中心</h3>
+                <span class="txt"></span>
+            </div>
+            <form action="" method="post" role="form" id="form1" onsubmit="return formcheck();">
+                <div class="formInfo">
+                    <div class="formText">
+                        <i class="login-icon login-icon-user"></i>
+                        <input type="text" name="username" autocomplete="off" class="input-text" value="" placeholder="用户名">
+                    </div>
+                    <div class="formText">
+                        <i class="login-icon login-icon-pwd"></i>
+                        <input type="password"   style="display:none"/>
+                        <input type="password" name="password" autocomplete="off" class="input-text" value="" placeholder="密  码">
+                    </div>
+                    <div class="formText submitDiv">
+                        <span class="submit_span">
+                        	<input type="submit" id="submit" name="submit" value="登录" class="sub qp_sub" value="登 录" />
+                        </span>
+                        <input name="token" value="{$_W['token']}" type="hidden" />
+                    </div>
+                </div>
+            </form>
+        </div> -->
+		<!-- <h1 class="text-center">商户管理后台</h1>
+		<form class="form_wrap" action="" method="post" role="form" id="form1" onsubmit="return formcheck();">
+			<div class="input-group input-group-lg">
+				<span class="input-group-addon">账号</span>
+				<input type="text" name="username" class="form-control" placeholder="请输入账号名">
+			</div>
+			<div class="input-group input-group-lg">
+				<span class="input-group-addon">密码</span>
+				<input type="password" name="password" class="form-control" placeholder="请输入密码">
+			</div>
+			<button class="btn btn-lg btn-primary" type="submit" id="submit" name="submit" value="登录" style="background-color: #1ab394;border-color: #1ab394;width:100%;">登录</button>
+			<input name="token" value="{$_W['token']}" type="hidden" />
+		</form> -->
+	<!-- </div>
+</div> -->
+<script>
+	function formcheck() {
+		if($('#remember:checked').length == 1) {
+			cookie.set('remember-username', $(':text[name="username"]').val());
+		} else {
+			cookie.del('remember-username');
+		}
+		return true;
+	}
+	$('#toggle').click(function() {
+		$('#imgverify').prop('src', '{php echo $_W['siteroot'].url("utility/code")}r='+Math.round(new Date().getTime()));
+		return false;
+	});
+//	$('#form1').submit(function() {
+//		var verify = $(':text[name="verify"]').val();
+//		if (verify == '') {
+//			alert('请填写验证码');
+//			return false;
+//		}
+//	});
+</script>
+
+	<div class="container-fluid footer text-center" role="footer">	
+		<div class="friend-link">
+			{if empty($_W['setting']['copyright']['footerright'])}
+				<a href=" ">微信开发</a>
+				<a href="http://s.we7.cc">微信应用</a>
+				<a href="http://bbs.we7.cc">微擎论坛</a>
+				<a href="http://s.we7.cc">联系客服</a>
+			{else}
+				{$_W['setting']['copyright']['footerright']}
+			{/if}
+		</div>
+		<div class="copyright">{if empty($_W['setting']['copyright']['footerleft'])}Powered by <a href="http://www.we7.cc"><b>微擎</b></a> v{IMS_VERSION} &copy; 2014-2015 <a href="http://www.we7.cc">www.we7.cc</a>{else}{$_W['setting']['copyright']['footerleft']}{/if}</div>
+		{if !empty($_W['setting']['copyright']['icp'])}<div>备案号:<a href="http://www.miitbeian.gov.cn" target="_blank">{$_W['setting']['copyright']['icp']}</a></div>{/if}
+	</div>
+	{if !empty($_W['setting']['copyright']['statcode'])}{$_W['setting']['copyright']['statcode']}{/if}
+	{if !empty($_GPC['m']) && !in_array($_GPC['m'], array('keyword', 'special', 'welcome', 'default', 'userapi')) || defined('IN_MODULE')}
+	<script>
+		if(typeof $.fn.tooltip != 'function' || typeof $.fn.tab != 'function' || typeof $.fn.modal != 'function' || typeof $.fn.dropdown != 'function') {
+			require(['bootstrap']);
+		}
+	</script>
+	{/if}
+</body>
+</html>
+
+
+


+ 174 - 0
cert/WxPay.Api.php

xqd
@@ -0,0 +1,174 @@
+<?php
+require_once IA_ROOT . "/addons/zh_tcwq/cert/WxPay.Exception.php";
+require_once IA_ROOT . "/addons/zh_tcwq/cert/WxPay.Data.php";
+
+/**
+ * 
+ * 接口访问类,包含所有微信支付API列表的封装,类中方法为static方法,
+ * 每个接口有默认超时时间(除提交被扫支付为10s,上报超时时间为1s外,其他均为6s)
+ * @author widyhu
+ *
+ */
+class WxPayApi
+{
+	/**
+	 * 
+	 * 查询订单,WxPayOrderQuery中out_trade_no、transaction_id至少填一个
+	 * appid、mchid、spbill_create_ip、nonce_str不需要填入
+	 * @param WxPayOrderQuery $inputObj
+	 * @param int $timeOut
+	 * @throws WxPayException
+	 * @return 成功时返回,其他抛异常
+	 */
+	public static function orderQuery($inputObj, $timeOut = 6,$key)
+	{
+		$url = "https://api.mch.weixin.qq.com/pay/orderquery";
+		//检测必填参数
+		if(!$inputObj->IsOut_trade_noSet() && !$inputObj->IsTransaction_idSet()) {
+			throw new WxPayException("订单查询接口中,out_trade_no、transaction_id至少填一个!");
+		}
+		
+		$inputObj->SetNonce_str(self::getNonceStr());//随机字符串
+		$inputObj->SetSign($key);//签名
+		$xml = $inputObj->ToXml();
+		
+		$startTimeStamp = self::getMillisecond();//请求开始时间
+		$response = self::postXmlCurl($xml, $url, false, $timeOut,'1','2');
+		$result = WxPayResults::Init($response);
+		return $result;
+	}
+	
+	/**
+	 *
+ 	 *退款接口
+ 	 *
+  	 */
+	public static function refund($inputObj, $timeOut = 6,$f1,$f2,$key)
+
+	{
+
+		global $_W,$_GPC;
+
+		$url = "https://api.mch.weixin.qq.com/secapi/pay/refund";
+
+		//检测必填参数
+
+		if(!$inputObj->IsOut_trade_noSet() && !$inputObj->IsTransaction_idSet()) {
+
+			throw new WxPayException("退款申请接口中,out_trade_no、transaction_id至少填一个!");
+
+		}else if(!$inputObj->IsOut_refund_noSet()){
+
+			throw new WxPayException("退款申请接口中,缺少必填参数out_refund_no!");
+
+		}else if(!$inputObj->IsTotal_feeSet()){
+
+			throw new WxPayException("退款申请接口中,缺少必填参数total_fee!");
+
+		}else if(!$inputObj->IsRefund_feeSet()){
+
+			throw new WxPayException("退款申请接口中,缺少必填参数refund_fee!");
+
+		}else if(!$inputObj->IsOp_user_idSet()){
+
+			throw new WxPayException("退款申请接口中,缺少必填参数op_user_id!");
+
+		}
+		$inputObj->SetNonce_str(self::getNonceStr());//随机字符串
+		$inputObj->SetSign($key);//签名
+		$xml = $inputObj->ToXml();
+		$startTimeStamp = self::getMillisecond();//请求开始时间
+		$response = self::postXmlCurl($xml, $url, true, $timeOut,$f1,$f2);
+		$result = WxPayResults::Init($response);
+		return $result;
+	}
+
+	/**
+	 * 
+	 * 产生随机字符串,不长于32位
+	 * @param int $length
+	 * @return 产生的随机字符串
+	 */
+	public static function getNonceStr($length = 32) 
+	{
+		$chars = "abcdefghijklmnopqrstuvwxyz0123456789";  
+		$str ="";
+		for ( $i = 0; $i < $length; $i++ )  {  
+			$str .= substr($chars, mt_rand(0, strlen($chars)-1), 1);  
+		} 
+		return $str;
+	}
+	
+
+
+	/**
+	 * 以post方式提交xml到对应的接口url
+	 * 
+	 * @param string $xml  需要post的xml数据
+	 * @param string $url  url
+	 * @param bool $useCert 是否需要证书,默认不需要
+	 * @param int $second   url执行超时时间,默认30s
+	 * @throws WxPayException
+	 */
+	private static function postXmlCurl($xml, $url, $useCert, $second = 30,$f1,$f2)
+	{
+
+		
+		$ch = curl_init();
+		//设置超时
+		curl_setopt($ch, CURLOPT_TIMEOUT, $second);
+		
+//		//如果有配置代理这里就设置代理
+//		if(WxPayConfig::CURL_PROXY_HOST != "0.0.0.0" 
+//			&& WxPayConfig::CURL_PROXY_PORT != 0){
+//			curl_setopt($ch,CURLOPT_PROXY, WxPayConfig::CURL_PROXY_HOST);
+//			curl_setopt($ch,CURLOPT_PROXYPORT, WxPayConfig::CURL_PROXY_PORT);
+//		}
+		curl_setopt($ch,CURLOPT_URL, $url);
+		curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
+		curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);//严格校验
+		//设置header
+		curl_setopt($ch, CURLOPT_HEADER, FALSE);
+		//要求结果为字符串且输出到屏幕上
+		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
+	
+		if($useCert == true){
+			//设置证书
+			//使用证书:cert 与 key 分别属于两个.pem文件
+			curl_setopt($ch,CURLOPT_SSLCERTTYPE,'PEM');
+			curl_setopt($ch,CURLOPT_SSLCERT, $f1);
+			curl_setopt($ch,CURLOPT_SSLKEYTYPE,'PEM');
+			curl_setopt($ch,CURLOPT_SSLKEY, $f2);
+		}
+		//post提交方式
+		curl_setopt($ch, CURLOPT_POST, TRUE);
+		curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
+		//运行curl
+		$data = curl_exec($ch);
+		//返回结果
+		if($data){
+			curl_close($ch);
+			return $data;
+		} else {
+			$error = curl_errno($ch);
+			curl_close($ch);
+			message("退款失败,CURL出错,错误码:".$error);exit;
+			
+//			throw new WxPayException("curl出错,错误码:$error");
+		}
+	}
+	
+	/**
+	 * 获取毫秒级别的时间戳
+	 */
+	private static function getMillisecond()
+	{
+		//获取毫秒的时间戳
+		$time = explode ( " ", microtime () );
+		$time = $time[1] . ($time[0] * 1000);
+		$time2 = explode( ".", $time );
+		$time = $time2[0];
+		return $time;
+	}
+}
+

+ 703 - 0
cert/WxPay.Data.php

xqd
@@ -0,0 +1,703 @@
+<?php
+/**
+* 2015-06-29 修复签名问题
+**/
+require_once IA_ROOT . "/addons/zh_tcwq/cert/WxPay.Exception.php";
+
+/**
+ * 
+ * 数据对象基础类,该类中定义数据类最基本的行为,包括:
+ * 计算/设置/获取签名、输出xml格式的参数、从xml读取数据对象等
+ * @author widyhu
+ *
+ */
+class WxPayDataBase
+{
+	protected $values = array();
+	
+	/**
+	* 设置签名,详见签名生成算法
+	* @param string $value 
+	**/
+	public function SetSign($key)
+	{
+		$sign = $this->MakeSign($key);
+		$this->values['sign'] = $sign;
+		return $sign;
+	}
+	
+	/**
+	* 获取签名,详见签名生成算法的值
+	* @return 值
+	**/
+	public function GetSign()
+	{
+		return $this->values['sign'];
+	}
+	
+	/**
+	* 判断签名,详见签名生成算法是否存在
+	* @return true 或 false
+	**/
+	public function IsSignSet()
+	{
+		return array_key_exists('sign', $this->values);
+	}
+
+	/**
+	 * 输出xml字符
+	 * @throws WxPayException
+	**/
+	public function ToXml()
+	{
+		if(!is_array($this->values) 
+			|| count($this->values) <= 0)
+		{
+    		throw new WxPayException("数组数据异常!");
+    	}
+    	
+    	$xml = "<xml>";
+    	foreach ($this->values as $key=>$val)
+    	{
+    		if (is_numeric($val)){
+    			$xml.="<".$key.">".$val."</".$key.">";
+    		}else{
+    			$xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
+    		}
+        }
+        $xml.="</xml>";
+        return $xml; 
+	}
+	
+    /**
+     * 将xml转为array
+     * @param string $xml
+     * @throws WxPayException
+     */
+	public function FromXml($xml)
+	{	
+		if(!$xml){
+			throw new WxPayException("xml数据异常!");
+		}
+        //将XML转为array
+        //禁止引用外部xml实体
+        libxml_disable_entity_loader(true);
+        $this->values = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);		
+		return $this->values;
+	}
+	
+	/**
+	 * 格式化参数格式化成url参数
+	 */
+	public function ToUrlParams()
+	{
+		$buff = "";
+		foreach ($this->values as $k => $v)
+		{
+			if($k != "sign" && $v != "" && !is_array($v)){
+				$buff .= $k . "=" . $v . "&";
+			}
+		}
+		
+		$buff = trim($buff, "&");
+		return $buff;
+	}
+	
+	/**
+	 * 生成签名
+	 * @return 签名,本函数不覆盖sign成员变量,如要设置签名需要调用SetSign方法赋值
+	 */
+	public function MakeSign($key)
+	{
+		//签名步骤一:按字典序排序参数
+		ksort($this->values);
+		$string = $this->ToUrlParams();
+		//签名步骤二:在string后加入KEY
+		$string = $string . "&key=".$key;
+		//签名步骤三:MD5加密
+		$string = md5($string);
+		//签名步骤四:所有字符转为大写
+		$result = strtoupper($string);
+		return $result;
+	}
+	
+	/**
+	 * 获取设置的值
+	 */
+	public function GetValues()
+	{
+		return $this->values;
+	}
+}
+/**
+ * 
+ * 订单查询输入对象
+ * @author widyhu
+ *
+ */
+class WxPayOrderQuery extends WxPayDataBase
+{
+	/**
+	* 设置微信分配的公众账号ID
+	* @param string $value 
+	**/
+	public function SetAppid($value)
+	{
+		$this->values['appid'] = $value;
+	}
+	/**
+	* 获取微信分配的公众账号ID的值
+	* @return 值
+	**/
+	public function GetAppid()
+	{
+		return $this->values['appid'];
+	}
+	/**
+	* 判断微信分配的公众账号ID是否存在
+	* @return true 或 false
+	**/
+	public function IsAppidSet()
+	{
+		return array_key_exists('appid', $this->values);
+	}
+
+
+	/**
+	* 设置微信支付分配的商户号
+	* @param string $value 
+	**/
+	public function SetMch_id($value)
+	{
+		$this->values['mch_id'] = $value;
+	}
+	/**
+	* 获取微信支付分配的商户号的值
+	* @return 值
+	**/
+	public function GetMch_id()
+	{
+		return $this->values['mch_id'];
+	}
+	/**
+	* 判断微信支付分配的商户号是否存在
+	* @return true 或 false
+	**/
+	public function IsMch_idSet()
+	{
+		return array_key_exists('mch_id', $this->values);
+	}
+
+
+	/**
+	* 设置微信的订单号,优先使用
+	* @param string $value 
+	**/
+	public function SetTransaction_id($value)
+	{
+		$this->values['transaction_id'] = $value;
+	}
+	/**
+	* 获取微信的订单号,优先使用的值
+	* @return 值
+	**/
+	public function GetTransaction_id()
+	{
+		return $this->values['transaction_id'];
+	}
+	/**
+	* 判断微信的订单号,优先使用是否存在
+	* @return true 或 false
+	**/
+	public function IsTransaction_idSet()
+	{
+		return array_key_exists('transaction_id', $this->values);
+	}
+
+
+	/**
+	* 设置商户系统内部的订单号,当没提供transaction_id时需要传这个。
+	* @param string $value 
+	**/
+	public function SetOut_trade_no($value)
+	{
+		$this->values['out_trade_no'] = $value;
+	}
+	/**
+	* 获取商户系统内部的订单号,当没提供transaction_id时需要传这个。的值
+	* @return 值
+	**/
+	public function GetOut_trade_no()
+	{
+		return $this->values['out_trade_no'];
+	}
+	/**
+	* 判断商户系统内部的订单号,当没提供transaction_id时需要传这个。是否存在
+	* @return true 或 false
+	**/
+	public function IsOut_trade_noSet()
+	{
+		return array_key_exists('out_trade_no', $this->values);
+	}
+
+
+	/**
+	* 设置随机字符串,不长于32位。推荐随机数生成算法
+	* @param string $value 
+	**/
+	public function SetNonce_str($value)
+	{
+		$this->values['nonce_str'] = $value;
+	}
+	/**
+	* 获取随机字符串,不长于32位。推荐随机数生成算法的值
+	* @return 值
+	**/
+	public function GetNonce_str()
+	{
+		return $this->values['nonce_str'];
+	}
+	/**
+	* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
+	* @return true 或 false
+	**/
+	public function IsNonce_strSet()
+	{
+		return array_key_exists('nonce_str', $this->values);
+	}
+}
+/**
+ * 
+ * 接口调用结果类
+ * @author widyhu
+ *
+ */
+class WxPayResults extends WxPayDataBase
+{
+	/**
+	 * 
+	 * 检测签名
+	 */
+	public function CheckSign()
+	{
+		//fix异常
+		if(!$this->IsSignSet()){
+			throw new WxPayException("签名错误1");
+		}
+		
+		$sign = $this->MakeSign();
+		if($this->GetSign() == $sign){
+			return true;
+		}
+		throw new WxPayException("签名错误2");
+	}
+	
+	/**
+	 * 
+	 * 使用数组初始化
+	 * @param array $array
+	 */
+	public function FromArray($array)
+	{
+		$this->values = $array;
+	}
+	
+	/**
+	 * 
+	 * 使用数组初始化对象
+	 * @param array $array
+	 * @param 是否检测签名 $noCheckSign
+	 */
+	public static function InitFromArray($array, $noCheckSign = false)
+	{
+		$obj = new self();
+		$obj->FromArray($array);
+		if($noCheckSign == false){
+		}
+        return $obj;
+	}
+	
+	/**
+	 * 
+	 * 设置参数
+	 * @param string $key
+	 * @param string $value
+	 */
+	public function SetData($key, $value)
+	{
+		$this->values[$key] = $value;
+	}
+	
+    /**
+     * 将xml转为array
+     * @param string $xml
+     * @throws WxPayException
+     */
+	public static function Init($xml)
+	{	
+		$obj = new self();
+		$obj->FromXml($xml);
+		//fix bug 2015-06-29
+		if($obj->values['return_code'] != 'SUCCESS'){
+			 return $obj->GetValues();
+		}
+        return $obj->GetValues();
+	}
+}
+
+/**
+ * 
+ * 回调基础类
+ * @author widyhu
+ *
+ */
+class WxPayNotifyReply extends  WxPayDataBase
+{
+	/**
+	 * 
+	 * 设置错误码 FAIL 或者 SUCCESS
+	 * @param string
+	 */
+	public function SetReturn_code($return_code)
+	{
+		$this->values['return_code'] = $return_code;
+	}
+	
+	/**
+	 * 
+	 * 获取错误码 FAIL 或者 SUCCESS
+	 * @return string $return_code
+	 */
+	public function GetReturn_code()
+	{
+		return $this->values['return_code'];
+	}
+
+	/**
+	 * 
+	 * 设置错误信息
+	 * @param string $return_code
+	 */
+	public function SetReturn_msg($return_msg)
+	{
+		$this->values['return_msg'] = $return_msg;
+	}
+	
+	/**
+	 * 
+	 * 获取错误信息
+	 * @return string
+	 */
+	public function GetReturn_msg()
+	{
+		return $this->values['return_msg'];
+	}
+	
+	/**
+	 * 
+	 * 设置返回参数
+	 * @param string $key
+	 * @param string $value
+	 */
+	public function SetData($key, $value)
+	{
+		$this->values[$key] = $value;
+	}
+}
+
+
+
+
+/**
+ * 
+ * 提交退款输入对象
+ * @author widyhu
+ *
+ */
+class WxPayRefund extends WxPayDataBase
+{
+	/**
+	* 设置微信分配的公众账号ID
+	* @param string $value 
+	**/
+	public function SetAppid($value)
+	{
+		$this->values['appid'] = $value;
+	}
+	/**
+	* 获取微信分配的公众账号ID的值
+	* @return 值
+	**/
+	public function GetAppid()
+	{
+		return $this->values['appid'];
+	}
+	/**
+	* 判断微信分配的公众账号ID是否存在
+	* @return true 或 false
+	**/
+	public function IsAppidSet()
+	{
+		return array_key_exists('appid', $this->values);
+	}
+
+
+	/**
+	* 设置微信支付分配的商户号
+	* @param string $value 
+	**/
+	public function SetMch_id($value)
+	{
+		$this->values['mch_id'] = $value;
+	}
+	/**
+	* 获取微信支付分配的商户号的值
+	* @return 值
+	**/
+	public function GetMch_id()
+	{
+		return $this->values['mch_id'];
+	}
+	/**
+	* 判断微信支付分配的商户号是否存在
+	* @return true 或 false
+	**/
+	public function IsMch_idSet()
+	{
+		return array_key_exists('mch_id', $this->values);
+	}
+
+
+	/**
+	* 设置微信支付分配的终端设备号,与下单一致
+	* @param string $value 
+	**/
+	public function SetDevice_info($value)
+	{
+		$this->values['device_info'] = $value;
+	}
+	/**
+	* 获取微信支付分配的终端设备号,与下单一致的值
+	* @return 值
+	**/
+	public function GetDevice_info()
+	{
+		return $this->values['device_info'];
+	}
+	/**
+	* 判断微信支付分配的终端设备号,与下单一致是否存在
+	* @return true 或 false
+	**/
+	public function IsDevice_infoSet()
+	{
+		return array_key_exists('device_info', $this->values);
+	}
+
+
+	/**
+	* 设置随机字符串,不长于32位。推荐随机数生成算法
+	* @param string $value 
+	**/
+	public function SetNonce_str($value)
+	{
+		$this->values['nonce_str'] = $value;
+	}
+	/**
+	* 获取随机字符串,不长于32位。推荐随机数生成算法的值
+	* @return 值
+	**/
+	public function GetNonce_str()
+	{
+		return $this->values['nonce_str'];
+	}
+	/**
+	* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
+	* @return true 或 false
+	**/
+	public function IsNonce_strSet()
+	{
+		return array_key_exists('nonce_str', $this->values);
+	}
+
+	/**
+	* 设置微信订单号
+	* @param string $value 
+	**/
+	public function SetTransaction_id($value)
+	{
+		$this->values['transaction_id'] = $value;
+	}
+	/**
+	* 获取微信订单号的值
+	* @return 值
+	**/
+	public function GetTransaction_id()
+	{
+		return $this->values['transaction_id'];
+	}
+	/**
+	* 判断微信订单号是否存在
+	* @return true 或 false
+	**/
+	public function IsTransaction_idSet()
+	{
+		return array_key_exists('transaction_id', $this->values);
+	}
+
+
+	/**
+	* 设置商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
+	* @param string $value 
+	**/
+	public function SetOut_trade_no($value)
+	{
+		$this->values['out_trade_no'] = $value;
+	}
+	/**
+	* 获取商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no的值
+	* @return 值
+	**/
+	public function GetOut_trade_no()
+	{
+		return $this->values['out_trade_no'];
+	}
+	/**
+	* 判断商户系统内部的订单号,transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no是否存在
+	* @return true 或 false
+	**/
+	public function IsOut_trade_noSet()
+	{
+		return array_key_exists('out_trade_no', $this->values);
+	}
+
+
+	/**
+	* 设置商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔
+	* @param string $value 
+	**/
+	public function SetOut_refund_no($value)
+	{
+		$this->values['out_refund_no'] = $value;
+	}
+	/**
+	* 获取商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔的值
+	* @return 值
+	**/
+	public function GetOut_refund_no()
+	{
+		return $this->values['out_refund_no'];
+	}
+	/**
+	* 判断商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔是否存在
+	* @return true 或 false
+	**/
+	public function IsOut_refund_noSet()
+	{
+		return array_key_exists('out_refund_no', $this->values);
+	}
+
+
+	/**
+	* 设置订单总金额,单位为分,只能为整数,详见支付金额
+	* @param string $value 
+	**/
+	public function SetTotal_fee($value)
+	{
+		$this->values['total_fee'] = $value;
+	}
+	/**
+	* 获取订单总金额,单位为分,只能为整数,详见支付金额的值
+	* @return 值
+	**/
+	public function GetTotal_fee()
+	{
+		return $this->values['total_fee'];
+	}
+	/**
+	* 判断订单总金额,单位为分,只能为整数,详见支付金额是否存在
+	* @return true 或 false
+	**/
+	public function IsTotal_feeSet()
+	{
+		return array_key_exists('total_fee', $this->values);
+	}
+
+
+	/**
+	* 设置退款总金额,订单总金额,单位为分,只能为整数,详见支付金额
+	* @param string $value 
+	**/
+	public function SetRefund_fee($value)
+	{
+		$this->values['refund_fee'] = $value;
+	}
+	/**
+	* 获取退款总金额,订单总金额,单位为分,只能为整数,详见支付金额的值
+	* @return 值
+	**/
+	public function GetRefund_fee()
+	{
+		return $this->values['refund_fee'];
+	}
+	/**
+	* 判断退款总金额,订单总金额,单位为分,只能为整数,详见支付金额是否存在
+	* @return true 或 false
+	**/
+	public function IsRefund_feeSet()
+	{
+		return array_key_exists('refund_fee', $this->values);
+	}
+
+
+	/**
+	* 设置货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
+	* @param string $value 
+	**/
+	public function SetRefund_fee_type($value)
+	{
+		$this->values['refund_fee_type'] = $value;
+	}
+	/**
+	* 获取货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型的值
+	* @return 值
+	**/
+	public function GetRefund_fee_type()
+	{
+		return $this->values['refund_fee_type'];
+	}
+	/**
+	* 判断货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型是否存在
+	* @return true 或 false
+	**/
+	public function IsRefund_fee_typeSet()
+	{
+		return array_key_exists('refund_fee_type', $this->values);
+	}
+
+
+	/**
+	* 设置操作员帐号, 默认为商户号
+	* @param string $value 
+	**/
+	public function SetOp_user_id($value)
+	{
+		$this->values['op_user_id'] = $value;
+	}
+	/**
+	* 获取操作员帐号, 默认为商户号的值
+	* @return 值
+	**/
+	public function GetOp_user_id()
+	{
+		return $this->values['op_user_id'];
+	}
+	/**
+	* 判断操作员帐号, 默认为商户号是否存在
+	* @return true 或 false
+	**/
+	public function IsOp_user_idSet()
+	{
+		return array_key_exists('op_user_id', $this->values);
+	}
+}
+

+ 13 - 0
cert/WxPay.Exception.php

xqd
@@ -0,0 +1,13 @@
+<?php
+/**
+ * 
+ * 微信支付API异常类
+ * @author widyhu
+ *
+ */
+class WxPayException extends Exception {
+	public function errorMessage()
+	{
+		return $this->getMessage();
+	}
+}

+ 85 - 0
cert/WxPay.Notify.php

xqd
@@ -0,0 +1,85 @@
+<?php
+/**
+ * 
+ * 回调基础类
+ * @author widyhu
+ *
+ */
+class WxPayNotify extends WxPayNotifyReply
+{
+	/**
+	 * 
+	 * 回调入口
+	 * @param bool $needSign  是否需要签名输出
+	 */
+	final public function Handle($needSign = true)
+	{
+		$msg = "OK";
+		//当返回false的时候,表示notify中调用NotifyCallBack回调失败获取签名校验失败,此时直接回复失败
+		$result = WxpayApi::notify(array($this, 'NotifyCallBack'), $msg);
+		if($result == false){
+			$this->SetReturn_code("FAIL");
+			$this->SetReturn_msg($msg);
+			$this->ReplyNotify(false);
+			return;
+		} else {
+			//该分支在成功回调到NotifyCallBack方法,处理完成之后流程
+			$this->SetReturn_code("SUCCESS");
+			$this->SetReturn_msg("OK");
+		}
+		$this->ReplyNotify($needSign);
+	}
+	
+	/**
+	 * 
+	 * 回调方法入口,子类可重写该方法
+	 * 注意:
+	 * 1、微信回调超时时间为2s,建议用户使用异步处理流程,确认成功之后立刻回复微信服务器
+	 * 2、微信服务器在调用失败或者接到回包为非确认包的时候,会发起重试,需确保你的回调是可以重入
+	 * @param array $data 回调解释出的参数
+	 * @param string $msg 如果回调处理失败,可以将错误信息输出到该方法
+	 * @return true回调出来完成不需要继续回调,false回调处理未完成需要继续回调
+	 */
+	public function NotifyProcess($data, &$msg)
+	{
+		//TODO 用户基础该类之后需要重写该方法,成功的时候返回true,失败返回false
+		return true;
+	}
+	
+	/**
+	 * 
+	 * notify回调方法,该方法中需要赋值需要输出的参数,不可重写
+	 * @param array $data
+	 * @return true回调出来完成不需要继续回调,false回调处理未完成需要继续回调
+	 */
+	final public function NotifyCallBack($data)
+	{
+		$msg = "OK";
+		$result = $this->NotifyProcess($data, $msg);
+		
+		if($result == true){
+			$this->SetReturn_code("SUCCESS");
+			$this->SetReturn_msg("OK");
+		} else {
+			$this->SetReturn_code("FAIL");
+			$this->SetReturn_msg($msg);
+		}
+		return $result;
+	}
+	
+	/**
+	 * 
+	 * 回复通知
+	 * @param bool $needSign 是否需要签名输出
+	 */
+	final private function ReplyNotify($needSign = true)
+	{
+		//如果需要签名
+		if($needSign == true && 
+			$this->GetReturn_code($return_code) == "SUCCESS")
+		{
+			$this->SetSign();
+		}
+		WxpayApi::replyNotify($this->ToXml());
+	}
+}

+ 0 - 0
cert/apiclient_cert_1.pem


+ 0 - 0
cert/apiclient_cert_10.pem


+ 26 - 0
cert/apiclient_cert_133.pem

xqd
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEcDCCA9mgAwIBAgIEAfI9yTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJARYQbW1wYXltY2hAdGVuY2VudDAeFw0xODA1MTQwMzM5NDda
+Fw0yODA1MTEwMzM5NDdaMIGfMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdk
+b25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2VudDEOMAwGA1UE
+CxMFTU1QYXkxMzAxBgNVBAMUKuayiOmYs+aBkuWKm+eZvuaIkOijhemlsOW3peeo
+i+aciemZkOWFrOWPuDESMBAGA1UEBBMJMTAwMzYzNDQ2MIIBIjANBgkqhki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CKj7tDSmRPoFj7DzPLCimtS
+mOR1wjOPNGmFEWrGpReY+NU65EkiLwde37We8aU=
+-----END CERTIFICATE-----

+ 0 - 0
cert/apiclient_cert_249.pem


+ 0 - 0
cert/apiclient_cert_261.pem


+ 26 - 0
cert/apiclient_cert_33.pem

xqd
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEaTCCA9KgAwIBAgIEAXBP5zANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC
+Q04xEjAQBgNVBAgTCUd1YW5nZG9uZzERMA8GA1UEBxMIU2hlbnpoZW4xEDAOBgNV
+BAoTB1RlbmNlbnQxDDAKBgNVBAsTA1dYRzETMBEGA1UEAxMKTW1wYXltY2hDQTEf
+MB0GCSqGSIb3DQEJARYQbW1wYXltY2hAdGVuY2VudDAeFw0xNzEwMTgwOTEwMjda
+Fw0yNzEwMTYwOTEwMjdaMIGYMQswCQYDVQQGEwJDTjESMBAGA1UECBMJR3Vhbmdk
+b25nMREwDwYDVQQHEwhTaGVuemhlbjEQMA4GA1UEChMHVGVuY2VudDEOMAwGA1UE
+CxMFTU1QYXkxLTArBgNVBAMUJOatpuaxieW4gua0quWxseWMuuWcn+WutuWxseW6
+hOmkkOmmhjERMA8GA1UEBBMIMTA3NjEyNzUwggEiMA0GCSqGSIb3DQEBAQUAA4IB
+DwAwggEKAoIBAQDXzF/0nGOG6jURpW4dyyM0nGyQoWWNcZmUbNet8d2RS/8GOJY1
+496UQI2bZ0f/pdymDrilJNRh+VZKevX5c8d1IS4IRD11+k/v/IFZn8wsxrQoM3TO
+xQmZTJQ6/AlrRk/1q9SYvfCEh2ufyaYga5YQCaIqK/Oe6QT7jgmo63I4NJXKz/Ft
+ujCOU8jXYGh0J2lpGf4GWhTaOZk1u/xPBponSR+EVvq+1CSCO83MG/9z0TQGv/SH
+BgA1757pO1jRfntc7AAMGCvXzdwVd9ZR5L/rNdE6uyeoj2cURJjkkdDg45tm/UMO
+l3o0y6njUXQ5Y+M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AwIwDQYJKoZIhvcNAQEFBQADgYEARzG2
++EDgM2DcSEboedsxnHBM9hUpFqzQ95CR0IjqiCgybQ9eBP1/JoHlxfn+T5+JCsH+
+0Ok2Fd0aGj3JdURUj3nu+cptwD/pEXLnD4E2et/6YwBXOiaTXuxRReiPCOxwRjOm
+FL/xfwIBC35iMxufOH+va0SibtDc+uHuWQ9Cv7g=
+-----END CERTIFICATE-----

+ 0 - 0
cert/apiclient_cert_69.pem


+ 0 - 0
cert/apiclient_cert_91.pem


+ 0 - 0
cert/apiclient_key_1.pem


+ 0 - 0
cert/apiclient_key_10.pem


+ 28 - 0
cert/apiclient_key_133.pem

xqd
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDGaSnfvYqSOQkZ
+XLAqO43DXQFWvFS0mZnQGihxZ9lNvLCLZYFOEK8ulpEFORLct9X2FtWepnAJPMGu
+3Px2uIWueTcg4tRdpQ7g5JOO8enmac4/re2jKrM0kkOG2KgBPjkod/RZkSvkLEn+
+lwRst6zv+E7WEGYJQ0W8UGvCdBPm+3eg6p6CzMw9Bn2aNtlsIvvBuV9QpCcGGRAl
+XUQfMZvP8jXzoxhuPY7dr8rQzGaP2lGd8CaCyfyyH3+MzvffKPYd7+Gj+KtetbgX
+T4cPWBitThFDUau5TP6zjRY1jo+b68PQtVpKzqfqR6Kl85YvjDpHKrGXBknjPn7j
+h3//VwYnAgMBAAECggEAWleuMmtqulPwGbVDnadKUId7wZO1ehpqmAAhJComHyho
+tsA8VWBxc+QpGli3hvrKGOii0j90yi/4/PcwmZpBfIVDHd1K12z9zlcl/TOXzkul
+FwfKKb6apLhouPDT5uT/P7cG8vWQJ7Am7R60bBBiVU4aD4yd+V/BVBLGTl9uZICT
+O87V/VAsjq0d/hmqKzFrH6GL8nfxyPBijrYKqVWLqA2o2NRSLkmE3t51KhvyV8HU
+ANeQdETehPATHfMRkoehwzu+oFJbad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9ld8kRGUPNA1K/663+aHG1jjRc0jAoGAb0/I0jZmWzzVP0mF8JE3
+fPRZ1RbcgvMpoOhaAI3Y2wn7J5C9f32FXAFFhaDLSpklJN5XYhaEm8tRnuLfFL+O
+nvgn3pNDxnHmmO+uM4ox89MxXAu0iBYyYcI120HPlWdZ56AeORcgU5XeQE216Ftn
+HFbCDHv8IXgnf0gngwmoaZ8=
+-----END PRIVATE KEY-----

+ 0 - 0
cert/apiclient_key_249.pem


+ 0 - 0
cert/apiclient_key_261.pem


+ 28 - 0
cert/apiclient_key_33.pem

xqd
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDXzF/0nGOG6jUR
+pW4dyyM0nGyQoWWNcZmUbNet8d2RS/8GOJY1496UQI2bZ0f/pdymDrilJNRh+VZK
+evX5c8d1IS4IRD11+k/v/IFZn8wsxrQoM3TOxQmZTJQ6/AlrRk/1q9SYvfCEh2uf
+yaYga5YQCaIqK/Oe6QT7jgmo63I4NJXKz/FtujCOU8jXYGh0J2lpGf4GWhTaOZk1
+u/xPBponSR+EVvq+1CSCO83MG/9z0TQGv/SHBgA1757pO1jRfntc7AAMGCvXzdwV
+d9ZR5L/rNdE6uyeoj2cURJjkkdDg45tm/UMOl3o0y6njUXQ5Y+Mk6e5QQTwqPvF3
+9tbgI0SvAgMBAAECggEBAKY7dR9E6RYgjEjPmoew16nLZYX0DfprK9c+ENaZnggy
+9nygUnWo1uh04aB4aunvpoz0giAUwtXF8EbneVtzaI49xOvxRTcAX1uKs0mK4wkK
+9/SPzscI2WARsY3OYKMWQroIZ3hRuFkeyDUKbMJEnhA0m4rI2J3s+j2dKKvK0u2f
+ididwBLT3/4OrxO01ShlXzRq0F3atRYrRaiQ8ui4gNCJTT993biXYpglqYghlvSV
+WWlBjwtC1mJHhcNtNEHeUVde9gnxAaEqIDnvNkoEJK7JKhOqMyh31TExzpB0nAMS
+QNNyCD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+BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A
+cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC
+AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ
+MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm
+aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw
+ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj
+IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF
+MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
+A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
+7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
+1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
+-----END CERTIFICATE-----

+ 1 - 0
developer.cer

xqd
@@ -0,0 +1 @@
+AA14A135D2A43FF1057719DA8424A6A9KYU7C0RPRGBBPL7UR6

+ 23 - 0
errorCode.php

xqd
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * error code 说明.
+ * <ul>
+
+ *    <li>-41001: encodingAesKey 非法</li>
+ *    <li>-41003: aes 解密失败</li>
+ *    <li>-41004: 解密后得到的buffer非法</li>
+ *    <li>-41005: base64加密失败</li>
+ *    <li>-41016: base64解密失败</li>
+ * </ul>
+ */
+class ErrorCode
+{
+	public static $OK = 0;
+	public static $IllegalAesKey = -41001;
+	public static $IllegalIv = -41002;
+	public static $IllegalBuffer = -41003;
+	public static $DecodeBase64Error = -41004;
+}
+
+?>

+ 503 - 0
hong.php

xqd
@@ -0,0 +1,503 @@
+<?php
+/**
+ * 随机红包+固定红包算法[策略模式]
+ * copyright (c) 2016 http://blog.csdn.net/CleverCode
+ */
+
+//配置传输数据DTO
+class OptionDTO
+{                  /*{{{*/
+
+    //红包总金额
+    public $totalMoney;
+
+    //红包数量
+    public $num;
+
+    //范围开始
+    public $rangeStart;
+
+    //范围结算
+    public $rangeEnd;
+
+    //生成红包策略
+    public $builderStrategy;
+
+    //随机红包剩余规则
+    public $randFormatType; //Can_Left:不修数据,可以有剩余;No_Left:不能有剩余
+
+    public static function create($totalMoney,$num,$rangeStart,$rangEnd,
+        $builderStrategy,$randFormatType = 'No_Left')
+    {/*{{{*/
+        $self = new self();
+        $self->num = $num;
+        $self->rangeStart = $rangeStart;
+        $self->rangeEnd = $rangEnd;
+        $self->totalMoney = $totalMoney;
+        $self->builderStrategy = $builderStrategy;
+        $self->randFormatType = $randFormatType;
+        return $self; 
+    }/*}}}*/
+
+}/*}}}*/
+
+//红包生成器接口
+interface IBuilderStrategy
+{/*{{{*/
+    //创建红包
+    public function create();    
+    //设置配置
+    public function setOption(OptionDTO $option); 
+    //是否可以生成红包
+    public function isCanBuilder();
+    //生成红包函数
+    public function fx($x);
+}/*}}}*/
+
+//固定等额红包策略
+class EqualPackageStrategy implements IBuilderStrategy
+{/*{{{*/
+    //单个红包金额
+    public $oneMoney;
+
+    //数量
+    public $num;
+
+    public function __construct($option = null) 
+    {
+        if($option instanceof OptionDTO)
+        {
+            $this->setOption($option);
+        }
+    }
+
+    public function setOption(OptionDTO $option)
+    {
+        $this->oneMoney = $option->rangeStart;
+        $this->num = $option->num;
+    }
+
+    public function create() 
+    {/*{{{*/
+
+        $data = array();
+        if(false == $this->isCanBuilder())
+        {
+            return $data;    
+        }
+
+        $data = array();
+        if(false == is_int($this->num) || $this->num <= 0) 
+        {
+            return $data;    
+        }
+        for($i = 1;$i <= $this->num;$i++)
+        {
+            $data[$i] = $this->fx($i);
+        }
+        return $data;
+    }/*}}}*/
+    
+    /**
+     * 等额红包的方程是一条直线 
+     * 
+     * @param mixed $x 
+     * @access public
+     * @return void
+     */
+    public function fx($x) 
+    {/*{{{*/
+        return $this->oneMoney; 
+    }/*}}}*/
+
+    /**
+     * 是否能固定红包 
+     * 
+     * @access public
+     * @return void
+     */
+    public function isCanBuilder()
+    {/*{{{*/
+        if(false == is_int($this->num) || $this->num <= 0) 
+        {
+            return false;    
+        }
+
+        if(false ==  is_numeric($this->oneMoney) || $this->oneMoney <= 0)
+        {
+            return false;
+        }
+
+        //单个红包小于1分
+        if($this->oneMoney < 0.01)
+        {
+            return false;
+        }
+        
+        return true;
+
+    }/*}}}*/
+
+
+}/*}}}*/
+
+//随机红包策略(三角形)
+class RandTrianglePackageStrategy implements IBuilderStrategy
+{/*{{{*/
+    //总额
+    public $totalMoney;
+
+    //红包数量
+    public $num;
+
+    //随机红包最小值
+    public $minMoney;
+
+    //随机红包最大值
+    public $maxMoney;
+
+    //修数据方式:NO_LEFT: 红包总额 = 预算总额;CAN_LEFT: 红包总额 <= 预算总额
+    public $formatType; 
+
+    //预算剩余金额
+    public $leftMoney;
+
+
+    public function __construct($option = null) 
+    {/*{{{*/
+        if($option instanceof OptionDTO)
+        {
+            $this->setOption($option);
+        }
+    }/*}}}*/
+
+    public function setOption(OptionDTO $option)
+    {/*{{{*/
+        $this->totalMoney = $option->totalMoney;
+        $this->num = $option->num;
+        $this->formatType = $option->randFormatType;
+        $this->minMoney = $option->rangeStart;
+        $this->maxMoney = $option->rangeEnd;
+        $this->leftMoney = $this->totalMoney;
+    }/*}}}*/
+
+    /**
+     * 创建随机红包 
+     * 
+     * @access public
+     * @return void
+     */
+    public function create() 
+    {/*{{{*/
+        
+        $data = array();
+        if(false == $this->isCanBuilder())
+        {
+            return $data;    
+        }
+        
+        $leftMoney = $this->leftMoney;
+        for($i = 1;$i <= $this->num;$i++)
+        {
+            $data[$i] = $this->fx($i);
+            $leftMoney = $leftMoney - $data[$i]; 
+        }
+
+        //修数据
+        list($okLeftMoney,$okData) = $this->format($leftMoney,$data);
+
+        //随机排序
+        shuffle($okData);
+        $this->leftMoney = $okLeftMoney;
+
+        return $okData;
+    }/*}}}*/
+
+    /**
+     * 是否能够发随机红包 
+     * 
+     * @access public
+     * @return void
+     */
+    public function isCanBuilder()
+    {/*{{{*/
+        if(false == is_int($this->num) || $this->num <= 0) 
+        {
+            return false;    
+        }
+
+        if(false ==  is_numeric($this->totalMoney) || $this->totalMoney <= 0)
+        {
+            return false;
+        }
+
+        //均值
+        $avgMoney = $this->totalMoney / 1.0 / $this->num;
+        
+        //均值小于最小值
+        if($avgMoney < $this->minMoney )
+        {
+            return false;
+        }
+        
+        return true;
+
+    }/*}}}*/
+
+    /**
+     * 获取剩余金额 
+     * 
+     * @access public
+     * @return void
+     */
+    public function getLeftMoney()
+    {/*{{{*/
+        return $this->leftMoney;
+    }/*}}}*/
+
+    /**
+     * 随机红包生成函数。三角函数。[(1,0.01),($num/2,$avgMoney),($num,0.01)] 
+     * 
+     * @param mixed $x,1 <= $x <= $this->num; 
+     * @access public
+     * @return void
+     */
+    public function fx($x)
+    {/*{{{*/
+        
+        if(false == $this->isCanBuilder())
+        {
+            return 0;
+        }
+
+        if($x < 1 || $x > $this->num)
+        {
+            return 0;
+        }
+        
+        $x1 = 1;
+        $y1 = $this->minMoney;
+        
+        //我的峰值
+        $y2 = $this->maxMoney;
+
+        //中间点
+        $x2 = ceil($this->num /  1.0 / 2);
+
+        //最后点
+        $x3 = $this->num;
+        $y3 = $this->minMoney;  
+
+        //当x1,x2,x3都是1的时候(竖线)
+        if($x1 == $x2 && $x2 == $x3)
+        {
+            return $y2;
+        }
+
+        // '/_\'三角形状的线性方程
+        //'/'部分
+        if($x1 != $x2 && $x >= $x1 && $x <= $x2)
+        {
+
+            $y = 1.0 * ($x - $x1) / ($x2 - $x1) * ($y2 - $y1) + $y1;  
+            return number_format($y, 2, '.', '');
+        }
+
+        //'\'形状
+        if($x2 != $x3 && $x >= $x2 && $x <= $x3)
+        {
+
+            $y = 1.0 * ($x - $x2) / ($x3 - $x2) * ($y3 - $y2) + $y2;  
+            return number_format($y, 2, '.', '');
+        }
+        
+        return 0;
+
+
+    }/*}}}*/
+
+    /**
+     * 格式化修红包数据 
+     * 
+     * @param mixed $leftMoney 
+     * @param array $data 
+     * @access public
+     * @return void
+     */
+    private function format($leftMoney,array $data)
+    {/*{{{*/
+
+        //不能发随机红包
+        if(false == $this->isCanBuilder())
+        {
+            return array($leftMoney,$data);  
+        }
+        
+        //红包剩余是0
+        if(0 == $leftMoney)
+        {
+            return array($leftMoney,$data);  
+        }
+
+        //数组为空
+        if(count($data) < 1)
+        {
+            return array($leftMoney,$data);  
+        }
+
+        //如果是可以有剩余,并且$leftMoney > 0
+        if('Can_Left' == $this->formatType
+          && $leftMoney > 0)
+        {
+            return array($leftMoney,$data);  
+        }
+
+
+        //我的峰值
+        $myMax = $this->maxMoney;
+
+        // 如果还有余钱,则尝试加到小红包里,如果加不进去,则尝试下一个。
+        while($leftMoney > 0)
+        {
+            $found = 0;
+            foreach($data as $key => $val) 
+            {
+                //减少循环优化
+                if($leftMoney <= 0)
+                {
+                    break;
+                }
+
+                //预判
+                $afterLeftMoney =  (double)$leftMoney - 0.01;
+                $afterVal = (double)$val + 0.01;
+                if( $afterLeftMoney >= 0  && $afterVal <= $myMax)
+                {
+                    $found = 1;
+                    $data[$key] = number_format($afterVal,2,'.','');
+                    $leftMoney = $afterLeftMoney;
+                    //精度
+                    $leftMoney = number_format($leftMoney,2,'.','');
+                }
+            }
+
+            //如果没有可以加的红包,需要结束,否则死循环
+            if($found == 0)
+            {
+                break;
+            }
+        }
+        //如果$leftMoney < 0 ,说明生成的红包超过预算了,需要减少部分红包金额
+        while($leftMoney < 0)
+        {
+            $found = 0;
+            foreach($data as $key => $val) 
+            {
+                if($leftMoney >= 0)
+                {
+                    break; 
+                }
+                //预判
+                
+                $afterLeftMoney =  (double)$leftMoney + 0.01;
+                $afterVal = (double)$val - 0.01;
+                if( $afterLeftMoney <= 0 && $afterVal >= $this->minMoney)
+                {
+                    $found = 1;
+                    $data[$key] = number_format($afterVal,2,'.','');
+                    $leftMoney = $afterLeftMoney;
+                    $leftMoney = number_format($leftMoney,2,'.','');
+                }
+            }
+            
+            //如果一个减少的红包都没有的话,需要结束,否则死循环
+            if($found == 0)
+            {
+                break;
+            }
+        }
+        return array($leftMoney,$data);  
+    }/*}}}*/
+
+}/*}}}*/
+
+//维护策略的环境类
+class RedPackageBuilder
+{/*{{{*/
+
+    // 实例  
+    protected static $_instance = null;  
+
+    /** 
+     * Singleton instance(获取自己的实例) 
+     * 
+     * @return MemcacheOperate 
+     */  
+    public static function getInstance()
+    {  /*{{{*/
+        if (null === self::$_instance) 
+        {  
+            self::$_instance = new self();  
+        }  
+        return self::$_instance;  
+    }  /*}}}*/
+
+    /** 
+     * 获取策略【使用反射】
+     * 
+     * @param string $type 类型 
+     * @return void 
+     */  
+    public function getBuilderStrategy($type)
+    {  /*{{{*/
+        $class = $type.'PackageStrategy';
+
+        if(class_exists($class))
+        {
+            return new $class();  
+        }
+        else
+        {
+            throw new Exception("{$class} 类不存在!");
+        }
+    }  /*}}}*/
+
+    public function getRedPackageByDTO(OptionDTO $optionDTO) 
+    {/*{{{*/
+        //获取策略
+        $builderStrategy = $this->getBuilderStrategy($optionDTO->builderStrategy);
+
+        //设置参数
+        $builderStrategy->setOption($optionDTO);
+
+        return $builderStrategy->create();
+    }/*}}}*/
+    
+}/*}}}*/
+
+class Client
+{/*{{{*/
+    public static function main($argv)
+    {
+        //固定红包
+        $dto = OptionDTO::create(1000,10,100,100,'Equal');
+        $data = RedPackageBuilder::getInstance()->getRedPackageByDTO($dto);
+        //print_r($data);
+
+        //随机红包[修数据]
+        $dto = OptionDTO::create(5,10,0.01,0.99,'RandTriangle');
+        $data = RedPackageBuilder::getInstance()->getRedPackageByDTO($dto);
+        print_r($data);
+
+        //随机红包[不修数据]
+        $dto = OptionDTO::create(5,10,0.01,0.99,'RandTriangle','Can_Left');
+        $data = RedPackageBuilder::getInstance()->getRedPackageByDTO($dto);
+        //print_r($data);
+        
+    }
+}/*}}}*/
+
+//Client::main($argv);
+
+
+

BIN
icon-custom.jpg




+ 963 - 0
inc/func/core.php

xqd
@@ -0,0 +1,963 @@
+<?php
+
+defined('IN_IA') or exit ('Access Denied');
+class Core extends WeModuleSite
+{
+	public function getMainMenu()//主菜单
+	{
+		global $_W, $_GPC;
+		$type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
+		$rst=pdo_update('zhtc_system',array('is_ff'=>2),array('uniacid'=>$_W['uniacid']));
+		$do = $_GPC['do'];
+		$navemenu = array();
+		$cur_color = ' style="color:#d9534f;" ';
+		$account=pdo_get('zhtc_account',array('uid'=>$_W['user']['uid']));
+		if ($_W['role'] == 'operator') {
+			if($account['role']==3){
+				 header('location:city.php');
+			}
+			if($account['role']==2){
+				$arr=explode(',',$account['authority']);
+				foreach ($arr as $key => $value) {
+					if( $value=='store'){
+						$sjarr=array(
+							0 => $this->createMainMenu('商家列表 ', $do, 'store', ''),
+							1 => $this->createMainMenu('商家添加 ', $do, 'storeinfo2', ''),
+							2 => $this->createMainMenu('入驻期限', $do, 'in', ''), 
+							3 => $this->createMainMenu('商家分类', $do, 'storetype', ''),
+							4=> $this->createMainMenu('商家设置', $do, 'storecheck', ''), 
+							5=> $this->createMainMenu('评论管理', $do, 'sjpinglun', ''),
+							//6=> $this->createMainMenu('升级管理', $do, 'upgrade', '')
+							);
+						if($type['is_syqx']==1 and $type['is_sy']==1){
+							array_push($sjarr, $this->createMainMenu('收银订单', $do, 'dmorder', ''));
+						}
+						if($type['is_yhqqx']==1 and $type['is_coupon']==1){
+							array_push($sjarr, $this->createMainMenu('优惠券', $do, 'coupon', ''));
+						}
+						$navemenu[0] = array(
+							'title' => '<a href="index.php?c=site&a=entry&op=display&do=store&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-university"></icon>  商家管理</a>',
+							'items' => $sjarr
+							);
+					}
+					if( $value=='information'){
+						$navemenu[1] = array(
+							'title' => '<a href="index.php?c=site&a=entry&op=display&do=information&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-comment-o"></icon>  帖子管理</a>',
+							'items' => array(
+								0 => $this->createMainMenu('帖子列表 ', $do, 'information', ''),
+								1=> $this->createMainMenu('分类列表', $do, 'fenlei', ''),
+								2 => $this->createMainMenu('添加帖子', $do, 'addinformation', ''),
+								3 => $this->createMainMenu('置顶设置', $do, 'top', ''),
+								4=> $this->createMainMenu('帖子设置', $do, 'tzcheck', ''),
+								5=> $this->createMainMenu('评论管理', $do, 'tzpinglun', '')
+								)
+							);
+					}
+					if( $value=='carinfo'){
+						if($type['is_pcfw']==1 and $type['is_pcqx']==1){
+							$navemenu[2] = array(
+								'title' => '<a href="index.php?c=site&a=entry&op=display&do=carinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-car"></icon>  拼车管理</a>',
+								'items' => array(
+									0 => $this->createMainMenu('拼车列表 ', $do, 'carinfo', ''),
+									2=> $this->createMainMenu('审核设置', $do, 'carcheck', ''),
+									3=> $this->createMainMenu('标签管理', $do, 'tag', ''),
+									)
+								);
+						}
+
+					}	
+					if( $value=='zx'){
+						$navemenu[3] = array(
+							'title' => '<a href="index.php?c=site&a=entry&op=display&do=zx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-book"></icon>  资讯管理</a>',
+							'items' => array(
+								1 => $this->createMainMenu('资讯管理', $do, 'zx', ''), 
+								3=> $this->createMainMenu('资讯审核', $do, 'zxcheckmanager', ''),             
+								0 => $this->createMainMenu('分类管理 ', $do, 'zxtype', ''),                       
+								2=> $this->createMainMenu('审核设置', $do, 'zxcheck', ''),                  
+								4=> $this->createMainMenu('评论管理', $do, 'zxpinglun', ''),
+								)
+							);
+					}
+					if( $value=='video'){
+						if($type['is_video']==1 ){
+						$navemenu[18] = array(
+							'title' => '<a href="index.php?c=site&a=entry&op=display&do=video&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
+							'items' => array(
+								0 => $this->createMainMenu('视频管理 ', $do, 'video', ''),
+								1=> $this->createMainMenu('分类管理', $do, 'videotype', ''),
+								)
+							);    
+						}       
+					}
+					if( $value=='yellowstore'){
+						if($type['is_pageopen']==1 and $type['is_hyqx']==1){
+							$navemenu[4] = array(
+								'title' => '<a href="index.php?c=site&a=entry&op=display&do=yellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>黄页114</a>',
+								'items' => array(
+									0 => $this->createMainMenu('入驻列表 ', $do, 'yellowstore', ''),
+									1=> $this->createMainMenu('分类管理', $do, 'yellowtype', ''),
+									2=> $this->createMainMenu('添加入驻', $do, 'addyellowstore', ''),
+									3=> $this->createMainMenu('入驻设置', $do, 'yellowset', ''),
+									4=> $this->createMainMenu('审核设置', $do, 'yellowcheck', ''), 
+									)
+								);
+						}
+					}
+					if( $value=='activity'){
+						if($type['is_hd']==1 and $type['is_hdqx']==1){
+							$navemenu[20] = array(
+								'title' => '<a href="index.php?c=site&a=entry&op=display&do=activity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
+								'items' => array(
+									0 => $this->createMainMenu('活动管理 ', $do, 'activity', ''),
+									1 => $this->createMainMenu('分类管理 ', $do, 'acttype', ''),
+									2 => $this->createMainMenu('活动设置 ', $do, 'activityset', ''),
+									)
+								);
+						}
+
+					}
+					if( $value=='ad'){
+						$navemenu[6] = array(
+							'title' => '<a href="index.php?c=site&a=entry&op=display&do=ad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon>  广告管理</a>',
+							'items' => array(
+								0 => $this->createMainMenu('广告列表 ', $do, 'ad', ''),
+								1 => $this->createMainMenu('广告添加', $do, 'addad', ''),
+								2 => $this->createMainMenu('公告列表', $do, 'news', ''),
+								3=> $this->createMainMenu('公告设置', $do, 'ggset', ''),
+								4=> $this->createMainMenu('流量主管理', $do, 'llz', ''),
+								)
+							);
+					}
+					if( $value=='goods'){
+						if($type['is_sp']==1 and $type['is_spqx']==1){
+							$navemenu[7] = array(
+								'title' => '<a href="index.php?c=site&a=entry&op=display&do=goods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:#8d8d8d;" class="fa fa-cart-plus"></icon>  商品管理</a>',
+								'items' => array(
+									0 => $this->createMainMenu('商品列表 ', $do, 'goods', ''),
+									3=> $this->createMainMenu('商品设置', $do, 'goodscheck', ''),
+									4=> $this->createMainMenu('订单管理 ', $do, 'ddgl', ''),
+									)
+								);
+						}
+					}	
+				}
+			}
+			if($account['role']==1){
+				$navemenu[13] = array(
+					'title' => '<a href="javascript:void(0)" id="yframe-15" class="panel-title wytitle"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon>  业务菜单</a>',
+					'items' => array(
+						0 => $this->createMainMenu('账号管理', $do, 'account', 'fa-home')
+						)
+
+					);
+
+			}
+
+		}elseif($_W['isfounder'] || $_W['role'] == 'manager' || $_W['role'] == 'operator') {
+			$navemenu[14] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=index&m=zh_tcwq" class="panel-title wytitle" id="yframe-14"><icon style="color:#8d8d8d;" class="fa fa-newspaper-o"></icon>  数据概况</a>',
+
+				'items' => array(
+					0 => $this->createMainMenu('数据展示 ', $do, 'index', ''),
+					)
+				);              
+			// $navemenu[24] = array(
+
+			// 	'title' => '<a href="index.php?c=site&a=entry&op=display&do=zhanghao&m=zh_tcwq" class="panel-title wytitle" id="yframe-24"><icon style="color:#8d8d8d;" class="fa fa-newspaper-o"></icon>账号管理</a>',
+
+			// 	'items' => array(
+
+			// 		0 => $this->createMainMenu('账号管理 ', $do, 'zhanghao', ''),
+
+			// 		1 => $this->createMainMenu('账号添加 ', $do, 'addzhanghao', ''),
+
+			// 		)
+
+			// 	);      
+
+			$navemenu[17] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=nav&m=zh_tcwq" class="panel-title wytitle" id="yframe-17"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>导航管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('导航管理 ', $do, 'nav', ''),
+					1=> $this->createMainMenu('添加导航', $do, 'addnav', ''),
+					2=> $this->createMainMenu('版块导航栏', $do, 'plate', ''),
+                    3=> $this->createMainMenu('底部导航', $do, 'bottom', ''),
+					)
+				);           
+
+			$sjarr=array(
+				0 => $this->createMainMenu('商家列表 ', $do, 'store', ''),
+				1 => $this->createMainMenu('商家添加 ', $do, 'storeinfo2', ''),
+				2 => $this->createMainMenu('入驻期限', $do, 'in', ''), 
+				3 => $this->createMainMenu('商家分类', $do, 'storetype', ''),
+				4=> $this->createMainMenu('商家设置', $do, 'storecheck', ''), 
+				5=> $this->createMainMenu('评论管理', $do, 'sjpinglun', ''),
+				//6=> $this->createMainMenu('升级管理', $do, 'upgrade', '')
+				);
+
+			if($type['is_syqx']==1 and $type['is_sy']==1){
+				array_push($sjarr, $this->createMainMenu('收银订单', $do, 'dmorder', ''));
+			}
+			if($type['is_yhqqx']==1 and $type['is_coupon']==1){
+				array_push($sjarr, $this->createMainMenu('优惠券', $do, 'coupon', ''));
+				array_push($sjarr, $this->createMainMenu('优惠券分类', $do, 'coupontype', ''));
+			}
+			$navemenu[0] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=store&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-university"></icon>  商家管理</a>',
+				'items' => $sjarr
+				);
+			$navemenu[1] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=information&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-comment-o"></icon>  帖子管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('帖子列表 ', $do, 'information', ''),
+					1=> $this->createMainMenu('分类列表', $do, 'fenlei', ''),
+					2 => $this->createMainMenu('添加帖子', $do, 'addinformation', ''),
+					3 => $this->createMainMenu('置顶设置', $do, 'top', ''),
+                     // 3 => $this->createMainMenu('信息分类 ', $do, 'type', ''),
+                     // 4 => $this->createMainMenu('二级信息分类 ', $do, 'type2', ''),
+					4=> $this->createMainMenu('帖子设置', $do, 'tzcheck', ''),
+					5=> $this->createMainMenu('评论管理', $do, 'tzpinglun', '')
+					)
+				);
+			if($type['is_pcfw']==1 and $type['is_pcqx']==1){
+				$navemenu[2] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=carinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-car"></icon>  拼车管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('拼车列表 ', $do, 'carinfo', ''),
+						2=> $this->createMainMenu('审核设置', $do, 'carcheck', ''),
+						3=> $this->createMainMenu('标签管理', $do, 'tag', ''),
+						)
+					);
+			}
+			$navemenu[3] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=zx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-book"></icon>  资讯管理</a>',
+				'items' => array(
+					1 => $this->createMainMenu('资讯管理', $do, 'zx', ''), 
+					3=> $this->createMainMenu('资讯审核', $do, 'zxcheckmanager', ''),             
+					0 => $this->createMainMenu('分类管理 ', $do, 'zxtype', ''),                       
+					2=> $this->createMainMenu('审核设置', $do, 'zxcheck', ''),                  
+					4=> $this->createMainMenu('评论管理', $do, 'zxpinglun', ''),
+					)
+				);
+			if($type['is_video']==1 ){
+			$navemenu[18] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=video&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('视频管理 ', $do, 'video', ''),
+					1=> $this->createMainMenu('分类管理', $do, 'videotype', ''),
+					)
+				); 
+				}          
+			if($type['is_pageopen']==1 and $type['is_hyqx']==1){
+				$navemenu[4] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=yellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>黄页114</a>',
+					'items' => array(
+						0 => $this->createMainMenu('入驻列表 ', $do, 'yellowstore', ''),
+						1=> $this->createMainMenu('分类管理', $do, 'yellowtype', ''),
+						2=> $this->createMainMenu('添加入驻', $do, 'addyellowstore', ''),
+						3=> $this->createMainMenu('入驻设置', $do, 'yellowset', ''),
+						4=> $this->createMainMenu('审核设置', $do, 'yellowcheck', ''), 
+						)
+					);
+			}
+			if($type['is_hd']==1 and $type['is_hdqx']==1){
+				$navemenu[20] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=activity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('活动管理 ', $do, 'activity', ''),
+						1 => $this->createMainMenu('分类管理 ', $do, 'acttype', ''),
+						2 => $this->createMainMenu('活动设置 ', $do, 'activityset', ''),
+						)
+					);
+			}
+			if($type['g_qx']==1 and $type['g_open']==1){
+				$navemenu[22] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=grouporder&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon>  拼团管理</a>',
+					'items' => array(                  
+						1=> $this->createMainMenu('订单管理 ', $do, 'grouporder', ''),
+						2 => $this->createMainMenu('团管理 ', $do, 'group', ''),
+						3 => $this->createMainMenu('商品管理', $do, 'groupgoods', ''),
+						4 => $this->createMainMenu('分类列表 ', $do, 'grouptype', ''),
+						)
+					);
+			}
+			if($type['is_xsqg']==1 and $type['is_qgqx']==1){
+				$navemenu[23] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=qgorder&m=zh_tcwq" class="panel-title wytitle" id="yframe-23"><icon style="color:#8d8d8d;" class="fa fa-star-half-o"></icon>  限时抢购</a>',
+					'items' => array(
+						1 => $this->createMainMenu('订单管理', $do, 'qgorder', ''),
+						2 => $this->createMainMenu('商品管理', $do, 'qggoodall', ''),
+						3 => $this->createMainMenu('分类管理', $do, 'rushtype', ''),												
+						)
+					);
+			}
+           // $navemenu[5] = array(
+
+           //      'title' => '<a href="index.php?c=site&a=entry&op=display&do=news&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:#8d8d8d;" class="fa fa-bell"></icon>  公告管理</a>',
+
+           //      'items' => array(
+
+           //           0 => $this->createMainMenu('公告列表 ', $do, 'news', ''),
+
+           //      )
+
+           //  );
+
+            // 下面是复制的上面的数据
+
+			if($type['is_sp']==1 and $type['is_spqx']==1){
+				$navemenu[7] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=goods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:#8d8d8d;" class="fa fa-cart-plus"></icon>  商品管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('商品列表 ', $do, 'goods', ''),
+						3=> $this->createMainMenu('商品设置', $do, 'goodscheck', ''),
+						4=> $this->createMainMenu('订单管理 ', $do, 'ddgl', ''),
+						)
+					);
+			}
+			if($type['is_jf']==1 and $type['is_jfqx']==1){
+				$navemenu[8] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=integral&m=zh_tcwq" class="panel-title wytitle" id="yframe-8"><icon style="color:#8d8d8d;" class="fa fa-star-half-o"></icon>  积分商城</a>',
+					'items' => array(
+						0 => $this->createMainMenu('签到管理', $do, 'integral', ''),
+						2 => $this->createMainMenu('商品列表', $do, 'jfgoods', ''),
+						3 => $this->createMainMenu('商品分类', $do, 'jftype', '')
+						)
+					);
+			}
+			$yxarr=array(
+				0 => $this->createMainMenu('营销插件 ', $do, 'ygquan', ''),
+				1 => $this->createMainMenu('商家入驻', $do, 'storerz', ''),
+				2 => $this->createMainMenu('发帖子', $do, 'tzopen', ''),				
+				);
+			if($type['is_hyqx']==1){
+				array_push($yxarr, $this->createMainMenu('黄页114', $do, 'hyopen', ''));
+			}
+			if($type['is_pcqx']==1){
+				array_push($yxarr, $this->createMainMenu('拼车设置', $do, 'caropen', ''));
+			}
+			if($type['is_yhqqx']==1){
+				array_push($yxarr, $this->createMainMenu('优惠券功能', $do, 'couponset', ''));
+			}
+			if($type['is_syqx']==1){
+				array_push($yxarr, $this->createMainMenu('收银功能', $do, 'syset', ''));
+			}
+			if($type['is_hdqx']==1){
+				array_push($yxarr, $this->createMainMenu('活动报名', $do, 'hdset', ''));
+			}
+			// if($type['is_hbqx']==1){
+			// 	array_push($yxarr, $this->createMainMenu('红包福利', $do, 'hbopen', ''));
+			// }
+			if($type['is_hhrqx']==1){
+				array_push($yxarr, $this->createMainMenu('加入合伙人', $do, 'hhropen', ''));
+			}
+			if($type['is_dcsqx']==1){
+				array_push($yxarr, $this->createMainMenu('开通多城市', $do, 'manycity', ''));
+			}
+			if($type['is_jfqx']==1){
+				array_push($yxarr, $this->createMainMenu('积分功能', $do, 'jfsz', ''));
+			}
+			if($type['is_spqx']==1){
+				array_push($yxarr, $this->createMainMenu('商品功能', $do, 'spsz', ''));
+			}
+			if($type['is_qgqx']==1){
+				array_push($yxarr, $this->createMainMenu('限时抢购', $do, 'qgset', ''));
+			}
+			if($type['g_qx']==1){
+				array_push($yxarr, $this->createMainMenu('拼团功能', $do, 'groupgoodscheck', ''));
+			}
+			if($type['is_message']==1){
+			array_push($yxarr, $this->createMainMenu('消息推送', $do, 'message', ''));
+			}
+			$navemenu[9] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=ygquan&m=zh_tcwq" class="panel-title wytitle" id="yframe-9"><icon style="color:#8d8d8d;" class="fa fa-gift"></icon>  营销设置</a>',
+				'items' => $yxarr
+				);
+			$navemenu[6] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=ad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon>  广告管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('广告列表 ', $do, 'ad', ''),
+					1 => $this->createMainMenu('广告添加', $do, 'addad', ''),
+					2 => $this->createMainMenu('公告列表', $do, 'news', ''),
+					3=> $this->createMainMenu('公告设置', $do, 'ggset', ''),
+					4=> $this->createMainMenu('流量主管理', $do, 'llz', ''),
+					)
+				);
+			$navemenu[16] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=txlist&m=zh_tcwq" class="panel-title wytitle" id="yframe-16"><icon style="color:#8d8d8d;" class="fa fa-key"></icon>  数据统计</a>',
+				'items' => array(
+					2 => $this->createMainMenu('提现列表 ', $do, 'txlist', ''),
+					3 => $this->createMainMenu('提现设置 ', $do, 'txsz', ''),
+                  //  0 => $this->createMainMenu('红包统计 ', $do, 'hbdata', ''),
+					1 => $this->createMainMenu('销售额统计 ', $do, 'xsdata', ''),
+					)
+				);  
+			$navemenu[11] = array(
+
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=user2&m=zh_tcwq" class="panel-title wytitle" id="yframe-11"><icon style="color:#8d8d8d;" class="fa fa-user"></icon>  会员管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('会员列表 ', $do, 'user2', ''),
+					)
+				);
+			if($type['is_hhr']==1 and $type['is_hhrqx']==1){
+				$navemenu[19] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=fxlist&m=zh_tcwq" class="panel-title wytitle" id="yframe-19"><icon style="color:#8d8d8d;" class="fa fa-users"></icon>  同城合伙人</a>',
+					'items' => array(
+						0 => $this->createMainMenu('合伙人管理', $do, 'fxlist', ''),
+						1 => $this->createMainMenu('合伙人设置', $do, 'fxset', ''),
+						2 => $this->createMainMenu('等级设置', $do, 'level', ''),
+						3 => $this->createMainMenu('提现申请', $do, 'fxtx', ''),
+						)
+					);
+			}
+			if($type['many_city']==2 and $type['is_dcsqx']==1){
+				$navemenu[15] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=account&m=zh_tcwq" class="panel-title wytitle" id="yframe-15"><icon style="color:#8d8d8d;" class="fa fa-graduation-cap"></icon>多城市管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('账号管理 ', $do, 'account', ''),
+						1 => $this->createMainMenu('账号添加 ', $do, 'countadd', ''),
+						2 => $this->createMainMenu('佣金提现 ', $do, 'yjtx', ''),
+						3 => $this->createMainMenu('代理佣金比例设置', $do, 'commission', '')
+						)
+					);
+			}
+			if($_COOKIE["cz_password"]==$type['cz_password'] || $type['cz_password']==''){
+				$navemenu[12] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=settings&m=zh_tcwq" class="panel-title wytitle" id="yframe-12"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon>  系统设置</a>',
+				'items' => array(
+					0 => $this->createMainMenu('基本信息 ', $do, 'settings', ''),
+					1 => $this->createMainMenu('小程序配置', $do, 'peiz', ''),
+					2 => $this->createMainMenu('支付配置', $do, 'pay', ''), 
+					4 => $this->createMainMenu('短信配置', $do, 'sms', ''),
+					5 => $this->createMainMenu('模板消息', $do, 'template', ''),                  					
+					6 => $this->createMainMenu('关键词管理 ', $do, 'sensitive', ''),  
+					8 => $this->createMainMenu('账号管理 ', $do, 'zhanghao', ''),   
+					9 => $this->createMainMenu('帮助中心', $do, 'help', ''),          
+					)
+				);
+			}else{
+				$navemenu[12] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=password&m=zh_tcwq" class="panel-title wytitle" id="yframe-12"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon>  系统设置</a>',
+				'items' => array(
+					0 => $this->createMainMenu('基本信息 ', $do, 'password', ''),
+					1 => $this->createMainMenu('小程序配置', $do, 'password', ''),
+					2 => $this->createMainMenu('支付配置', $do, 'password', ''), 
+					4 => $this->createMainMenu('短信配置', $do, 'password', ''),
+					5 => $this->createMainMenu('模板消息', $do, 'password', ''),                  					
+					6 => $this->createMainMenu('关键词管理 ', $do, 'password', ''),  
+					8 => $this->createMainMenu('账号管理 ', $do, 'password', ''),   
+					9 => $this->createMainMenu('帮助中心', $do, 'password', ''),          
+					)
+				);
+			}
+			
+			if ($_W['role'] == 'founder'){
+				$navemenu[21] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=wxapplist&m=zh_tcwq" class="panel-title wytitle" id="yframe-21"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon>  权限设置</a>',
+					'items' => array(
+						0 => $this->createMainMenu('小程序列表 ', $do, 'wxapplist', ''),                
+						)
+					);
+			}
+		}
+		return $navemenu;
+	}
+
+	public function getMainMenu2()
+	{
+		global $_W, $_GPC;
+		$type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
+		$do = $_GPC['do'];
+		$navemenu = array();
+		$cur_color = ' style="color:#d9534f;" ';
+		if($_W['isfounder'] || $_W['role'] == 'manager' || $_W['role'] == 'operator') {
+			$navemenu[0] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=inindex&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-newspaper-o"></icon>  数据概况</a>',
+				'items' => array(
+					0 => $this->createMainMenu('数据展示', $do, 'inindex', ''),
+					)
+				);
+			$navemenu[9] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=instore&m=zh_tcwq" class="panel-title wytitle" id="yframe-9"><icon style="color:#8d8d8d;" class="fa fa-university"></icon>  商家管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('商家列表 ', $do, 'instore', ''),
+					1 => $this->createMainMenu('商家添加 ', $do, 'instoreinfo2', ''),
+					3=> $this->createMainMenu('评论管理', $do, 'insjpinglun', ''),
+					)
+				);
+			$navemenu[1] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=ininformation&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-comment-o"></icon>  帖子管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('帖子列表 ', $do, 'ininformation', ''),
+					1 => $this->createMainMenu('添加帖子', $do, 'inaddinformation', ''),
+					2=> $this->createMainMenu('评论管理', $do, 'intzpinglun', ''),
+					)
+				);
+			if($type['is_pcfw']==1 and $type['is_pcqx']==1){
+				$navemenu[2] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=incarinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-car"></icon>  拼车管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('拼车列表 ', $do, 'incarinfo', ''),
+						)
+					);
+			}
+			$navemenu[3] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=inzx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-book"></icon>  资讯管理</a>',
+				'items' => array(
+					1 => $this->createMainMenu('资讯管理', $do, 'inzx', ''), 
+					3=> $this->createMainMenu('资讯审核', $do, 'inzxcheckmanager', ''),                              
+					4=> $this->createMainMenu('评论管理', $do, 'inzxpinglun', ''),
+					)
+				);
+			if($type['is_pageopen']==1 and $type['is_hyqx']==1){
+				$navemenu[4] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=inyellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>黄页114</a>',
+					'items' => array(
+						0=> $this->createMainMenu('入驻列表 ', $do, 'inyellowstore', ''),
+						3=> $this->createMainMenu('添加入驻', $do, 'inaddyellowstore', ''),
+						)
+					);
+			}
+			if($type['is_hd']==1 and $type['is_hdqx']==1){
+				$navemenu[20] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=inactivity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('活动管理 ', $do, 'inactivity', ''),
+						)
+					);
+			}
+			$navemenu[18] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=invideo&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('视频管理 ', $do, 'invideo', ''),
+					)
+				);   
+			$navemenu[5] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=innews&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:#8d8d8d;" class="fa fa-user"></icon>  公告管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('公告列表 ', $do, 'innews', ''),
+					)
+				);
+            // 下面是复制的上面的数据
+			$navemenu[6] = array(
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=inad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon>  广告管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('广告列表 ', $do, 'inad', ''),
+					1 => $this->createMainMenu('广告添加', $do, 'inaddad', ''),
+					)
+				);
+			if($type['is_sp']==1 and $type['is_spqx']==1){
+				$navemenu[7] = array(
+					'title' => '<a href="index.php?c=site&a=entry&op=display&do=ingoods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:#8d8d8d;" class="fa fa-cart-plus"></icon>  商品管理</a>',
+					'items' => array(
+						0 => $this->createMainMenu('商品列表 ', $do, 'ingoods', ''),
+                    // 4=> $this->createMainMenu('订单管理 ', $do, 'inddgl', ''),
+						)
+					);
+			}
+			$navemenu[8] = array(
+				'id' => 'nav12',
+				'title' => '<a href="index.php?c=site&a=entry&op=display&do=txdetails&m=zh_tcwq" class="panel-title wytitle" id="yframe-8"><icon style="color:#8d8d8d;" class="fa fa-university"></icon>  提现管理</a>',
+				'items' => array(
+					0 => $this->createMainMenu('提现明细 ', $do, 'txdetails', ''),
+					1 => $this->createMainMenu('申请提现 ', $do, 'txapply', '')
+					)
+				);  
+		}
+		return $navemenu;
+	}
+	public function getNaveMenu($city, $action)
+	{  
+		global $_W, $_GPC;
+		$type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));      
+		$do = $_GPC['do'];
+		$navemenu = array();
+		$cur_color = '#8d8d8d';
+		$navemenu[0] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=start&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon>  数据概况</a>',
+			'items' => array(
+				0 => $this->createSubMenu('数据展示', $do, 'start', 'fa-angle-right', $cur_color, $city),
+				),
+			'icon' => 'fa fa-user-md'
+			);
+		$cur_color = '#8d8d8d';
+		$navemenu[9] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-9"><icon style="color:#8d8d8d;" class="fa fa-university"></icon>  商家管理</a>',
+
+			'items' => array(
+				0 => $this->createSubMenu('商家列表 ', $do, 'dlinstore', 'fa-angle-right', $cur_color, $city),
+				1 => $this->createSubMenu('商家添加 ', $do, 'dlinstoreinfo2', 'fa-angle-right', $cur_color, $city),
+				3=> $this->createSubMenu('评论管理', $do, 'dlinsjpinglun', 'fa-angle-right', $cur_color, $city),
+				)
+			);
+		$navemenu[1] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlininformation&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:' . $cur_color . ';" class="fa fa-bars"></icon>  帖子管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('帖子列表 ', $do, 'dlininformation', 'fa-angle-right', $cur_color, $city),
+				1 => $this->createSubMenu('添加帖子', $do, 'dlinaddinformation', 'fa-angle-right', $cur_color, $city),
+				2 => $this->createSubMenu('评论管理', $do, 'dlintzpinglun', 'fa-angle-right', $cur_color, $city),
+
+				)
+			);
+
+		$cur_color = '#8d8d8d';
+		if($type['is_pcfw']==1 and $type['is_pcqx']==1){
+			$navemenu[2] = array(
+				'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlincarinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:' . $cur_color . ';" class="fa fa-trophy"></icon> 拼车管理</a>',
+				'items' => array(
+					0 => $this->createSubMenu('拼车列表 ', $do, 'dlincarinfo', 'fa-angle-right', $cur_color, $city),
+					)
+				);
+		}
+		$cur_color = '#8d8d8d';
+		$navemenu[3] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinzx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:' . $cur_color . ';" class="fa fa-binoculars"></icon>  资讯管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('资讯管理', $do, 'dlinzx', 'fa-angle-right', $cur_color, $city),
+				1 => $this->createSubMenu('资讯审核', $do, 'dlinzxcheckmanager', 'fa-angle-right', $cur_color, $city),
+				5 => $this->createSubMenu('评论管理', $do, 'dlinzxpinglun', 'fa-angle-right', $cur_color, $city),
+				),
+			);
+		$cur_color = '#8d8d8d';
+		if($type['is_pageopen']==1 and $type['is_hyqx']==1){
+			$navemenu[4] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinyellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:' . $cur_color . ';" class="fa fa-gift"></icon>  黄页114</a>',
+				'items' => array(
+					0 => $this->createSubMenu('入驻列表 ', $do, 'dlinyellowstore', 'fa-angle-right', $cur_color, $city),
+					1 => $this->createSubMenu('添加入驻', $do, 'dlinaddyellowstore', 'fa-angle-right', $cur_color, $city),
+					)
+				);
+		}
+		if($type['is_hd']==1 and $type['is_hdqx']==1){
+			$navemenu[20] = array(
+				'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinactivity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
+				'items' => array(
+					0 => $this->createSubMenu('活动管理 ', $do, 'dlinactivity', 'fa-angle-right', $cur_color, $city),
+					)
+				);
+		}
+		$navemenu[18] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinvideo&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('视频管理 ', $do, 'dlinvideo', 'fa-angle-right', $cur_color, $city),
+				)
+			);
+		$cur_color = '#8d8d8d';
+		$navemenu[5] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinnews&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:' . $cur_color . ';" class="fa fa-key"></icon>  公告管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('公告列表 ', $do, 'dlinnews', 'fa-angle-right', $cur_color, $city),
+				)
+			);
+		$cur_color = '#8d8d8d';
+		$navemenu[6] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:' . $cur_color . ';" class="fa fa-book"></icon>  广告管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('管理广告 ', $do, 'dlinad', 'fa-angle-right', $cur_color, $city),
+				1 => $this->createSubMenu('广告添加', $do, 'dlinaddad', 'fa-angle-right', $cur_color, $city),
+				)
+			);
+		$cur_color = '#8d8d8d';
+		if($type['is_sp']==1 and $type['is_spqx']==1){
+			$navemenu[7] = array(
+				'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlingoods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:' . $cur_color . ';" class="fa fa-cubes"></icon>  商品管理</a>',
+				'items' => array(
+					0 => $this->createSubMenu('商品列表 ', $do, 'dlingoods', 'fa-angle-right', $cur_color, $city),
+					)
+				);
+		}
+		$cur_color = '#8d8d8d';
+		$navemenu[8] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=dltxdetails&m=zh_tcwq" class="panel-title wytitle" id="yframe-8"><icon style="color:' . $cur_color . ';" class="fa fa-database"></icon>  提现管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('提现明细 ', $do, 'dltxdetails', 'fa-angle-right', $cur_color, $city),
+				1 => $this->createSubMenu('申请提现 ', $do, 'dltxapply', 'fa-angle-right', $cur_color, $city),
+				)
+			);
+		return $navemenu;
+	}
+	public function getNaveMenu2($storeid)
+	{  
+		global $_W, $_GPC;    
+		$do = $_GPC['do'];
+		$navemenu = array();
+		$cur_color = '#8d8d8d';
+		$type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
+		if($_GPC['account_id']){
+			$role=pdo_get('zhtc_account',array('uid'=>$_GPC['account_id'],'weid'=>$_W['uniacid']));
+			setcookie('storeid',$role['storeid']);
+			$storeid=$role['storeid'];
+		}else{
+			$storeid=$_COOKIE["storeid"];
+		}
+		$store=pdo_get('zhtc_store',array('id'=>$storeid));
+		$navemenu[0] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjstatistics&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 商家信息</a>',
+			'items' => array(
+				0 => $this->createSubMenu('数据概况', $do, 'sjstatistics', 'fa-angle-right', $cur_color, $storeid),
+				1 => $this->createSubMenu('门店信息', $do, 'sjstoreinfo', 'fa-angle-right', $cur_color, $storeid),         
+				),
+			'icon' => 'fa fa-user-md'
+			);
+		$navemenu[2] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjddgl&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 订单管理</a>',
+			'items' => array(
+				1 => $this->createSubMenu('订单列表 ', $do, 'sjddgl', 'fa-angle-right', $cur_color, $storeid),
+				),
+			'icon' => 'fa fa-user-md'
+			);
+		$cur_color = '#8d8d8d';
+		if($store['is_shop']==1 AND $type['is_spqx']==1 AND $type['is_sp']==1){
+		$navemenu[1] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjgoods&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 商品管理</a>',
+			'items' => array(
+				1 => $this->createSubMenu('商品列表 ', $do, 'sjgoods', 'fa-angle-right', $cur_color, $storeid),
+				2=> $this->createSubMenu('添加商品', $do, 'sjaddgoods', 'fa-angle-right', $cur_color, $storeid),
+				),
+			'icon' => 'fa fa-user-md'
+			);
+		}
+		
+		if($store['is_yhq']==1 AND $type['is_coupon']==1 AND $type['is_yhqqx']==1){
+		$navemenu[3] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjcoupon&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-university"></icon>  优惠券</a>',
+			'items' => array(
+				0 => $this->createSubMenu('优惠券列表 ', $do, 'sjcoupon', 'fa-angle-right', $cur_color, $storeid),
+				1 => $this->createSubMenu('添加优惠券 ', $do, 'sjaddcoupon', 'fa-angle-right', $cur_color, $storeid),
+				)
+			);
+		}
+		if($type['g_qx']==1 AND $type['g_open']==1 AND $store['is_pt']==1){
+			$navemenu[4] = array(
+				'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjgrouporder&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon>  拼团管理</a>',
+				'items' => array(                  
+					1=> $this->createSubMenu('订单管理 ', $do, 'sjgrouporder', 'fa-angle-right', $cur_color, $storeid),
+					2 => $this->createSubMenu('团管理 ', $do, 'sjgroup', 'fa-angle-right', $cur_color, $storeid),
+					3 => $this->createSubMenu('商品管理', $do, 'sjgroupgoods', 'fa-angle-right', $cur_color, $storeid),
+					4 => $this->createSubMenu('添加商品', $do, 'sjaddgroupgoods', 'fa-angle-right', $cur_color, $storeid),
+					)
+				);	
+		}
+		if($type['is_xsqg']==1 AND $type['is_qgqx']==1 AND $store['is_qg']==1){
+			$navemenu[5] = array(
+				'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjqgorder&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:#8d8d8d;" class="fa fa-star-half-o"></icon>  限时抢购</a>',
+				'items' => array(
+					1 => $this->createSubMenu('订单管理', $do, 'sjqgorder', 'fa-angle-right', $cur_color, $storeid),
+					2 => $this->createSubMenu('商品管理', $do, 'sjqggoodall', 'fa-angle-right', $cur_color, $storeid),
+					3 => $this->createSubMenu('添加商品', $do, 'sjaddqggoodall', 'fa-angle-right', $cur_color, $storeid),					
+					)
+				);
+		}
+
+		$navemenu[6] = array(
+			'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjtxlist&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:' . $cur_color . ';" class="fa fa-database"></icon>  提现管理</a>',
+			'items' => array(
+				0 => $this->createSubMenu('提现明细 ', $do, 'sjtxlist', 'fa-angle-right', $cur_color, $storeid),
+				1 => $this->createSubMenu('申请提现 ', $do, 'sjtxapply', 'fa-angle-right', $cur_color, $storeid),
+				)
+			);
+		return $navemenu;
+	}
+	function createWebUrl2($do, $query = array()) {
+		$query['do'] = $do;
+		$query['m'] = strtolower($this->modulename);
+		return $this->wurl('site/entry', $query);
+	}
+
+	function wurl($segment, $params = array()) {
+		list($controller, $action, $do) = explode('/', $segment);
+		$url = './city.php?';
+		if (!empty($controller)) {
+			$url .= "c={$controller}&";
+		}
+		if (!empty($action)) {
+			$url .= "a={$action}&";
+		}
+		if (!empty($do)) {
+			$url .= "do={$do}&";
+		}
+		if (!empty($params)) {
+			$queryString = http_build_query($params, '', '&');
+			$url .= $queryString;
+		}
+		return $url;
+	}
+	function createCoverMenu($title, $method, $op, $icon = "fa-image", $color = '#d9534f')
+	{
+		global $_GPC, $_W;
+		$cur_op = $_GPC['op'];
+		$color = ' style="color:'.$color.';" ';
+		return array('title' => $title, 'url' => $op != $cur_op ? $this->createWebUrl($method, array('op' => $op)) : '',
+			'active' => $op == $cur_op ? ' active' : '',
+			'append' => array(
+				'title' => '<i class="fa fa-angle-right"></i>',
+				)
+			);
+	}
+
+	function createMainMenu($title, $do, $method, $icon = "fa-image", $color = '')
+	{
+		$color = ' style="color:'.$color.';" ';
+		return array('title' => $title, 'url' => $do != $method ? $this->createWebUrl($method, array('op' => 'display')) : '',
+			'active' => $do == $method ? ' active' : '',
+			'append' => array(
+				'title' => '<i '.$color.' class="fa fa-angle-right"></i>',
+				)
+			);
+	}
+
+
+    function createSubMenu($title, $do, $method, $icon = "fa-image", $color = '#d9534f', $city)
+    {
+    	$color = ' style="color:'.$color.';" ';
+    	$url = $this->createWebUrl2($method, array('op' => 'display', 'city' => $city));
+    	if ($method == 'stores2') {
+    		$url = $this->createWebUrl2('stores2', array('op' => 'post', 'id' => $storeid, 'city' =>$city));
+    	}
+    	return array('title' => $title, 'url' => $do != $method ? $url : '',
+    		'active' => $do == $method ? ' active' : '',
+    		'append' => array(
+    			'title' => '<i class="fa '.$icon.'"></i>',
+    			)
+    		);
+    }
+
+    public function getStoreById($id)
+    {
+    	$store = pdo_fetch("SELECT * FROM " . tablename('zhtc_store') . " WHERE id=:id LIMIT 1", array(':id' => $id));
+    	return $store;
+    }
+
+
+    public function set_tabbar($action, $storeid)
+    {
+    	$actions_titles = $this->actions_titles;
+    	$html = '<ul class="nav nav-tabs">';
+    	foreach ($actions_titles as $key => $value) {
+    		if ($key == 'stores') {
+    			$url = $this->createWebUrl('stores', array('op' => 'post', 'id' => $storeid));
+    		} else {
+    			$url = $this->createWebUrl($key, array('op' => 'display', 'storeid' => $storeid));
+    		}
+    		$html .= '<li class="' . ($key == $action ? 'active' : '') . '"><a href="' . $url . '">' . $value . '</a></li>';
+    	}
+    	$html .= '</ul>';
+    	return $html;
+    }
+
+    public   function getSon($pid ,$arr){
+    	$newarr=array();
+    	foreach ($arr as $key => $value) {
+    		if($pid==$value['type_id']){
+    			$newarr[]=$value; 
+               // continue;                     
+    		}      
+    	}
+    	return $newarr;
+    }
+
+
+    public   function getSon2($pid ,$arr){
+    	$newarr=array();
+    	foreach ($arr as $key => $value) {
+    		if($pid==$value['type2_id']){
+    			$newarr[]=$value; 
+              // continue;                     
+    		}      
+    	}
+    	return $newarr;
+    }
+
+    public function increaseScore($user_id){
+    	global $_GPC, $_W;
+    	$system=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
+    	if($system['is_jf']==1 and $system['integral']>0){
+    		$res= pdo_update('zhtc_user',array('total_score +='=>$system['integral']),array('id'=>$user_id));
+    		if($res){
+    			$data3['score']=$system['integral'];
+    			$data3['user_id']=$user_id;
+    			$data3['note']='发帖';
+    			$data3['type']=1;
+    			$data3['cerated_time']=date('Y-m-d H:i:s');
+		        $data3['uniacid']=$_W['uniacid'];//小程序id
+		        pdo_insert('zhtc_integral',$data3);//添加积分明细 
+		    }
+		}
+	}
+
+	public function getaccess_token(){
+		global $_GPC, $_W;
+		$tokenName='access_token'.$_W['uniacid'];
+		$timeName='access_token_time'.$_W['uniacid'];
+		load()->classs('wesession');
+   		WeSession::start($_W['uniacid'], CLIENT_IP);
+   		if($_SESSION[$timeName]<time() || !$_SESSION[$tokenName]){
+   			$res=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
+			$appid=$res['appid'];
+			$secret=$res['appsecret'];
+			$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$secret."";
+			$ch = curl_init();
+			curl_setopt($ch, CURLOPT_URL,$url);
+			curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
+			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
+			$data = curl_exec($ch);
+			curl_close($ch);
+			$data = json_decode($data,true);
+			$_SESSION[$tokenName]=$data['access_token'];
+			$_SESSION[$timeName]=time()+300;
+			return $data['access_token'];
+   		}else{
+   			return $_SESSION[$tokenName];
+   		}
+		
+	}
+	public function httpRequest($url,$data = null){
+			$curl = curl_init();
+			curl_setopt($curl, CURLOPT_URL, $url);
+			curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
+			curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
+			if (!empty($data)){
+				curl_setopt($curl, CURLOPT_POST, 1);
+				curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
+			}
+			curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+    //执行
+			$output = curl_exec($curl);
+			curl_close($curl);
+			return $output;
+		}
+	//查找模板的关键词列表
+	public function getKeyword($id){
+		global $_GPC, $_W;
+		$url='https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get?access_token='.$this->getaccess_token();
+		$formWork = '{
+            "id": "' . $id . '"
+        }';
+        $data = $this->httpRequest($url, $formWork);
+        return json_decode($data,true)['keyword_list'];
+	}
+	//生成模板
+	public function generateTemplate($id,$keyword_id_list){
+		global $_GPC, $_W;
+		$key=$this->getKeyword($id);
+		$list=[];
+		for($i=0;$i<count($keyword_id_list);$i++){
+			
+			for($k=0;$k<count($key);$k++){
+				if($keyword_id_list[$i]==$key[$k]['name']){
+					$list[]=$key[$k]['keyword_id'];
+				}
+			}
+		}
+        $url='https://api.weixin.qq.com/cgi-bin/wxopen/template/add?access_token='.$this->getaccess_token();
+        $formWork = '{
+                 "id": "' . $id . '",
+                 "keyword_id_list": ' . json_encode($list) . '
+         }';
+        $data = $this->httpRequest($url, $formWork);
+        // print_r($data);die;
+        return json_decode($data,true)['template_id'];
+
+
+	}
+}

+ 1 - 0
inc/upload/tcsj.jpeg

xqd
@@ -0,0 +1 @@
+{"errcode":40169,"errmsg":"invalid length for scene, or the data is not json string hint: [W9AWxa00484523]"}

+ 1 - 0
inc/upload/tcsj1.jpeg

xqd
@@ -0,0 +1 @@
+{"errcode":41030,"errmsg":"invalid page hint: [UXDJfa09124245]"}

BIN
inc/upload/tcsj10.jpeg


BIN
inc/upload/tcsj100.jpeg


+ 1 - 0
inc/upload/tcsj101.jpeg

xqd
@@ -0,0 +1 @@
+{"errcode":41030,"errmsg":"invalid page hint: [RQHzbA06520724]"}

BIN
inc/upload/tcsj102.jpeg


BIN
inc/upload/tcsj103.jpeg


BIN
inc/upload/tcsj104.jpeg


BIN
inc/upload/tcsj105.jpeg


BIN
inc/upload/tcsj106.jpeg


BIN
inc/upload/tcsj107.jpeg


BIN
inc/upload/tcsj108.jpeg


BIN
inc/upload/tcsj109.jpeg


BIN
inc/upload/tcsj11.jpeg


BIN
inc/upload/tcsj110.jpeg


BIN
inc/upload/tcsj111.jpeg


BIN
inc/upload/tcsj112.jpeg


BIN
inc/upload/tcsj113.jpeg


BIN
inc/upload/tcsj114.jpeg


BIN
inc/upload/tcsj115.jpeg


BIN
inc/upload/tcsj116.jpeg


BIN
inc/upload/tcsj118.jpeg


BIN
inc/upload/tcsj119.jpeg


BIN
inc/upload/tcsj12.jpeg


BIN
inc/upload/tcsj120.jpeg


BIN
inc/upload/tcsj121.jpeg


BIN
inc/upload/tcsj122.jpeg


BIN
inc/upload/tcsj123.jpeg


BIN
inc/upload/tcsj124.jpeg


BIN
inc/upload/tcsj125.jpeg


BIN
inc/upload/tcsj126.jpeg


BIN
inc/upload/tcsj127.jpeg


BIN
inc/upload/tcsj128.jpeg


BIN
inc/upload/tcsj129.jpeg


BIN
inc/upload/tcsj130.jpeg


BIN
inc/upload/tcsj131.jpeg


BIN
inc/upload/tcsj132.jpeg


BIN
inc/upload/tcsj133.jpeg


BIN
inc/upload/tcsj134.jpeg


BIN
inc/upload/tcsj135.jpeg


BIN
inc/upload/tcsj136.jpeg


BIN
inc/upload/tcsj137.jpeg


BIN
inc/upload/tcsj138.jpeg


BIN
inc/upload/tcsj139.jpeg


BIN
inc/upload/tcsj14.jpeg


Деякі файли не було показано, через те що забагато файлів було змінено