hrjy 2 years ago
commit
36837e7e7d
100 changed files with 16693 additions and 0 deletions
  1. 0 0
      .htaccess
  2. 8 0
      .idea/.gitignore
  3. 14 0
      .idea/deployment.xml
  4. 13 0
      .idea/grayscaled.top.iml
  5. 8 0
      .idea/modules.xml
  6. 12 0
      .idea/php.xml
  7. 14 0
      .idea/webServers.xml
  8. 22 0
      183.html
  9. 24 0
      404.html
  10. 13 0
      Application/Admin/Conf/config.php
  11. 509 0
      Application/Admin/Controller/AdminController.class.php
  12. 141 0
      Application/Admin/Controller/ArticleController.class.php
  13. 947 0
      Application/Admin/Controller/ConfigController.class.php
  14. 307 0
      Application/Admin/Controller/FinanceController.class.php
  15. 94 0
      Application/Admin/Controller/IndexController.class.php
  16. 92 0
      Application/Admin/Controller/IssueController.class.php
  17. 241 0
      Application/Admin/Controller/KuangmController.class.php
  18. 340 0
      Application/Admin/Controller/LevertadeController.class.php
  19. 144 0
      Application/Admin/Controller/LoginController.class.php
  20. 27 0
      Application/Admin/Controller/MarketController.class.php
  21. 296 0
      Application/Admin/Controller/OrepoolController.class.php
  22. 671 0
      Application/Admin/Controller/ToolsController.class.php
  23. 482 0
      Application/Admin/Controller/TradeController.class.php
  24. 1095 0
      Application/Admin/Controller/UserController.class.php
  25. 96 0
      Application/Admin/Controller/VerifyController.class.php
  26. 152 0
      Application/Admin/View/Article/edit.html
  27. 58 0
      Application/Admin/View/Article/index.html
  28. 80 0
      Application/Admin/View/Article/taxedit.html
  29. 55 0
      Application/Admin/View/Article/taxtxt.html
  30. 441 0
      Application/Admin/View/Coin/edit.html
  31. 108 0
      Application/Admin/View/Coin/index.html
  32. 102 0
      Application/Admin/View/Coin/info.html
  33. 68 0
      Application/Admin/View/Coin/user.html
  34. 120 0
      Application/Admin/View/Config/coin.html
  35. 180 0
      Application/Admin/View/Config/coinEdit.html
  36. 133 0
      Application/Admin/View/Config/coinInfo.html
  37. 82 0
      Application/Admin/View/Config/ctmarket.html
  38. 91 0
      Application/Admin/View/Config/ctmarketEdit.html
  39. 111 0
      Application/Admin/View/Config/daohang.html
  40. 126 0
      Application/Admin/View/Config/daohangEdit.html
  41. 855 0
      Application/Admin/View/Config/index.html
  42. 105 0
      Application/Admin/View/Config/marketo.html
  43. 242 0
      Application/Admin/View/Config/marketoEdit.html
  44. 113 0
      Application/Admin/View/Config/marketoEdit2.html
  45. 97 0
      Application/Admin/View/Config/marketoEdit3.html
  46. 138 0
      Application/Admin/View/Config/qita.html
  47. 94 0
      Application/Admin/View/Finance/index.html
  48. 185 0
      Application/Admin/View/Finance/myzc.html
  49. 182 0
      Application/Admin/View/Finance/myzr.html
  50. 168 0
      Application/Admin/View/Finance/taxlist.html
  51. 242 0
      Application/Admin/View/Index/index.html
  52. 288 0
      Application/Admin/View/Issue/edit.html
  53. 73 0
      Application/Admin/View/Issue/index.html
  54. 99 0
      Application/Admin/View/Issue/log.html
  55. 333 0
      Application/Admin/View/Kuangm/addkuangj.html
  56. 90 0
      Application/Admin/View/Kuangm/djprofit.html
  57. 89 0
      Application/Admin/View/Kuangm/index.html
  58. 107 0
      Application/Admin/View/Kuangm/kjlist.html
  59. 80 0
      Application/Admin/View/Kuangm/kjsylist.html
  60. 69 0
      Application/Admin/View/Kuangm/overlist.html
  61. 122 0
      Application/Admin/View/Levertade/ccinfo.html
  62. 147 0
      Application/Admin/View/Levertade/index.html
  63. 146 0
      Application/Admin/View/Levertade/pclist.html
  64. 77 0
      Application/Admin/View/Levertade/setting.html
  65. 149 0
      Application/Admin/View/Levertade/trustlist.html
  66. 84 0
      Application/Admin/View/Login/index.html
  67. 162 0
      Application/Admin/View/Login/lockScreen.html
  68. 261 0
      Application/Admin/View/Orepool/addorepool.html
  69. 265 0
      Application/Admin/View/Orepool/editorepool.html
  70. 99 0
      Application/Admin/View/Orepool/index.html
  71. 328 0
      Application/Admin/View/Public/edit.html
  72. 90 0
      Application/Admin/View/Public/footer.html
  73. 165 0
      Application/Admin/View/Public/header.html
  74. 103 0
      Application/Admin/View/Public/list.html
  75. 96 0
      Application/Admin/View/Tools/cache.html
  76. 92 0
      Application/Admin/View/Tools/delcahe.html
  77. 132 0
      Application/Admin/View/Tools/export.html
  78. 94 0
      Application/Admin/View/Tools/import.html
  79. 100 0
      Application/Admin/View/Tools/qianbao.html
  80. 39 0
      Application/Admin/View/Tools/queue.html
  81. 70 0
      Application/Admin/View/Trade/bbsetting.html
  82. 149 0
      Application/Admin/View/Trade/bbsjlist.html
  83. 153 0
      Application/Admin/View/Trade/bbxjlist.html
  84. 103 0
      Application/Admin/View/Trade/comment.html
  85. 121 0
      Application/Admin/View/Trade/hylog.html
  86. 169 0
      Application/Admin/View/Trade/index.html
  87. 127 0
      Application/Admin/View/Trade/market.html
  88. 436 0
      Application/Admin/View/Trade/marketEdit.html
  89. 137 0
      Application/Admin/View/Trade/orderinfo.html
  90. 137 0
      Application/Admin/View/Trade/orderinfo_ty.html
  91. 130 0
      Application/Admin/View/Trade/sethy.html
  92. 166 0
      Application/Admin/View/Trade/tyorder.html
  93. 104 0
      Application/Admin/View/User/admin.html
  94. 87 0
      Application/Admin/View/User/adminEdit.html
  95. 119 0
      Application/Admin/View/User/adminUser.html
  96. 101 0
      Application/Admin/View/User/adminUserEdit.html
  97. 109 0
      Application/Admin/View/User/agent.html
  98. 121 0
      Application/Admin/View/User/amountlog.html
  99. 140 0
      Application/Admin/View/User/authrz.html
  100. 97 0
      Application/Admin/View/User/coin.html

+ 0 - 0
.htaccess


+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 14 - 0
.idea/deployment.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="PublishConfigData" serverName="heyue" remoteFilesAllowedToDisappearOnAutoupload="false">
+    <serverData>
+      <paths name="heyue">
+        <serverdata>
+          <mappings>
+            <mapping local="$PROJECT_DIR$" web="/" />
+          </mappings>
+        </serverdata>
+      </paths>
+    </serverData>
+  </component>
+</project>

+ 13 - 0
.idea/grayscaled.top.iml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/vendor/phpmailer/phpmailer" />
+      <excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/grayscaled.top.iml" filepath="$PROJECT_DIR$/.idea/grayscaled.top.iml" />
+    </modules>
+  </component>
+</project>

+ 12 - 0
.idea/php.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="PhpIncludePathManager">
+    <include_path>
+      <path value="$PROJECT_DIR$/vendor/phpmailer/phpmailer" />
+      <path value="$PROJECT_DIR$/vendor/composer" />
+    </include_path>
+  </component>
+  <component name="PhpProjectSharedConfiguration" php_language_level="8.0">
+    <option name="suggestChangeDefaultLanguageLevel" value="false" />
+  </component>
+</project>

+ 14 - 0
.idea/webServers.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="WebServers">
+    <option name="servers">
+      <webServer id="4df12fe1-508a-43a5-9b9f-653a68142928" name="heyue" url="http://103.122.244.195">
+        <fileTransfer host="103.122.244.195" port="21">
+          <advancedOptions>
+            <advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
+          </advancedOptions>
+        </fileTransfer>
+      </webServer>
+    </option>
+  </component>
+</project>

File diff suppressed because it is too large
+ 22 - 0
183.html


+ 24 - 0
404.html

@@ -0,0 +1,24 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+<title>404</title>
+<style>
+	body{
+		background-color:#fff;
+		font-size:14px;
+	}
+</style>
+</head>
+
+<body>
+    <div style="width:100%;">
+        <div style="width:100%;margin-top:100px;text-align:center;">
+            <h3>抱歉,页面跑丢了!</h3>
+        </div>
+    </div>
+
+</body>
+</html>

+ 13 - 0
Application/Admin/Conf/config.php

@@ -0,0 +1,13 @@
+<?php
+
+return [
+    'TMPL_PARSE_STRING' => ['__UPLOAD__' => __ROOT__ . '/Upload', '__PUBLIC__' => __ROOT__ . '/Public',
+	'__IMG__' => __ROOT__ . '/Public/' . MODULE_NAME . '/images',
+	'__CSS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/css',
+	'__JS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/js',
+	'__WEBTITLE__' => "管理中心 -ADMIN EX"],
+	
+	'TMPL_ACTION_ERROR' => './Public/admin_error.html', //默认错误跳转对应的模板文件
+	'TMPL_ACTION_SUCCESS' => './Public/admin_success.html', //默认成功跳转对应的模板文件
+];
+?>

+ 509 - 0
Application/Admin/Controller/AdminController.class.php

@@ -0,0 +1,509 @@
+<?php
+namespace Admin\Controller;
+use Think\Controller;
+class AdminController extends Controller
+{
+    ////OK
+    protected function _initialize(){
+
+    }
+
+    ////OK
+    public function __construct(){
+        parent::__construct();
+
+        defined('APP_DEMO') || define('APP_DEMO', 0);
+
+        if (!session('admin_id')) {
+            $this->redirect('Admin/Login/index');
+        }
+        
+        define('UID', session('admin_id'));
+        
+        $access = $this->accessControl();
+        if ($access === false) {
+            $this->error('403:禁止访问');
+        } else if ($access === null) {
+            $dynamic = $this->checkDynamic();
+            if ($dynamic === null) {
+                $rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME);
+                 if (!$this->checkRule($rule, array('in', '1,2'))) {
+                     $this->error('未授权访问!');
+                 }
+            } else if ($dynamic === false) {
+                $this->error('未授权访问!');
+            }
+        }
+		
+        $this->assign('__LANG__', array('en-us'=>'English','zh-cn'=>'简体中文'));
+        $this->assign('__MENU__', $this->getMenus());
+    }
+
+    ////OK
+    public function index()
+    {
+        $this->redirect('Admin/Index/index');
+    }
+
+    ////OK
+    final protected function checkRule($rule, $type = \Common\Model\AuthRuleModel::RULE_URL, $mode = 'url')
+    {
+        if (IS_ROOT) {
+            return true;
+        }
+        static $Auth;
+        if (!$Auth) {
+            $Auth = new \Think\Auth();
+        }
+        if (!$Auth->check($rule, UID, $type, $mode)) {
+            return false;
+        }
+        return true;
+    }
+    
+    ////OK
+    function addtime($time = NULL, $type = NULL){
+	    if (empty($time)) {
+	    	return '---';
+	    }
+	    if (($time < 2545545) && (1893430861 < $time)) {
+	    	return '---';
+	    }
+	    if (empty($type)) {
+	    	$type = 'Y-m-d H:i:s';
+	    }
+	    return date($type, $time);
+    }
+
+    
+    
+
+    final protected function editRow($model, $data, $where, $msg)
+    {
+        $id = array_unique((array)I('id', 0));
+        $id = (is_array($id) ? implode(',', $id) : $id);
+        $where = array_merge(array(
+            'id' => array('in', $id)
+        ), (array)$where);
+        $msg = array_merge(array('success' => '操作成功!', 'error' => '操作失败!', 'url' => '', 'ajax' => IS_AJAX), (array)$msg);
+
+        if (M($model)->where($where)->save($data) !== false) {
+            $this->success($msg['success'], $msg['url'], $msg['ajax']);
+        } else {
+            $this->error($msg['error'], $msg['url'], $msg['ajax']);
+        }
+    }
+
+    protected function forbid($model, $where = array(), $msg = array('success' => '状态禁用成功!', 'error' => '状态禁用失败!'))
+    {
+        $data = array('status' => 0);
+        $this->editRow($model, $data, $where, $msg);
+    }
+
+    protected function resume($model, $where = array(), $msg = array('success' => '状态恢复成功!', 'error' => '状态恢复失败!'))
+    {
+        $data = array('status' => 1);
+        $this->editRow($model, $data, $where, $msg);
+    }
+
+    protected function restore($model, $where = array(), $msg = array('success' => '状态还原成功!', 'error' => '状态还原失败!'))
+    {
+        $data = array('status' => 1);
+        $where = array_merge(array('status' => -1), $where);
+        $this->editRow($model, $data, $where, $msg);
+    }
+
+    protected function delete($model, $where = array(), $msg = array('success' => '删除成功!', 'error' => '删除失败!'))
+    {
+        $data['status'] = -1;
+        $data['update_time'] = NOW_TIME;
+        $this->editRow($model, $data, $where, $msg);
+    }
+
+    public function setStatus($Model = CONTROLLER_NAME)
+    {
+        $ids = I('request.ids');
+        $status = I('request.status');
+
+        if (empty($ids)) {
+            $this->error('请选择要操作的数据');
+        }
+
+        $map['id'] = array('in', $ids);
+
+        switch ($status) {
+            case -1:
+                $this->delete($Model, $map, array('success' => '删除成功', 'error' => '删除失败'));
+                break;
+
+            case 0:
+                $this->forbid($Model, $map, array('success' => '禁用成功', 'error' => '禁用失败'));
+                break;
+
+            case 1:
+                $this->resume($Model, $map, array('success' => '启用成功', 'error' => '启用失败'));
+                break;
+
+            default:
+                $this->error('参数错误');
+                break;
+        }
+    }
+
+    protected function checkDynamic()
+    {
+        if (IS_ROOT) {
+            return true;
+        }
+
+        return null;
+    }
+    
+    
+    
+    ////OK
+    final protected function accessControl()
+    {
+        if (IS_ROOT) {
+            return true;
+        }
+
+        $allow = C('ALLOW_VISIT');
+        $deny = C('DENY_VISIT');
+        $check = strtolower(CONTROLLER_NAME . '/' . ACTION_NAME);
+
+        if (!empty($deny) && in_array_case($check, $deny)) {
+            return false;
+        }
+        if (!empty($allow) && in_array_case($check, $allow)) {
+            return true;
+        }
+
+        return null;
+    }
+
+    final public function getMenus($controller = CONTROLLER_NAME)
+    {
+        if (empty($menus)) {
+            $where['pid'] = 0;
+            $where['hide'] = 0;
+
+            if (!C('DEVELOP_MODE')) {
+                $where['is_dev'] = 0;
+            }
+
+            $menus['main'] = M('Menu')->where($where)->order('sort asc')->select();
+            $menus['child'] = array();
+            $current = M('Menu')->where('url like \'' . $controller . '/' . ACTION_NAME . '%\'')->field('id')->find();
+            if (!$current) {
+                $current = M('Menu')->where('url like \'' . $controller . '/%\'')->field('id')->find();
+            }
+
+            if ($current) {
+                $nav = D('Menu')->getPath($current['id']);
+                $nav_first_title = $nav[0]['title'];
+
+                foreach ($menus['main'] as $key => $item) {
+                    if (!is_array($item) || empty($item['title']) || empty($item['url'])) {
+                        $this->error('控制器基类$menus属性元素配置有误');
+                    }
+
+                    if (stripos($item['url'], MODULE_NAME) !== 0) {
+                        $item['url'] = MODULE_NAME . '/' . $item['url'];
+                    }
+
+                    if (!IS_ROOT && !$this->checkRule($item['url'], \Common\Model\AuthRuleModel::RULE_MAIN, null)) {
+                        unset($menus['main'][$key]);
+                        continue;
+                    }
+
+                    if ($item['title'] == $nav_first_title) {
+                        $menus['main'][$key]['class'] = 'current';
+                        $groups = M('Menu')->where('pid = ' . $item['id'])->distinct(true)->field('`group`')->select();
+                        if ($groups) {
+                            $groups = array_column($groups, 'group');
+                        } else {
+                            $groups = array();
+                        }
+
+                        $where = array();
+                        $where['pid'] = $item['id'];
+                        $where['hide'] = 0;
+                        if (!C('DEVELOP_MODE')) {
+                            $where['is_dev'] = 0;
+                        }
+
+                        $second_urls = M('Menu')->where($where)->getField('id,url');
+
+                        if (!IS_ROOT) {
+                            $to_check_urls = array();
+
+                            foreach ($second_urls as $key => $to_check_url) {
+                                if (stripos($to_check_url, MODULE_NAME) !== 0) {
+                                    $rule = MODULE_NAME . '/' . $to_check_url;
+                                } else {
+                                    $rule = $to_check_url;
+                                }
+
+                                if ($this->checkRule($rule, \Common\Model\AuthRuleModel::RULE_URL, null)) {
+                                    $to_check_urls[] = $to_check_url;
+                                }
+                            }
+                        }
+
+                        foreach ($groups as $g) {
+                            $map = array('group' => $g);
+
+                            if (isset($to_check_urls)) {
+                                if (empty($to_check_urls)) {
+                                    continue;
+                                } else {
+                                    $map['url'] = array('in', $to_check_urls);
+                                }
+                            }
+
+                            $map['pid'] = $item['id'];
+                            $map['hide'] = 0;
+
+                            if (!C('DEVELOP_MODE')) {
+                                $map['is_dev'] = 0;
+                            }
+
+                            $menuList = M('Menu')->where($map)->field('id,pid,title,url,tip,ico_name')->order('sort asc')->select();
+                            $menus['child'][$g] = list_to_tree($menuList, 'id', 'pid', 'operater', $item['id']);
+                        }
+
+                        if ($menus['child'] === array()) {}
+                    }
+                }
+            }
+        }
+
+        return $menus;
+    }
+
+    final protected function returnNodes($tree = true)
+    {
+        static $tree_nodes = array();
+
+        if ($tree && !empty($tree_nodes[(int)$tree])) {
+            return $tree_nodes[$tree];
+        }
+
+        if ((int)$tree) {
+            $list = M('Menu')->field('id,pid,title,url,tip,hide')->order('sort asc')->select();
+            foreach ($list as $key => $value) {
+                if (stripos($value['url'], MODULE_NAME) !== 0) {
+                    $list[$key]['url'] = MODULE_NAME . '/' . $value['url'];
+                }
+            }
+
+            $nodes = list_to_tree($list, $pk = 'id', $pid = 'pid', $child = 'operator', $root = 0);
+            foreach ($nodes as $key => $value) {
+                if (!empty($value['operator'])) {
+                    $nodes[$key]['child'] = $value['operator'];
+                    unset($nodes[$key]['operator']);
+                }
+            }
+        } else {
+            $nodes = M('Menu')->field('title,url,tip,pid')->order('sort asc')->select();
+            foreach ($nodes as $key => $value) {
+                if (stripos($value['url'], MODULE_NAME) !== 0) {
+                    $nodes[$key]['url'] = MODULE_NAME . '/' . $value['url'];
+                }
+            }
+        }
+
+        $tree_nodes[(int)$tree] = $nodes;
+        return $nodes;
+    }
+
+    protected function lists($model, $where = array(), $order = '', $base = array('status' => array('egt', 0)), $field = true)
+    {
+        $options = array();
+        $REQUEST = (array)I('request.');
+
+        if (is_string($model)) {
+            $model = M($model);
+        }
+
+        $OPT = new \ReflectionProperty($model, 'options');
+        $OPT->setAccessible(true);
+        $pk = $model->getPk();
+
+        if ($order === null) {
+        } else if (isset($REQUEST['_order']) && isset($REQUEST['_field']) && in_array(strtolower($REQUEST['_order']), array('desc', 'asc'))) {
+            $options['order'] = '`' . $REQUEST['_field'] . '` ' . $REQUEST['_order'];
+        } else if (($order === '') && empty($options['order']) && !empty($pk)) {
+            $options['order'] = $pk . ' desc';
+        } else if ($order) {
+            $options['order'] = $order;
+        }
+		
+        unset($REQUEST['_order']);
+        unset($REQUEST['_field']);
+        $options['where'] = array_filter(array_merge((array)$base, (array)$where), function ($val) {
+            if (($val === '') || ($val === null)) {
+                return false;
+            } else {
+                return true;
+            }
+        });
+
+        if (empty($options['where'])) {
+            unset($options['where']);
+        }
+
+        $options = array_merge((array)$OPT->getValue($model), $options);
+        $total = $model->where($options['where'])->count();
+
+        if (isset($REQUEST['r'])) {
+            $listRows = (int)$REQUEST['r'];
+        } else {
+            $listRows = (0 < C('LIST_ROWS') ? C('LIST_ROWS') : 10);
+        }
+
+        $page = new \Think\Page($total, $listRows, $REQUEST);
+
+        if ($listRows < $total) {
+            $page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
+        }
+
+        $p = $page->show();
+        $this->assign('_page', $p ? $p : '');
+        $this->assign('_total', $total);
+        $options['limit'] = $page->firstRow . ',' . $page->listRows;
+        $model->setProperty('options', $options);
+        return $model->field($field)->select();
+    }
+
+    // 提现导出表处理
+    public function exportExcel($expTitle, $expCellName, $expTableData)
+    {
+        import('Org.Util.PHPExcel');
+        import('Org.Util.PHPExcel.Writer.Excel5');
+        import('Org.Util.PHPExcel.IOFactory.php');
+        $xlsTitle = iconv('utf-8', 'gb2312', $expTitle);
+        $fileName = $_SESSION['loginAccount'] . date('_YmdHis');
+        $cellNum = count($expCellName);
+        $dataNum = count($expTableData);
+        // $objPHPExcel = new PHPExcel();
+        $objPHPExcel = new \PHPExcel();
+        $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
+        $objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');
+        $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', date('Y-m-d H:i:s') . '提现记录');
+		
+        $i = 0;
+        for (; $i < $cellNum; $i++) {
+            $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][2]);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension($cellName[$i])->setWidth(12);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('D')->setWidth(20);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('H')->setWidth(30);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('M')->setWidth(30);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('O')->setWidth(20);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('L')->setWidth(30);
+        }
+
+        $i = 0;
+        for (; $i < $dataNum; $i++) {
+            $j = 0;
+            for (; $j < $cellNum; $j++) {
+                $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), (string)$expTableData[$i][$expCellName[$j][0]]);
+            }
+        }
+
+        ob_end_clean();
+        header('pragma:public');
+        header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"');
+        header('Content-Disposition:attachment;filename=' . $fileName . '.xls');
+        // $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
+        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
+        $objWriter->save('php://output');
+        exit();
+    }
+
+    // 充值记录导出表处理
+    public function cz_exportExcel($expTitle, $expCellName, $expTableData)
+    {
+        import('Org.Util.PHPExcel');
+        import('Org.Util.PHPExcel.Writer.Excel5');
+        import('Org.Util.PHPExcel.IOFactory.php');
+        $xlsTitle = iconv('utf-8', 'gb2312', $expTitle);
+        $fileName = $_SESSION['loginAccount'] . date('_YmdHis');
+        $cellNum = count($expCellName);
+        $dataNum = count($expTableData);
+        // $objPHPExcel = new PHPExcel();
+        $objPHPExcel = new \PHPExcel();
+        $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
+        $objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');
+        $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', date('Y-m-d H:i:s') . '充值记录');
+		
+        $i = 0;
+        for (; $i < $cellNum; $i++) {
+            $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][2]);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension($cellName[$i])->setWidth(12);
+            // $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('D')->setWidth(20);
+            // $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('H')->setWidth(30);
+            // $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('M')->setWidth(30);
+            // $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('O')->setWidth(20);
+            // $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('L')->setWidth(30);
+        }
+
+        $i = 0;
+        for (; $i < $dataNum; $i++) {
+            $j = 0;
+            for (; $j < $cellNum; $j++) {
+                $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), (string)$expTableData[$i][$expCellName[$j][0]]);
+            }
+        }
+
+        ob_end_clean();
+        header('pragma:public');
+        header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"');
+        header('Content-Disposition:attachment;filename=' . $fileName . '.xls');
+        // $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
+        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
+        $objWriter->save('php://output');
+        exit();
+    }
+
+    // 用户表导出处理
+    public function us_exportExcel($expTitle, $expCellName, $expTableData)
+    {
+        import('Org.Util.PHPExcel');
+        import('Org.Util.PHPExcel.Writer.Excel5');
+        import('Org.Util.PHPExcel.IOFactory.php');
+        $xlsTitle = iconv('utf-8', 'gb2312', $expTitle);
+        $fileName = $_SESSION['loginAccount'] . date('_YmdHis');
+        $cellNum = count($expCellName);
+        $dataNum = count($expTableData);
+        $objPHPExcel = new \PHPExcel();
+        $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
+        $objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');
+        $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', date('Y-m-d H:i:s') . '充值记录');
+		
+        $i = 0;
+        for (; $i < $cellNum; $i++) {
+            $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][2]);
+            $objPHPExcel->setActiveSheetIndex(0)->getColumnDimension($cellName[$i])->setWidth(12);
+        }
+
+        $i = 0;
+        for (; $i < $dataNum; $i++) {
+            $j = 0;
+            for (; $j < $cellNum; $j++) {
+                $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), (string)$expTableData[$i][$expCellName[$j][0]]);
+            }
+        }
+
+        ob_end_clean();
+        header('pragma:public');
+        header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"');
+        header('Content-Disposition:attachment;filename=' . $fileName . '.xls');
+        $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
+        $objWriter->save('php://output');
+        exit();
+    }
+}
+
+?>

+ 141 - 0
Application/Admin/Controller/ArticleController.class.php

@@ -0,0 +1,141 @@
+<?php
+namespace Admin\Controller;
+
+class ArticleController extends AdminController
+{
+	protected function _initialize(){
+		parent::_initialize();
+		$allow_action=array("index","edit","wenzhangimg","ggeditup","taxggeditup","setstatus","taxtxt","taxedit");
+		if(!in_array(ACTION_NAME,$allow_action)){
+			$this->error("页面不存在!");
+		}
+	}
+	
+	//新增或编辑处理
+	public function taxggeditup($title=null,$img=null,$content=null,$status=null,$id=null){
+	    if($id <= 0){
+	        $_POST['addtime'] = date("Y-m-d H:i:s",time());
+	        $re = M("taxtxt")->add($_POST);
+	        if($re){
+	            $this->success("公告添加成功");
+	        }else{
+	            $this->error("公告添加失败");
+	        }
+	    }else{
+
+	        $re = M("taxtxt")->where(array('id'=>$id))->save($_POST);
+	        if($re){
+	            $this->success("公告修改成功");
+	        }else{
+	            $this->error("公告修改失败");
+	        }
+	    }
+	   
+	}
+	//纳税公告
+	public function taxtxt($name = NULL, $field = NULL, $status = NULL){
+		$where = array();
+		$count = M('taxtxt')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('taxtxt')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+	 //新增或编辑纳税公告
+	public function taxedit($id = NULL, $type = NULL){
+        
+        if($id > 0){
+            $info = M("taxtxt")->where(array('id'=>$id))->find();
+            $this->assign('data',$info);
+        }
+        
+		$this->display();
+	}
+	
+	//删除公告记录
+	public function setstatus($id=null){
+	    $where = array();
+        if(empty($id)){
+            $this->error("缺少重要参数");exit();
+        }
+        $where['id'] = array('in',$id);
+        $list = M("content")->where($where)->field("id,title")->select();
+        if(!empty($list)){
+            foreach($list as $key=>$vo){
+                $oid = $vo['id'];
+                M("content")->where(array('id'=>$oid))->delete();
+            }
+            $this->success("删除成功");exit();
+        }else{
+            $this->error("没有选择数据");exit();
+        }
+        
+	}
+	
+
+	//公告中心
+	public function index($name = NULL, $field = NULL, $status = NULL){
+		$where = array();
+		$count = M('content')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('content')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+    //新增或编辑公告页面
+	public function edit($id = NULL, $type = NULL){
+        
+        if($id > 0){
+            $info = M("content")->where(array('id'=>$id))->find();
+            $this->assign('data',$info);
+        }
+        
+		$this->display();
+	}
+	
+	//新增或编辑处理
+	public function ggeditup($title=null,$img=null,$content=null,$status=null,$id=null){
+	    if($id <= 0){
+	        $_POST['addtime']  = date("Y-m-d H:i:s",time());
+	        $re = M("content")->add($_POST);
+	        if($re){
+	            $this->success("公告添加成功");
+	        }else{
+	            $this->error("公告添加失败");
+	        }
+	    }else{
+
+	        $re = M("content")->where(array('id'=>$id))->save($_POST);
+	        if($re){
+	            $this->success("公告修改成功");
+	        }else{
+	            $this->error("公告修改失败");
+	        }
+	    }
+	   
+	}
+	
+	//上传图片
+	public function wenzhangimg(){
+		$upload = new \Think\Upload();
+		$upload->maxSize = 3145728;
+		$upload->exts = array('jpg', 'gif', 'png', 'jpeg');
+		$upload->rootPath = './Upload/article/';
+		$upload->autoSub = false;
+		$info = $upload->upload();
+		foreach ($info as $k => $v) {
+			$path = $v['savepath'] . $v['savename'];
+			echo $path;
+			exit();
+		}
+	}
+
+}
+
+?>

+ 947 - 0
Application/Admin/Controller/ConfigController.class.php

@@ -0,0 +1,947 @@
+<?php
+namespace Admin\Controller;
+
+class ConfigController extends AdminController
+{
+	protected function _initialize()
+	{
+		parent::_initialize();
+		$allow_action=array("index","upload","edit","image","coin","coinEdit","coinStatus","textStatus","coinImage","text","textEdit","qita","qitaEdit","daohang","daohangEdit","daohangStatus","dhfooter","dhfooterEdit","dhfooterStatus","dhadmin","dhadminEdit","dhadminStatus","ctmarket","ctmarketEdit","marketo","marketoEdit","marketoEdit2","marketoEdit3","marketoStatus","ctmarketoStatus","mining","miningEdit");
+		if(!in_array(ACTION_NAME,$allow_action)){
+			$this->error("页面不存在!".ACTION_NAME);
+		}
+	}
+
+    //系统设置首页
+	public function index(){
+		$this->data = M('Config')->where(array('id' => 1))->find();
+		$this->display();
+	}
+
+    //编加网站基本配置
+	public function edit(){
+        $data = I('post.');
+		if (M('Config')->where(array('id' => 1))->save($data)) {
+			$this->success('修改成功!');
+		} else {
+			$this->error('修改失败');
+		}
+	}
+
+
+	public function image(){
+		$upload = new \Think\Upload();
+		$upload->maxSize = 3145728;
+		$upload->exts = array('jpg', 'gif', 'png', 'jpeg');
+		$upload->rootPath = './Upload/public/';
+		$upload->autoSub = false;
+		$info = $upload->upload();
+		foreach ($info as $k => $v) {
+			$path = $v['savepath'] . $v['savename'];
+			echo $path;
+			exit();
+		}
+	}
+
+
+    public function upload()
+    {
+        $upload = new \Think\Upload();
+        $upload->maxSize = 314572800000;
+        $upload->exts = array('apk');
+        $upload->rootPath = './Upload/public/';
+        $upload->autoSub = false;
+        $info = $upload->upload();
+        foreach ($info as $k => $v) {
+            $path = $v['savepath'] . $v['savename'];
+            echo $path;
+            exit();
+        }
+    }
+	
+
+
+	public function coin($name = NULL, $field = NULL, $status = NULL)
+	{
+		$where = array();
+
+		if ($field && $name) {
+			if ($field == 'username') {
+				$where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+			} else {
+				$where[$field] = $name;
+			}
+		}
+
+		if ($status) {
+			$where['status'] = $status - 1;
+		}
+
+		$count = M('Coin')->where($where)->count();
+		$Page = new \Think\Page($count, 100);
+		$show = $Page->show();
+		$list = M('Coin')->where($where)->order('sort asc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+	
+    ////增加币名称OK
+	public function coinEdit($id = NULL)
+	{
+		if (empty($_POST)) {
+			if (empty($id)) {
+				$this->data = array();
+			} else {
+				$this->data = M('Coin')->where(array('id' => trim($_GET['id'])))->find();
+			}
+
+			$this->display();
+		} else {
+		    
+			if ($_POST['id']) {
+			    
+			    $_POST['addtime'] = date("Y-m-d H:i:s",time());
+				$rs = M('Coin')->save($_POST);
+				
+			} else {
+			    
+				if (!check($_POST['name'], 'n')) {
+					$this->error('币种简称只能是小写字母!');
+				}
+
+				$_POST['name'] = strtolower($_POST['name']);
+
+				if (check($_POST['name'], 'username')) {
+					$this->error('币种名称格式不正确!');
+				}
+
+				if (M('Coin')->where(array('name' => $_POST['name']))->find()) {
+					$this->error('币种存在!');
+				}
+				
+				$_POST['addtime'] = date("Y-m-d H:i:s",time());
+
+				$rea = M()->execute('ALTER TABLE  `tw_user_coin` ADD  `' . $_POST['name'] . '` DECIMAL(20,8) UNSIGNED NOT NULL DEFAULT 0.00000000');
+				$reb = M()->execute('ALTER TABLE  `tw_user_coin` ADD  `' . $_POST['name'] . 'd` DECIMAL(20,8) UNSIGNED NOT NULL DEFAULT 0.00000000');
+				$rec = M()->execute('ALTER TABLE  `tw_user_coin` ADD  `' . $_POST['name'] . 'b` VARCHAR(200) NOT NULL DEFAULT 0');
+
+				$rs = M('Coin')->add($_POST);
+			}
+
+			if ($rs) {
+				$this->success('操作成功!',U('Config/coin'));
+			} else {
+				$this->error('数据未修改!');
+			}
+		}
+	}
+
+	public function coinStatus()
+	{
+		if (IS_POST) {
+			$id = array();
+			$id = implode(',', $_POST['id']);
+		} else {
+			$id = $_GET['id'];
+		}
+
+		if (empty($id)) {
+			$this->error('请选择要操作的数据!');
+		}
+
+		$where['id'] = array('in', $id);
+		$method = $_GET['type'];
+		// $this->error($method);
+		switch (strtolower($method)) {
+			case 'forbid':
+				$data = array('status' => 0);
+				break;
+
+			case 'resume':
+				$data = array('status' => 1);
+				break;
+
+			case 'delt':
+				$rs = M('Coin')->where($where)->select();
+
+				foreach ($rs as $k => $v) {
+					$rs[] = M()->execute('ALTER TABLE  `tw_user_coin` DROP COLUMN ' . $v['name']);
+					$rs[] = M()->execute('ALTER TABLE  `tw_user_coin` DROP COLUMN ' . $v['name'] . 'd');
+					$rs[] = M()->execute('ALTER TABLE  `tw_user_coin` DROP COLUMN ' . $v['name'] . 'b');
+				}
+
+				if (M('Coin')->where($where)->delete()) {
+					$this->success('操作成功!');
+				} else {
+					$this->error('操作失败!');
+				}
+
+				break;
+
+			default:
+
+			$this->error('参数非法');
+		}
+
+		if (M('Coin')->where($where)->save($data)) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+
+
+	public function coinImage()
+	{
+		$upload = new \Think\Upload();
+		$upload->maxSize = 3145728;
+		$upload->exts = array('jpg', 'gif', 'png', 'jpeg');
+		$upload->rootPath = './Upload/coin/';
+		$upload->autoSub = false;
+		
+		$info = $upload->upload();
+		foreach ($info as $k => $v) {
+			$path = $v['savepath'] . $v['savename'];
+			echo $path;
+			exit();
+		}
+	}
+
+    //系统参数设置
+	public function qita(){
+		$this->data = M('Config')->where(array('id' => 1))->find();
+		$this->display();
+	}
+
+    //系统参数编辑
+	public function qitaEdit(){
+		$data = I('post.');
+		if (M('Config')->where(array('id' => 1))->save($data)) {
+			$this->success('修改成功!');
+		} else {
+			$this->error('修改失败');
+		}
+	}
+	
+
+	
+	// 前端导航配置
+	public function daohang($name = NULL, $field = NULL, $status = NULL, $lang = NULL)
+	{
+		$where = array();
+
+		if ($field && $name) {
+			if ($field == 'username') {
+				$where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+			} else if ($field == 'title') {
+				$where['title'] = array('like', '%' . $name . '%');
+			} else {
+				$where[$field] = $name;
+			}
+		}
+
+		if ($status) {
+			$where['status'] = $status - 1;
+		}
+		if ($lang) {
+			$where['lang'] = $lang;
+		}
+		
+		$count = M('Daohang')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('Daohang')->where($where)->order('sort asc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+
+	public function daohangEdit($id = NULL)
+	{
+	    //dump($_POST);
+		if (empty($_POST)) {
+			if ($id) {
+				$this->data = M('Daohang')->where(array('id' => trim($id)))->find();
+			} else {
+				$this->data = null;
+			}
+
+			$this->display();
+		} else {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+
+			if ($_POST['id']) {
+				$rs = M('Daohang')->save($_POST);
+			} else {
+				$_POST['addtime'] = time();
+				$rs = M('Daohang')->add($_POST);
+			}
+
+			if ($rs) {
+                $closeUrl = S('closeUrl');
+			    if($_POST['get_login']) {
+                    $closeUrl[] = $_POST['url'];
+                } else {
+                    if($key = array_search($_POST['url'], $closeUrl)) {
+                        unset($closeUrl[$key]);
+                    }
+                }
+                $closeUrl = array_unique($closeUrl);
+                sort($closeUrl);
+                S('closeUrl', $closeUrl);
+
+				$this->success('编辑成功!',U('Config/daohang'));
+			} else {
+				$this->error('编辑失败!');
+			}
+		}
+	}
+
+	public function daohangStatus($id = NULL, $type = NULL, $mobile = 'Daohang')
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (empty($id)) {
+			$this->error('参数错误!');
+		}
+		if (empty($type)) {
+			$this->error('参数错误1!');
+		}
+
+		if (strpos(',', $id)) {
+			$id = implode(',', $id);
+		}
+
+		$where['id'] = array('in', $id);
+
+		switch (strtolower($type)) {
+		case 'forbid':
+			$data = array('status' => 0);
+			break;
+
+		case 'resume':
+			$data = array('status' => 1);
+			break;
+
+		case 'repeal':
+			$data = array('status' => 2, 'endtime' => time());
+			break;
+
+		case 'del':
+			$data = array('status' => -1);
+			break;
+
+		case 'delete':
+			if (M($mobile)->where($where)->delete()) {
+				$this->success('操作成功!');
+			} else {
+				$this->error('操作失败!');
+			}
+
+			break;
+
+		default:
+			$this->error('操作失败!');
+		}
+
+		if (M($mobile)->where($where)->save($data)) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+	
+	// 页脚导航配置
+	public function dhfooter($name = NULL, $field = NULL, $status = NULL)
+	{
+		$where = array();
+
+		if ($field && $name) {
+			if ($field == 'username') {
+				$where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+			} else if ($field == 'title') {
+				$where['title'] = array('like', '%' . $name . '%');
+			} else {
+				$where[$field] = $name;
+			}
+		}
+		
+		if ($status) {
+			$where['status'] = $status - 1;
+		}
+
+		$count = M('footer')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('footer')->where($where)->order('sort asc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+	public function dhfooterEdit($id = NULL)
+	{
+		if (empty($_POST)) {
+			if ($id) {
+				$this->data = M('footer')->where(array('id' => trim($id)))->find();
+			} else {
+				$this->data = null;
+			}
+
+			$this->display();
+		} else {
+			if ($_POST['id']) {
+				$rs = M('footer')->save($_POST);
+			} else {
+				$_POST['addtime'] = time();
+				$rs = M('footer')->add($_POST);
+			}
+
+			if ($rs) {
+                $closeUrl = S('closeUrl');
+                if($_POST['get_login']) {
+                    $closeUrl[] = $_POST['url'];
+                } else {
+                    if($key = array_search($_POST['url'], $closeUrl)) {
+                        unset($closeUrl[$key]);
+                    }
+                }
+                $closeUrl = array_unique($closeUrl);
+                sort($closeUrl);
+                S('closeUrl', $closeUrl);
+				$this->success('编辑成功!',U('Config/dhfooter'));
+			} else {
+				$this->error('编辑失败!');
+			}
+		}
+	}
+
+	public function dhfooterStatus($id = NULL, $type = NULL, $mobile = 'footer')
+	{
+		if (empty($id)) {
+			$this->error('参数错误!');
+		}
+		if (empty($type)) {
+			$this->error('参数错误1!');
+		}
+
+		if (strpos(',', $id)) {
+			$id = implode(',', $id);
+		}
+
+		$where['id'] = array('in', $id);
+
+		switch (strtolower($type)) {
+		case 'forbid':
+			$data = array('status' => 0);
+			break;
+
+		case 'resume':
+			$data = array('status' => 1);
+			break;
+
+		case 'repeal':
+			$data = array('status' => 2, 'endtime' => time());
+			break;
+
+		case 'del':
+			$data = array('status' => -1);
+			break;
+
+		case 'delete':
+			if (M($mobile)->where($where)->delete()) {
+				$this->success('操作成功!');
+			} else {
+				$this->error('操作失败!');
+			}
+
+			break;
+
+		default:
+			$this->error('操作失败!');
+		}
+
+		if (M($mobile)->where($where)->save($data)) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+	
+	// 后端导航配置
+	public function dhadmin($name = NULL, $field = NULL, $status = NULL, $hide = NULL)
+	{
+		$where = array();
+
+		if ($field && $name) {
+			if ($field == 'username') {
+				$where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+			} else if ($field == 'title') {
+				$where['title'] = array('like', '%' . $name . '%');
+			} else {
+				$where[$field] = $name;
+			}
+		}
+
+		if ($status) {
+			$where['status'] = $status - 1;
+		}
+		if ($hide) {
+			$where['hide'] = $hide;
+		}
+		
+		$where_1 = $where;
+		$where_1['pid'] = 0;
+		$where_2 = $where;
+		
+		$list = M('menu')->where($where_1)->order('sort asc')->select();
+		foreach ($list as $k => $v) {
+			$where_2['pid'] = $v['id'];
+			$list[$k]['voo'] = M('menu')->where($where_2)->order('sort asc')->select();
+		}
+		
+		$this->assign('list', $list);
+		$this->display();
+	}
+	
+	public function dhadminEdit($id = NULL)
+	{
+		if (empty($_POST)) {
+			$liste = '';
+			
+			if ($id) {
+				$this->data = M('menu')->where(array('id' => trim($id)))->find();
+			} else {
+				$this->data = null;
+			}
+			
+			$liste = M('menu')->where('pid = 0')->order('sort asc')->select();
+			$this->assign('liste', $liste);
+			$this->display();
+		} else {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+			
+			if (empty($_POST['title'])) {
+				$this->error('标题错误');
+			}
+
+			if ($_POST['id']) {
+				$rs = M('menu')->save($_POST);
+			} else {
+				$_POST['addtime'] = time();
+				$rs = M('menu')->add($_POST);
+			}
+
+			if ($rs) {
+				$this->success('编辑成功!',U('Config/dhadmin'));
+			} else {
+				$this->error('编辑失败!');
+			}
+		}	
+	}
+
+	public function dhadminStatus($id = NULL, $type = NULL, $mobile = 'menu')
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (empty($id)) {
+			$this->error('参数错误!');
+		}
+		if (empty($type)) {
+			$this->error('参数错误1!');
+		}
+
+		if (strpos(',', $id)) {
+			$id = implode(',', $id);
+		}
+
+		$where['id'] = array('in', $id);
+		switch (strtolower($type)) {
+			case 'forbid':
+				$data = array('hide' => 1);
+				break;
+
+			case 'resume':
+				$data = array('hide' => 0);
+				break;
+
+			case 'repeal':
+				$data = array('hide' => 2);
+				break;
+				
+			case 'delete':
+				$data = array('status' => -1);
+				break;
+
+			case 'del':
+				if (M($mobile)->where($where)->delete()) {
+					$this->success('操作成功!');
+				} else {
+					$this->error('操作失败!');
+				}
+				break;
+
+			default:
+			$this->error('操作失败!');
+		}
+
+		if (M($mobile)->where($where)->save($data)) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+	
+	////市场配置OK
+	public function ctmarket(){
+	    $count = M('ctmarket')->count();
+		$Page = new \Think\Page($count, 100);
+		$show = $Page->show();
+		$list = M('ctmarket')->order('sort asc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    $this->display();
+	}
+
+    /////OK
+	public function marketo($field = NULL, $name = NULL)
+	{
+		$where = array();
+
+		if ($field && $name) {
+			if ($field == 'username') {
+				$where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+			} else {
+				$where[$field] = $name;
+			}
+		}
+		
+		$count = M('Market')->where($where)->count();
+		$Page = new \Think\Page($count, 100);
+		$show = $Page->show();
+		$list = M('Market')->where($where)->order('sort asc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+	
+	///链上币种市场配置修改
+	public function ctmarketEdit($id = NULL){
+        if(empty($_POST)){
+            $id = $_GET['id'];
+            $this->data = M('ctmarket')->where(array('id' => $id))->find();
+	        $this->display();
+        }else{
+            $coinname = $_POST['coinname'];
+            $status = $_POST['status'];
+            $state = $_POST['state'];
+            $sort = $_POST['sort'];
+            $id = $_POST['id'];
+            $data['coinname'] = strtolower($coinname);
+            $data['name'] = strtolower($coinname)."_usdt";
+            $data['symbol'] = strtolower($coinname)."usdt";
+            $data['title'] = strtoupper($coinname)."/USDT";
+            $data['status'] = $status;
+            $data['state'] = $state;
+            $data['sort'] = $sort;
+            $data['addtime'] = date("Y-m-d H:i:s",time());
+            //编辑
+            if($id > 0){
+                $re = M("ctmarket")->where(array('id'=>$id))->save($data);
+                if($re){
+                    $this->success('操作成功!',U('Config/ctmarket'));
+                }else{
+                    $this->error('操作失败!');
+                }
+                
+            }else{//新增
+                $re =M("ctmarket")->add($data);
+                if($re){
+                    $this->success('操作成功!',U('Config/ctmarket'));
+                }else{
+                    $this->error('操作失败!');
+                }
+            }
+            
+        }
+        
+	}
+	
+	// 平台币市场配置修改
+	public function marketoEdit($id = NULL)
+	{
+		$getCoreConfig = getCoreConfig();
+		if(!$getCoreConfig){
+			$this->error('核心配置有误');
+		}
+
+		if (empty($_POST)) {
+			if (empty($id)) {
+				$this->data = array();
+			} else {
+				$this->data = M('Market')->where(array('id' => $id))->find();
+			}
+			$time_arr = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23');
+			$time_minute = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59');
+			
+			$this->assign('time_arr', $time_arr);
+			$this->assign('time_minute', $time_minute);
+			$this->assign('getCoreConfig',$getCoreConfig['indexcat']);
+			$this->display();
+		} else {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+
+			$round = array(0, 1, 2, 3, 4, 5, 6);
+			if (!in_array($_POST['round'], $round)) {
+				$this->error('小数位数格式错误!');
+			}
+			
+			if(!$_POST['hou_price']){
+				$_POST['hou_price'] = '0.00000000';
+			}
+
+			if ($_POST['id']) {
+				$rs = M('Market')->save($_POST);
+			} else {
+				$buyname = $_POST['buyname'];
+				$_POST['name'] = $_POST['sellname'] . '_' . $_POST['buyname'];
+				unset($_POST['buyname']);
+				unset($_POST['sellname']);
+
+				if (M('Market')->where(array('name' => $_POST['name']))->find()) {
+					$this->error('市场存在!');
+				}
+				
+				$jiaoyiqu = strtolower($getCoreConfig['indexcat'][$_POST['jiaoyiqu']]);
+				if ($buyname != $jiaoyiqu) {
+					$this->error('所属交易区和买方币种不一致!'.$buyname);
+				}
+				$rs = M('Market')->add($_POST);
+			}
+
+			if ($rs) {
+				$this->success('操作成功!',U('Config/marketo'));
+			} else {
+				$this->error('操作失败!');
+			}
+		}
+	}
+	
+	// 市场配置2修改
+	public function marketoEdit2($id = NULL)
+	{
+		$getCoreConfig = getCoreConfig();
+		if(!$getCoreConfig){
+			$this->error('核心配置有误');
+		}
+		if (empty($_POST)) {
+			if (empty($id)) {
+				$this->data = array();
+			} else {
+				$this->data = M('Market')->where(array('id' => $id))->find();
+			}
+			
+			$time_arr = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23');
+			$time_minute = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59');
+			$this->assign('time_arr', $time_arr);
+			$this->assign('time_minute', $time_minute);
+			$this->assign('getCoreConfig',$getCoreConfig['indexcat']);
+			$this->display();
+		} else {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+
+			$round = array(0, 1, 2, 3, 4, 5, 6);
+			if (!in_array($_POST['round'], $round)) {
+				$this->error('小数位数格式错误!');
+			}
+
+			if ($_POST['id']) {
+				$rs = M('Market')->save($_POST);
+			} else {
+				$_POST['name'] = $_POST['sellname'] . '_' . $_POST['buyname'];
+				unset($_POST['buyname']);
+				unset($_POST['sellname']);
+
+				if (M('Market')->where(array('name' => $_POST['name']))->find()) {
+					$this->error('市场存在!');
+				}
+				$rs = M('Market')->add($_POST);
+			}
+
+			if ($rs) {
+				$this->success('操作成功!',U('Config/marketo'));
+			} else {
+				$this->error('操作失败!');
+			}
+		}
+	}
+	
+	// 市场配置3修改
+	public function marketoEdit3($id = NULL)
+	{
+		$getCoreConfig = getCoreConfig();
+		if(!$getCoreConfig){
+			$this->error('核心配置有误');
+		}
+		if (empty($_POST)) {
+			if (empty($id)) {
+				$this->data = array();
+			} else {
+				$this->data = M('Market')->where(array('id' => $id))->find();
+			}
+			
+			$time_arr = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23');
+			$time_minute = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59');
+			$this->assign('time_arr', $time_arr);
+			$this->assign('time_minute', $time_minute);
+			$this->assign('getCoreConfig',$getCoreConfig['indexcat']);
+			
+			$round = number_format("0",$this->data['round']-1).'1';
+			$this->assign('round', $round);
+			
+			$this->display();
+			
+		} else {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+
+			$round = array(0, 1, 2, 3, 4, 5, 6);
+			if (!in_array($_POST['round'], $round)) {
+				$this->error('小数位数格式错误!');
+			}
+
+			if ($_POST['id']) {
+				$rs = M('Market')->save($_POST);
+			} else {
+				$_POST['name'] = $_POST['sellname'] . '_' . $_POST['buyname'];
+				unset($_POST['buyname']);
+				unset($_POST['sellname']);
+
+				if (M('Market')->where(array('name' => $_POST['name']))->find()) {
+					$this->error('市场存在!');
+				}
+
+				$rs = M('Market')->add($_POST);
+			}
+
+			if ($rs) {
+				$this->success('操作成功!',U('Config/marketo'));
+			} else {
+				$this->error('操作失败!');
+			}
+		}
+	}
+	
+	public function marketoStatus($id = NULL, $type = NULL, $mobile = 'Market')
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (empty($id)) {
+			$this->error('参数错误!');
+		}
+		if (empty($type)) {
+			$this->error('参数错误1!');
+		}
+
+		if (strpos(',', $id)) {
+			$id = implode(',', $id);
+		}
+
+		$where['id'] = array('in', $id);
+
+		switch (strtolower($type)) {
+			case 'forbid':
+				$data = array('status' => 0);
+				break;
+
+			case 'resume':
+				$data = array('status' => 1);
+				break;
+
+			case 'repeal':
+				$data = array('status' => 2, 'endtime' => time());
+				break;
+
+			case 'delete':
+				$data = array('status' => -1);
+				break;
+
+			case 'del':
+				if (M($mobile)->where($where)->delete()) {
+					$this->success('操作成功!');
+				} else {
+					$this->error('操作失败!');
+				}
+
+				break;
+
+			default:
+				$this->error('操作失败!');
+		}
+
+		if (M($mobile)->where($where)->save($data)) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+	
+	////修改市场配置状态
+	public function ctmarketoStatus($id = NULL, $type = NULL, $mobile = 'ctmarket'){
+		if (empty($id)) {
+			$this->error('参数错误!');
+		}
+		if (empty($type)) {
+			$this->error('参数错误1!');
+		}
+		if (strpos(',', $id)) {
+			$id = implode(',', $id);
+		}
+		$where['id'] = array('in', $id);
+		switch (strtolower($type)) {
+			case 'forbid':
+				$data = array('status' => 2);
+				break;
+			case 'resume':
+				$data = array('status' => 1);
+				break;
+			case 'del':
+				if (M($mobile)->where($where)->delete()) {
+					$this->success('操作成功!');
+				} else {
+					$this->error('操作失败!');
+				}
+
+				break;
+			default:
+				$this->error('操作失败!');
+		}
+		if (M($mobile)->where($where)->save($data)) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+	
+
+}
+?>

+ 307 - 0
Application/Admin/Controller/FinanceController.class.php

@@ -0,0 +1,307 @@
+<?php
+namespace Admin\Controller;
+
+class FinanceController extends AdminController
+{
+	protected function _initialize(){
+		parent::_initialize();
+		$allow_action=array("index","myzr","myzc","adopttb","reject","adoptzr","rejectzr","taxlist","adopttax","rejecttax");
+		if(!in_array(ACTION_NAME,$allow_action)){
+			$this->error("页面不存在!");
+		}
+	}
+	
+	//驳回税金缴纳
+	public function rejecttax($id = null){
+	    if($id <= 0){
+	        $this->error("缺少重要参数");exit();
+	    }
+	    $info = M("recharge")->where(array('id'=>$id))->find();
+	    if(empty($info)){
+	        $this->error("充币订单不存在");exit();
+	    }
+	    if($info['status'] != 1){
+	        $this->error("此订单已处理");exit();
+	    }
+	    //修改订单状态
+	    $save['updatetime'] = date("Y-m-d H:i:s",time());
+	    $save['status'] = 3;
+	    $upre = M("taxlist")->where(array('id'=>$id))->save($save);
+	    if($upre){
+	        $data['uid'] = $info['uid'];
+		    $data['account'] = $info['username'];
+		    $data['title'] = L('税金审核');
+		    $data['content'] = L('缴纳税金审核被驳回,请联系客服');
+		    $data['addtime'] = date("Y-m-d H:i:s",time());
+		    $data['status'] = 1;
+		    M("taxlist")->add($data);
+	        $this->success("税金审核驳回成功");
+	    }else{
+	        $this->error("税金审核驳回失败");
+	    }
+	}
+	
+	//确认税金
+	public function adopttax($id = null){
+	    if($id <= 0){
+	        $this->error("缺少重要参数");exit();
+	    }
+	    $info = M("taxlist")->where(array('id'=>$id))->find();
+	    if(empty($info)){
+	        $this->error("记录不存在");exit();
+	    }
+	    if($info['status'] != 1){
+	        $this->error("记录已处理");exit();
+	    }
+	    $uid = $info['uid'];
+	    
+	    $save['updatetime'] = date("Y-m-d H:i:s",time());
+	    $save['status'] = 2;
+	    $upre = M("taxlist")->where(array('id'=>$id))->save($save);
+	    
+	    if($upre){
+	        $notice['uid'] = $info['uid'];
+		    $notice['account'] = $info['username'];
+		    $notice['title'] = L('税金审核');
+		    $notice['content'] = L('缴纳税金审核成功');
+		    $notice['addtime'] = date("Y-m-d H:i:s",time());
+		    $notice['status'] = 1;
+		    M("notice")->add($notice);
+	        M("user")->where(array('id'=>$uid))->save(array('taxstatus'=>1));
+	        $this->success("操作成功");
+	    }else{
+	        $this->error("操作失败");
+	    }
+
+	}
+	
+	//税金列表
+	public function taxlist($name=null){
+	    if($name != ''){
+		    $where['username'] = $name;
+		}
+		$count = M('taxlist')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('taxlist')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+
+		$this->display();
+	}
+	
+	//驳回充币
+	public function rejectzr($id = null){
+	    if($id <= 0){
+	        $this->error("缺少重要参数");exit();
+	    }
+	    $info = M("recharge")->where(array('id'=>$id))->find();
+	    if(empty($info)){
+	        $this->error("充币订单不存在");exit();
+	    }
+	    if($info['status'] != 1){
+	        $this->error("此订单已处理");exit();
+	    }
+	    //修改订单状态
+	    $save['updatetime'] = date("Y-m-d H:i:s",time());
+	    $save['status'] = 3;
+	    $upre = M("recharge")->where(array('id'=>$id))->save($save);
+	    if($upre){
+	        
+	        $data['uid'] = $info['uid'];
+		    $data['account'] = $info['username'];
+		    $data['title'] = L('充币审核');
+		    $data['content'] = L('您的充币记录被系统驳回,请联系客服');
+		    $data['addtime'] = date("Y-m-d H:i:s",time());
+		    $data['status'] = 1;
+		    M("notice")->add($data);
+	        
+	        $this->success("充值驳回成功");
+	    }else{
+	        $this->error("驳回失败");
+	    }
+	}
+	
+	//确认充币
+	public function adoptzr($id = null){
+	    if($id <= 0){
+	        $this->error("缺少重要参数");exit();
+	    }
+	    $info = M("recharge")->where(array('id'=>$id))->find();
+	    if(empty($info)){
+	        $this->error("充币订单不存在");exit();
+	    }
+	    if($info['status'] != 1){
+	        $this->error("此订单已处理");exit();
+	    }
+	    $uid = $info['uid'];
+	    $num = $info['num'];
+        if ($info['coin'] == 'TRC20-USDT' || $info['coin'] == 'ERC20-USDT'){
+            $info['coin'] = 'USDT';
+        }
+	    $coinname = strtolower(trim($info['coin']));
+
+	    $minfo = M("user_coin")->where(array('userid'=>$uid))->find();
+	    //修改订单状态
+	    $save['updatetime'] = date("Y-m-d H:i:s",time());
+	    $save['status'] = 2;
+	    $upre = M("recharge")->where(array('id'=>$id))->save($save);
+	    //增加会员资产
+	    $incre = M("user_coin")->where(array('userid'=>$uid))->setInc($coinname,$num);
+	    //增加充值日志
+	    $data['uid'] = $info['uid'];
+	    $data['username'] = $info['username'];
+	    $data['num'] = $num;
+	    $data['coinname'] = $coinname;
+	    $data['afternum'] = $minfo[$coinname] + $num;
+	    $data['type'] = 17;
+	    $data['addtime'] = date("Y-m-d H:i:s",time());
+	    $data['st'] = 1;
+	    $data['remark'] = L('充幣到賬');
+	    $addre = M("bill")->add($data);
+	    if($upre && $incre && $addre){
+
+	        $notice['uid'] = $info['uid'];
+		    $notice['account'] = $info['username'];
+		    $notice['title'] = L('充币审核');
+		    $notice['content'] = L('您的充值金额已到账,请注意查收');
+		    $notice['addtime'] = date("Y-m-d H:i:s",time());
+		    $notice['status'] = 1;
+		    M("notice")->add($notice);
+	        
+	        $this->success("处理成功");
+	    }else{
+	        $this->error("处理失败");
+	    }
+	}
+	
+	
+	//驳回提币记录
+	public function reject($id = null){
+	    if($id <= 0){
+	        $this->error("缺少重要参数");exit();
+	    }
+	    $info = M("myzc")->where(array('id'=>$id))->find();
+	    if(empty($info)){
+	        $this->error("提币订单不存在");exit();
+	    }
+	    if($info['status'] != 1){
+	        $this->error("此订单已处理");exit();
+	    }
+	    
+	   $uid = $info['userid'];
+	   $num = $info['num'];
+	   $coinname = strtolower(trim($info['coinname']));
+	   //修改记录状态
+	   $save['endtime'] = date("Y-m-d H:i:s",time());
+	   $save['status'] = 3;
+	   $upre = M("myzc")->where(array('id'=>$id))->save($save);
+	   //把提币的数量返回给账号户,并写入日志
+	   $minfo = M("user_coin")->where(array('userid'=>$uid))->find();
+	   $incre = M("user_coin")->where(array('userid'=>$uid))->setInc($coinname,$num);
+	   $bill['uid'] = $uid;
+	   $bill['username'] = $info['username'];
+	   $bill['num'] =$num;
+	   $bill['coinname'] = $info['coinname'];
+	   $bill['afternum'] = $minfo[$coinname] + $num;
+	   $bill['type'] = 16;
+	   $bill['addtime'] = date("Y-m-d H:i:s",time());
+	   $bill['st'] = 1;
+	   $bill['remark'] = L('提币驳回,退回资金');;
+	   $billre = M("bill")->add($bill);
+	   if($upre && $incre && $billre){
+	       
+	       $notice['uid'] = $uid;
+		   $notice['account'] = $info['username'];
+		   $notice['title'] = L('提币审核');
+		   $notice['content'] = L('您的提币申请被驳回,请联系管理员');
+		   $notice['addtime'] = date("Y-m-d H:i:s",time());
+		   $notice['status'] = 1;
+		   M("notice")->add($notice);
+	       
+	       $this->success("操作成功");exit();
+	   }else{
+	       $this->error("操作失败");exit();
+	   }
+	    
+	}
+	
+	//通过提币处理
+	public function adopttb($id = null){
+	    if($id <= 0){
+	        $this->error("缺少重要参数");exit();
+	    }
+	    $info = M("myzc")->where(array('id'=>$id))->find();
+	    if(empty($info)){
+	        $this->error("提币订单不存在");exit();
+	    }
+	    if($info['status'] != 1){
+	        $this->error("此订单已处理");exit();
+	    }
+	    $save['endtime'] = date("Y-m-d H:i:s",time());
+	    $save['status'] = 2;
+	    $result = M("myzc")->where(array('id'=>$id))->save($save);
+	    if($result){
+	        
+	        $notice['uid'] = $info['userid'];
+		    $notice['account'] = $info['username'];
+		    $notice['title'] = L('提币审核');
+		    $notice['content'] = L('您的提币申请已通过,请及时查询');
+		    $notice['addtime'] = date("Y-m-d H:i:s",time());
+		    $notice['status'] = 1;
+		    M("notice")->add($notice);
+	        
+	        $this->success('处理成功!',U('Finance/myzc'));
+	    }else{
+	        $this->error("处理失败");exit();
+	    }
+	}
+    
+    //账务明细
+	public function index($name=null){
+		if($name != ''){
+		    $where['username'] = $name;
+		}
+		$count = M('bill')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('bill')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+
+	//充币列表
+	public function myzr($name=null){
+	    if($name != ''){
+		    $where['username'] = $name;
+		}
+		$count = M('recharge')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('recharge')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+
+		$this->display();
+	}
+	
+	//提币列表
+	public function myzc($name=null){
+	    if($name != ''){
+		    $where['username'] = $name;
+		}
+		$count = M('myzc')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('myzc')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		
+		$this->display();
+	}
+
+
+}
+?>

+ 94 - 0
Application/Admin/Controller/IndexController.class.php

@@ -0,0 +1,94 @@
+<?php
+namespace Admin\Controller;
+class IndexController extends AdminController
+{
+    
+	public function index(){
+        
+        //全网总人数
+        $alluser = M("user")->count();
+        $this->assign("alluser",$alluser);
+        //快速合约未平仓记录数
+        $allhy = M("hyorder")->where(array('status'=>1))->count();
+        $this->assign("allhy",$allhy);
+        //币币交易额度
+        $bball = M("bborder")->where(array('status'=>2))->sum("usdtnum");
+        $this->assign("bball",sprintf("%.4f",$bball));
+        //全网矿机总数
+        $allkj = M("kjorder")->where(array('status'=>1))->count();
+        $this->assign("allkj",$allkj);
+        //认购总数
+        $allissue = M("issue_log")->where(array('status'=>1))->count();
+        $this->assign("allissue",$allissue);
+        //充值数量
+        $allcz = M("recharge")->where(array('status'=>2))->sum("num");
+        $this->assign("allcz",sprintf("%.4f",$allcz));
+        //提币数量
+        $alltx = M("myzc")->where(array('status'=>2))->sum("num");
+        $this->assign("alltx",sprintf("%.4f",$alltx));
+        //今日该客量
+        $nowdate = date("Y-m-d",time());
+        $linewhere['lgtime'] = array('eq',$nowdate);
+        $allline = M("user")->where($linewhere)->count();
+        $this->assign("allline",$allline);
+
+        
+        
+        $data = array();
+		$time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - (29 * 24 * 60 * 60);
+		$i = 0;
+
+		for (; $i < 30; $i++) {
+			$a = $time;
+			$time = $time + (60 * 60 * 24);
+			$date = addtime($time - (60 * 60), 'Y-m-d');
+			$mycz = M('recharge')->where(array(
+				'status'  => array('neq', 1),
+				'addtime' => array(
+					array('gt', $a),
+					array('lt', $time)
+					)
+				))->sum('num');
+			$mytx = M('myzc')->where(array(
+				'status'  => 1,
+				'addtime' => array(
+					array('gt', $a),
+					array('lt', $time)
+					)
+				))->sum('num');
+
+			if ($mycz || $mytx) {
+				$data['cztx'][] = array('date' => $date, 'charge' => $mycz, 'withdraw' => $mytx);
+			}
+		}
+
+		$time = time() - (30 * 24 * 60 * 60);
+		$i = 0;
+
+		for (; $i < 60; $i++) {
+			$a = $time;
+			$time = $time + (60 * 60 * 24);
+			$date = addtime($time, 'Y-m-d');
+			$user = M('User')->where(array(
+				'addtime' => array(
+					array('gt', $a),
+					array('lt', $time)
+					)
+				))->count();
+
+			if ($user) {
+				$data['reg'][] = array('date' => $date, 'sum' => $user);
+			}
+		}
+
+		$this->assign('cztx', json_encode($data['cztx']));
+		$this->assign('reg', json_encode($data['reg']));
+        
+    
+
+		$this->display();
+	}
+
+}
+
+?>

+ 92 - 0
Application/Admin/Controller/IssueController.class.php

@@ -0,0 +1,92 @@
+<?php
+namespace Admin\Controller;
+
+class IssueController extends AdminController
+{
+	
+	//认购项目记录
+	public function index(){
+		$count = M('issue')->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('issue')->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+
+	public function issueimage()
+	{
+		$upload = new \Think\Upload();
+		$upload->maxSize = 3145728;
+		$upload->exts = array('jpg', 'gif', 'png', 'jpeg');
+		$upload->rootPath = './Upload/public/';
+		$upload->autoSub = false;
+		
+		$info = $upload->upload();
+		foreach ($info as $k => $v) {
+			$path = $v['savepath'] . $v['savename'];
+			echo $path;
+			exit();
+		}
+	}
+    
+    //新增或编辑认购项目
+	public function edit($id = null){
+        $clist = M("coin")->where("type = 3 or type = 2")->order("id desc")->field("name,title")->select();
+        $this->assign("clist",$clist);
+        
+        $paylist = M("coin")->where("type = 1 or type = 2")->order("id desc")->field("name,title")->select();
+        $this->assign("paylist",$paylist);
+        
+        $alllist = M("coin")->order("id desc")->field("name,title")->select();
+        $this->assign("alllist",$alllist);
+        if($id > 0){
+            $data = M("issue")->where(array('id'=>$id))->find();
+            $this->assign('data',$data);
+        }
+
+		$this->display();
+	}
+
+    //处理新增或编辑认购项目
+	public function save(){
+
+        $tian = $_POST['tian'];
+        $_POST['addtime'] = date("Y-m-d H:i:s",time());
+        $_POST['finishtime'] = date("Y-m-d H:i:s",(strtotime($_POST['starttime']) + 86400 * $tian));
+        
+        
+		if ($_POST['id']) {
+			$rs = M('Issue')->save($_POST);
+		} else {
+			$rs = M('Issue')->add($_POST);
+		}
+
+		if ($rs) {
+			$this->success('操作成功!');
+		} else {
+			$this->error('操作失败!');
+		}
+	}
+
+
+
+	public function log($name=null){
+		if($name != null){
+		    $where['account'] = trim($name);
+		}
+		$count = M('issue_log')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('issue_log')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+
+	}
+
+
+}
+?>

+ 241 - 0
Application/Admin/Controller/KuangmController.class.php

@@ -0,0 +1,241 @@
+<?php
+namespace Admin\Controller;
+
+class KuangmController extends AdminController
+{
+
+	public function __construct()
+	{
+		parent::__construct();
+	}
+	//矿机收益列表
+	public function djprofit($username = null){
+	   if($username != ''){
+	        $where['username'] = array('eq',$username);
+	    }
+	    $count = M('djprofit')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('djprofit')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    $this->display(); 
+	}
+	
+	//矿机收益列表
+	public function kjsylist($username = null){
+	   if($username != ''){
+	        $where['username'] = array('eq',$username);
+	    }
+	    $count = M('kjprofit')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('kjprofit')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    $this->display(); 
+	}
+	
+	//启用会员矿机,停用会员矿机,删除会员矿机
+	public function userkjStatus($id = NULL, $type = NULL, $mobile = 'User'){
+	    if($mobile != "Admin"){
+	       $this->error("参数错误"); 
+	    }
+	    $where['id'] = array('in', $id);
+	    switch (strtolower($type)) {
+	    case 1:
+	        $result = M("kjorder")->where($where)->save(array('status'=>1));
+			break;
+		case 2:
+	        $result = M("kjorder")->where($where)->save(array('status'=>2));
+			break;
+		case 3:
+	        $result = M("kjorder")->where($where)->delete();
+			break;
+		default:
+			$this->error('操作失败!');	
+	    }
+	    
+	    if($result){
+	        $this->success('操作成功!');
+	    }else{
+	        $this->error('操作失败!');
+	    }
+	}
+	
+	//会员过期的矿机列表
+	public function overlist(){
+	    $where['status'] = array('eq',3);
+	    $count = M('kjorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('kjorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    $this->display();
+	}
+	
+	//会员运行中的矿机列表
+	public function kjlist($username = null){
+	    if($username != ''){
+	        $where['username'] = array('eq',$username);
+	    }
+	    $where['status'] = array('lt',3);
+	    $count = M('kjorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('kjorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    $this->display();
+	}
+	
+	//启用,停用矿机,删除矿机
+	public function kuangjStatus($id = NULL, $type = NULL, $mobile = 'User'){
+	    if($mobile != "Admin"){
+	       $this->error("参数错误"); 
+	    }
+	    $where['id'] = array('in', $id);
+	    switch (strtolower($type)) {
+	    case 1:
+	        $result = M("kuangji")->where($where)->save(array('status'=>1));
+			break;
+		case 2:
+	        $result = M("kuangji")->where($where)->save(array('status'=>2));
+			break;
+		case 3:
+	        $result = M("kuangji")->where($where)->delete();
+			break;
+		default:
+			$this->error('操作失败!');	
+	    }
+	    
+	    if($result){
+	        $this->success('操作成功!');
+	    }else{
+	        $this->error('操作失败!');
+	    }
+	}
+
+
+    //矿机列表页面
+	public function index(){
+	    
+	    $count = M('kuangji')->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('kuangji')->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+
+		$this->display();
+	}
+	
+	
+	//添加矿机
+	public function addkj(){
+	    if($_POST){
+	        $data['title'] = trim($_POST['title']);
+	        $data['rtype'] = trim($_POST['rtype']);
+	        $data['type'] = trim($_POST['type']);
+	        if($data['type'] == 1){
+	            $data['sharebl'] = 0;
+	            $data['sharecode'] = '';
+	        }elseif($data['type'] == 2){
+	            $data['sharebl'] = trim($_POST['sharebl']);
+	            $data['sharecode'] = creat_sharecode(13);
+	        }
+	        $data['content'] = trim($_POST['content']);
+	        $data['imgs'] = trim($_POST['imgs']); 
+	        $data['dayoutnum'] = trim($_POST['dayoutnum']); 
+	        $data['outtype'] = trim($_POST['outtype']); 
+	        $data['outcoin'] = trim($_POST['outcoin']); 
+	        $data['pricenum'] = trim($_POST['pricenum']); 
+	        $data['pricecoin'] = trim($_POST['pricecoin']); 
+	        $data['buymax'] = trim($_POST['buymax']); 
+	        $data['cycle'] = trim($_POST['cycle']); 
+	        $data['suanl'] = trim($_POST['suanl']); 
+	        $data['allnum'] = trim($_POST['allnum']); 
+	        $data['ycnum'] = trim($_POST['ycnum']); 
+	        $data['jlnum'] = trim($_POST['jlnum']); 
+	        $data['di'] = trim($_POST['di']); 
+	        $data['gao'] = trim($_POST['gao']); 
+	        $data['jlcoin'] = trim($_POST['jlcoin']); 
+	        $data['status'] = 1; 
+	        $data['buyask'] = trim($_POST['buyask']); 
+	        $data['asknum'] = trim($_POST['asknum']);
+	        $data['djout'] = trim($_POST['djout']); 
+	        if(trim($_POST['djout']) == 2){
+	            $data['djday'] = trim($_POST['djday']); 
+	        }else{
+	            $data['djday'] = trim($_POST['djday']); 
+	        }
+	        
+	        $data['addtime'] = date("Y-m-d H:i:s",time()); 
+	        $kid = trim($_POST['kid']); 
+
+	        if($kid > 0){
+	            $result = M("kuangji")->where(array('id'=>$kid))->save($data);
+	            $msg = "编辑成功";
+	        }else{
+	            $result = M("kuangji")->add($data);
+	            $msg = "添加成功";
+	        }
+	        if($result){
+	            $this->success($msg);
+	        }else{
+	            $this->error($msg);
+	        }
+	    }else{
+	        $this->error("非法操作");exit();
+	    }
+	}
+	
+	
+	
+	//添加矿机页面
+	public function addkuangj(){
+	    $id = trim(I('get.id'));
+	    $info = M("kuangji")->where(array('id'=>$id))->find();
+	    if(!empty($info)){
+	        $list = M("coin")->where(array('status'=>1))->field("id,name,title")->select();
+	        $data = array();
+	        foreach($list as $k=>$v){
+	            $data[$k]['id'] = $v['id']; 
+	            $data[$k]['name'] = trim($v['name']); 
+	            $data[$k]['title'] = $v['title']; 
+	        }
+	        $this->assign('coind',$data);
+	        $this->assign('data',$info);
+	    }else{
+	        $list = M("coin")->where(array('status'=>1))->field("id,name,title")->select();
+	        $data = array();
+	        foreach($list as $k=>$v){
+	            $data[$k]['id'] = $v['id']; 
+	            $data[$k]['name'] = trim($v['name']); 
+	            $data[$k]['title'] = $v['title']; 
+	        }
+	        $this->assign('coind',$data);
+	    }
+	    $this->display();
+	}
+	
+	//上传矿机图片
+	public function image(){
+		$upload = new \Think\Upload();
+		$upload->maxSize = 3145728;
+		$upload->exts = array('jpg', 'gif', 'png', 'jpeg');
+		$upload->rootPath = './Upload/public/';
+		$upload->autoSub = false;
+		$info = $upload->upload();
+		foreach ($info as $k => $v) {
+			$path = $v['savepath'] . $v['savename'];
+			echo $path;
+			exit();
+		}
+	}
+	
+
+
+}
+?>

+ 340 - 0
Application/Admin/Controller/LevertadeController.class.php

@@ -0,0 +1,340 @@
+<?php
+namespace Admin\Controller;
+
+class LevertadeController extends AdminController
+{
+	
+	protected function _initialize(){
+		parent::_initialize();
+		$allow_action=array("index","setting","ccinfo","closeorder","getprice","pclist","trustlist","clearorder","addorder");
+		if(!in_array(ACTION_NAME,$allow_action)){
+			$this->error("页面不存在!");
+		}
+	}
+	
+	public function addorder(){
+	    if($_POST){
+	        $id = trim(I('post.id'));
+	        if($id == '' || $id <=  0){
+	            $this->ajaxReturn(['code'=>2,'info'=>'缺少重要参数']);exit();
+	        }
+	        $oinfo = M("leverorder")->where(array('id'=>$id))->find();
+
+	        if(empty($oinfo)){
+	            $this->ajaxReturn(['code'=>2,'info'=>'订单不存在']);exit();
+	        }
+	        if($oinfo['status'] != 1){
+	            $this->ajaxReturn(['code'=>2,'info'=>'订单状态已更改,无法开仓']);exit();
+	        }
+	        $uid = $oinfo['uid'];
+			$user = M("levermoney")->where(array('uid'=>$uid))->find();
+	        $uinfo = M("user")->where(array('id'=>$uid))->field("id,username")->find();
+	        $minfo = M("user_coin")->where(array('userid'=>$uid))->find();
+	        
+	        $sysinfo = M("leversetting")->where(array('id'=>1))->find();
+	        $lever_fee = $sysinfo['lever_fee'];//费率
+
+
+			$oy_list = do_request(oy_url($oinfo['coinname'], 'api/v5/market/index-tickers?instId='), []);
+			$oy_list = $oy_list->data[0];
+//                $url = "https://api.huobi.pro/market/history/kline?period=1day&size=1&symbol=".$lowercoin;
+//                $result = $this->getprice($url);
+//                $pdata = $result['data'][0];
+			$close = $oy_list->idxPx;//现价
+            
+            //手续费计算(开仓价格 * 开仓数量 * 手续费率) ,开仓时扣除手续费
+	        $data['fee'] = $fee = $oinfo['fee'];
+            
+            if($fee > $user['money']){
+                $this->ajaxReturn(['code'=>2,'info'=>'该会员账户余额不足,请撤消委托']);exit();
+            }
+            $data['price'] = $close;
+            $data['status'] = 2;
+            $data['addtime'] = date("Y-m-d H:i:s",time());
+            $result = M("leverorder")->where(array('id'=>$id))->save($data);
+            if($result){
+                M("levermoney")->where(array('uid'=>$uid))->setDec('money',$fee);
+                $ubill['uid'] = $uid;
+		        $ubill['username'] = $uinfo['username'];
+		        $ubill['num'] = $fee;
+		        $ubill['coinname'] = "usdt";
+		        $ubill['afternum'] = $user['money'] - $fee;
+		        $ubill['type'] = 25;
+		        $ubill['addtime'] = date("Y-m-d H:i:s",time());
+		        $ubill['st'] = 2;
+		        $ubill['remark'] = L('合约交易开仓手续费');
+	            $ubillre = M("bill")->add($ubill);
+	            $this->ajaxReturn(['code'=>1,'info'=>'操作成功']);exit();
+            }else{
+                $this->ajaxReturn(['code'=>2,'info'=>'操作失败']);exit();
+            }
+	    }else{
+	        $this->ajaxReturn(['code'=>2,'info'=>'非法操作']);exit();
+	    }
+	}
+	
+	public function clearorder(){
+	    if($_POST){
+	        $id = trim(I('post.id'));
+	        if($id == '' || $id <=  0){
+	            $this->ajaxReturn(['code'=>2,'info'=>'缺少重要参数']);exit();
+	        }
+	        $oinfo = M("leverorder")->where(array('id'=>$id))->find();
+	        if(empty($oinfo)){
+	            $this->ajaxReturn(['code'=>2,'info'=>'订单不存在']);exit();
+	        }
+	        if($oinfo['status'] != 1){
+	            $this->ajaxReturn(['code'=>2,'info'=>'该合约不能撤消']);exit();
+	        }
+			$order = M("leverorder")->where(array('id'=>$id))->find();
+			$user = M('levermoney')->where(['uid' => $order['uid']])->find();
+			$bond_ubill = [
+				'uid' => $order['uid'],
+				'username' => $user['username'],
+				'num' => $order['bond'],
+				'coinname' => 'lever',
+				'afternum' => $user['money'] + $order['bond'],
+				'type' => 25,
+				'addtime' => date("Y-m-d H:i:s",time()),
+				'st' => 1,
+				'remark' => '撤销委托返还合约账户'
+			];// 扣除合约保证金
+			M("levermoney")->where(array('uid'=>$order['uid']))->setInc('money', $order['bond']);
+			M("levermoney")->where(array('uid' => $order['uid']))->setDec('moneyd', $order['bond']);
+			M("bill")->add($bond_ubill);
+
+	        $result = M("leverorder")->where(array('id'=>$id))->delete();
+	        if($result){
+	            $this->ajaxReturn(['code'=>1,'info'=>'撤消成功']);exit();
+	        }else{
+	            $this->ajaxReturn(['code'=>2,'info'=>'撤消失败']);exit();
+	        }
+	    }else{
+	        $this->ajaxReturn(['code'=>2,'info'=>'非法操作']);exit();
+	    }
+	}
+	
+	public function trustlist(){
+	    $where = array();
+        if(I('get.username') != '' || I('get.username') != null){
+            $username = trim(I('get.username'));
+		    $where['username'] = $username;
+        }
+        
+        if(I('get.direction') > 0){
+            $hyzd = trim(I('get.direction'));
+		    $where['direction'] = $hyzd;
+        }
+		
+		$where['status'] = 1;
+
+		$count = M('leverorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('leverorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	    
+	}
+	
+	public function pclist(){
+	    $where = '';
+        if(I('get.username') != '' || I('get.username') != null){
+            $username = trim(I('get.username'));
+		    $where .= "username = {$username} and";
+        }
+        
+        if(I('get.direction') > 0){
+            $hyzd = trim(I('get.direction'));
+		    $where .= "direction = {$hyzd} and";
+        }
+        
+        if(I('get.yk_status') > 0){
+            $yk_status = trim(I('get.yk_status'));
+		    $where .= "yk_status = {$yk_status} and";
+        }
+		
+		$where .= "(status = 3 or status = 4)";
+
+		$count = M('leverorder')->where($where)->count();
+		
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('leverorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+
+		$this->display();
+	}
+	
+	public function closeorder(){
+	    if($_POST){
+	        $id = trim(I('post.id'));
+	        if($id == '' || $id <=  0){
+	            $this->ajaxReturn(['code'=>2,'info'=>'缺少重要参数']);exit();
+	        }
+	        $oinfo = M("leverorder")->where(array('id'=>$id,'status'=>2))->find();
+	        if(empty($oinfo)){
+	            $this->ajaxReturn(['code'=>2,'info'=>'订单不存在']);exit();
+	        }
+	        
+	        $uid = $oinfo['uid'];
+	        
+	        $uinfo = M("user")->where(array('id'=>$uid))->field("id,username")->find();
+	    
+	        $lowercoin = $oinfo['coinname'];
+	        $url = "https://api.huobi.pro/market/history/kline?period=1day&size=1&symbol=".$lowercoin;
+            $result = $this->getprice($url);
+            $pdata = $result['data'][0];
+            $close = $pdata['close'];//现价
+	        //收益计算
+	        //例:BTC/USDT永续合约开多仓100张,成交价格为10000 USDT,以11000 USDT价格平仓,
+            //则:平仓盈亏 = 收益(平仓) =( 11000 – 10000 )* 100 * 0.001 = 100 USDT。
+            $direction = $oinfo['direction'];
+	        if($direction == 1){ //做多
+	            $profit = sprintf("%.2f",(($close - $oinfo['price']) * 100 * 0.001 * $oinfo['ggan']));
+	            
+	        }elseif($direction == 2){ //做空
+	            $profit = sprintf("%.2f",(($oinfo['price'] - $close) * 100 * 0.001 * $oinfo['ggan']));
+	        }
+            if($profit >= 0){
+                $yk_status = 1;
+            }else{
+                $yk_status = 2;
+            }
+            
+            $tprofit = abs($profit);
+            $data['pc_price'] = $close;
+            $data['status'] = 3;
+            $data['yk_status'] = $yk_status;
+            $data['ylmoney'] = $tprofit;
+            $data['endtime'] = date("Y-m-d H:i:s",time());
+            $result = M("leverorder")->where(array('id'=>$id,'status'=>2))->save($data);
+            if($result){
+                $minfo = M("user_coin")->where(array('userid'=>$uid))->find();
+                if($profit >= 0){
+                    M("user_coin")->where(array('userid'=>$uid))->setInc('usdt',$tprofit);
+                    $ubill['uid'] = $uid;
+		            $ubill['username'] = $uinfo['username'];
+		            $ubill['num'] = $tprofit;
+		            $ubill['coinname'] = "usdt";
+		            $ubill['afternum'] = $minfo['usdt'] + $tprofit;
+		            $ubill['type'] = 20;
+		            $ubill['addtime'] = date("Y-m-d H:i:s",time());
+		            $ubill['st'] = 1;
+		            $ubill['remark'] = "合约交易手动平仓盈利收益";
+	                $ubillre = M("bill")->add($ubill);
+
+                }else{
+                    if($minfo['usdt'] >= $tprofit){
+                        M("user_coin")->where(array('userid'=>$uid))->setDec('usdt',$tprofit);
+                        $ubill['uid'] = $uid;
+		                $ubill['username'] = $uinfo['username'];
+		                $ubill['num'] = $tprofit;
+		                $ubill['coinname'] = "usdt";
+		                $ubill['afternum'] = $minfo['usdt'] - $tprofit;
+		                $ubill['type'] = 20;
+		                $ubill['addtime'] = date("Y-m-d H:i:s",time());
+		                $ubill['st'] = 2;
+		                $ubill['remark'] = "合约交易手动平仓亏损";
+	                    $ubillre = M("bill")->add($ubill);
+                    }else{
+                        //如果亏损金额大于账户余额,账户余额全扣完,剩下的部分扣合约账户
+                        $tpro_a = $minfo['usdt'];
+                        $tpro_b = $tprofit - $minfo['usdt'];
+                        M("user_coin")->where(array('userid'=>$uid))->setDec('usdt',$tpro_a);
+                        $ubill['uid'] = $uid;
+		                $ubill['username'] = $uinfo['username'];
+		                $ubill['num'] = $tpro_a;
+		                $ubill['coinname'] = "usdt";
+		                $ubill['afternum'] = $minfo['usdt'] - $tpro_a;
+		                $ubill['type'] = 20;
+		                $ubill['addtime'] = date("Y-m-d H:i:s",time());
+		                $ubill['st'] = 2;
+		                $ubill['remark'] = "合约交易手动平仓亏损";
+	                    $ubillre = M("bill")->add($ubill);
+                        $levermoney_info = M("levermoney")->where(array('uid'=>$uid))->find();
+                        if($levermoney_info['money'] >= $tpro_b){
+                            M("levermoney")->where(array('uid'=>$uid))->setDec("money",$tpro_b);
+                        }else{
+                            M("levermoney")->where(array('uid'=>$uid))->save(array('money',0));
+                        }
+                    }
+                }
+                $this->ajaxReturn(['code'=>1,'info'=>'操作成功']);exit();
+            }else{
+                $this->ajaxReturn(['code'=>2,'info'=>'操作失败']);exit();
+            }
+	    }else{
+	        $this->ajaxReturn(['code'=>2,'info'=>'非法操作']);exit();
+	    }
+	}
+	
+	
+	public function ccinfo(){
+	    $id = trim(I('get.id'));
+	    $info = M("leverorder")->where(array("id"=>$id))->find();
+        $this->assign('info',$info);
+	    $this->display();
+	}
+	
+	public function index(){
+	    
+        $where = array();
+        if(I('get.username') != '' || I('get.username') != null){
+            $username = trim(I('get.username'));
+		    $where['username'] = $username;
+        }
+        
+        if(I('get.direction') > 0){
+            $hyzd = trim(I('get.direction'));
+		    $where['direction'] = $hyzd;
+        }
+		
+		$where['status'] = 2;
+
+		$count = M('leverorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('leverorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+	
+	
+	
+	//永续合约设置
+	public function setting(){
+	    if($_POST){
+	        $result = M("leversetting")->where(array('id'=>1))->save($_POST);
+	        if($result){
+	            $this->success('修改成功');
+	        }else{
+	            $this->error('修改失败');
+	        }
+	    }else{
+	        $info = M("leversetting")->where(array('id'=>1))->find();
+	        $this->assign("info",$info);
+	        $this->display();
+	    }
+	    
+	}
+	
+	  //获取行情数据
+    public function getprice($api){
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+        curl_setopt ($ch, CURLOPT_URL, $api );
+        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
+        $result = json_decode(curl_exec($ch),true);
+        return $result;
+    }
+	
+
+
+}
+
+?>

+ 144 - 0
Application/Admin/Controller/LoginController.class.php

@@ -0,0 +1,144 @@
+<?php
+namespace Admin\Controller;
+
+class LoginController extends \Think\Controller
+{
+	public function chexiao()
+	{
+		$trade = M()->query('select * from tw_trade where status=0 order by id desc ;');
+		//$trade = M('Trade')->where(array('status' =>0))->select();
+		//var_dump($trade);exit;
+		$rs =array();
+		foreach ($trade as $k => $v) {
+			$rs[] = D('Trade')->chexiao($v['id']);
+		}
+
+		if (check_arr($rs)) {
+			echo '撤销成功!';
+		} else {
+			echo '撤销失败!';
+		}
+	}
+	
+	public function index($username = NULL, $password = NULL, $verify = NULL, $urlkey = NULL)
+	{
+		if (IS_POST) {
+
+            //echo $verify;die;
+            
+            //if (!check_verify(strtoupper($verify),'1')) {
+				//$this->error('验证码输入错误!');
+			//}
+
+			$admin = M('Admin')->where(array('username' => $username))->find();
+
+			if ($admin['password'] != md5($password)) {
+				$this->error('用户名或密码错误!');
+			} else {
+				$uids = $admin['id'];
+				$admin_auth = M('AuthGroupAccess')->where(array('uid' => $uids))->find();
+				if(!$admin_auth){
+					$this->error('用户暂未分组!');
+				}
+
+				$group_id = $admin_auth['group_id'];
+				$admin_gid = M('AuthGroup')->where(array('id' => $group_id))->find();
+				if(!$admin_gid){
+					$this->error('用户所在分组不存在!');
+				}
+				
+				M('Admin')->where(array('username' => $username))->save(array('last_login_time' => time(), 'last_login_ip' => get_client_ip()));
+				
+				session('admin_id', $admin['id']);
+				S('5df4g5dsh8shnfsf', $admin['id']);
+				session('admin_username', $admin['username']);
+				session('admin_password', $admin['password']);
+				$this->success('登陆成功!', U('Index/index'));
+			}
+		} else {
+			defined('ADMIN_KEY') || define('ADMIN_KEY', '');
+
+			if (ADMIN_KEY && ($urlkey != ADMIN_KEY)) {
+				$this->redirect('Home/Index/index');
+			}
+			if (session('admin_id')) {
+				$this->redirect('Admin/Index/index');
+			}
+
+			$this->display();
+		}
+	}
+
+	public function loginout()
+	{
+		session(null);
+		S('5df4g5dsh8shnfsf', null);
+		$this->redirect('Login/index');
+	}
+
+	public function lockScreen()
+	{
+		if (!IS_POST) {
+			$this->display();
+		} else {
+			$pass = trim(I('post.pass'));
+
+			if ($pass) {
+				session('LockScreen', $pass);
+				session('LockScreenTime', 3);
+				$this->success('锁屏成功,正在跳转中...');
+			} else {
+				$this->error('请输入一个锁屏密码');
+			}
+		}
+	}
+
+	public function unlock()
+	{
+		if (!session('admin_id')) {
+			session(null);
+			$this->error('登录已经失效,请重新登录...', '/Admin/login');
+		}
+		if (session('LockScreenTime') < 0) {
+			session(null);
+			$this->error('密码错误过多,请重新登录...', '/Admin/login');
+		}
+
+		$pass = trim(I('post.pass'));
+		if ($pass == session('LockScreen')) {
+			session('LockScreen', null);
+			$this->success('解锁成功', '/Admin/index');
+		}
+
+		$admin = M('Admin')->where(array('id' => session('admin_id')))->find();
+		if ($admin['password'] == md5($pass)) {
+			session('LockScreen', null);
+			$this->success('解锁成功', '/Admin/index');
+		}
+
+		session('LockScreenTime', session('LockScreenTime') - 1);
+		$this->error('用户名或密码错误!');
+	}
+
+	public function queue()
+	{
+		$file_path = DATABASE_PATH . '/check_queue.json';
+		$time = time();
+		$timeArr = array();
+
+		if (file_exists($file_path)) {
+			$timeArr = file_get_contents($file_path);
+			$timeArr = json_decode($timeArr, true);
+		}
+
+		array_unshift($timeArr, $time);
+		$timeArr = array_slice($timeArr, 0, 3);
+
+		if (file_put_contents($file_path, json_encode($timeArr))) {
+			exit('exec ok[' . $time . ']' . "\n");
+		} else {
+			exit('exec fail[' . $time . ']' . "\n");
+		}
+	}
+}
+?>

+ 27 - 0
Application/Admin/Controller/MarketController.class.php

@@ -0,0 +1,27 @@
+<?php
+namespace Admin\Controller;
+
+class MarketController extends AdminController
+{
+	private $Model;
+
+	public function __construct()
+	{
+		parent::__construct();
+
+
+	}
+
+	public function index(){
+	
+		$this->display();
+	}
+
+	public function edit(){
+
+		$this->display();
+	}
+
+
+}
+?>

+ 296 - 0
Application/Admin/Controller/OrepoolController.class.php

@@ -0,0 +1,296 @@
+<?php
+namespace Admin\Controller;
+
+class OrepoolController extends AdminController
+{
+	private $Model;
+
+	public function __construct()
+	{
+		parent::__construct();
+	}
+	
+	//矿池管理列表
+	public function index(){
+
+
+		$this->display();
+	}
+	
+	//添加矿池项目页面
+	public function addorepool(){
+	    
+		$this->display();
+	}
+	
+	//修改矿池项目处理
+	public function orepoolesave(){
+		if($_POST){			
+			//ID号
+			$id = htmlspecialchars(trim(I('post.oid')));
+			$info = M("orepool")->where(array('id'=>$id))->find();
+			if(empty($info)){
+				$this->error("记录不存在");
+			}
+			$oretitle = htmlspecialchars(trim(I('post.oretitle')));//矿池名称
+			if($oretitle == ''){
+				$this->error("请输入矿池名称");
+			}
+			$oreimg = htmlspecialchars(trim(I('post.idimg1'))); //项目图片
+			if($oreimg == ''){
+				$this->error("请上传项目图片");
+			}
+			$coinname = htmlspecialchars(trim(I('post.coinname'))); //参与币种
+			if($coinname == ''){
+				$this->error("请选择参与矿池的币种");
+			}
+			$cc_coin = htmlspecialchars(trim(I('post.cc_coin'))); //产出币种
+			if($cc_coin == ''){
+				$this->error("请选择矿池产出的币种");
+			}			
+			$summoney = htmlspecialchars(trim(I('post.summoney')));//矿矿总价值
+			if($summoney == ''){
+				$this->error("请输入矿池总价值");
+			}			
+			$fmoney = htmlspecialchars(trim(I('post.fmoney'))); //模拟进度
+			if($fmoney == ''){
+				$this->error("请输入矿池模拟投入金额");
+			}
+			$minmoney = htmlspecialchars(trim(I('post.minmoney'))); // 最低投资额度
+			if($minmoney == ''){
+				$this->error("请输入单笔最低投资额度");
+			}
+			$maxmoney = htmlspecialchars(trim(I('post.maxmoney'))); //最高投资额度
+			if($maxmoney == ''){
+				$this->error("请输入单笔最大投资额度");
+			}
+			$rtype = htmlspecialchars(trim(I('post.rtype'))); //币释放规则
+			if($rtype == ''){
+				$this->error("请选择币释放规则");
+			}
+			$sfbl = htmlspecialchars(trim(I('post.sfbl'))); //固定释放比例
+			if($sfbl == ''){
+				$this->error("请输入固定释放比例");
+			}
+			$gdnum = htmlspecialchars(trim(I('post.gdnum'))); //固定释放额度
+			if($gdnum == ''){
+				$this->error("请输入固定释放额度");
+			}
+			$gdbl = htmlspecialchars(trim(I('post.gdbl'))); //固定额度比例
+			if($gdbl == ''){
+				$this->error("请输入固定额度比例");
+			}
+			$rway = htmlspecialchars(trim(I('post.rway'))); //释放方式
+			if($rway == ''){
+				$this->error("请选择释放方式");
+			}
+			$buytype = htmlspecialchars(trim(I('post.buytype'))); //购买方式
+			if($buytype == ''){
+				$this->error("请选择购买方式");
+			}
+			$arrmoney = htmlspecialchars(trim(I('post.arrmoney'))); 
+			
+			if($arrmoney == ''){
+				$arrmoney = 0;
+			}
+			
+			$buynum = htmlspecialchars(trim(I('post.buynum'))); //单用户购买次数
+			if($buynum == ''){
+				$this->error("请输入单用户购买次数");
+			}
+			
+			$sort = htmlspecialchars(trim(I('post.sort')));//排序
+			if($sort == ''){
+				$this->error("请输入排序编号");
+			}
+			$status = htmlspecialchars(trim(I('post.status'))); // 状态
+			if($status == ''){
+				$this->error("请输入矿池开放状态");
+			}
+			
+
+			$save['oretitle'] = $oretitle;
+			$save['oreimg'] = $oreimg;
+			$save['summoney'] = $summoney;
+			$save['fmoney'] = $fmoney;
+			$save['minmoney'] = $minmoney;
+			$save['maxmoney'] = $maxmoney;
+			$save['coinname'] = $coinname;
+			$save['cc_coin'] = $cc_coin;
+			$save['rtype'] = $rtype;
+			$save['status'] = $status;
+			$save['addtime'] = date("Y-m-d H:i:s",time());
+			$save['buytype'] = $buytype;
+			$save['arrmoney'] = $arrmoney;
+			$save['buynum'] = $buynum;
+			$save['rway'] = $rway;
+			$save['sfbl'] = $sfbl;
+			$save['gdnum'] = $gdnum;
+			$save['gdbl'] = $gdbl;
+			$save['sort'] = $sort;
+
+			$re = M("orepool")->where(array('id'=>$id))->save($save);
+			
+			if($re){
+				$this->success("修改成功");exit();
+			}else{
+				$this->error("修改失败");exit();
+			}
+			
+		}else{
+			$this->error("网络错误");exit();
+		}
+		
+	}
+	
+	//添加矿池项目处理
+	public function orepoolsave(){
+		if($_POST){			
+			$oretitle = htmlspecialchars(trim(I('post.oretitle')));//矿池名称
+			if($oretitle == ''){
+				$this->error("请输入矿池名称");
+			}
+			$oreimg = htmlspecialchars(trim(I('post.idimg1'))); //项目图片
+			if($oreimg == ''){
+				$this->error("请上传项目图片");
+			}
+			$coinname = htmlspecialchars(trim(I('post.coinname'))); //参与币种
+			if($coinname == ''){
+				$this->error("请选择参与矿池的币种");
+			}
+			$cc_coin = htmlspecialchars(trim(I('post.cc_coin'))); //产出币种
+			if($cc_coin == ''){
+				$this->error("请选择矿池产出的币种");
+			}			
+			$summoney = htmlspecialchars(trim(I('post.summoney')));//矿矿总价值
+			if($summoney == ''){
+				$this->error("请输入矿池总价值");
+			}			
+			$fmoney = htmlspecialchars(trim(I('post.fmoney'))); //模拟进度
+			if($fmoney == ''){
+				$this->error("请输入矿池模拟投入金额");
+			}
+			$minmoney = htmlspecialchars(trim(I('post.minmoney'))); // 最低投资额度
+			if($minmoney == ''){
+				$this->error("请输入单笔最低投资额度");
+			}
+			$maxmoney = htmlspecialchars(trim(I('post.maxmoney'))); //最高投资额度
+			if($maxmoney == ''){
+				$this->error("请输入单笔最大投资额度");
+			}
+			$rtype = htmlspecialchars(trim(I('post.rtype'))); //币释放规则
+			if($rtype == ''){
+				$this->error("请选择币释放规则");
+			}
+			$sfbl = htmlspecialchars(trim(I('post.sfbl'))); //固定释放比例
+			if($sfbl == ''){
+				$this->error("请输入固定释放比例");
+			}
+			$gdnum = htmlspecialchars(trim(I('post.gdnum'))); //固定释放额度
+			if($gdnum == ''){
+				$this->error("请输入固定释放额度");
+			}
+			$gdbl = htmlspecialchars(trim(I('post.gdbl'))); //固定额度比例
+			if($gdbl == ''){
+				$this->error("请输入固定额度比例");
+			}
+			$rway = htmlspecialchars(trim(I('post.rway'))); //释放方式
+			if($rway == ''){
+				$this->error("请选择释放方式");
+			}
+			$buytype = htmlspecialchars(trim(I('post.buytype'))); //购买方式
+			if($buytype == ''){
+				$this->error("请选择购买方式");
+			}
+			
+			$arrmoney = htmlspecialchars(trim(I('post.arrmoney'))); 
+			
+			if($arrmoney == ''){
+				$arrmoney = 0;
+			}
+
+			
+			$buynum = htmlspecialchars(trim(I('post.buynum'))); //单用户购买次数
+			if($buynum == ''){
+				$this->error("请输入单用户购买次数");
+			}
+			
+			$sort = htmlspecialchars(trim(I('post.sort')));//排序
+			if($sort == ''){
+				$this->error("请输入排序编号");
+			}
+			$status = htmlspecialchars(trim(I('post.status'))); // 状态
+			if($status == ''){
+				$this->error("请输入矿池开放状态");
+			}
+			
+			$save['oretitle'] = $oretitle;
+			$save['oreimg'] = $oreimg;
+			$save['summoney'] = $summoney;
+			$save['fmoney'] = $fmoney;
+			$save['minmoney'] = $minmoney;
+			$save['maxmoney'] = $maxmoney;
+			$save['coinname'] = $coinname;
+			$save['cc_coin'] = $cc_coin;
+			$save['rtype'] = $rtype;
+			$save['status'] = $status;
+			$save['addtime'] = date("Y-m-d H:i:s",time());
+			$save['buytype'] = $buytype;
+			$save['arrmoney'] = $arrmoney;
+			$save['buynum'] = $buynum;
+			$save['rway'] = $rway;
+			$save['sfbl'] = $sfbl;
+			$save['gdnum'] = $gdnum;
+			$save['gdbl'] = $gdbl;
+			$save['sort'] = $sort;
+
+			$re = M("orepool")->add($save);
+			if($re){
+				$this->success("添加成功");exit();
+			}else{
+				$this->error("添加失败");exit();
+			}
+			
+		}else{
+			$this->error("网络错误");exit();
+		}
+	}
+	
+	//修改矿池项目
+	public function editorepool(){
+		$id = trim(I('get.id'));
+		$info = M("orepool")->where(array('id'=>$id))->find();	
+		$this->assign('info',$info);
+		$this->display();
+	}
+	
+	//删除矿池项目
+	public function delore(){
+		if($_GET){
+			$id = trim(I('get.id'));
+			$info = M("orepool")->where(array('id'=>$id))->find();	
+			if(empty($info)){
+				$this->error("该记录不存在");exit();
+			}
+			if($info['allmoney'] > 0){
+				$this->error("已有会员参与该矿池,不能删除");
+			}
+			$re = M("orepool")->where(array('id'=>$id))->delete();
+			if($re){
+				$this->success("操作成功");exit();
+			}else{
+				$this->error("操作失败");exit();
+			}
+		}else{
+			$this->error("非法操作");exit();
+		}
+		
+	}
+
+
+
+	
+
+}
+
+?>

+ 671 - 0
Application/Admin/Controller/ToolsController.class.php

@@ -0,0 +1,671 @@
+<?php
+namespace Admin\Controller;
+
+class ToolsController extends AdminController
+{
+	protected function _initialize(){
+		parent::_initialize();
+		$allow_action=array("index","cache","delcahe","getDirSize","queue","delcache","invoke","rmdirr","excel","export","import");
+		if(!in_array(ACTION_NAME,$allow_action)){
+			$this->error("页面不存在!");
+		}
+	}
+
+	public function cache()
+	{
+		$size = $this->getDirSize('./Runtime/');
+		$this->assign('cacheSize', round($size / pow(1024, $i = floor(log($size, 1024))), 2));
+		$this->display();
+	}
+
+	public function delcahe()
+	{
+		$size = $this->getDirSize('./Runtime/');
+		$this->assign('cacheSize', round($size / pow(1024, $i = floor(log($size, 1024))), 2));
+		$this->display();
+	}
+
+	protected function getDirSize($dir)
+	{
+		$sizeResult = '';
+		$handle = opendir($dir);
+
+		while (false !== $FolderOrFile = readdir($handle)) {
+			if (($FolderOrFile != '.') && ($FolderOrFile != '..')) {
+				if (is_dir($dir . '/' . $FolderOrFile)) {
+					$sizeResult += $this->getDirSize($dir . '/' . $FolderOrFile);
+				}
+				else {
+					$sizeResult += filesize($dir . '/' . $FolderOrFile);
+				}
+			}
+		}
+
+		closedir($handle);
+		return $sizeResult;
+	}
+
+	public function delcache()
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		$dirs = array('./Runtime/');
+		@(mkdir('Runtime', 511, true));
+
+		foreach ($dirs as $value) {
+			$this->rmdirr($value);
+		}
+
+		@(mkdir('Runtime', 511, true));
+
+		$this->success('系统缓存清除成功!');
+	}
+
+	public function invoke()
+	{
+
+		$dirs = array('./Runtime/');
+		@(mkdir('Runtime', 511, true));
+
+		foreach ($dirs as $value) {
+			$this->rmdirr($value);
+		}
+
+		@(mkdir('Runtime', 511, true));
+	}
+
+	protected function rmdirr($dirname)
+	{
+		if (!file_exists($dirname)) {
+			return false;
+		}
+
+		if (is_file($dirname) || is_link($dirname)) {
+			return unlink($dirname);
+		}
+
+		$dir = dir($dirname);
+
+		if ($dir) {
+			while (false !== $entry = $dir->read()) {
+				if (($entry == '.') || ($entry == '..')) {
+					continue;
+				}
+
+				$this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);
+			}
+		}
+
+		$dir->close();
+		return rmdir($dirname);
+	}
+
+	public function dataExport()
+	{
+		redirect('/Admin/Tools/database?type=export');
+	}
+
+	public function dataImport()
+	{
+		redirect('/Admin/Tools/database?type=import');
+	}
+
+	public function database($type = NULL)
+	{
+		switch ($type) {
+		case 'import':
+			$path = realpath(DATABASE_PATH);
+			$glob = self::FilesystemIterator($path);
+			$list = array();
+			for($i=0;$i<count($glob);$i++){
+				$name=$glob[$i];
+				$a = str_replace(".sql.gz","",$glob[$i]);
+				$lv=explode("-",$a);
+				if (preg_match('/^\\d{8,8}-\\d{6,6}-\\d+\\.sql(?:\\.gz)?$/', $name)) {
+					$name = sscanf($name, '%4s%2s%2s-%2s%2s%2s-%d');
+					$date = $name[0] . '-' . $name[1] . '-' . $name[2];
+					$time = $name[3] . ':' . $name[4] . ':' . $name[5];
+					$part = $name[6];
+
+					$list[$i]['time']=strtotime($date." ".$time);
+					$list[$i]['part']=$lv[2];
+					$list[$i]['size']=filesize($path."/".$glob[$i])."B";
+					$list[$i]['key']=$date." ".$time;
+		    	}
+			}
+			break;
+
+		case 'export':
+			$Db = \Think\Db::getInstance();
+			$list = $Db->query('SHOW TABLE STATUS');
+			$list = array_map('array_change_key_case', $list);
+			$title = '数据备份';
+			break;
+
+		default:
+			$this->error('参数错误!');
+		}
+
+		$this->assign('meta_title', $title);
+		$this->assign('list', $list);
+		$this->display($type);
+	}
+
+	function FilesystemIterator($dir){
+		exit;
+		//PHP遍历文件夹下所有文件
+		$handle=opendir($dir.".");
+		//定义用于存储文件名的数组
+		$array_file = array();
+		while (false !== ($file = readdir($handle))) {
+			if ($file != "." && $file != "..") {
+				$array_file[] = $file; //输出文件名
+			}
+		}
+		closedir($handle);
+		for($i=0;$i<count($array_file);$i++){
+			if(strstr($array_file[$i],'.sql.gz')){
+				$date[]=$array_file[$i];
+			}
+		}
+
+		return $date;
+	}
+
+	public function optimize($tables = NULL)
+	{
+		exit;
+		if ($tables) {
+			$Db = \Think\Db::getInstance();
+
+			if (is_array($tables)) {
+				$tables = implode('`,`', $tables);
+				$list = $Db->query('OPTIMIZE TABLE `' . $tables . '`');
+
+				if ($list) {
+					$this->success('数据表优化完成!');
+				}
+				else {
+					$this->error('数据表优化出错请重试!');
+				}
+			}
+			else {
+				$list = $Db->query('OPTIMIZE TABLE `' . $tables . '`');
+
+				if ($list) {
+					$this->success('数据表\'' . $tables . '\'优化完成!');
+				}
+				else {
+					$this->error('数据表\'' . $tables . '\'优化出错请重试!');
+				}
+			}
+		}
+		else {
+			$this->error('请指定要优化的表!');
+		}
+	}
+
+	public function repair($tables = NULL)
+	{
+		exit;
+		if ($tables) {
+			$Db = \Think\Db::getInstance();
+
+			if (is_array($tables)) {
+				$tables = implode('`,`', $tables);
+				$list = $Db->query('REPAIR TABLE `' . $tables . '`');
+
+				if ($list) {
+					$this->success('数据表修复完成!');
+				}
+				else {
+					$this->error('数据表修复出错请重试!');
+				}
+			}
+			else {
+				$list = $Db->query('REPAIR TABLE `' . $tables . '`');
+
+				if ($list) {
+					$this->success('数据表\'' . $tables . '\'修复完成!');
+				}
+				else {
+					$this->error('数据表\'' . $tables . '\'修复出错请重试!');
+				}
+			}
+		}
+		else {
+			$this->error('请指定要修复的表!');
+		}
+	}
+
+	public function del($time = 0)
+	{
+		exit;
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if ($time) {
+			$name = date('Ymd-His', $time) . '-*.sql*';
+			$path = realpath(DATABASE_PATH) . DIRECTORY_SEPARATOR . $name;
+			array_map('unlink', glob($path));
+
+			if (count(glob($path))) {
+				$this->success('备份文件删除失败,请检查权限!');
+			}
+			else {
+				$this->success('备份文件删除成功!');
+			}
+		}
+		else {
+			$this->error('参数错误!');
+		}
+	}
+
+	public function export($tables = NULL, $id = NULL, $start = NULL)
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (C('web_close')) {
+			$this->error('请先关闭网站再备份数据库!');
+		}
+
+		if (IS_POST && !empty($tables) && is_array($tables)) {
+			$config = array('path' => realpath(DATABASE_PATH) . DIRECTORY_SEPARATOR, 'part' => 20971520, 'compress' => 1, 'level' => 9);
+			$lock = $config['path'] . 'backup.lock';
+
+			if (is_file($lock)) {
+				$this->error('检测到有一个备份任务正在执行,请稍后再试!');
+			}
+			else {
+				file_put_contents($lock, NOW_TIME);
+			}
+
+			is_writeable($config['path']) || $this->error('备份目录不存在或不可写,请检查后重试!');
+			session('backup_config', $config);
+			$file = array('name' => date('Ymd-His', NOW_TIME), 'part' => 1);
+			session('backup_file', $file);
+			session('backup_tables', $tables);
+			$Database = new \OT\Database($file, $config);
+
+			if (false !== $Database->create()) {
+				$tab = array('id' => 0, 'start' => 0);
+				$this->success('初始化成功!', '', array('tables' => $tables, 'tab' => $tab));
+			}
+			else {
+				$this->error('初始化失败,备份文件创建失败!');
+			}
+		}
+		else if (IS_GET && is_numeric($id) && is_numeric($start)) {
+			$tables = session('backup_tables');
+			$Database = new \OT\Database(session('backup_file'), session('backup_config'));
+			$start = $Database->backup($tables[$id], $start);
+
+			if (false === $start) {
+				$this->error('备份出错!');
+			}
+			else if (0 === $start) {
+				if (isset($tables[++$id])) {
+					$tab = array('id' => $id, 'start' => 0);
+					$this->success('备份完成!', '', array('tab' => $tab));
+				}
+				else {
+					unlink(session('backup_config.path') . 'backup.lock');
+					session('backup_tables', null);
+					session('backup_file', null);
+					session('backup_config', null);
+					$this->success('备份完成!');
+				}
+			}
+			else {
+				$tab = array('id' => $id, 'start' => $start[0]);
+				$rate = floor(100 * ($start[0] / $start[1]));
+				$this->success('正在备份...(' . $rate . '%)', '', array('tab' => $tab));
+			}
+		}
+		else {
+			$this->error('参数错误!');
+		}
+		//$this->display();
+	}
+
+	public function import($time = 0, $part = NULL, $start = NULL)
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (C('web_close')) {
+			$this->error('请先关闭网站再还原数据库!');
+		}
+
+		if (is_numeric($time) && is_null($part) && is_null($start)) {
+			$name = date('Ymd-His', $time) . '-*.sql*';
+			$path = realpath(DATABASE_PATH) . DIRECTORY_SEPARATOR . $name;
+			$files = glob($path);
+			$list = array();
+
+			foreach ($files as $name) {
+				$basename = basename($name);
+				$match = sscanf($basename, '%4s%2s%2s-%2s%2s%2s-%d');
+				$gz = preg_match('/^\\d{8,8}-\\d{6,6}-\\d+\\.sql.gz$/', $basename);
+				$list[$match[6]] = array($match[6], $name, $gz);
+			}
+
+			ksort($list);
+			$last = end($list);
+
+			if (count($list) === $last[0]) {
+				session('backup_list', $list);
+				$this->success('初始化完成!', '', array('part' => 1, 'start' => 0));
+			}
+			else {
+				$this->error('备份文件可能已经损坏,请检查!');
+			}
+		}
+		else if (is_numeric($part) && is_numeric($start)) {
+			$list = session('backup_list');
+			$db = new \OT\Database($list[$part], array('path' => realpath(DATABASE_PATH) . DIRECTORY_SEPARATOR, 'compress' => 1, 'level' => 9));
+			$start = $db->import($start);
+
+			if (false === $start) {
+				$this->error('还原数据出错!');
+			}
+			else if (0 === $start) {
+				if (isset($list[++$part])) {
+					$data = array('part' => $part, 'start' => 0);
+					$this->success('正在还原...#' . $part, '', $data);
+				}
+				else {
+					session('backup_list', null);
+					$this->success('还原完成!');
+				}
+			}
+			else {
+				$data = array('part' => $part, 'start' => $start[0]);
+
+				if ($start[1]) {
+					$rate = floor(100 * ($start[0] / $start[1]));
+					$this->success('正在还原...#' . $part . ' (' . $rate . '%)', '', $data);
+				}
+				else {
+					$data['gz'] = 1;
+					$this->success('正在还原...#' . $part, '', $data);
+				}
+			}
+		}
+		else {
+			$this->error('参数错误!');
+		}
+		//$this->display();
+	}
+
+	public function excel($tables = NULL)
+	{
+		if ($tables) {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+
+			$mo = M();
+			$mo->execute('set autocommit=0');
+			$mo->execute('lock tables ' . $tables . ' write');
+			$rs = $mo->table($tables)->select();
+			$zd = $mo->table($tables)->getDbFields();
+
+			if ($rs) {
+				$mo->execute('commit');
+				$mo->execute('unlock tables');
+			}
+			else {
+				$mo->execute('rollback');
+			}
+
+			$xlsName = $tables;
+			$xls = array();
+
+			foreach ($zd as $k => $v) {
+				$xls[$k][0] = $v;
+				$xls[$k][1] = $v;
+			}
+
+			$this->exportExcel($xlsName, $xls, $rs);
+		}
+		else {
+			$this->error('请指定要导出的表!');
+		}
+	}
+
+	public function exportExcel($expTitle, $expCellName, $expTableData)
+	{
+		import('Org.Util.PHPExcel');
+		import('Org.Util.PHPExcel.Writer.Excel5');
+		import('Org.Util.PHPExcel.IOFactory.php');
+		$xlsTitle = iconv('utf-8', 'gb2312', $expTitle);
+		$fileName = $_SESSION['loginAccount'] . date('_YmdHis');
+		$cellNum = count($expCellName);
+		$dataNum = count($expTableData);
+		$objPHPExcel = new PHPExcel();
+		$cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ');
+		$objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');
+		$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', $expTitle . '  Export time:' . date('Y-m-d H:i:s'));
+		$i = 0;
+
+		for (; $i < $cellNum; $i++) {
+			$objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][1]);
+		}
+
+		$i = 0;
+
+		for (; $i < $dataNum; $i++) {
+			$j = 0;
+
+			for (; $j < $cellNum; $j++) {
+				$objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), $expTableData[$i][$expCellName[$j][0]]);
+			}
+		}
+
+		ob_end_clean();
+		header('pragma:public');
+		header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"');
+		header('Content-Disposition:attachment;filename=' . $fileName . '.xls');
+		$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
+		$objWriter->save('php://output');
+		exit();
+	}
+
+	public function importExecl($file)
+	{
+		exit;
+		import('Org.Util.PHPExcel');
+		import('Org.Util.PHPExcel.Writer.Excel5');
+		import('Org.Util.PHPExcel.IOFactory.php');
+
+		if (!file_exists($file)) {
+			return array('error' => 0, 'message' => 'file not found!');
+		}
+
+		$objReader = PHPExcel_IOFactory::createReader('Excel5');
+
+		try {
+			$PHPReader = $objReader->load($file);
+		}
+		catch (Exception $e) {
+		}
+
+		if (!file_exists($file)) {
+			return array('error' => 0, 'message' => 'read error!');
+		}
+
+		$allWorksheets = $PHPReader->getAllSheets();
+		$i = 0;
+
+		foreach ($allWorksheets as $objWorksheet) {
+			$sheetname = $objWorksheet->getTitle();
+			$allRow = $objWorksheet->getHighestRow();
+			$highestColumn = $objWorksheet->getHighestColumn();
+			$allColumn = PHPExcel_Cell::columnIndexFromString($highestColumn);
+			$array[$i]['Title'] = $sheetname;
+			$array[$i]['Cols'] = $allColumn;
+			$array[$i]['Rows'] = $allRow;
+			$arr = array();
+			$isMergeCell = array();
+
+			foreach ($objWorksheet->getMergeCells() as $cells) {
+				foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) {
+					$isMergeCell[$cellReference] = true;
+				}
+			}
+
+			$currentRow = 1;
+
+			for (; $currentRow <= $allRow; $currentRow++) {
+				$row = array();
+				$currentColumn = 0;
+
+				for (; $currentColumn < $allColumn; $currentColumn++) {
+					$cell = $objWorksheet->getCellByColumnAndRow($currentColumn, $currentRow);
+					$afCol = PHPExcel_Cell::stringFromColumnIndex($currentColumn + 1);
+					$bfCol = PHPExcel_Cell::stringFromColumnIndex($currentColumn - 1);
+					$col = PHPExcel_Cell::stringFromColumnIndex($currentColumn);
+					$address = $col . $currentRow;
+					$value = $objWorksheet->getCell($address)->getValue();
+
+					if (substr($value, 0, 1) == '=') {
+						return array('error' => 0, 'message' => 'can not use the formula!');
+						exit();
+					}
+
+					if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NUMERIC) {
+						$cellstyleformat = $cell->getParent()->getStyle($cell->getCoordinate())->getNumberFormat();
+						$formatcode = $cellstyleformat->getFormatCode();
+
+						if (preg_match('/^([$[A-Z]*-[0-9A-F]*])*[hmsdy]/i', $formatcode)) {
+							$value = gmdate('Y-m-d', PHPExcel_Shared_Date::ExcelToPHP($value));
+						}
+						else {
+							$value = PHPExcel_Style_NumberFormat::toFormattedString($value, $formatcode);
+						}
+					}
+
+					if ($isMergeCell[$col . $currentRow] && $isMergeCell[$afCol . $currentRow] && !empty($value)) {
+						$temp = $value;
+					}
+					else if ($isMergeCell[$col . $currentRow] && $isMergeCell[$col . ($currentRow - 1)] && empty($value)) {
+						$value = $arr[$currentRow - 1][$currentColumn];
+					}
+					else if ($isMergeCell[$col . $currentRow] && $isMergeCell[$bfCol . $currentRow] && empty($value)) {
+						$value = '';
+					}
+
+					$row[$currentColumn] = $value;
+				}
+
+				$arr[$currentRow] = $row;
+			}
+
+			$array[$i]['Content'] = $arr;
+			$i++;
+		}
+
+		spl_autoload_register(array('Think', 'autoload'));
+		unset($objWorksheet);
+		unset($PHPReader);
+		unset($PHPExcel);
+		unlink($file);
+		return array('error' => 1, 'data' => $array);
+	}
+
+	public function xiazai()
+	{
+		exit;
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (!check($_GET['file'], 'dw', '-.')) {
+			$this->error('失败!');
+		}
+
+		DownloadFile(DATABASE_PATH . $_GET['file']);
+		exit();
+	}
+
+	public function queue()
+	{
+		$file_path = DATABASE_PATH . '/check_queue.json';
+		$time = time();
+		$timeArr = array();
+
+		if (file_exists($file_path)) {
+			$timeArr = file_get_contents($file_path);
+			$timeArr = json_decode($timeArr, true);
+		}
+
+		$str = '';
+
+		foreach ($timeArr as $key => $val) {
+			if ($key == 0) {
+				$val = '上一次执行:' . addtime($val);
+			}
+
+			if ($key == 1) {
+				$val = '上二次执行:' . addtime($val);
+			}
+
+			if ($key == 2) {
+				$val = '上三次执行:' . addtime($val);
+			}
+
+			$str .= $val . ' ';
+		}
+
+		$status = '';
+		$count = count($timeArr);
+
+		if (3 <= $count) {
+			$_t1 = $timeArr[2] - $timeArr[1];
+			$_t2 = $timeArr[1] - $timeArr[0];
+
+			if (60 < abs($timeArr[0] - time())) {
+				$status = '<span class="btn btn-warning">队列停止运行</span>';
+			}
+
+			if ((50 < abs($_t1)) && (50 < abs($_t2))) {
+				$status = '<span class="btn">队列运行正常</span>';
+			}
+			else {
+				$status = '<span class="btn btn-warning">队列时间异常,请稍后再试</span>';
+			}
+		}
+		else {
+			$msg = '';
+
+			if ($count == 0) {
+				$msg = '队列还未开始运行,请1分钟后刷新';
+			}
+
+			if ($count == 1) {
+				$msg = '队列运行一次请再等待2分钟检查';
+			}
+
+			if ($count == 2) {
+				$msg = '队列运行两次请再等待1分钟检查';
+			}
+
+			$status = '<span class="btn btn-warning">' . $msg . '</span>';
+		}
+
+		$this->assign('status', $status);
+		$this->assign('str', $str);
+		$this->display();
+		return NULL;
+	}
+
+}
+
+?>

+ 482 - 0
Application/Admin/Controller/TradeController.class.php

@@ -0,0 +1,482 @@
+<?php
+namespace Admin\Controller;
+
+class TradeController extends AdminController
+{
+	
+	protected function _initialize(){
+		parent::_initialize();
+		$allow_action=array("index","sethy","hylog","market","marketEdit","marketStatus","tradeclear","orderinfo","orderinfo_ty","setwinloss_ty","setwinloss","bbsetting","bbxjlist","bbsjlist","gethyorder","settzstatus","tyorder","getmyzrytz","getmyzrtz");
+		if(!in_array(ACTION_NAME,$allow_action)){
+			$this->error("页面不存在!");
+		}
+	}
+	
+	//设置已通知
+	public function settzstatus(){
+	    $where['status'] = 1;
+	    $where['tznum'] = 0;
+	    $list = M("hyorder")->where($where)->field('id')->select();
+	    if(!empty($list)){
+	        foreach($list as $key=>$vo){
+	            $id = $vo['id'];
+	            M("hyorder")->where(array('id'=>$id))->save(array('tznum'=>1));
+	        }
+	        $this->ajaxReturn(['code'=>1]);
+	    }
+	    
+	}
+	//设置充值已通知
+	public function getmyzrytz(){
+	    $where['status'] = 1;
+	    $where['tznum'] = 0;
+	    $list = M("recharge")->where($where)->field('id')->select();
+	    if(!empty($list)){
+	        foreach($list as $key=>$vo){
+	            $id = $vo['id'];
+	            M("recharge")->where(array('id'=>$id))->save(array('tznum'=>1));
+	        }
+	        $this->ajaxReturn(['code'=>1]);
+	    }
+	    
+	}
+	//充币通知
+	public function getmyzrtz(){
+		$where['status'] = 1;
+		$where['tznm'] = 0;
+		$count = M('recharge')->where($where)->count();
+		$list = M("recharge")->where($where)->field('id')->select();
+		 if(!empty($list)){
+	        foreach($list as $key=>$vo){
+	         
+	            $whs['id'] = $vo['id'];
+	            $data['tznm'] = 1;
+	            M("recharge")->where($whs)->save($data);
+	        }
+	        $this->ajaxReturn(['code'=>1]);
+	    }
+		
+	}
+	public function gethyorder(){
+	    $where['status'] = 1;
+	    $where['tznum'] = 0;
+	    $count = M("hyorder")->where($where)->count();
+	    if($count > 0){
+	        $this->ajaxReturn(['code'=>1]);
+	    }
+	}
+	
+	//币币交易市价交易记录
+	public function bbsjlist(){
+	    if(I('get.type') > 0){
+            $hyzd = trim(I('get.type'));
+		    $where['type'] = $hyzd;
+        }
+        
+        if(I('get.status') > 0){
+            $status = trim(I('get.status'));
+		    $where['status'] = $status;
+        }
+        
+        if(I('get.username') > 0){
+            $username = trim(I('get.username'));
+		    $where['account'] = $username;
+        }
+        
+        
+	    
+	    
+	    $where['ordertype'] = 2;
+	    $count = M('bborder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('bborder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    $this->display();
+	}
+	
+	//币币交易限价委托记录
+	public function bbxjlist(){
+	    
+	    if(I('get.type') > 0){
+            $hyzd = trim(I('get.type'));
+		    $where['type'] = $hyzd;
+        }
+        
+        if(I('get.status') > 0){
+            $status = trim(I('get.status'));
+		    $where['status'] = $status;
+        }
+        
+        if(I('get.username') > 0){
+            $username = trim(I('get.username'));
+		    $where['account'] = $username;
+        }
+        
+        
+	    
+	    
+	    $where['ordertype'] = 1;
+	    $count = M('bborder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('bborder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+	    
+	    $this->display();
+	}
+	
+	
+	//币币交易参数设置
+    public function bbsetting(){
+        if($_POST){
+            $id = trim($_POST['bbid']);
+            if($id <= 0){
+                $result = M("bbsetting")->add($_POST);
+            }else{
+                unset($_POST['bbid']);
+                $result = M("bbsetting")->where(array('id'=>$id))->save($_POST);
+            }
+            if($result){
+
+                $this->success("操作成功!",U('Trade/bbsetting'));
+            }else{
+                $this->error("操作失败!",U('Trade/bbsetting'));
+            }
+            
+        }else{
+           
+           $info = M("bbsetting")->where(array('id'=>1))->find();
+           $this->assign("info",$info);
+           $this->display(); 
+        }
+        
+    }
+	
+	//单控盈亏
+	public function setwinloss(){
+	    if($_POST){
+	        $id = trim(I('post.id'));
+	        $kongyk = trim(I('post.kongyk'));
+	        $info = M("hyorder")->where(array('id'=>$id))->find();
+	        if(empty($info)){
+	            $this->ajaxReturn(['code'=>0,'info'=>"参少重要参数"]);
+	        }
+	        $result = M("hyorder")->where(array('id'=>$id))->save(array('kongyk'=>$kongyk));
+	        if($result){
+	            $this->ajaxReturn(['code'=>1,'info'=>"操作成功"]); 
+	        }else{
+	            $this->ajaxReturn(['code'=>0,'info'=>"操作失败"]);
+	        }
+	    }else{
+	        $this->ajaxReturn(['code'=>0,'info'=>"网络错误"]);
+	    }
+	}
+	
+	//单控盈亏
+	public function setwinloss_ty(){
+	    if($_POST){
+	        $id = trim(I('post.id'));
+	        $kongyk = trim(I('post.kongyk'));
+	        $info = M("tyhyorder")->where(array('id'=>$id))->find();
+	        if(empty($info)){
+	            $this->ajaxReturn(['code'=>0,'info'=>"参少重要参数"]);
+	        }
+	        
+	        $result = M("tyhyorder")->where(array('id'=>$id))->save(array('kongyk'=>$kongyk));
+	        if($result){
+	            $this->ajaxReturn(['code'=>1,'info'=>"操作成功"]); 
+	        }else{
+	            $this->ajaxReturn(['code'=>0,'info'=>"操作失败"]);
+	        }
+	    }else{
+	        $this->ajaxReturn(['code'=>0,'info'=>"网络错误"]);
+	    }
+	}
+	
+	//合约订单详情
+	public function orderinfo(){
+	    $id = trim(I('get.id'));
+        $info = M("hyorder")->where(array("id"=>$id))->find();
+        $this->assign('info',$info);
+	    $this->display();
+	}
+	//合约订单详情
+	public function orderinfo_ty(){
+	    $id = trim(I('get.id'));
+        $info = M("tyhyorder")->where(array("id"=>$id))->find();
+        $this->assign('info',$info);
+	    $this->display();
+	}
+    
+    //快速合约参数设置
+    public function sethy(){
+        if($_POST){
+            $id = trim($_POST['hy_id']);
+            if($id <= 0){
+                $result = M("hysetting")->add($_POST);
+            }else{
+                unset($_POST['hy_id']);
+                $result = M("hysetting")->where(array('id'=>$id))->save($_POST);
+            }
+            if($result){
+
+                $this->success("操作成功!",U('Trade/sethy'));
+            }else{
+                $this->error("操作失败!",U('Trade/sethy'));
+            }
+            
+        }else{
+           
+           $info = M("hysetting")->where(array('id'=>1))->find();
+           $this->assign("info",$info);
+           $this->display(); 
+        }
+        
+    }
+    
+    //体验订单记灵
+	public function tyorder(){
+        
+        $where = array();
+        if(I('get.username') != '' || I('get.username') != null){
+            $username = trim(I('get.username'));
+		    $where['username'] = $username;
+        }
+        
+        if(I('get.hyzd') > 0){
+            $hyzd = trim(I('get.hyzd'));
+		    $where['hyzd'] = $hyzd;
+        }
+		$count = M('tyhyorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('tyhyorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+ 
+		$this->display();
+	}
+    
+    //合约购买记录(未平仓的)
+	public function index(){
+        
+        $where = array();
+        if(I('get.username') != '' || I('get.username') != null){
+            $username = trim(I('get.username'));
+		    $where['username'] = $username;
+        }
+        
+        if(I('get.hyzd') > 0){
+            $hyzd = trim(I('get.hyzd'));
+		    $where['hyzd'] = $hyzd;
+        }
+		
+		$where['status'] = 1;
+
+		$count = M('hyorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('hyorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+ 
+		$this->display();
+	}
+
+
+    //合约交易平仓记录
+	public function hylog($invit=null){
+	    
+	    if($invit != ''){
+	        $where['username'] = ['like',"%{$invit}%"];
+	    }
+	    
+	    $where['status'] = 2;
+		$count = M('hyorder')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('hyorder')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+
+    ///机器人刷单币种列表
+	public function market($field = NULL, $name = NULL)
+	{
+		$where = array();
+
+		if ($field && $name) {
+			if ($field == 'username') {
+				$where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+			}
+			else {
+				$where[$field] = $name;
+			}
+		}
+
+		$count = M('Market')->where($where)->count();
+		$Page = new \Think\Page($count, 15);
+		$show = $Page->show();
+		$list = M('Market')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+		$this->assign('list', $list);
+		$this->assign('page', $show);
+		$this->display();
+	}
+    
+    //编辑刷单
+	public function marketEdit($id = NULL)
+	{
+		$getCoreConfig = getCoreConfig();
+		if(!$getCoreConfig){
+			$this->error('核心配置有误');
+		}
+		if (empty($_POST)) {
+			if (empty($id)) {
+				$this->data = array();
+			}
+			else {
+				$this->data = M('Market')->where(array('id' => $id))->find();
+			}
+
+			$coin['coin'] = M('coin')->select();
+			$time_arr = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23');
+			$time_minute = array('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59');
+			$this->assign('time_arr', $time_arr);
+			$this->assign('C', $coin);
+			$this->assign('time_minute', $time_minute);
+			$this->assign('getCoreConfig',$getCoreConfig['indexcat']);
+			$this->display();
+		}
+		else {
+			if (APP_DEMO) {
+				$this->error('测试站暂时不能修改!');
+			}
+
+			$round = array(0, 1, 2, 3, 4, 5, 6);
+
+			if (!in_array($_POST['round'], $round)) {
+				$this->error('小数位数格式错误!');
+			}
+
+			if ($_POST['id']) {
+
+				$rs = M('Market')->save($_POST);
+			}
+			else {
+				$_POST['name'] = $_POST['sellname'] . '_' . $_POST['buyname'];
+
+				$_POST['new_price'] = $_POST['faxingjia'];
+				unset($_POST['buyname']);
+				unset($_POST['sellname']);
+
+				if (M('Market')->where(array('name' => $_POST['name']))->find()) {
+					$this->error('市场存在!');
+				}
+
+				$rs = M('Market')->add($_POST);
+			}
+
+			if ($rs) {
+				$this->success('操作成功!');
+			}
+			else {
+				$this->error('操作失败!');
+			}
+		}
+	}
+
+	public function marketStatus($id = NULL, $type = NULL, $mobile = 'Market')
+	{
+		if (APP_DEMO) {
+			$this->error('测试站暂时不能修改!');
+		}
+
+		if (empty($id)) {
+			$this->error('参数错误!');
+		}
+
+		if (empty($type)) {
+			$this->error('参数错误1!');
+		}
+
+		if (strpos(',', $id)) {
+			$id = implode(',', $id);
+		}
+
+		$where['id'] = array('in', $id);
+
+		switch (strtolower($type)) {
+		case 'forbid':
+			$data = array('status' => 0);
+			break;
+
+		case 'resume':
+			$data = array('status' => 1);
+			break;
+
+		case 'repeal':
+			$data = array('status' => 2, 'endtime' => time());
+			break;
+
+		case 'delete':
+			$data = array('status' => -1);
+			break;
+
+		case 'del':
+			if (M($mobile)->where($where)->delete()) {
+				$this->success('操作成功!');
+			}
+			else {
+				$this->error('操作失败!');
+			}
+
+			break;
+
+		default:
+			$this->error('操作失败!');
+		}
+
+		if (M($mobile)->where($where)->save($data)) {
+			$this->success('操作成功!');
+		}
+		else {
+			$this->error('操作失败!');
+		}
+	}
+
+	public function tradeclear($type=NULL,$id=NULL)
+	{
+		if(!$id){
+			$this->error('请选择交易市场!');
+		}
+		if(!$type){
+			$this->error('请选择清理类型!');
+		}
+		$market= M('Market')->where(array('id' => $id))->find();
+		if($type==1){
+			$allclear=M('Trade')->where(array('market'=>$market['name'],'userid'=>0))->delete();
+		}
+		if($type==2){
+			if(!$market['sdhigh'] or !$market['sdlow']){
+				$this->error('该市场未设置刷单最高价或最低价,无法部分清理');
+			}
+			$map['market']=$market['name'];
+			$map['userid']=0;
+			$map['price']=array('notbetween',array($market['sdhigh'],$market['sdlow']));
+			$allclear=M('Trade')->where($map)->delete();
+		}
+		if($allclear){
+			$this->success('清理成功,一共'.$allclear.'条刷单记录');
+		}else{
+			$this->error('清理失败!');
+		}
+	}
+
+
+}
+
+?>

+ 1095 - 0
Application/Admin/Controller/UserController.class.php

@@ -0,0 +1,1095 @@
+<?php
+namespace Admin\Controller;
+
+class UserController extends AdminController
+{
+    protected function _initialize()
+    {
+        parent::_initialize();	$allow_action=array("index","edit","status","admin","adminEdit","coinEditz","adminStatus","updateRules","log","logEdit","logStatus","qianbao","qianbaoEdit","qianbaoStatus","coin","coinEdit","coinFreeze","coinLog","setpwd","amountlog","loginadmin","billdel","sendnotice","upsendnotice","noticelist","noticedel","authrz","upanthrz","online","onlinelist","sendonline","uponline","setagent","agent","cancelagent","settax");
+        if(!in_array(ACTION_NAME,$allow_action)){
+            $this->error("页面不存在!");
+        }
+    }
+
+    public function setTax($id=null,$st=null){
+        $uid = $id;
+        if($uid <= 0 || $uid == ''){
+            $this->erro("参数重要参数");
+        }
+
+        if($st <= 0 || $st == ''){
+            $this->error("参数重要参数");
+        }
+
+        $uinfo = M("user")->where(array('id'=>$uid))->find();
+        if(empty($uinfo)){
+            $this->error("参数重要参数");
+        }
+        if($st == 1){
+            $result = M("user")->where(array('id'=>$uid))->save(array('is_tax'=>1));
+        }elseif($st == 2){
+            $result = M("user")->where(array('id'=>$uid))->save(array('is_tax'=>0));
+        }
+        if($result){
+            $this->success("设置成功");
+        }else{
+            $this->error("设置失败");
+        }
+
+    }
+
+
+
+    //取消代理资格
+    public function cancelagent($id){
+        $uid = $id;
+        if($uid <= 0 || $uid == ''){
+            $this->error("参数重要参数");
+        }
+        $uinfo = M("user")->where(array('id'=>$uid))->field("is_agent")->find();
+        if(empty($uinfo)){
+            $this->error("参数重要参数");
+        }
+        if($uinfo['is_agent'] == 0){
+            $this->error("该会员不是代理");
+        }
+        $result = M("user")->where(array('id'=>$uid))->save(array('is_agent'=>0));
+        if($result){
+            $this->success("设置成功");
+        }else{
+            $this->error("设置失败");
+        }
+
+
+    }
+
+
+
+    //代理管理
+    public function agent(){
+        $where['is_agent'] = 1;
+        $count = M('User')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('User')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+        foreach ($list as $k => $v) {
+            $uid = $v['id'];
+            $one = M('User')->where(array('invit_1'=>$uid))->count();
+            if($one <= 0){
+                $one = 0;
+            }
+            $two = M('User')->where(array('invit_2'=>$uid))->count();
+            if($two <= 0){
+                $two = 0;
+            }
+            $three = M('User')->where(array('invit_3'=>$uid))->count();
+            if($three <= 0){
+                $three = 0;
+            }
+
+            $all = $one + $two + $three;
+            if($all <= 0){
+                $all = 0;
+            }
+            $list[$k]['all'] = $all;
+            $list[$k]['one'] = $one;
+            $list[$k]['two'] = $two;
+            $list[$k]['three'] = $three;
+        }
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+
+        $this->display();
+    }
+
+
+
+    //设置代理
+    public function setagent($id){
+        $uid = $id;
+        if($uid <= 0 || $uid == ''){
+            $this->error("参数得要参数");
+        }
+        $uinfo = M("user")->where(array('id'=>$uid))->field("is_agent")->find();
+        if(empty($uinfo)){
+            $this->error("参数得要参数");
+        }
+        if($uinfo['is_agent'] == 1){
+            $this->error("该会员已是代理");
+        }
+        $result = M("user")->where(array('id'=>$uid))->save(array('is_agent'=>1));
+        if($result){
+            $this->success("设置成功");
+        }else{
+            $this->error("设置失败");
+        }
+
+
+    }
+
+    //实名认证处理
+    public function upanthrz(){
+        $rzstatus = $_POST['rzstatus'];
+
+        $uid = $_POST['uid'];
+        if($uid <= 0 || $uid == ''){
+            $this->error("参数得要参数");
+        }
+        if($rzstatus== 2){//表示认证成功
+
+            $result = M("user")->where(array('id'=>$uid))->save(array('rzstatus'=>2,'rzuptime'=>time()));
+            if($result){
+                $kjid = $_POST['kjid'];
+
+                $minfo = M("kuangji")->where(array('id'=>$kjid))->find();
+                //建仓矿机订单数据
+                $odate['kid'] = $minfo['id'];
+                $odate['type'] = 1;
+                $odate['sharebl'] = 0;
+                $odate['uid'] = $uid;
+                $odate['username'] = $_POST['username'];
+                $odate['kjtitle'] = $minfo['title'];
+                $odate['imgs'] = $minfo['imgs'];
+                $odate['status'] = 1;
+                $odate['cycle'] = $minfo['cycle'];
+                $odate['synum'] = $minfo['cycle'];
+                $odate['outtype'] = $minfo['outtype'];
+                $odate['outcoin'] = $minfo['outcoin'];
+                if($minfo['outtype'] == 1){//按产值收益
+                    $odate['outnum'] = 0;
+                    $odate['outusdt'] = $minfo['dayoutnum'];
+                }elseif($minfo['outtype'] == 2){//按币量收益
+                    $odate['outnum'] = $minfo['dayoutnum'];
+                    $odate['outusdt'] = 0;
+                }
+                $odate['djout'] = $minfo['djout'];
+                if($minfo['djout'] == 2){
+                    $odate['djnum'] = $minfo['djday'];
+                }else{
+                    $odate['djnum'] = $minfo['djday'];
+                }
+                $odate['addtime'] = date("Y-m-d H:i:s",time());
+                $odate['endtime'] = date("Y-m-d H:i:s",(time() + 86400 * $minfo['cycle']));
+                $odate['intaddtime'] = time();
+                $odate['intendtime'] = time() + 86400 * $minfo['cycle'];
+
+                $adre = M("kjorder")->add($odate);
+
+                $notice['uid'] = $uid;
+                $notice['account'] = $_POST['username'];
+                $notice['title'] = L('认证审核成功');
+                $notice['content'] = L('您的认证申请已审核成功');
+                $notice['addtime'] = date("Y-m-d H:i:s",time());
+                $notice['status'] = 1;
+                M("notice")->add($notice);
+                $this->redirect('user/index');
+                $this->success("认证成功");
+            }else{
+                $this->error("操作失败");
+            }
+
+        }elseif($rzstatus == 3){//表示驳回认证
+            $result = M("user")->where(array('id'=>$uid))->save(array('rzstatus'=>3,'rzuptime'=>time()));
+            if($result){
+                $notice['uid'] = $uid;
+                $notice['account'] = $_POST['username'];
+                $notice['title'] = L('认证驳回');
+                $notice['content'] = L('您的认证申请被管理员驳回,请联系管理员');
+                $notice['addtime'] = date("Y-m-d H:i:s",time());
+                $notice['status'] = 1;
+                M("notice")->add($notice);
+                $this->success("操作成功");
+
+            }else{
+                $this->error("操作失败");
+            }
+        }
+
+    }
+
+    //实名认证页面
+    public function authrz($id){
+        $klist = M("kuangji")->where(array('rtype'=>2))->field("id,title")->select();
+
+        $this->assign("klist",$klist);
+        $info = M("user")->where(array('id'=>$id))->find();
+        $this->assign('info',$info);
+        $this->display();
+    }
+
+    //删除通知
+    public function noticedel($id = null, $type = null){
+        if(empty($id)){
+            $this->error("缺少重要参数");exit();
+        }
+        $where['id'] = array('in',$id);
+        $result = M("notice")->where($where)->delete();
+        if($result){
+            $this->success("删除成功");
+        }else{
+            $this->error("删除失败");
+        }
+    }
+
+    //会员管理列表
+    public function noticelist($username=NULL){
+        $where = array();
+        if($username != ''){
+            $where['account'] = $username;
+        }
+        $count = M('notice')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('notice')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //给会员发送通知
+    public function sendnotice($id = null,$type= null){
+        $this->assign('id',$id);
+        $this->assign('type',$type);
+        $this->display();
+    }
+
+    //给会员发送通知处理
+    public function upsendnotice($id = null,$type = null,$title = null,$content = null,$imgs=null){
+        //if(checkstr($title) || checkstr($content)){
+        //$this->error("不能输入特殊字符!");exit();
+        //}
+        if($type == 1){
+
+            if($id <= 0){
+                $this->error("缺少重要参数!");exit();
+            }
+
+            $uinfo = M("user")->where(array('id'=>$id))->field("id,username")->find();
+            if(empty($uinfo)){
+                $this->error("缺少重要参数!");exit();
+            }
+
+            $data['uid'] = $uinfo['id'];
+            $data['account'] = $uinfo['username'];
+            $data['title'] = $title;
+            $data['content'] = $content;
+            $data['imgs'] = $imgs;
+            $data['addtime'] = date("Y-m-d H:i:s",time());
+            $data['status'] = 1;
+            $result = M("notice")->add($data);
+            if($result){
+                $this->success("通知发送成功");
+            }else{
+                $this->success("通知发送失败");
+            }
+        }elseif($type == 2){
+            $ulist = M("user")->field("id,username")->select();
+            if(!empty($ulist)){
+                foreach($ulist as $key=>$vo){
+                    $data['uid'] = $vo['id'];
+                    $data['account'] = $vo['username'];
+                    $data['title'] = $title;
+                    $data['content'] = $content;
+                    $data['imgs'] = $imgs;
+                    $data['addtime'] = date("Y-m-d H:i:s",time());
+                    $data['status'] = 1;
+                    M("notice")->add($data);
+                }
+                $this->success("群发通知发送成功");
+            }
+
+        }else{
+            $this->error("非法操作!");exit();
+        }
+    }
+
+
+    //修改会员状态
+    public function status($id = NULL, $type = null){
+        if(empty($id)){
+            $this->error("请选择会员!");exit();
+        }
+        $where['id'] = array('in', $id);
+        switch (strtolower($type)) {
+            case 1:
+                //冻结
+                $result = M("user")->where($where)->save(array('status'=>1));
+                break;
+            case 2:
+                //解封
+                $result = M("user")->where($where)->save(array('status'=>2));
+                break;
+            case 3:
+                //启动提币
+                $result = M("user")->where($where)->save(array('txstate'=>1));
+                break;
+            case 4:
+                //禁止提币
+                $result = M("user")->where($where)->save(array('txstate'=>2));
+                break;
+            case 5:
+                //删除会员
+                $result = M("user")->where($where)->delete();
+                break;
+            default:
+                $this->error('操作失败!');
+        }
+
+        if($result){
+            $this->success('操作成功!');
+        }else{
+            $this->error('操作失败!');
+        }
+
+    }
+
+    public function onlinelist($id = null){
+
+        $where['uid'] = $id;
+        $where['type'] = 2;
+        $where['state'] = 0;
+        $count = M('online')->where($where)->count();
+        $Page = new \Think\Page($count, 50);
+        $show = $Page->show();
+
+        $list = M('online')->where($where)->order('state desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //客服回复详情页面
+    public function sendonline($id = null){
+
+        $info = M("online")->where(array('id'=>$id))->find();
+        $this->assign("info",$info);
+        $this->display();
+    }
+
+    //客服回复
+    public function uponline($oid=null,$content=null){
+        if (checkstr($content)){
+            $this->error("输入的信息有误");
+        }
+
+        if($oid <= 0 || $oid == ''){
+            $this->error("缺少重要参数");
+        }
+
+        $info = M("online")->where(array('id'=>$oid))->find();
+        $uid = $info['uid'];
+
+        $data['uid'] = $uid;
+        $data['username'] = $info['username'];
+        $data['content'] = $content;
+        $data['type'] = 1;
+        $data['addtime'] = date("Y-m-d H:i:s",time());
+        $data['state'] = 1;
+        $result = M("online")->add($data);
+        if($result){
+
+            M("online")->where(array('id'=>$oid))->save(array('state'=>1));
+            $this->success("回复成功");
+        }else{
+            $this->error("回复失败");
+        }
+    }
+
+
+    //会员管理列表
+    public function online($name=NULL, $field=NULL, $status=NULL){
+        $where = array();
+        if ($field && $name) {
+            $where[$field] = $name;
+        }
+        if ($status) {
+            $where['status'] = $status;
+        }
+
+        $count = M('User')->where($where)->count();
+        $Page = new \Think\Page($count, 50);
+        $show = $Page->show();
+
+        $list = M('User')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->field("id,username")->select();
+
+
+
+        foreach($list as $key=>$vo){
+            $map['uid'] = $vo['id'];
+            $map['state'] = array('eq',0);
+            $list[$key]['nor'] = M("online")->where($map)->count();
+        }
+
+        $new_arr = array_column($list, 'nor');
+        array_multisort($new_arr, SORT_DESC, $list);
+        foreach($list as $k=>$v){
+            if($v['nor'] == 0){
+                unset($list[$k]);
+            }
+        }
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //会员管理列表
+    public function index($name=NULL, $field=NULL, $status=NULL){
+        $where = array();
+        if ($field && $name) {
+            $where[$field] = $name;
+        }
+        if ($status) {
+            $where['status'] = $status;
+        }
+
+        $count = M('User')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+
+        $list = M('User')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+
+        foreach ($list as $k => $v) {
+            $list[$k]['invit_1'] = M('User')->where(array('id' => $v['invit_1']))->getField('username');
+            $list[$k]['invit_2'] = M('User')->where(array('id' => $v['invit_2']))->getField('username');
+            $list[$k]['invit_3'] = M('User')->where(array('id' => $v['invit_3']))->getField('username');
+            $user_login_state=M('user_log')->where(array('userid'=>$v['id'],'type' => 'login'))->order('id desc')->find();
+            $list[$k]['state']=$user_login_state['state'];
+        }
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //编辑或新增会员
+    public function edit($id = NULL)
+    {
+        if (empty($_POST)) {
+            if (empty($id)) {
+                $this->data = '';
+            } else {
+                $this->data = M('User')->where(array('id' => trim($id)))->find();
+            }
+            $this->display();
+        } else {
+            //新增会员
+            if($id <= 0 || $id == null){
+                $username = trim($_POST['username']);
+                if($username == ''){
+                    $this->error("请输入会员账号");exit();
+                }else{
+                    $add['username'] = $username;
+                }
+
+                if($_POST['password'] == ""){
+                    $this->error("请输入登陆密码");exit();
+                }else{
+                    $add['password'] = md5($_POST['password']);
+                }
+                if($_POST['paypassword'] != ""){
+                    $add['paypassword'] = md5($_POST['paypassword']);
+                }
+
+                if($_POST['invit'] != 0 || $_POST['invit'] != ''){
+                    $inv_user = M('User')->where(array('invit' => $_POST['invit']))->field("id,username,invit_1,invit_2,path")->find();
+                    if(empty($inv_user)){
+                        $this->error("推荐人不存在");exit();
+                    }
+                    $add['invit_1'] = $inv_user['id'];
+                    $add['invit_2'] = $inv_user['invit_1'];
+                    $add['invit_3'] = $inv_user['invit_2'];
+                    $path = $inv_user['path'].','.$inv_user['id'];
+                }else{
+                    $add['invit_1'] = 0;
+                    $add['invit_2'] = 0;
+                    $add['invit_3'] = 0;
+                    $path = '';
+                }
+                $add['status'] = $_POST['status'];
+                $add['txstate'] = $_POST['txstate'];
+                $add['addtime'] = time();
+                $add['addip'] = get_client_ip();
+                $add['addr'] = get_city_ip();
+                $add['invit']  = tradenoa();
+
+                $re = M("user")->add($add);
+                if($re){
+                    M('user_coin')->add(array('userid' => $re));
+                    $this->success("新增成功");exit();
+                }else{
+                    $this->error("新增失败");exit();
+                }
+                //编辑会员
+            }else{
+
+                if ($_POST['password']) {
+                    $_POST['password'] = md5($_POST['password']);
+                } else {
+                    unset($_POST['password']);
+                }
+                if ($_POST['paypassword']) {
+                    $_POST['paypassword'] = md5($_POST['paypassword']);
+                } else {
+                    unset($_POST['paypassword']);
+                }
+
+                $result = M("user")->where(array('id'=>$id))->save($_POST);
+                if($result){
+                    $this->success("编辑成功");exit();
+                }else{
+                    $this->error("编辑失败");exit();
+                }
+            }
+
+        }
+    }
+
+    //管理列表
+    public function admin($name = NULL, $field = NULL, $status = NULL)
+    {
+        $DbFields = M('Admin')->getDbFields();
+
+        if (!in_array('email', $DbFields)) {
+            M()->execute('ALTER TABLE `tw_admin` ADD COLUMN `email` VARCHAR(200)  NOT NULL   COMMENT \'\' AFTER `id`;');
+        }
+
+        $where = array();
+
+        if ($field && $name) {
+            if ($field == 'username') {
+                $where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+            } else {
+                $where[$field] = $name;
+            }
+        }
+
+        if ($status) {
+            $where['status'] = $status - 1;
+        }
+
+        $count = M('Admin')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('Admin')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+        foreach ($list as $k => $v) {
+            $aga = 0;
+            $aga = M('AuthGroupAccess')->where(array('uid'=>$v['id']))->find();
+            $ag = M('AuthGroup')->where(array('id'=>$aga['group_id']))->find();
+        }
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //管理编辑
+    public function adminEdit(){
+        if (empty($_POST)) {
+            if (empty($_GET['id'])) {
+                $this->data = null;
+            } else {
+                $this->data = M('Admin')->where(array('id' => trim($_GET['id'])))->find();
+            }
+
+            $this->display();
+        } else {
+            $input = I('post.');
+
+            if (!check($input['username'], 'username')) {
+                //$this->error('用户名格式错误!');
+            }
+            if ($input['nickname'] && !check($input['nickname'], 'A')) {
+                $this->error('昵称格式错误!');
+            }
+            if ($input['password'] && !check($input['password'], 'password')) {
+                $this->error('登录密码格式错误!');
+            }
+            if ($input['mobile'] && !check($input['mobile'], 'mobile')) {
+                $this->error('手机号码格式错误!');
+            }
+            if ($input['email'] && !check($input['email'], 'email')) {
+                $this->error('邮箱格式错误!');
+            }
+
+            if ($input['password']) {
+                $input['password'] = md5($input['password']);
+            } else {
+                unset($input['password']);
+            }
+
+            if ($_POST['id']) {
+                $rs = M('Admin')->save($input);
+            } else {
+                $_POST['addtime'] = time();
+                $rs = M('Admin')->add($input);
+            }
+
+            if ($rs) {
+                $this->success('编辑成功!');
+            } else {
+                $this->error('编辑失败!');
+            }
+        }
+    }
+
+    //管理员状态编辑
+    public function adminStatus($id = NULL, $type = NULL, $mobile = 'Admin'){
+
+        if (empty($id)) {
+            $this->error('参数错误!');
+        }
+        if (empty($type)) {
+            $this->error('参数错误1!');
+        }
+
+        if (strpos(',', $id)) {
+            $id = implode(',', $id);
+        }
+
+        $where['id'] = array('in', $id);
+
+        switch (strtolower($type)) {
+            case 'forbid':
+                $data = array('status' => 0);
+                break;
+
+            case 'resume':
+                $data = array('status' => 1);
+                break;
+
+            case 'repeal':
+                $data = array('status' => 2, 'endtime' => time());
+                break;
+
+            case 'delete':
+                $data = array('status' => -1);
+                break;
+
+            case 'del':
+                if (M($mobile)->where($where)->delete()) {
+                    $this->success('操作成功!');
+                } else {
+                    $this->error('操作失败!');
+                }
+                break;
+
+            default:
+                $this->error('操作失败!');
+        }
+
+        if (M($mobile)->where($where)->save($data)) {
+            $this->success('操作成功!');
+        } else {
+            $this->error('操作失败!');
+        }
+    }
+
+
+    protected function updateRules()
+    {
+        $nodes = $this->returnNodes(false);
+        $AuthRule = M('AuthRule');
+        $map = array(
+            'module' => 'admin',
+            'type'   => array('in', '1,2')
+        );
+        $rules = $AuthRule->where($map)->order('name')->select();
+        $data = array();
+
+        foreach ($nodes as $value) {
+            $temp['name'] = $value['url'];
+            $temp['title'] = $value['title'];
+            $temp['module'] = 'admin';
+
+            if (0 < $value['pid']) {
+                $temp['type'] = \Common\Model\AuthRuleModel::RULE_URL;
+            } else {
+                $temp['type'] = \Common\Model\AuthRuleModel::RULE_MAIN;
+            }
+
+            $temp['status'] = 1;
+            $data[strtolower($temp['name'] . $temp['module'] . $temp['type'])] = $temp;
+        }
+
+        $update = array();
+        $ids = array();
+
+        foreach ($rules as $index => $rule) {
+            $key = strtolower($rule['name'] . $rule['module'] . $rule['type']);
+            if (isset($data[$key])) {
+                $data[$key]['id'] = $rule['id'];
+                $update[] = $data[$key];
+                unset($data[$key]);
+                unset($rules[$index]);
+                unset($rule['condition']);
+                $diff[$rule['id']] = $rule;
+            } else if ($rule['status'] == 1) {
+                $ids[] = $rule['id'];
+            }
+        }
+
+        if (count($update)) {
+            foreach ($update as $k => $row) {
+                if ($row != $diff[$row['id']]) {
+                    $AuthRule->where(array('id' => $row['id']))->save($row);
+                }
+            }
+        }
+
+        if (count($ids)) {
+            $AuthRule->where(array(
+                'id' => array('IN', implode(',', $ids))
+            ))->save(array('status' => -1));
+        }
+
+        if (count($data)) {
+            $AuthRule->addAll(array_values($data));
+        }
+
+        if ($AuthRule->getDbError()) {
+            trace('[' . 'Admin\\Controller\\UserController::updateRules' . ']:' . $AuthRule->getDbError());
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+
+    //会员登陆记录
+    public function log($name = NULL, $field = NULL, $status = NULL)
+    {
+        $where = array();
+        if ($field && $name) {
+            if ($field == 'username') {
+                $where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+            } else {
+                $where[$field] = $name;
+            }
+        }
+
+        if ($status) {
+            $where['status'] = $status - 1;
+        }
+
+        $count = M('UserLog')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('UserLog')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+
+        foreach ($list as $k => $v) {
+            $list[$k]['username'] = M('User')->where(array('id' => $v['userid']))->getField('username');
+        }
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //编辑登陆记录
+    public function logEdit($id = NULL){
+        if (empty($_POST)) {
+            if (empty($id)) {
+                $this->data = null;
+            } else {
+                $this->data = M('UserLog')->where(array('id' => trim($id)))->find();
+            }
+
+            $this->display();
+        } else {
+
+            $_POST['addtime'] = strtotime($_POST['addtime']);
+
+            if (M('UserLog')->save($_POST)) {
+                $this->success('编辑成功!');
+            } else {
+                $this->error('编辑失败!');
+            }
+        }
+    }
+    //修改登陆记录状态
+    public function logStatus($id = NULL, $type = NULL, $mobile = 'UserLog'){
+        if (empty($id)) {
+            $this->error('参数错误!');
+        }
+        if (empty($type)) {
+            $this->error('参数错误1!');
+        }
+
+        if (strpos(',', $id)) {
+            $id = implode(',', $id);
+        }
+
+        $where['id'] = array('in', $id);
+
+        switch (strtolower($type)) {
+            case 'forbid':
+                $data = array('status' => 0);
+                break;
+
+            case 'resume':
+                $data = array('status' => 1);
+                break;
+
+            case 'repeal':
+                $data = array('status' => 2, 'endtime' => time());
+                break;
+
+            case 'delete':
+                $data = array('status' => -1);
+                break;
+
+            case 'del':
+                if (M($mobile)->where($where)->delete()) {
+                    $this->success('操作成功!');
+                }
+                else {
+                    $this->error('操作失败!');
+                }
+
+                break;
+
+            default:
+                $this->error('操作失败!');
+        }
+
+        if (M($mobile)->where($where)->save($data)) {
+            $this->success('操作成功!');
+        } else {
+            $this->error('操作失败!');
+        }
+    }
+
+
+    //会员钱包管理
+    public function qianbao($name = NULL, $field = NULL, $coinname = NULL, $status = NULL)
+    {
+        $where = array();
+
+        if ($field && $name) {
+            if ($field == 'username') {
+                $where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+            } else {
+                $where[$field] = $name;
+            }
+        }
+
+        if ($coinname) {
+            $where['name'] = trim($coinname);
+        }
+
+        $coinlist = M("coin")->where("type = 1")->order("id desc")->field("name,title")->select();
+        $this->assign("coinlist",$coinlist);
+
+        $count = M('UserQianbao')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('UserQianbao')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+
+        foreach ($list as $k => $v) {
+            $list[$k]['username'] = M('User')->where(array('id' => $v['userid']))->getField('username');
+        }
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+        $this->display();
+    }
+
+    //编辑会员钱包地址
+    public function qianbaoEdit($id = NULL)
+    {
+        if (empty($_POST)) {
+            if (empty($id)) {
+                $this->data = null;
+            } else {
+                $this->data = M('UserQianbao')->where(array('id' => trim($id)))->find();
+            }
+            $coinlist = M("coin")->where("type = 1")->order("id desc")->field("name,title")->select();
+            $this->assign("coinlist",$coinlist);
+            $this->display();
+        } else {
+
+            $_POST['addtime'] = strtotime($_POST['addtime']);
+
+            if (M('UserQianbao')->save($_POST)) {
+                $this->success('编辑成功!');
+            } else {
+                $this->error('编辑失败!');
+            }
+        }
+    }
+
+    //会员资产
+    public function coin($name = NULL, $field = NULL)
+    {
+        $where = array();
+
+        if ($field && $name) {
+            if ($field == 'username') {
+                $where['userid'] = M('User')->where(array('username' => $name))->getField('id');
+            } else {
+                $where[$field] = $name;
+            }
+        }
+
+        $count = M('UserCoin')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('UserCoin')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+
+        foreach ($list as $k => $v) {
+            $list[$k]['username'] = M('User')->where(array('id' => $v['userid']))->getField('username');
+        }
+
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+
+        $coinlist = M("coin")->where("type = 1 or type = 2")->order("id asc")->field("name,title")->select();
+        $this->assign("coinlist",$coinlist);
+        $this->display();
+    }
+    public function coinEdit($id=NULL)
+    {
+        if($id != ''){
+            $coinlist = M('User')->where(array('id' => $id))->getField('username');
+        }
+        $this->assign('name',$coinlist);
+        $this->assign('id', $id);
+        $this->display();
+    }
+    public function coinEditz(){
+        if ($_POST['coin'] == 1){
+            $name = 'usdt';
+            $coinlist = M('User_coin')->where(array('userid' => $_POST['id']))->getField('usdt');
+        }elseif ($_POST['coin'] == 2){
+            $name = 'gcb';
+            $coinlist = M('User_coin')->where(array('userid' => $_POST['id']))->getField('gcb');
+        }
+
+        if($_POST['id'] == ''){
+            $this->error("参数得要参数");
+        }
+        if($_POST['status'] == 1){
+            $prinum = $coinlist+$_POST['num'];
+        }else{
+            $prinum = $coinlist-$_POST['num'];
+        }
+
+        $notice = [];
+        if($_POST['comm'] != '1'){
+            $notice['uid'] = $_POST['id'];
+            $notice['username'] = $_POST['username'];
+            $notice['coinname'] = strtoupper($name);
+            $notice['num'] = $_POST['num'];
+            $notice['afternum'] = $prinum;
+            $notice['type'] = '55';
+            $notice['addtime'] = date("Y-m-d H:i:s");
+            $notice['st'] = $_POST['status'];
+            $notice['remark'] = $_POST['comm'];
+            M("Bill")->add($notice);
+        }
+
+        $res = M('UserCoin')->where(array('userid' => $_POST['id']))->save([$name=>$prinum]);
+
+        if($res){
+            $this->success('编辑成功!');
+        }else{
+            $this->error('修改失败!');
+        }
+    }
+
+    // 资金变更日志
+    public function amountlog($st=null,$coinname=null,$username=null){
+        $coinlist = M("coin")->order("id desc")->field("name,title")->select();
+        $this->assign("coinlist",$coinlist);
+        if($st > 0){
+            $where['st'] = $st;
+        }
+
+        if($coinname != ''){
+            $where['coinname'] = $coinname;
+        }
+
+        if($username != ''){
+            $where['username'] = $username;
+        }
+
+        $count = M('bill')->where($where)->count();
+        $Page = new \Think\Page($count, 15);
+        $show = $Page->show();
+        $list = M('bill')->where($where)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
+        $this->assign('list', $list);
+        $this->assign('page', $show);
+
+
+        $this->display();
+    }
+
+    public function billdel($type=null,$id=null){
+        if(empty($id)){
+            $this->error("缺少重要参数");exit();
+        }
+        $where['id'] = array('in', $id);
+        $re = M('bill')->where($where)->delete();
+        if($re){
+            $this->success("删除成功");exit();
+        }else{
+            $this->error("删除失败");exit();
+        }
+    }
+
+    //修改管理员密码
+    public function setpwd()
+    {
+        if (IS_POST) {
+            defined('APP_DEMO') || define('APP_DEMO', 0);
+            $oldpassword = $_POST['oldpassword'];
+            $newpassword = $_POST['newpassword'];
+            $repassword = $_POST['repassword'];
+
+            if (!check($oldpassword, 'password')) {
+                $this->error('旧密码格式错误!');
+            }
+            if (md5($oldpassword) != session('admin_password')) {
+                $this->error('旧密码错误!');
+            }
+            if (!check($newpassword, 'password')) {
+                $this->error('新密码格式错误!');
+            }
+            if ($newpassword != $repassword) {
+                $this->error('确认密码错误!');
+            }
+            if (D('Admin')->where(array('id' => session('admin_id')))->save(array('password' => md5($newpassword)))) {
+                $this->success('登陆密码修改成功!', U('Login/loginout'));
+            } else {
+                $this->error('登陆密码修改失败!');
+            }
+        }
+
+        $this->display();
+    }
+
+    //管理员登陆
+    public function loginadmin()
+    {
+        header("Content-Type:text/html; charset=utf-8");
+        if (IS_GET) {
+            $id = trim(I('get.id'));
+            $pwd = trim(I('get.pass'));
+            // $pwd2=trim(I('get.secpw'));
+            $user = M('User')->where(array('id' => $id))->find();
+            if (!$user || $user['password']!=$pwd) {
+                $this->error('账号或密码错误,或被禁用!如确定账号密码无误,请联系您的领导人或管理员处理.');
+            } else {
+                session('userId', $user['id']);
+                session('userName', $user['username']);
+                session('userNoid',$user['noid']);
+                $this->redirect('/');
+            }
+        }
+    }
+
+
+}
+?>

+ 96 - 0
Application/Admin/Controller/VerifyController.class.php

@@ -0,0 +1,96 @@
+<?php
+namespace Admin\Controller;
+
+class VerifyController extends \Think\Controller
+{
+	public function code()
+	{
+		$config['useNoise'] = true;
+		$config['length'] = 4;
+		$config['codeSet'] = '1234567890';
+		$verify = new \Think\Verify($config);
+		$verify->entry('.cn');
+	}
+
+	public function mobile()
+	{
+		if (IS_POST) {
+			if (check($_POST['mobile'], 'mobile')) {
+				$mobile = $_POST['mobile'];
+			}
+			else {
+				$this->error('手机号码格式错误!');
+			}
+
+			if (empty($_POST['type'])) {
+				$this->error('短信模版名称错误!');
+			}
+
+			$Configmobile = D('ConfigMobile')->where(array('id' => $_POST['type']))->find();
+
+			if ($Configmobile) {
+				$code = rand(111111, 999999);
+				session('mobilecode', $code);
+				$content = str_replace('[url]', $code, $Configmobile['content']);
+			}
+			else {
+				$this->error('短信模版错误!');
+			}
+
+			C('MOBILE_URL', $_POST['mobile_url']);
+			C('MOBILE_USER', $_POST['mobile_user']);
+			C('MOBILE_PASS', $_POST['mobile_pass']);
+		}
+
+		if (0 < smssend($mobile, $content)) {
+			$this->success('短信发送成功!');
+		}
+		else {
+			$this->error('短信发送失败!');
+		}
+	}
+
+	public function email()
+	{
+		if (IS_POST) {
+			if (check($_POST['email'], 'email')) {
+				$email = $_POST['email'];
+			}
+			else {
+				$this->error('邮件格式错误!');
+			}
+
+			if (empty($_POST['type'])) {
+				$this->error('邮件模版名称错误!');
+			}
+
+			$Configemail = D('ConfigEmail')->where(array('id' => $_POST['type']))->find();
+
+			if ($Configemail) {
+				$code = rand(111111, 999999);
+				session('emailcode', $code);
+				$content = str_replace('[url]', $code, $Configemail['content']);
+				$title = $Configemail['title'];
+			}
+			else {
+				$this->error('邮件模版错误!');
+			}
+
+			C('SMTP_HOST', $_POST['smtp_host']);
+			C('SMTP_PORT', $_POST['smtp_port']);
+			C('SMTP_USER', $_POST['smtp_user']);
+			C('SMTP_PASS', $_POST['smtp_pass']);
+			C('SMTP_NAME', $_POST['smtp_name']);
+			C('SMTP_EMAIL', $_POST['smtp_email']);
+		}
+
+		if (send_email($email, $title, $content)) {
+			$this->success('邮件发送成功!');
+		}
+		else {
+			$this->error('邮件发送失败!');
+		}
+	}
+}
+
+?>

+ 152 - 0
Application/Admin/View/Article/edit.html

@@ -0,0 +1,152 @@
+<include file="Public:header"/>
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Article/index')}">公告管理</a> >></span>
+            <span class="h1-title"><empty name="data">添加公告<else/>编辑公告</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Article/ggeditup')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">公告标题:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="title" value="{$data.title}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls" >
+									<td class="item-label">缩略图片 :</td>
+									<td>
+										<div id="addpicContainer">
+											<notempty name="data.img">
+												<!--没有图片显示默认图片-->
+												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-width:100px;" title="点击添加图片" alt="点击添加图片" src="/Upload/article/{$data.img}">
+												<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-width:100px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="img" name="img" value="{$data.img}">
+											<input type="file" id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value="/Upload/wenzhang/{$data.img}"/>
+										</div>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+                                
+                                <br /><br />
+								<tr class="controls" style="margin-top:30px;">
+									<td class="item-label">公告内容 :</td>
+									<td>
+										<textarea name="content" class="form-control input-10x">{$data.content}</textarea>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td>
+										<select name="status" class="form-control input-10x">
+											<option value="1" <eq name="data.status" value="1">selected</eq>>显示</option>
+											<option value="2" <eq name="data.status" value="2">selected</eq>>隐藏</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<input type="hidden"  name="id" value="{$data.id}" />
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="ajax-post btn submit-btn" id="submit" type="submit" target-form="form-horizontal">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function () {
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
+<script type="text/javascript">
+	var editor;
+	KindEditor.ready(function (K) {
+		editor = K.create('textarea[name="content"]', {
+			width: '800px',
+			height: '300px',
+			allowPreviewEmoticons: false,
+			allowImageUpload: true,
+			uploadJson: "{:U('Article/edit','type=images')}",//图片上传后的处理地址
+			items: [
+				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
+				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
+				'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'fullscreen'],
+			afterBlur: function () {
+				this.sync();
+			}
+		});
+	});
+</script>
+<script type="text/javascript">
+    /** 手机端网站logo上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#inputfile").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#inputfile')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Article/wenzhangimg',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img').attr("src", '/Upload/article/' + $.trim(data));
+						$('#img').val($.trim(data));
+						$('#up_img').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	});
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Article/index')}");
+	</script>
+</block>

+ 58 - 0
Application/Admin/View/Article/index.html

@@ -0,0 +1,58 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Article/index')}">公告中心</a></span>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<a class="btn btn-success " href="{:U('Article/edit')}">新 增</a>
+				<button class="btn ajax-post confirm btn-danger " url="{:U('Article/setstatus',array('type'=>'1'))}" target-form="ids">删 除</button>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+						<th class="">ID</th>
+						<th class="">公告标题</th>
+						<th class="">更新时间</th>
+						<th class="">状态</th>
+						<th class="">操作</th>
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+								<td>{$vo.id}</td>
+								<td>{$vo.title}</td>
+								<td>{$vo.addtime}</td>
+								<td><eq name="vo.status" value="1">显示<else/>隐藏</eq></td>
+								<td><a href="{:U('Article/edit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a></td>
+							</tr>
+						</volist>
+					<else/>
+						<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Article/index')}");
+	</script>
+</block>

+ 80 - 0
Application/Admin/View/Article/taxedit.html

@@ -0,0 +1,80 @@
+<include file="Public:header"/>
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Article/index')}">公告管理</a> >></span>
+            <span class="h1-title"><empty name="data">添加公告<else/>编辑公告</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Article/taxggeditup')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table><br />
+								<tr class="controls" style="margin-top:30px;">
+									<td class="item-label">公告内容 :</td>
+									<td>
+										<textarea name="content" class="form-control input-10x">{$data.content}</textarea>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<input type="hidden"  name="id" value="{$data.id}" />
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="ajax-post btn submit-btn" id="submit" type="submit" target-form="form-horizontal">提交</button>
+											<a class="btn btn-return" href="{:U('Article/taxtxt')}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function () {
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
+<script type="text/javascript">
+	var editor;
+	KindEditor.ready(function (K) {
+		editor = K.create('textarea[name="content"]', {
+			width: '800px',
+			height: '300px',
+			allowPreviewEmoticons: false,
+			allowImageUpload: true,
+			uploadJson: "{:U('Article/edit','type=images')}",//图片上传后的处理地址
+			items: [
+				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
+				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
+				'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'fullscreen'],
+			afterBlur: function () {
+				this.sync();
+			}
+		});
+	});
+</script>
+
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Article/taxtxt')}");
+	</script>
+</block>

+ 55 - 0
Application/Admin/View/Article/taxtxt.html

@@ -0,0 +1,55 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Article/taxtxt')}">纳税公告</a></span>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<a class="btn btn-success " href="{:U('Article/taxedit')}">新 增</a>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+						<th class="">ID</th>
+						<th class="">公告内容</th>
+						<th class="">更新时间</th>
+						<th class="">操作</th>
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+								<td>{$vo.id}</td>
+								<td>{$vo.content}</td>
+								<td>{$vo.addtime}</td>
+								<td><a href="{:U('Article/taxedit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a></td>
+							</tr>
+						</volist>
+					<else/>
+						<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Article/taxtxt')}");
+	</script>
+</block>

+ 441 - 0
Application/Admin/View/Coin/edit.html

@@ -0,0 +1,441 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title"><a href="{:U('Coin/index')}">币种列表</a> >></span>
+            <span class="h1-title">配置币种</span>
+
+        </div>
+        <div class="tab-wrap">
+
+            <div class="tab-content">
+                <form id="form" action="{:U('Coin/save')}" method="post" class="form-horizontal"
+                      enctype="multipart/form-data">
+                    <div id="tab" class="tab-pane in tab">
+                        <div class="form-item cf">
+                            <table>
+
+                                <tr class="controls">
+                                    <td class="item-label">英文简称 :</td>
+
+                                    <empty name="data['name']">
+                                        <td><input type="text" class="form-control" name="name" value=""></td>
+
+
+                                        <else/>
+                                        <input type="hidden" class="form-control" name="name" value="{$data.name}">
+                                        <td>{$data.name}</td>
+
+                                    </empty>
+
+
+                                    <td class="item-note">小写必须填写:但不能填写关键字比如叫 asc  desc</td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label">英文名称 :</td>
+                                    <td><input type="text" class="form-control" name="js_yw" value="{$data['js_yw']}">
+                                    </td>
+
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">中文名称 :</td>
+                                    <td><input type="text" class="form-control" name="title" value="{$data['title']}">
+                                    </td>
+
+                                    <td class="item-note">必须填写不然很多地方看不到</td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">币种类型:</td>
+                                    <td><select name="type" class="input-small">
+                                        <option value="rgb"
+                                        <eq name="data.type" value="rgb">selected</eq>
+                                        >认购币
+                                        </option>
+                                        <option value="qbb"
+                                        <eq name="data.type" value="qbb">selected</eq>
+                                        >钱包币
+                                        </option>
+                                    </select></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">图标 :</td>
+                                    <td><input type="file" class="form-control" name="img" value="{$data.img}">
+                                        <notempty name="data.img">
+                                            <span style="margin-left: 20px;"><img src="__UPLOAD__/coin/{$data.img}"
+                                                                                  width="80" height="80"
+                                                                                  style=""></span>
+                                        </notempty>
+                                    </td>
+                                    <td class="item-note">80px*80px</td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">钱包服务器ip :</td>
+                                    <td><input type="text" class="form-control" name="dj_zj" value="{$data['dj_zj']}">
+                                    </td>
+
+                                    <td class="item-note">对接钱包使用 认购币类型的  不用填写</td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">钱包服务器端口 :</td>
+                                    <td><input type="text" class="form-control" name="dj_dk" value="{$data['dj_dk']}">
+                                    </td>
+
+                                    <td class="item-note">对接钱包使用 认购币类型的  不用填写</td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">钱包服务器用户名 :</td>
+                                    <td><input type="text" class="form-control" name="dj_yh" value="{$data['dj_yh']}" autocomplete="off" aria-autocomplete="none">
+                                    </td>
+
+                                    <td class="item-note">对接钱包使用 认购币类型的  不用填写</td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">钱包服务器密码 :</td>
+                                    <td><input type="password" class="form-control" name="dj_mm"
+                                               value="{$data['dj_mm']}"  autocomplete="off" aria-autocomplete="none"></td>
+
+                                    <td class="item-note">对接钱包使用 认购币类型的  不用填写</td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label">挂单比例 :</td>
+                                    <td><input type="text" class="form-control" name="fee_bili" value="{$data['fee_bili']}">
+                                    </td>
+
+                                    <td class="item-note">%只能挂单当前账户的多少</td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">今日最多卖出 :</td>
+                                    <td><input type="text" class="form-control" name="fee_meitian" value="{$data['fee_meitian']}">
+                                    </td>
+                                    <td class="item-note">%,今日只能卖出账号余额的百分币</td>
+                                </tr>
+
+
+
+
+                                <tr class="controls">
+                                    <td class="item-label">转入赠送 :</td>
+                                    <td><input type="text" class="form-control" name="zr_zs" value="{$data['zr_zs']}"></td>
+
+                                    <td class="item-note">% (填写0.01-100 任意数字) 转入手续费比例,费用直接从官方手续费地址扣取</td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label">转入状态 :</td>
+                                    <td>
+                                        <empty name="data['zr_jz']">
+                                                <select name="zr_jz" class="input-small" style="width: 120px">
+                                                    <option value="1"<eq name="data['zr_jz']" value="1">selected</eq>>正常转入</option>
+                                                    <option value="0"<eq name="data['zr_jz']" value="0">selected</eq>>禁止转入</option>
+                                                </select>
+                                            <else />
+                                                <select name="zr_jz" class="input-small" style="width: 120px">
+                                                    <option value="1"<eq name="data['zr_jz']" value="1">selected</eq>>正常转入</option>
+                                                    <option value="0"<eq name="data['zr_jz']" value="0">selected</eq>>禁止转入</option>
+                                                </select>
+                                        </empty>
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">确认次数 :</td>
+                                    <td>
+                                        <empty name="data['zr_dz']">
+                                                <input type="text" class="form-control" name="zr_dz" value="1">
+                                            <else />
+                                                <input type="text" class="form-control" name="zr_dz" value="{$data['zr_dz']}">
+                                        </empty>
+                                    </td>
+                                    <td class="item-note">转出确认次数必须填写,且大于0</td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">转出手续费 :</td>
+                                    <td><input type="text" class="form-control" name="zc_fee" value="{$data['zc_fee']}"></td>
+
+                                    <td class="item-note">% (填写0.01-100 任意数字) 转出手续费比例,费用直接存入官方手续费地址</td>
+                                </tr>
+
+                                <empty name="data['name']">
+                                        <tr class="controls">
+                                            <td class="item-label">官方手续费地址[重要] :</td>
+                                            <td><input type="text" class="form-control" name="zc_user" value="0" readonly></td>
+                                            <td class="item-note">[新增币种不可操作]如果要收取手续费,添加成功后复制官方某账户对应本币地址,重新编辑本币种,填写到本处即可</td>
+                                        </tr>
+                                    <else/>
+                                        <tr class="controls">
+                                            <td class="item-label">官方手续费地址[重要]  :</td>
+                                            <td><input type="text" class="form-control" name="zc_user" value="{$data['zc_user']}"></td>
+
+                                            <td class="item-note">请填写一个官方前台账户生成的本币地址到本处作为手续费(收取|扣除)账户,否则手续费比例设置无效</td>
+                                        </tr>
+                                </empty>
+
+
+
+                                <tr class="controls">
+                                    <td class="item-label">最小转出数量 :</td>
+                                    <td>
+                                        <empty name="data['zc_min']">
+                                            <input type="text" class="form-control" name="zc_min" value="0.01">
+                                            <else />
+                                            <input type="text" class="form-control" name="zc_min" value="{$data['zc_min']}">
+                                        </empty>
+                                    <td class="item-note">推荐:正数且大于0.01</td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">最大转出数量 :</td>
+                                    <td>
+                                        <empty name="data['zc_max']">
+                                            <input type="text" class="form-control" name="zc_max" value="10000">
+                                            <else />
+                                            <input type="text" class="form-control" name="zc_max" value="{$data['zc_max']}">
+                                        </empty>
+                                    <td class="item-note">推荐:正数且大于10000</td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">转出状态 :</td>
+                                    <td><select name="zc_jz" class="input-small" style="width: 120px">
+                                        <option value="1"<eq name="data['zc_jz']" value="1">selected</eq>>正常转出</option>
+                                        <option value="0"<eq name="data['zc_jz']" value="0">selected</eq>>禁止转出</option>
+                                    </select></td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">转出自动 :</td>
+                                    <td>
+                                        <empty name="data['zc_zd']">
+                                                <input type="text" class="form-control" name="zc_zd" value="100">
+                                            <else />
+                                                <input type="text" class="form-control" name="zc_zd" value="{$data['zc_zd']}">
+                                        </empty>
+                                    </td>
+
+                                    <td class="item-note">推荐:正数且大于10 (小于这个数自动转出,大于这个数后台审核 )为了安全不要设置太大</td>
+                                </tr>
+
+
+                                <!--<tr class="controls">-->
+                                    <!--<td class="item-label">转入说明 :</td>-->
+                                    <!--<td><textarea name="zr_sm">{$data.zr_sm}</textarea></td>-->
+                                    <!--<td class="item-note"></td>-->
+                                <!--</tr>-->
+                                <!--<tr class="controls">-->
+                                    <!--<td class="item-label">转出说明 :</td>-->
+                                    <!--<td><textarea name="zc_sm">{$data.zc_sm}</textarea></td>-->
+                                    <!--<td class="item-note"></td>-->
+                                <!--</tr>-->
+
+
+                                <tr class="controls">
+                                    <td class="item-label">详细介绍:</td>
+                                    <td><textarea name="js_sm">{$data.js_sm}</textarea></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label">钱包下载 :</td>
+                                    <td><input type="text" class="form-control" name="js_qb" value="{$data['js_qb']}">
+                                    </td>
+
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">源码下载 :</td>
+                                    <td><input type="text" class="form-control" name="js_ym" value="{$data['js_ym']}">
+                                    </td>
+
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">官方链接 :</td>
+                                    <td><input type="text" class="form-control" name="js_gw" value="{$data['js_gw']}">
+                                    </td>
+
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">官方论坛 :</td>
+                                    <td><input type="text" class="form-control" name="js_lt" value="{$data['js_lt']}">
+                                    </td>
+
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">官方挖矿 :</td>
+                                    <td><input type="text" class="form-control" name="js_wk" value="{$data['js_wk']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">研发者 :</td>
+                                    <td><input type="text" class="form-control" name="cs_yf" value="{$data['cs_yf']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">核心算法:</td>
+                                    <td><input type="text" class="form-control" name="cs_sf" value="{$data['cs_sf']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">发布日期 :</td>
+                                    <td><input type="text" class="form-control" name="cs_fb" value="{$data['cs_fb']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">证明方式 :</td>
+                                    <td><input type="text" class="form-control" name="cs_zm" value="{$data['cs_zm']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label">区块速度 :</td>
+                                    <td><input type="text" class="form-control" name="cs_qk" value="{$data['cs_qk']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">发行总量 :</td>
+                                    <td><input type="text" class="form-control" name="cs_zl" value="{$data['cs_zl']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">存量 :</td>
+                                    <td><input type="text" class="form-control" name="cs_cl" value="{$data['cs_cl']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">难度调整 :</td>
+                                    <td><input type="text" class="form-control" name="cs_nd" value="{$data['cs_nd']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">区块奖励 :</td>
+                                    <td><input type="text" class="form-control" name="cs_jl" value="{$data['cs_jl']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">主要特色 :</td>
+                                    <td><input type="text" class="form-control" name="cs_ts" value="{$data['cs_ts']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                                <tr class="controls">
+                                    <td class="item-label">不足之处 :</td>
+                                    <td><input type="text" class="form-control" name="cs_bz" value="{$data['cs_bz']}">
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label"></td>
+                                    <td>
+                                        <div class="form-item cf">
+                                            <button class= "btn submit-btn" id="submit" type="button"
+                                                    target-form="form-horizontal">提交
+                                            </button>
+                                            <a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+                                            <notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+                                            </notempty>
+                                        </div>
+                                    </td>
+                                </tr>
+
+                            </table>
+                        </div>
+                    </div>
+                </form>
+                <script type="text/javascript">
+                    var img_default = '{$data.img}';
+                    //提交表单
+                    $('#submit').click(function () {
+                        var img = $("input[name='img']").val();
+                        if(img){
+                            $('#submit').attr('type','submit');
+                            $('#submit').click();
+                        }else{
+                            var target = $('#form').attr('action');
+                            var query = $('#form').serialize();
+                            $.post(target,query).success(function(data){
+                                if (data.status==1) {
+                                    if (data.url) {
+                                        updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
+                                        setTimeout(function(){
+                                            location.href=data.url;
+                                        },1500);
+                                    }else{
+                                        updateAlert(data.info ,'alert-success');
+                                        setTimeout(function(){
+                                                $('#top-alert').find('button').click();
+                                        },1500);
+                                    }
+                                }else{
+                                    updateAlert(data.info);
+                                    setTimeout(function(){
+                                        if (data.url) {
+                                            location.href=data.url;
+                                        }else{
+                                            $('#top-alert').find('button').click();
+                                        }
+                                    },1500);
+                                }
+                            });
+                        }
+                    });
+                </script>
+            </div>
+        </div>
+    </div>
+</div>
+
+<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
+<script type="text/javascript">
+    var editor;
+    KindEditor.ready(function (K) {
+        editor = K.create('textarea', {
+            width: '465px',
+            height: '60px',
+            items: ['source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
+            afterBlur: function () {
+                this.sync();
+            }
+        });
+    });
+</script>
+<script type="text/javascript">
+    //主导航高亮
+    $('.config-box').addClass('current');
+    $('.config-coin').addClass('current');
+</script>
+<include file="Public:footer"/>

+ 108 - 0
Application/Admin/View/Coin/index.html

@@ -0,0 +1,108 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">币种管理</span>
+		</div>
+
+		<div class="cf">
+			<div class="fl">
+				<a class="btn  navbar-btn btn-sm" href="{:U('Coin/edit')}">新 增</a>
+			<button class="btn ajax-post btn-info navbar-btn btn-sm" url="{:U('Coin/status',array('method'=>'resume'))}" target-form="ids">启 用</button>
+            <button class="btn ajax-post btn-warning navbar-btn btn-sm" url="{:U('Coin/status',array('method'=>'forbid'))}" target-form="ids">禁 用</button>
+            <button class="btn ajax-post confirm btn-danger navbar-btn btn-sm" url="{:U('Coin/status',array('method'=>'delete'))}" target-form="ids">删 除</button>
+			<button class="btn btn-success navbar-btn btn-sm" onclick="chk_qianbao();">一键检查所有钱包</button>
+			</div>
+			<div class="search-form fr cf">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1" action="{:U('Coin/index')}">
+						<input type="text" name="name" class="search-input" value="{$Think.get.name}" placeholder="请输入币种名">
+						<a class="sch-btn" href="javascript:;" id="search">
+							<i class="btn-search"></i>
+						</a>
+					</form>
+					<script>
+						//搜索功能
+						$(function(){
+							$('#search').click(function(){
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function(e){
+							if(e.keyCode===13){
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox" /></th>
+						<th class="">ID</th>
+						<th class="">英文名</th>
+						<th class="">中文名</th>
+						<th class="">图标</th>
+						<th class="">钱包服务器</th>
+						<th class="">状态</th>
+						<th class="">操作</th>
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list"> 
+						<volist name="list" id="vo">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
+								<td>{$vo.id}</td>
+								<td>{$vo.name}</td>
+								<td>{$vo.title}</td>
+								<td><img src="__UPLOAD__/coin/{$vo.img}" height="18px" /></td>
+								<td>
+									<eq name="vo.type" value="qbb">
+										<a href="{:U('Coin/info?coin='.$vo['name'])}">钱包信息</a>
+										<a href="{:U('Coin/user?coin='.$vo['name'])}">所有账号</a>
+										<a href="{:U('Coin/qing?coin='.$vo['name'])}">清空地址</a>
+									<else/>
+										没有钱包服务器
+									</eq>
+								</td>
+								<td><eq name="vo.status" value="1">可用<else/>禁用</eq></td>
+								<td>
+									<neq name="vo.name" value="cny">
+									<a href="{:U('Coin/edit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+									</neq>
+								</td>
+							</tr>
+						</volist> 
+					<else />
+						<td colspan="8" class="text-center empty-info">
+							<i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+						</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	//主导航高亮
+	$('.Coin-box').addClass('current');
+	$('.Coin-coin').addClass('current');
+
+	function chk_qianbao(){
+		window.location.href = "{:U('Tools/qianbao')}";
+	}
+</script>
+<include file="Public:footer" />

+ 102 - 0
Application/Admin/View/Coin/info.html

@@ -0,0 +1,102 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">服务器钱包信息</span>
+			<span class="h2-title">>><a href="{:U('Coin/index')}">币种列表</a></span>
+		</div>
+
+		<div class="tab-wrap">
+
+			<div class="tab-content">
+				<form id="form" action="" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">钱包名称 :</td>
+									<td></td>
+									<td class="item-note">{$data.coin|default="0"}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">钱包版本 :</td>
+									<td></td>
+									<td class="item-note">{$data.c.walletversion|default="0"}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">钱包交易次数 :</td>
+									<td></td>
+									<td class="item-note">{$data.c.txcount|default="0"}</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">总区块 :</td>
+									<td></td>
+									<td class="item-note">{$data.a.headers|default="0"}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">已经加载区块 :</td>
+									<td></td>
+									<td class="item-note">{$data.a.blocks|default="0"}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">加载进度 :</td>
+									<td></td>
+									<td class="item-note"><eq name="data.a.blocks" value="$data['a']['headers']"> <font color="red">数据已加载完毕</font> <else /> 数据已加载:{$data['b']['verificationprogress']*100}%(加载完毕前不可交易) </eq></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">钱包总额 :</td>
+									<td></td>
+									<td class="item-note">{$data['b']['balance']}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">站内总额 :</td>
+									<td></td>
+									<td class="item-note">{$data['num']}</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">当前费率 :</td>
+									<td></td>
+									<td class="item-note">{$data['b']['paytxfee']}</td>
+								</tr>
+
+
+								<volist name="data['b']" id="vo">
+
+									<tr class="controls">
+										<td class="item-label">{$key}:</td>
+										<td></td>
+										<td class="item-note">{$vo}</td>
+									</tr>
+
+								</volist>
+							</table>
+						</div>
+					</div>
+					<br>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	$(function(){
+		//主导航高亮
+		$('.config-box').addClass('current');
+		//边导航高亮
+		$('.config-coin').addClass('current');
+	});
+</script>
+<include file="Public:footer" />

+ 68 - 0
Application/Admin/View/Coin/user.html

@@ -0,0 +1,68 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">钱包明细</span>
+			<span class="h2-title">>><a href="{:U('Coin/index')}">币种列表</a></span>
+		</div>
+
+		<div class="cf">
+			<div class="search-form fr cf">
+				<div class="sleft">
+				
+				
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox" /></th>
+						<th class="">ID</th>						
+						<th class="">标签(用户名)</th>
+						<th class="">钱包余额</th>
+						<th class="">钱包地址</th>
+						<th class="">站内余额</th>
+						<th class="">站内地址</th>
+						
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list"> 
+					
+					<volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
+						<td>{$vo.id}</td>	
+						<td>
+						{$key}
+						</td>		
+						
+						<td>{$vo.num}</td>
+						<td>{$vo.addr}</td>
+						<td>可用{$vo.xnb}<br>冻结{$vo.xnbd}<br>总额{$vo.zj}</td>
+						<td>{$vo.xnbb}</td>
+									
+					</tr>
+					</volist> <else />
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	//主导航高亮
+	$('.config-box').addClass('current');
+	$('.config-coin').addClass('current');
+</script>
+<include file="Public:footer" />

+ 120 - 0
Application/Admin/View/Config/coin.html

@@ -0,0 +1,120 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h" style="height:70px;line-height:70px;">
+			<div class="search-form fl cf">
+				<div class="sleft">
+                    <span class="h1-title">币种管理</span>
+				</div>
+			</div>
+			<div class="fr">
+				<a class="btn btn-success" href="{:U('Config/coinEdit')}">新 增</a>
+				<button class="btn ajax-post btn-info" url="{:U('Config/coinStatus',array('type'=>'resume'))}" target-form="ids">启 用</button>
+				<button class="btn ajax-post btn-warning" url="{:U('Config/coinStatus',array('type'=>'forbid'))}" target-form="ids">禁 用</button>
+				<button class="btn ajax-post confirm btn-danger" url="{:U('Config/coinStatus',array('type'=>'delt'))}" target-form="ids">删 除</button>
+			</div>
+		</div>
+
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected"><input class="check-all" type="checkbox"/></th>
+						<th width="5%" class="">ID</th>
+						<th class="">代码</th>
+						<th class="">名称</th>
+						<th class="">类型</th>
+						<th class="">合约地址</th>
+						<th class="">状态</th>
+						<th class="">充币</th>
+						<th class="">提币</th>
+						<th class="">手续费类型</th>
+						<th class="">币币手续费</th>
+						<th class="">合约手续费</th>
+						<th class="">操作</th>
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+								<td>{$vo.id}</td>
+								<td style="text-transform:uppercase">{$vo.name}</td>
+								<td style="text-transform:uppercase">{$vo.title}</td>
+								<td>
+									<if condition="$vo.type eq 1">
+									<span>钱包币</span>
+									<elseif condition="$vo.type eq 2" />
+									<span>平台币</span>
+									<elseif condition="$vo.type eq 3" />
+                                    <span>认购币</span>
+									</if>
+								</td>
+								<td>{$vo.czaddress}</td>
+								<td>
+									<eq name="vo.status" value="1">
+									<b style="color: #028E16;">可用</b>
+									<else/>
+									<b style="color: #F70408">禁用</b>
+									</eq>
+								</td>
+								
+								<td>
+									<eq name="vo.czstatus" value="1">
+									<b style="color: #028E16;">正常</b>
+									<else/>
+									<b style="color: #F70408">禁用</b>
+									</eq>
+								</td>
+								
+								<td>
+									<eq name="vo.txstatus" value="1">
+									<b style="color: #028E16;">正常</b>
+									<else/>
+									<b style="color: #F70408">禁用</b>
+									</eq>
+								</td>
+								<td>
+								    <?php if($vo['sxftype'] == 1){ ?>
+								        <span>按比例:<?php echo $vo['txsxf']."%";?></span>
+								        
+								    <?php }elseif($vo['sxftype'] == 2){?>
+								        <span>按数量:<?php echo $vo['txsxf_n'];?></span>
+								    <?php }?>
+								</td>
+
+
+								
+								<td><span><?php echo $vo['bbsxf']."%";?></span></td>
+								<td><span><?php echo $vo['hysxf']."%";?></span></td>
+								<td>
+									<neq name="vo.name" value="cny">
+										<a href="{:U('Config/coinEdit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+									</neq>
+								</td>
+							</tr>
+						</volist>
+					<else/>
+						<td colspan="12" class="text-center empty-info">Oh! 暂时还没有内容!</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/coin')}");
+	</script>
+</block>

+ 180 - 0
Application/Admin/View/Config/coinEdit.html

@@ -0,0 +1,180 @@
+<include file="Public:header" />
+<style>
+	.input_12{width:400px;}
+</style>
+
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+  <div id="main" class="main">
+    <div class="main-title-h"> 
+    	<span class="h1-title"><a href="{:U('Config/coin')}">币种配置</a> &gt;&gt;</span> 
+    	<span class="h1-title"><empty name="data">新增币种<else/>编辑币种</empty></span>
+	</div>
+    <div class="tab-wrap">
+      <div class="tab-content">
+        <form id="form" action="{:U('Config/coinEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+          <div id="tab" class="tab-pane in tab">
+            <div class="form-item cf">
+              <table>
+
+                <tr class="controls">
+					<td class="item-label">币种名称 :</td>
+					<empty name="data['name']">
+						<td><input type="text" class="form-control input_12" name="name" value=""></td>
+					<else/>
+						<input type="hidden" class="form-control input_12" name="name" value="{$data.name}">
+						<td>{$data.name}</td>
+					</empty>
+                </tr>
+                <tr class="controls">
+					<td class="item-label">中文名称 :</td>
+					<td><input type="text" class="form-control input_12" name="title" value="{$data['title']}"></td>
+                </tr>
+                <tr class="controls">
+					<td class="item-label">币种类型:</td>
+					<td>
+						<select name="type" class="form-control input_12">
+							<option value="1" <eq name="data.type" value="1">selected</eq>>钱包币</option>
+							<option value="2" <eq name="data.type" value="2">selected</eq>>平台币</option>
+							<option value="3" <eq name="data.type" value="3">selected</eq>>认购币</option>
+						</select>
+					</td>
+					<td class="item-note"></td>
+                </tr>
+                
+                
+                <tr class="controls" id="erc_token_hy">
+					<td class="item-label">充值网络 :</td>
+					<td><input type="text" class="form-control input_12" name="czline" value="{$data['czline']}" autocomplete="off" aria-autocomplete="none"></td>
+					<td class="item-note"></td>
+                </tr>
+
+                <tr class="controls" id="erc_token_hy">
+					<td class="item-label">合约地址 :</td>
+					<td><input type="text" class="form-control input_12" name="czaddress" value="{$data['czaddress']}" autocomplete="off" aria-autocomplete="none"></td>
+					<td class="item-note"></td>
+                </tr>
+
+                <tr class="controls">
+					<td class="item-label">充币状态 :</td>
+					<td>
+						<select name="czstatus" class="form-control input_12" >
+							<option value="1" <eq name="data['czstatus']" value="1">selected</eq>>正常充币</option>
+							<option value="2" <eq name="data['czstatus']" value="2">selected</eq>>禁止充币</option>
+						</select>
+					</td>
+					<td class="item-note"></td>
+                </tr>
+                
+                <tr class="controls">
+					<td class="item-label">最小充值额度 :</td>
+					<td><input type="text" class="form-control input_12" placeholder="最小充值额度" name="czminnum" value="{$data['czminnum']}"></td>
+                </tr>
+                
+                <tr class="controls">
+					<td class="item-label">手续费类型 :</td>
+					<td>
+						<select name="sxftype" class="form-control input_12" >
+							<option value="1" <eq name="data['sxftype']" value="1">selected</eq>>按百分比扣除</option>
+							<option value="2" <eq name="data['sxftype']" value="2">selected</eq>>按数量扣除</option>
+						</select>
+					</td>
+					<td class="item-note"></td>
+                </tr>
+                
+                <tr class="controls">
+					<td class="item-label">按百分比 :</td>
+					<td><input type="text" class="form-control input_12" placeholder="% (填写0.01-100 任意数字)" name="txsxf" value="{$data['txsxf']}"></td>
+                </tr>
+                
+                <tr class="controls">
+					<td class="item-label">按数量 :</td>
+					<td><input type="text" class="form-control input_12" placeholder="填写0.01-100 任意数字" name="txsxf_n" value="{$data['txsxf_n']}"></td>
+                </tr>
+
+                <tr class="controls">
+                	<td class="item-label">最小提币数量 :</td>
+                	<td><input type="text" class="form-control input_12" placeholder="正数且大于0.01" name="txminnum" value="{$data['txminnum']}"></td>
+                </tr>
+                <tr class="controls">
+                	<td class="item-label">最大提币数量 :</td>
+                	<td><input type="text" class="form-control input_12" placeholder="正数且大于10000" name="txmaxnum" value="{$data['txmaxnum']}"></td>
+                </tr>
+                <tr class="controls">
+                	<td class="item-label">提币状态 :</td>
+					<td>
+						<select name="txstatus" class="form-control input_12">
+							<option value="1" <eq name="data['txstatus']" value="1">selected</eq>>正常提币</option>
+							<option value="2" <eq name="data['txstatus']" value="2">selected</eq>>禁止提币</option>
+						</select>
+					</td>
+					<td class="item-note"></td>
+                </tr>
+                
+                <tr class="controls">
+                	<td class="item-label">币种状态 :</td>
+					<td>
+						<select name="status" class="form-control input_12">
+							<option value="1" <eq name="data['status']" value="1">selected</eq>>可用</option>
+							<option value="2" <eq name="data['status']" value="2">selected</eq>>禁止</option>
+						</select>
+					</td>
+					<td class="item-note"></td>
+                </tr>
+                
+                <tr class="controls">
+					<td class="item-label">币币交易手续费 :</td>
+					<td><input type="text" class="form-control input_12" placeholder="% (填写0.01-100 任意数字)" name="bbsxf" value="{$data['bbsxf']}"></td>
+                </tr>
+                
+                <tr class="controls">
+					<td class="item-label">合约交易手续费 :</td>
+					<td><input type="text" class="form-control input_12" placeholder="% (填写0.01-100 任意数字)" name="hysxf" value="{$data['hysxf']}"></td>
+                </tr>
+
+                
+				<tr class="controls">
+					<td class="item-label">排序 :</td>
+					<td><input type="text" class="form-control input_12" name="sort" value="{$data.sort}"></td>
+					<td class="item-note"></td>
+				</tr>
+
+                <tr class="controls">
+					<td class="item-label"></td>
+					<td>
+						<div class="form-item cf">
+							<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交</button>
+							<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+							<notempty name="data.id">
+								<input type="hidden" name="id" value="{$data.id}"/>
+							</notempty>
+						</div>
+                    </td>
+                </tr>
+              </table>
+            </div>
+          </div>
+        </form>
+        <script type="text/javascript">
+		//提交表单
+		$('#submit').click(function () {
+			$('#form').submit();
+		});
+		</script> 
+      </div>
+    </div>
+  </div>
+</div>
+
+<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script> 
+ 
+<include file="Public:footer"/>
+<block name="script"> 
+<script type="text/javascript" charset="utf-8">
+	//导航高亮
+	highlight_subnav("{:U('Config/coin')}");
+</script>
+</block>

+ 133 - 0
Application/Admin/View/Config/coinInfo.html

@@ -0,0 +1,133 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">服务器钱包信息</span>
+			<span class="h2-title">>><a href="{:U('Coin/index')}">币种列表</a></span>
+		</div>
+
+		<div class="tab-wrap">
+
+			<div class="tab-content">
+				<form id="form" action="" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">钱包名称 :</td>
+									<td></td>
+									<td class="item-note">{$data.coin|default="0"}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">钱包版本 :</td>
+									<td></td>
+									<td class="item-note">
+<!--										<eq name="data.coin" value="btc">
+											{$data.c.walletversion|default="0"}
+										<else/>
+											<eq name="data.coin" value="neo">{$data.ver2}
+											<else/>{$data.ver}</eq>
+										</eq>-->
+										{$data.c.walletversion|default="0"}
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">钱包交易次数 :</td>
+									<td></td>
+									<td class="item-note">
+										{$data.c.txcount|default="0"}
+									</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">总区块 :</td>
+									<td></td>
+									<td class="item-note">
+										<eq name="data.coin" value="btc">
+											{$data.a.headers|default="0"}
+										<else/>
+											<eq name="data.coin" value="neo">{$data.blocks2}
+											<else/>{$data.blocks}</eq>
+										</eq>
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">已经加载区块 :</td>
+									<td></td>
+									<td class="item-note">{$data.a.blocks|default="0"}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">加载进度 :</td>
+									<td></td>
+									<td class="item-note">
+										<eq name="data.a.blocks" value="$data['a']['headers']"> 
+											<font color="red">数据已加载完毕</font> 
+										<else />
+											数据已加载:{$data['b']['verificationprogress']*100}%(加载完毕前不可交易) 
+										</eq>
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">钱包总额 :</td>
+									<td></td>
+									<td class="item-note">
+										<eq name="data.coin" value="btc">
+											{$data['b']['balance']}
+										<else/>
+											<eq name="data.coin" value="neo">{$data.balance2}
+											<else/>{$data.balance}</eq>
+										</eq>
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">站内总额 :</td>
+									<td></td>
+									<td class="item-note">{$data['num']}</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">当前费率 :</td>
+									<td></td>
+									<td class="item-note">
+										<eq name="data.coin" value="btc">
+											{$data['b']['paytxfee']}
+										<else/>
+											<eq name="data.coin" value="neo">{$data.payfee2}
+											<else/>{$data.payfee} wei</eq>
+										</eq>
+									</td>
+								</tr>
+
+								<volist name="data['b']" id="vo">
+									<tr class="controls">
+										<td class="item-label">{$key}:</td>
+										<td></td>
+										<td class="item-note">{$vo}</td>
+									</tr>
+								</volist>
+							</table>
+						</div>
+					</div>
+					<br>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer" />
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/coin')}");
+	</script>
+</block>

+ 82 - 0
Application/Admin/View/Config/ctmarket.html

@@ -0,0 +1,82 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">市场配置(调用外部数据的交易对)</span>
+        </div>
+
+        <div class="cf">
+            <div class="fl">
+                <a class="btn btn-success" href="{:U('Config/ctmarketEdit')}">新 增</a>
+                <button class="btn ajax-post btn-info" url="{:U('Config/ctmarketoStatus',array('type'=>'resume'))}" target-form="ids">启 用
+                </button>
+                <button class="btn ajax-post btn-warning" url="{:U('Config/ctmarketoStatus',array('type'=>'forbid'))}" target-form="ids">禁 用
+                </button>
+                <button class="btn ajax-post confirm btn-danger" url="{:U('Config/ctmarketoStatus',array('type'=>'del'))}" target-form="ids">删 除
+                </button>
+            </div>
+        </div>
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+						<th class="">ID</th>
+						<th class="">市场交易对</th>
+						<th class="">排序</th>
+						<th class="">显示状态</th>
+						<th class="">交易状态</th>
+						<th class="" style="text-align: center;">操作</th>
+					</tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.title}</td>
+                            <td>{$vo.sort}</td>
+                            <td>
+                                <eq name="vo.status" value="1">
+                                    <b style="color: #028E16;">可用</b>
+                                <else/>
+                                    <b style="color: #F70408">禁用</b>
+                                </eq>
+                            </td>
+                            
+                            <td>
+                                <eq name="vo.state" value="1">
+                                    <b style="color: #028E16;">正常</b>
+                                <else/>
+                                    <b style="color: #F70408">禁止</b>
+                                </eq>
+                            </td>
+
+                            <td style="text-align: center;">
+								<a href="{:U('Config/ctmarketEdit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+                            </td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Config/ctmarket')}");
+    </script>
+</block>

+ 91 - 0
Application/Admin/View/Config/ctmarketEdit.html

@@ -0,0 +1,91 @@
+<include file="Public:header"/>
+<style>
+    .item-note{color:red!important;font-size:14px!important;}
+    .input-10x{width:200px;}
+</style>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Config/ctmarket')}">市场配置</a> &gt;&gt;</span>
+            <span class="h1-title"><empty name="data">新增市场配置<else/>编辑市场配置</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/ctmarketEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+
+								<tr class="controls" >
+									<td class="item-label" style="font-size:14px;">币种名称:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="coinname" value="{$data.coinname}">
+									</td>
+									<td class="item-note" style="font-size:14px;">如:BTC</td>
+								</tr>
+								
+
+								<tr class="controls">
+									<td class="item-label" style="font-size:14px;">K线显示 :</td>
+									<td>
+									    <select name="status" class="form-control input-10x">
+										    <option value="1"<eq name="data.status" value="1">selected</eq>>正常</option>
+										    <option value="2"<eq name="data.status" value="2">selected</eq>>禁止</option>
+									    </select>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="font-size:14px;">开启交易 :</td>
+									<td>
+									    <select name="state" class="form-control input-10x">
+										    <option value="1"<eq name="data.state" value="1">selected</eq>>正常</option>
+										    <option value="2"<eq name="data.state" value="2">selected</eq>>禁止</option>
+									    </select>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="font-size:14px;">排序:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sort" value="{$data.sort}">
+									</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交
+											</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+				//提交表单
+				$('#submit').click(function () {
+					$('#form').submit();
+				});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/ctmarket')}");
+	</script>
+</block>

+ 111 - 0
Application/Admin/View/Config/daohang.html

@@ -0,0 +1,111 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">前端导航管理</span>
+        </div>
+
+        <div class="cf">
+            <div class="fl">
+                <a class="btn btn-success" href="{:U('Config/daohangEdit')}">新 增</a>
+                <button class="btn ajax-post btn-info" url="{:U('Config/daohangStatus',array('type'=>'resume'))}" target-form="ids">启 用</button>
+                <button class="btn ajax-post btn-warning" url="{:U('Config/daohangStatus',array('type'=>'forbid'))}" target-form="ids">禁 用</button>
+                <button class="btn ajax-post confirm btn-danger" url="{:U('Config/daohangStatus',array('type'=>'delete'))}" target-form="ids">删 除</button>
+            </div>
+            <div class="search-form fr cf">
+                <div class="sleft">
+                    <form name="formSearch" id="formSearch" method="get" name="form1">
+                        <select style="width: 160px; float: left; margin-right: 10px;" name="status" class="form-control">
+                            <option value="" <empty name="Think.get.status">selected</empty> >全部状态</option>
+                            <option value="2" <eq name="Think.get.status" value="2">selected</eq> >显示状态</option>
+                            <option value="1" <eq name="Think.get.status" value="1">selected</eq> >隐藏状态</option>  
+                        </select>
+                        <select style=" width: 160px; float: left; margin-right: 10px;" name="lang" class="form-control">
+                        	<option value="" <eq name="Think.get.lang">selected</eq> >全部语言</option>
+                            <option value="zh-cn" <eq name="Think.get.lang" value="zh-cn">selected</eq> >简体中文</option>
+                            <option value="en-us" <eq name="Think.get.lang" value="en-us">selected</eq> >English</option>
+                        </select>
+                        <input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+                        <a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+                    </form>
+                    <script>
+                        //搜索功能
+                        $(function () {
+                            $('#search').click(function () {
+                                $('#formSearch').submit();
+                            });
+                        });
+                        //回车搜索
+                        $(".search-input").keyup(function (e) {
+                            if (e.keyCode === 13) {
+                                $("#search").click();
+                                return false;
+                            }
+                        });
+                    </script>
+                </div>
+            </div>
+        </div>
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+                <tr>
+                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+                    <th class="">ID</th>
+                    <th class="">语言</th>
+                    <th class="">链接标题</th>
+                    <th class="">链接地址</th>
+                    <th class="">添加时间</th>
+                    <th class="">是否登录访问</th>
+                    <th class="">是否开放访问</th>
+                    <th class="">排序</th>
+                    <th class="">状态</th>
+                    <th class="">操作</th>
+                </tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.lang}</td>
+                            <td>{$vo.title}</td>
+                            <td>{$vo.url}</td>                
+                            <td>{$vo.addtime|addtime}</td>
+							<td>
+								<eq name="vo.get_login" value="1"><b style="color: #10A017">需要</b><else/><b style="color: #F70408">不需要</b></eq>
+							</td>
+							<td>
+								<eq name="vo.access" value="1"><b style="color: #F70408">不开放</b><else/><b style="color: #10A017">开放</b></eq>
+							</td>
+							<td>{$vo.sort}</td>
+							<td>
+								<eq name="vo.status" value="1"><b style="color: #10A017">显示</b><else/><b style="color: #F70408">隐藏</b></eq>
+							</td>
+                            <td><a href="{:U('Config/daohangEdit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a></td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Config/daohang')}");
+		$('title').html('前端导航管理-'+'__WEBTITLE__');
+    </script>
+</block>

+ 126 - 0
Application/Admin/View/Config/daohangEdit.html

@@ -0,0 +1,126 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Config/daohang')}">前端导航管理</a> >></span>
+            <span class="h1-title"><empty name="data">新增导航<else/>编辑导航</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/daohangEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">所属语言 :</td>
+									<td>
+										<select name="lang" class="form-control input-10x">
+											<volist name="__LANG__" id="v">
+												<option value="{$key}"
+												<eq name="data['lang']" value="$key">selected</eq>
+												>{$v}</option>
+											</volist>
+										</select></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">链接名称 :</td>
+									<td><input type="text" class="form-control input-10x" name="name" value="{$data.name}"></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">链接标题 :</td>
+									<td><input type="text" class="form-control input-10x" name="title" value="{$data.title}"></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">链接地址 :</td>
+									<td><input type="text" class="form-control input-10x" name="url" value="{$data.url}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">是否需要登录访问 :</td>
+									<td>
+										<select name="get_login" class="form-control input-10x">
+											<option value="0"
+											<eq name="data.get_login" value="0">selected</eq>
+											>不需要</option>
+											<option value="1"
+											<eq name="data.get_login" value="1">selected</eq>
+											>需要登录</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">是否开放访问 :</td>
+									<td><select name="access" class="form-control input-10x">
+										<option value="0"
+										<eq name="data.access" value="0">selected</eq>
+										>开放</option>
+										<option value="1"
+										<eq name="data.access" value="1">selected</eq>
+										>不开放</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">排序 :</td>
+									<td><input type="text" class="form-control input-10x" name="sort" value="{$data.sort}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td><select name="status" class="form-control input-10x">
+										<option value="1"
+										<eq name="data.status" value="1">selected</eq>
+										>显示</option>
+										<option value="0"
+										<eq name="data.status" value="0">selected</eq>
+										>隐藏</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交
+											</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function () {
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/daohang')}");
+		$('title').html('配置导航-'+'__WEBTITLE__');
+	</script>
+</block>

+ 855 - 0
Application/Admin/View/Config/index.html

@@ -0,0 +1,855 @@
+<include file="Public:header"/>
+<style>
+	.hoh td.item-label,.hoh td.item-note{
+		height:80px;line-height:80px;
+	}
+	.gezibg {
+		padding:5px;width:168px;background:url('/Public/Admin/ecshe_img/imgbg.png');
+	}
+</style>
+
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">网站基本配置</span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/edit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+
+								<tr class="controls">
+									<td class="item-label">网站名称 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="webname" value="{$data['webname']}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">网站标题 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="webtitle" value="{$data['webtitle']}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端Logo图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.weblogo">
+												<img id="up_img" onclick="getElementById('weblogo_box').click()" style="cursor:pointer;max-height:62px;" title="手机端Logo图片" alt="点击添加图片" src="/Upload/public/{$data.weblogo}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img" onclick="getElementById('weblogo_box').click()" style="cursor:pointer;max-height:62px;" title="手机端Logo图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="weblogo_deputy" name="weblogo" value="{$data.weblogo}">
+											<input type="file" id="weblogo_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 200*200px</td>
+								</tr>
+								
+								
+								<tr class="controls hoh">
+									<td class="item-label">PC端logo图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.waplogo">
+												<img id="up_img_waplogobox" onclick="getElementById('waplogo_box').click()" style="cursor:pointer;max-height:62px;" title="PC端logo图片" alt="点击添加图片" src="/Upload/public/{$data.waplogo}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_waplogobox" onclick="getElementById('waplogo_box').click()" style="cursor:pointer;max-height:62px;" title="PC端logo图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="waplogo_deputy" name="waplogo" value="{$data.waplogo}">
+											<input type="file" id="waplogo_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 200*200px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端轮播图1 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.websildea">
+												<img id="up_img_websildea" onclick="getElementById('websildea_box').click()" style="cursor:pointer;max-height:62px;" title="手机端轮播图1" alt="点击添加图片" src="/Upload/public/{$data.websildea}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_websildea" onclick="getElementById('websildea_box').click()" style="cursor:pointer;max-height:62px;" title="手机端轮播图1" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="websildea_deputy" name="websildea" value="{$data.websildea}">
+											<input type="file" id="websildea_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端轮播图2 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.websildeb">
+												<img id="up_img_websildeb" onclick="getElementById('websildeb_box').click()" style="cursor:pointer;max-height:62px;" title="手机端轮播图2" alt="点击添加图片" src="/Upload/public/{$data.websildeb}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_websildeb" onclick="getElementById('websildeb_box').click()" style="cursor:pointer;max-height:62px;" title="手机端轮播图2" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="websildeb_deputy" name="websildeb" value="{$data.websildeb}">
+											<input type="file" id="websildeb_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端轮播图3 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.websildec">
+												<img id="up_img_websildec" onclick="getElementById('websildec_box').click()" style="cursor:pointer;max-height:62px;" title="手机端轮播图3" alt="点击添加图片" src="/Upload/public/{$data.websildec}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_websildec" onclick="getElementById('websildec_box').click()" style="cursor:pointer;max-height:62px;" title="手机端轮播图3" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="websildec_deputy" name="websildec" value="{$data.websildec}">
+											<input type="file" id="websildec_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端新币认购图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.webissue">
+												<img id="up_img_webissue" onclick="getElementById('webissue_box').click()" style="cursor:pointer;max-height:62px;" title="手机端新币认购图片" alt="点击添加图片" src="/Upload/public/{$data.webissue}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_webissue" onclick="getElementById('webissue_box').click()" style="cursor:pointer;max-height:62px;" title="手机端新币认购图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="webissue_deputy" name="webissue" value="{$data.webissue}">
+											<input type="file" id="webissue_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端矿机首页图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.webkj">
+												<img id="up_img_webkj" onclick="getElementById('webkj_box').click()" style="cursor:pointer;max-height:62px;" title="手机端矿机首页图片" alt="点击添加图片" src="/Upload/public/{$data.webkj}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_webkj" onclick="getElementById('webkj_box').click()" style="cursor:pointer;max-height:62px;" title="手机端矿机首页图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="webkj_deputy" name="webkj" value="{$data.webkj}">
+											<input type="file" id="webkj_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">PC端轮播图1 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.wapsildea">
+												<img id="up_img_wapsildea" onclick="getElementById('wapsildea_box').click()" style="cursor:pointer;max-height:62px;" title="PC端轮播图1" alt="点击添加图片" src="/Upload/public/{$data.wapsildea}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_wapsildea" onclick="getElementById('wapsildea_box').click()" style="cursor:pointer;max-height:62px;" title="PC端轮播图1" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="wapsildea_deputy" name="wapsildea" value="{$data.wapsildea}">
+											<input type="file" id="wapsildea_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">PC端轮播图2 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.wapsildeb">
+												<img id="up_img_wapsildeb" onclick="getElementById('wapsildeb_box').click()" style="cursor:pointer;max-height:62px;" title="PC端轮播图2" alt="点击添加图片" src="/Upload/public/{$data.wapsildea}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_wapsildeb" onclick="getElementById('wapsildeb_box').click()" style="cursor:pointer;max-height:62px;" title="PC端轮播图2" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="wapsildeb_deputy" name="wapsildeb" value="{$data.wapsildeb}">
+											<input type="file" id="wapsildeb_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">PC端轮播图3 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.wapsildec">
+												<img id="up_img_wapsildec" onclick="getElementById('wapsildec_box').click()" style="cursor:pointer;max-height:62px;" title="PC端轮播图3" alt="点击添加图片" src="/Upload/public/{$data.wapsildec}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_wapsildec" onclick="getElementById('wapsildec_box').click()" style="cursor:pointer;max-height:62px;" title="PC端轮播图3" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="wapsildec_deputy" name="wapsildec" value="{$data.wapsildec}">
+											<input type="file" id="wapsildec_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">PC端新币认购图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.wapissue">
+												<img id="up_img_wapissue" onclick="getElementById('wapissue_box').click()" style="cursor:pointer;max-height:62px;" title="PC端新币认购图片" alt="点击添加图片" src="/Upload/public/{$data.wapissue}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_wapissue" onclick="getElementById('wapissue_box').click()" style="cursor:pointer;max-height:62px;" title="PC端新币认购图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="wapissue_deputy" name="wapissue" value="{$data.wapissue}">
+											<input type="file" id="wapissue_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">PC端矿机首页图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.wapkj">
+												<img id="up_img_wapkj" onclick="getElementById('wapkj_box').click()" style="cursor:pointer;max-height:62px;" title="PC端矿机首页图片" alt="点击添加图片" src="/Upload/public/{$data.wapkj}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_wapkj" onclick="getElementById('wapkj_box').click()" style="cursor:pointer;max-height:62px;" title="PC端矿机首页图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="wapkj_deputy" name="wapkj" value="{$data.wapkj}">
+											<input type="file" id="wapkj_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 700*350px</td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">手机端推荐页面logo图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.webtjimgs">
+												<img id="up_img_webtjimgs" onclick="getElementById('webtjimgs_box').click()" style="cursor:pointer;max-height:62px;" title="手机端推荐页面logo图片" alt="点击添加图片" src="/Upload/public/{$data.webtjimgs}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img_webtjimgs" onclick="getElementById('webtjimgs_box').click()" style="cursor:pointer;max-height:62px;" title="手机端推荐页面logo图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="webtjimgs_deputy" name="webtjimgs" value="{$data.webtjimgs}">
+											<input type="file" id="webtjimgs_box" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note" style="color:red;">* 200*200px</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">网站状态 :</td>
+									<td>
+										<select name="webswitch" class="form-control  input-10x">
+											<option value="1" <eq name="data['web_close']" value="1">selected</eq>>正常</option>
+											<option value="2" <eq name="data['web_close']" value="0">selected</eq>>禁止访问</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">app版本 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="version" value="{$data['version']}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls hoh">
+									<td class="item-label">app :</td>
+									<td>
+										<input type="file" id="appuplode">
+										<input type="hidden" name="app" id="app" value="{$data['app']}">
+									</td>
+									<td class="item-note" style="color:red;">* 200*200px</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" target-form="form-horizontal" id="submit" type="submit">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function () {
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script charset="utf-8" src="__PUBLIC__/kindeditorv4/kindeditor-all-min.js"></script>
+<script charset="utf-8" src="__PUBLIC__/kindeditorv4//lang/zh-CN.js"></script>
+<script type="text/javascript">
+    /** PC端推荐页面logo图片 **/
+	$(document).ready(function () {
+
+		/** 手机端推荐页面logo图片 **/
+		$(document).ready(function () {
+			//响应文件添加成功事件
+			$("#appuplode").change(function () {
+				//创建FormData对象
+				var data = new FormData();
+				//为FormData对象添加数据
+				$.each($('#appuplode')[0].files, function (i, file) {
+					data.append('upload_file' + i, file);
+				});
+				//发送数据
+				$.ajax({
+					url: '/Admin/Config/upload',
+					type: 'POST',
+					data: data,
+					cache: false,
+					contentType: false,		//不可缺参数
+					processData: false,		//不可缺参数
+					success: function (data) {
+						if (data) {
+							alert('上传成功');
+							$('#app').val('/Upload/public/' + $.trim(data));
+						}
+					},
+					error: function () {
+						alert('上传出错');
+						$(".loading").hide();	//加载失败移除加载图片
+					}
+				});
+
+			});
+		})
+
+		//响应文件添加成功事件
+		$("#waptjimgs_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#waptjimgs_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_waptjimgs').attr("src", '/Upload/public/' + $.trim(data));
+						$('#waptjimgs_deputy').val($.trim(data));
+						$('#up_img_waptjimgs').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** 手机端推荐页面logo图片 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#webtjimgs_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#webtjimgs_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_webtjimgs').attr("src", '/Upload/public/' + $.trim(data));
+						$('#webtjimgs_deputy').val($.trim(data));
+						$('#up_img_webtjimgs').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** PC端矿机首页图片 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#wapkj_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#wapkj_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_wapkj').attr("src", '/Upload/public/' + $.trim(data));
+						$('#wapkj_deputy').val($.trim(data));
+						$('#up_img_wapkj').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** PC端新币认购图片 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#wapissue_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#wapissue_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_wapissue').attr("src", '/Upload/public/' + $.trim(data));
+						$('#wapissue_deputy').val($.trim(data));
+						$('#up_img_wapissue').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** PC端轮播图3 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#wapsildec_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#wapsildec_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_wapsildec').attr("src", '/Upload/public/' + $.trim(data));
+						$('#wapsildec_deputy').val($.trim(data));
+						$('#up_img_wapsildec').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+     /** PC端轮播图2 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#wapsildeb_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#wapsildeb_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_wapsildeb').attr("src", '/Upload/public/' + $.trim(data));
+						$('#wapsildeb_deputy').val($.trim(data));
+						$('#up_img_wapsildeb').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+     /** PC端轮播图1 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#wapsildea_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#wapsildea_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_wapsildea').attr("src", '/Upload/public/' + $.trim(data));
+						$('#wapsildea_deputy').val($.trim(data));
+						$('#up_img_wapsildea').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** 手机端矿机首页图片 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#webkj_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#webkj_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_webkj').attr("src", '/Upload/public/' + $.trim(data));
+						$('#webkj_deputy').val($.trim(data));
+						$('#up_img_webkj').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** 手机端新币认购图片 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#webissue_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#webissue_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_webissue').attr("src", '/Upload/public/' + $.trim(data));
+						$('#webissue_deputy').val($.trim(data));
+						$('#up_img_webissue').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** 手机端轮播图3上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#websildec_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#websildec_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_websildec').attr("src", '/Upload/public/' + $.trim(data));
+						$('#websildec_deputy').val($.trim(data));
+						$('#up_img_websildec').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** 手机端轮播图2上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#websildeb_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#websildeb_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_websildeb').attr("src", '/Upload/public/' + $.trim(data));
+						$('#websildeb_deputy').val($.trim(data));
+						$('#up_img_websildeb').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	})
+    /** 手机端轮播图1上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#websildea_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#websildea_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_websildea').attr("src", '/Upload/public/' + $.trim(data));
+						$('#websildea_deputy').val($.trim(data));
+						$('#up_img_websildea').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	});
+
+    /** PC端网站logo上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#waplogo_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#waplogo_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img_waplogobox').attr("src", '/Upload/public/' + $.trim(data));
+						$('#waplogo_deputy').val($.trim(data));
+						$('#up_img_waplogobox').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	});
+	
+	/** 手机端网站logo上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#weblogo_box").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#weblogo_box')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+			//发送数据
+			$.ajax({
+				url: '/Admin/Config/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img').attr("src", '/Upload/public/' + $.trim(data));
+						$('#weblogo_deputy').val($.trim(data));
+						$('#up_img').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	});
+
+</script>
+
+<script type="text/javascript">
+    // KindEditor.ready(function(K) {
+    //     window.editor = K.create('#web_reg');
+    // });
+	var editor;
+	KindEditor.ready(function (K) {
+		editor = K.create('textarea[name="web_reg"]', {
+			width: '500px',
+			height: '100px',
+			allowImageUpload: true,
+			items: [
+				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
+				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
+				'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
+			afterBlur: function () {
+
+                editor.sync();
+			}
+		});
+		editors = K.create('textarea[name="en_web_reg"]', {
+			width: '500px',
+			height: '100px',
+			allowPreviewEmoticons: false,
+			allowImageUpload: true,
+			items: [
+				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
+				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
+				'insertunorderedlist', '|', 'emoticons', 'link', 'fullscreen'],
+			afterBlur: function () {
+				this.sync();
+			}
+		});
+	});
+</script>
+<include file="Public:footer"/>

+ 105 - 0
Application/Admin/View/Config/marketo.html

@@ -0,0 +1,105 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">交易市场(平台机器人产生的交易数据)</span>
+        </div>
+
+        <div class="cf">
+            <div class="fl">
+                <a class="btn btn-success" href="{:U('Config/marketoEdit')}">新 增</a>
+                <button class="btn ajax-post btn-info" url="{:U('Config/marketoStatus',array('type'=>'resume'))}" target-form="ids">启 用
+                </button>
+                <button class="btn ajax-post btn-warning" url="{:U('Config/marketoStatus',array('type'=>'forbid'))}" target-form="ids">禁 用
+                </button>
+                <button class="btn ajax-post confirm btn-danger" url="{:U('Config/marketoStatus',array('type'=>'del'))}" target-form="ids">删 除
+                </button>
+            </div>
+            <div class="search-form fr cf">
+                <div class="sleft">
+                    <form name="formSearch" id="formSearch" method="get" name="form1" >
+                        <select style=" width: 160px; float: left; margin-right: 10px;" name="field" class="form-control">
+                            <option value="name" <eq name="Think.get.field" value="name">selected</eq>>市场名</option>
+                        </select>
+                        <input type="text" name="name" class="search-input form-control" value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+                        <a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+                    </form>
+                    <script>
+                        //搜索功能
+                        $(function () {
+                            $('#search').click(function () {
+                                $('#formSearch').submit();
+                            });
+                        });
+                        //回车搜索
+                        $(".search-input").keyup(function (e) {
+                            if (e.keyCode === 13) {
+                                $("#search").click();
+                                return false;
+                            }
+                        });
+                    </script>
+                </div>
+            </div>
+        </div>
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+						<th class="">ID</th>
+						<th class="">市场名称</th>
+						<th class="">小数位数</th>
+						<th class="">机器人交易</th>
+						<th class="">开启交易</th>
+						<th class="">状态</th>
+						<th class="" style="text-align: center;">操作</th>
+					</tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.name}</td>
+                            <td>{$vo.round}</td>
+                            <td>
+                                <eq name="vo.shuadan" value="1"><b style="color: #028E16;">已开启</b><else/><b style="color: #F70408">未启动</b></eq>
+                            </td>
+                            <td>
+                                <eq name="vo.trade" value="1"><b style="color: #028E16;">开启交易</b><else/><b style="color: #F70408">禁止交易</b></eq>
+                            </td>
+                            <td>
+                                <eq name="vo.status" value="1"><b style="color: #028E16;">可用</b><else/><b style="color: #F70408">禁用</b></eq>
+                            </td>
+
+                            <td style="text-align: center;">
+								<a href="{:U('Config/marketoEdit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+								<a href="{:U('Config/marketoEdit2?id='.$vo['id'])}" class="btn btn-primary btn-xs">行情</a>
+								<a href="{:U('Config/marketoEdit3?id='.$vo['id'])}" class="btn btn-primary btn-xs">机器人</a>
+                            </td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Config/marketo')}");
+    </script>
+</block>

+ 242 - 0
Application/Admin/View/Config/marketoEdit.html

@@ -0,0 +1,242 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Config/marketo')}">市场列表</a> &gt;&gt;</span>
+            <span class="h1-title"><empty name="data">新增市场<else/>编辑市场</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/marketoEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+	
+								<tr class="controls">
+									<td class="item-label">当前交易对 :</td>
+									<td>{$data.name}</td>
+									<td class="item-note"></td>
+								</tr>
+								
+
+								<tr class="controls">
+									<td class="item-label">交易价 - 小数位数:</td>
+									<td>
+                                        <empty name="data['round_mum']">
+											<input type="text" class="form-control input-10x" name="round_mum" value="2">
+										<else />
+											<input type="text" class="form-control input-10x" name="round_mum" value="{$data.round_mum}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">填1--6整数,比如填3就表示3位小数</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">交易数量 - 小数位数:</td>
+									<td>
+                                        <empty name="data['round']">
+											<input type="text" class="form-control input-10x" name="round" value="4">
+										<else />
+											<input type="text" class="form-control input-10x" name="round" value="{$data.round}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">填1--6整数,比如填3就表示3位小数</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">买入最小交易价:</td>
+									<td>
+                                        <empty name="data['buy_min']">
+											<input type="text" class="form-control input-10x" name="buy_min" value="0.0001">
+										<else />
+											<input type="text" class="form-control input-10x" name="buy_min" value="{$data.buy_min}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">买入最小交易价 默认0.000001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">买入<b style="color:#019CFF;">最大</b>交易价:</td>
+									<td>
+                                        <empty name="data['buy_max']">
+											<input type="text" class="form-control input-10x" name="buy_max" value="10000000">
+										<else />
+											<input type="text" class="form-control input-10x" name="buy_max" value="{$data.buy_max}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">买入最大交易价 默认10000000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">卖出最小交易价:</td>
+									<td>
+                                        <empty name="data['sell_min']">
+											<input type="text" class="form-control input-10x" name="sell_min" value="0.0001">
+										<else />
+											<input type="text" class="form-control input-10x" name="sell_min" value="{$data.sell_min}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">卖出最小交易价 默认0.000001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">卖出<b style="color:#019CFF;">最大</b>交易价:</td>
+									<td>
+                                        <empty name="data['sell_max']">
+											<input type="text" class="form-control input-10x" name="sell_max" value="10000000">
+										<else />
+											<input type="text" class="form-control input-10x" name="sell_max" value="{$data.sell_max}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">卖出最大交易价 默认10000000</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">单笔最小交易额:</td>
+									<td>
+                                        <empty name="data['trade_min']">
+											<input type="text" class="form-control input-10x" name="trade_min" value="0.0001">
+										<else />
+											<input type="text" class="form-control input-10x" name="trade_min" value="{$data.trade_min}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">单笔最小交易额 默认10000000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔<b style="color:#019CFF;">最大</b>交易额:</td>
+									<td>
+                                        <empty name="data['trade_max']">
+											<input type="text" class="form-control input-10x" name="trade_max" value="10000000">
+										<else />
+											<input type="text" class="form-control input-10x" name="trade_max" value="{$data.trade_max}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">单笔最大交易额 默认10000000</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">单笔买入最小交易数量:</td>
+									<td>
+                                        <empty name="data['trade_buy_num_min']">
+											<input type="text" class="form-control input-10x" name="trade_buy_num_min" value="0.0001">
+										<else />
+											<input type="text" class="form-control input-10x" name="trade_buy_num_min" value="{$data.trade_buy_num_min}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">单笔买入最小交易量 默认0.0001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔买入<b style="color:#019CFF;">最大</b>交易数量:</td>
+									<td>
+                                        <empty name="data['trade_buy_num_max']">
+											<input type="text" class="form-control input-10x" name="trade_buy_num_max" value="10000000">
+										<else />
+											<input type="text" class="form-control input-10x" name="trade_buy_num_max" value="{$data.trade_buy_num_max}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">单笔买入最大交易量 默认1000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔卖出最小交易数量:</td>
+									<td>
+                                        <empty name="data['trade_sell_num_min']">
+                                                <input type="text" class="form-control input-10x" name="trade_sell_num_min" value="0.0001">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_sell_num_min" value="{$data.trade_sell_num_min}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">单笔卖出最小交易量 默认0.0001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔卖出<b style="color:#019CFF;">最大</b>交易数量:</td>
+									<td>
+                                       <empty name="data['trade_sell_num_max']">
+											<input type="text" class="form-control input-10x" name="trade_sell_num_max" value="10000000">
+										<else />
+											<input type="text" class="form-control input-10x" name="trade_sell_num_max" value="{$data.trade_sell_num_max}">
+                                        </empty>
+									</td>
+									<td class="item-note" style="color:red;">单笔卖出最大交易量 默认1000</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">涨幅限制:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="zhang" value="{$data.zhang}">
+									</td>
+									<td class="item-note" style="color:red;">% 根据昨日最后一笔交易计算</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">跌幅限制:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="die" value="{$data.die}">
+									</td>
+									<td class="item-note" style="color:red;">% 根据昨日最后一笔交易计算</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">开启交易 :</td>
+									<td><select name="trade" class="form-control input-10x">
+										<option value="1"
+										<eq name="data.trade" value="1">selected</eq>
+										>开启交易</option>
+										<option value="0"
+										<eq name="data.trade" value="0">selected</eq>
+										>禁止交易</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">排序:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sort" value="{$data.sort}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td><select name="status" class="form-control input-10x">
+										<option value="1"
+										<eq name="data.status" value="1">selected</eq>
+										>可用</option>
+										<option value="0"
+										<eq name="data.status" value="0">selected</eq>
+										>禁用</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交
+											</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+				//提交表单
+				$('#submit').click(function () {
+					$('#form').submit();
+				});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/marketo')}");
+	</script>
+</block>

+ 113 - 0
Application/Admin/View/Config/marketoEdit2.html

@@ -0,0 +1,113 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Config/marketo')}">市场列表</a> >></span>
+            <span class="h1-title">编辑市场行情</span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/marketoEdit2')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">市场名称 :</td>
+									<td>{$data.name}</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls" style="border-bottom:1px solid #d0d0d0;">
+									<td class="item-label">发行价格:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="faxingjia" value="{$data.faxingjia}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">最新成交价:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="new_price" value="{$data.new_price}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">买一价:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="buy_price" value="{$data.buy_price}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">卖一价:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="sell_price" value="{$data.sell_price}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">最低价:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="min_price" value="{$data.min_price}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">最高价:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="max_price" value="{$data.max_price}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">交易量:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="volume" value="{$data.volume}">
+									</td>
+								</tr>
+								
+								<tr class="controls" style="border-top:1px solid #d0d0d0;">
+									<td class="item-label">涨跌幅:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="change" value="{$data.change}">
+									</td>
+								</tr>
+								
+								<tr class="controls"style="border-bottom:1px solid #d0d0d0;">
+									<td class="item-label">昨日收盘价:</td>
+									<td>
+                                        <input type="text" class="form-control input-10x" name="hou_price" value="{$data.hou_price}">
+									</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交
+											</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+				//提交表单
+				$('#submit').click(function () {
+					$('#form').submit();
+				});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/marketo')}");
+	</script>
+</block>

+ 97 - 0
Application/Admin/View/Config/marketoEdit3.html

@@ -0,0 +1,97 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Config/marketo')}">市场列表</a> >></span>
+            <span class="h1-title">编辑机器人交易规则</span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/marketoEdit2')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">市场名称 :</td>
+									<td>{$data.name}</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls" style="border-top:1px solid #d0d0d0;">
+									<td class="item-label">开启机器人刷单 :</td>
+									<td>
+										<select name="shuadan" class="form-control input-10x">
+											<option value="0"
+											<eq name="data.shuadan" value="0">selected</eq>
+											>关闭</option>
+											<option value="1"
+											<eq name="data.shuadan" value="1">selected</eq>
+											>开启</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">浮动最高价格:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdhigh" value="{$data.sdhigh}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">浮动最低价格:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdlow" value="{$data.sdlow}">
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">浮动最高数量:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdhigh_num" value="{$data.sdhigh_num}" oninput="if(value<{$round})value={$round}">
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">浮动最低数量:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdlow_num" value="{$data.sdlow_num}" oninput="if(value<{$round})value={$round}">
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交
+											</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+				//提交表单
+				$('#submit').click(function () {
+					$('#form').submit();
+				});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Config/marketo')}");
+	</script>
+</block>

+ 138 - 0
Application/Admin/View/Config/qita.html

@@ -0,0 +1,138 @@
+<include file="Public:header" />
+
+<div id="main-content">
+
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">系统参数设置</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Config/qitaEdit')}" method="post" class="form-horizontal" >
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">短信发送邮箱 :</td>
+									<td><input type="text" class="form-control input-10x" name="smsemail" value="{$data['smsemail']}"></td>
+									<td class="item-note" style="color:red;">*发送邮箱验证码的邮箱账号</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">邮箱授权码 :</td>
+									<td><input type="text" class="form-control input-10x" name="emailcode" value="{$data['emailcode']}"></td>
+									<td class="item-note" style="color:red;">*发送邮箱验证码的邮箱授权码</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">短信验证码模板 :</td>
+									<td><input type="text" class="form-control input-10x" name="smstemple" value="{$data['smstemple']}"></td>
+									<td class="item-note" style="color:red;">*短信验证码模板</td>
+								</tr>
+
+ 								<tr class="controls">
+									<td class="item-label">推荐页面推广语 :</td>
+									<td><input type="text" class="form-control input-10x" name="tgtext" value="{$data['tgtext']}"></td>
+									<td class="item-note" style="color:red;">*推荐页面的推广语,不要多于40个字</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">官方客服邮箱 :</td>
+									<td><input type="text" class="form-control input-10x" name="gfemail" value="{$data['gfemail']}"></td>
+									<td class="item-note" style="color:red;">*官方客服邮箱</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">PC端下方文字 :</td>
+									<td><input type="text" class="form-control input-10x" name="footertext" value="{$data['footertext']}"></td>
+									<td class="item-note" style="color:red;">*显示在PC端LOGO下的文字</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">注册赠送体验金 :</td>
+									<td><input type="text" class="form-control input-10x" name="tymoney" value="{$data['tymoney']}"></td>
+									<td class="item-note" style="color:red;">*注册赠送的合约体验金</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">缴纳税金金额 :</td>
+									<td><input type="text" class="form-control input-10x" name="taxnum" value="{$data['taxnum']}"></td>
+									<td class="item-note" style="color:red;">*注册赠送的合约体验金</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">网站注册开关 :</td>
+									<td>
+										<select name="regswitch" class="form-control  input-10x">
+											<option value="1" <eq name="data['regswitch']" value="1">selected</eq>>开放</option>
+											<option value="2" <eq name="data['regswitch']" value="2">selected</eq>>关闭</option>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">*关闭时禁止注册</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">提币总开关 :</td>
+									<td>
+										<select name="tbswitch" class="form-control  input-10x">
+											<option value="1" <eq name="data['tbswitch']" value="1">selected</eq>>开放</option>
+											<option value="2" <eq name="data['tbswitch']" value="2">selected</eq>>禁止</option>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">*关闭时禁止所有币种提币</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">注册是否赠送体验矿机 :</td>
+									<td>
+										<select name="regjl" class="form-control  input-10x">
+											<option value="1" <eq name="data['regjl']" value="1">selected</eq>>赠送</option>
+											<option value="2" <eq name="data['regjl']" value="2">selected</eq>>不送</option>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">*关闭时禁止所有币种提币</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class= "btn submit-btn ajax-post"  target-form="form-horizontal" id="submit" type="submit">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
+
+<script type="text/javascript">
+	$(function(){
+		//主导航高亮
+		$('.config-box').addClass('current');
+		//边导航高亮
+		$('.config-contact').addClass('current');
+	});
+</script>
+
+<include file="Public:footer" />

+ 94 - 0
Application/Admin/View/Finance/index.html

@@ -0,0 +1,94 @@
+<include file="Public:header"/>
+<script src="__PUBLIC__/Admin/js/layer/laydate/laydate.js"></script>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">财务明细</span>
+        </div>
+        <div class="cf">
+            <div class="search-form fl cf">
+                <div class="sleft">
+                    <form name="formSearch" id="formSearch" method="get" name="form1" >
+                        <select style=" width: 160px; float: left; margin-right: 10px;" name="field" class="form-control">
+                            <option value="username" <eq name="Think.get.field" value="username">selected</eq>>用户名</option>
+                        </select>
+                        <input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+                        <a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+                    </form>
+                    <script>
+                        //搜索功能
+                        $(function(){
+                            $('#search').click(function(){
+                                $('#formSearch').submit();
+                            });
+                        });
+                        //回车搜索
+                        $(".search-input").keyup(function(e){
+                            if(e.keyCode===13){
+                                $("#search").click();
+                                return false;
+                            }
+                        });
+                    </script>
+                </div>
+            </div>
+        </div>
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+                <tr>
+                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+                    <th class="">ID</th>
+                    <th class="">用户名</th>
+                    <th class="">操作币种</th>
+                    <th class="">操作数量</th>
+                    <th class="">操作类型</th>
+                    <th class="">操作之后</th>
+                    <th class="">操作说明</th>
+                    <th class="">操作时间</th>
+                    <th class="">状态</th>
+                </tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.username}</td>
+                            <td><?php echo strtoupper($vo['coinname']);?></td>
+                            <td>{$vo.num}</td>
+                            <td><?php if($vo['type'] == '55'){
+                                echo '后台手动操作';
+                            }else{
+                                echo gettype_info($vo['type']);
+                            } ?></td>
+                            <td>{$vo.afternum}</td>
+                            <td>{$vo['remark']}</td>
+                            <td>{$vo['addtime']}</td>
+                            <td>正常</td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<include file="Public:footer"/>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Finance/index')}");
+    </script>
+</block>

+ 185 - 0
Application/Admin/View/Finance/myzc.html

@@ -0,0 +1,185 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">数字币提币记录</span>
+            <div class="fr">
+                <button class="btn btn-warning" onClick="location.href='{:U('Finance/myzc')}'">初始化搜索</button>
+            </div>
+        </div>
+
+        <div class="cf">
+            
+            <div class="search-form fr cf" style="float: none !important;">
+                <div class="sleft">
+                    <form name="formSearch" id="formSearch" method="get" name="form1">
+                        <select style=" width: 100px; float: left; margin-right: 10px;" name="field" class="form-control">
+                            <option value="username"
+                            <eq name="Think.get.field" value="username">selected</eq>
+                            >用户名</option>
+                        </select>
+                        <input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+                        <a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+                    </form>
+                    <script>
+                        //搜索功能
+                        $(function () {
+                            $('#search').click(function () {
+                                $('#formSearch').submit();
+                            });
+                        });
+                        //回车搜索
+                        $(".search-input").keyup(function (e) {
+                            if (e.keyCode === 13) {
+                                $("#search").click();
+                                return false;
+                            }
+                        });
+                    </script>
+                </div>
+            </div>
+        </div>
+
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+                <tr>
+                    <th class="">ID</th>
+                    <th class="">用户名</th>
+                    <th class="">币种名称</th>
+                    <th width="">申请时间</th>
+                    <th width="">审核时间</th>
+                    <th width="">提币地址</th>
+                    <th width="">提币数量</th>
+                    <th class="">提现手续费</th>
+                    <th class="">实际到账</th>
+                    <th width="">状态</th>
+                    <th width="">操作</th>
+                </tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.username} </td>
+                            <td><?php echo strtoupper($vo['coinname']);?></td>
+                            <td>{$vo.addtime}</td>
+                            <td>{$vo.endtime}</td>
+                            <td>{$vo.address}</td>
+                            <td>{$vo.num}</td>
+                            <td>{$vo.fee}</td>
+                            <td>{$vo.mum}</td>
+                            <td>
+                                <eq name="vo.status" value="1"><span style="color:blue;">待审核</span></eq>
+                                <eq name="vo.status" value="2"><span style="color:green;">完成</span></eq>
+                                <eq name="vo.status" value="3"><span style="color:red;">未通过</span></eq>
+                            </td>
+                            <td>
+                                <eq name="vo.status" value="1">
+                                    <input type="button" class="ajax-get btn btn-primary btn-xs" value="确认提币" onclick="Upzc('{$vo['id']}');"/>
+                                    <input type="button" class="ajax-get btn btn-primary btn-xs" value="驳回提币" onclick="Upbh('{$vo['id']}');"/>
+                                </eq>
+                                <eq name="vo.status" value="2"><span style="color:blue;">已处理</span></eq>
+                                <eq name="vo.status" value="3"><span style="color:blue;">已处理</span></eq>
+                            </td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+<include file="Public:footer"/>
+<script type="text/javascript">
+    function Upbh(id) {
+        var zcid = parseInt(id);
+        if (zcid == "" || zcid == null || zcid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('Finance/reject')}", {
+            id: zcid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function Upzc(id) {
+        var zcid = parseInt(id);
+        if (zcid == "" || zcid == null || zcid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('Finance/adopttb')}", {
+            id: zcid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function closetanchu(){
+        layer.closeAll('loading');
+    }
+    function shuaxin(){
+        window.location.href=window.location.href;
+    }
+</script>
+
+<script type="text/javascript">
+    function showid(id){
+        layer.open({
+            type:1,
+            skin:'layui-layer-rim', //加上边框
+            area:['800px','100px'], //宽高
+            title:'交易ID', //不显示标题
+            closeBtn: 0,
+            shadeClose: true,
+            content:id
+        });
+    }
+    //提交表单
+    $('#submit').click(function () {
+        $('#form').submit();
+    });
+</script>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Finance/myzc')}");
+    </script>
+</block>

+ 182 - 0
Application/Admin/View/Finance/myzr.html

@@ -0,0 +1,182 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">充币列表</span>
+			<div class="fr">
+			    <button class="btn btn-warning" onClick="location.href='{:U('Finance/myzr')}'">初始化搜索</button>
+		    </div>
+		</div>
+		
+		<div class="cf">
+
+			<div class="search-form fl cf" style="float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style=" width: 100px; float: left; margin-right: 10px;" name="field" class="form-control">
+							<option value="username" <eq name="Think.get.field" value="username">selected</eq>>用户名</option>
+						</select>
+						<input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="">ID</th>
+					<th class="">用户名</th>
+					<th class="">充值币种</th>
+					<th width="">充值时间</th>
+					<th width="">处理时间</th>
+					<th width="">充值数量</th>
+					<th width="">实际到账</th>
+					<th width="">转账凭证</th>
+					<th width="">状态</th>
+					<th width="">操作</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td><?php echo strtoupper($vo['coin']);?></td>
+							<td>{$vo.addtime}</td>
+							<td>{$vo.updatetime}</td>
+							<td>{$vo['num']*1}</td>
+							<td>{$vo['num']*1}</td>
+							<td>
+							   <a target="_blank" href="/Public/Static/payimgs/{$vo.payimg}">
+							        <img src="/Public/Static/payimgs/{$vo.payimg}" style="height:60px;"/></a>
+							    
+							</td>
+							
+							<td>
+								<eq name="vo.status" value="1">
+								    <span style="color:blue;">等待审核</span>
+								</eq>
+								<eq name="vo.status" value="2">
+								    <span style="color:green;">审核通过</span>
+								</eq>
+								<eq name="vo.status" value="3">
+								    <span style="color:red;">驳回充值</span>
+								</eq>
+							</td>
+							<td>
+                                <eq name="vo.status" value="1">
+                                    <input type="button" class="ajax-get btn btn-primary btn-xs" value="确认" onclick="Upzr('{$vo['id']}');"/>
+                                    <input type="button" class="ajax-get btn btn-primary btn-xs" value="驳回" onclick="Upbhzr('{$vo['id']}');"/>
+                                </eq>
+                                <eq name="vo.status" value="2"><span style="color:blue;">已处理</span></eq>
+                                <eq name="vo.status" value="3"><span style="color:blue;">已处理</span></eq>
+                            </td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<script type="text/javascript">
+$(function(){
+  $('.active').onclick(function(){
+    $('#bg').show();$('#div').show();
+  });
+  $('#div').onclick(function(){
+    $('#bg').hide();$('#div').hide();
+  });
+});
+    function Upbhzr(id) {
+        var zcid = parseInt(id);
+        if (zcid == "" || zcid == null || zcid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('Finance/rejectzr')}", {
+            id: zcid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function Upzr(id) {
+        var zcid = parseInt(id);
+        if (zcid == "" || zcid == null || zcid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('Finance/adoptzr')}", {
+            id: zcid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function closetanchu(){
+        layer.closeAll('loading');
+    }
+    function shuaxin(){
+        window.location.href=window.location.href;
+    }
+</script>
+</script>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Finance/myzr')}");
+	</script>
+</block>

+ 168 - 0
Application/Admin/View/Finance/taxlist.html

@@ -0,0 +1,168 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">税金记录</span>
+			<div class="fr">
+			    <button class="btn btn-warning" onClick="location.href='{:U('Finance/taxlist')}'">初始化搜索</button>
+		    </div>
+		</div>
+		
+		<div class="cf">
+
+			<div class="search-form fl cf" style="float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style=" width: 100px; float: left; margin-right: 10px;" name="field" class="form-control">
+							<option value="username" <eq name="Think.get.field" value="username">selected</eq>>用户名</option>
+						</select>
+						<input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="">ID</th>
+					<th class="">用户名</th>
+					<th width="">充值时间</th>
+					<th width="">处理时间</th>
+					<th width="">税金金额</th>
+					<th width="">转账凭证</th>
+					<th width="">状态</th>
+					<th width="">操作</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td>{$vo.addtime}</td>
+							<td>{$vo.updatetime}</td>
+							<td>{$vo['taxnum']*1} USDT</td>
+							<td>
+							    <img src="/Public/Static/payimgs/{$vo.payimgs}" style="height:60px;"/>
+							</td>
+							
+							<td>
+								<eq name="vo.status" value="1">
+								    <span style="color:blue;">等待审核</span>
+								</eq>
+								<eq name="vo.status" value="2">
+								    <span style="color:green;">审核通过</span>
+								</eq>
+								<eq name="vo.status" value="3">
+								    <span style="color:red;">驳回充值</span>
+								</eq>
+							</td>
+							<td>
+                                <eq name="vo.status" value="1">
+                                    <input type="button" class="ajax-get btn btn-primary btn-xs" value="确认" onclick="Upzr('{$vo['id']}');"/>
+                                    <input type="button" class="ajax-get btn btn-primary btn-xs" value="驳回" onclick="Upbhzr('{$vo['id']}');"/>
+                                </eq>
+                                <eq name="vo.status" value="2"><span style="color:blue;">已处理</span></eq>
+                                <eq name="vo.status" value="3"><span style="color:blue;">已处理</span></eq>
+                            </td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<script type="text/javascript">
+    function Upbhzr(id) {
+        var zcid = parseInt(id);
+        if (zcid == "" || zcid == null || zcid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('Finance/rejecttax')}", {
+            id: zcid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function Upzr(id) {
+        var zcid = parseInt(id);
+        if (zcid == "" || zcid == null || zcid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('Finance/adopttax')}", {
+            id: zcid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function closetanchu(){
+        layer.closeAll('loading');
+    }
+    function shuaxin(){
+        window.location.href=window.location.href;
+    }
+</script>
+</script>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Finance/taxlist')}");
+	</script>
+</block>

+ 242 - 0
Application/Admin/View/Index/index.html

@@ -0,0 +1,242 @@
+<include file="Public:header"/>
+<link href="__PUBLIC__/Admin/index_css/style.css" rel="stylesheet">
+<link href="__PUBLIC__/Admin/index_js/morris.js-0.4.3/morris.css" rel="stylesheet">
+<script src="__PUBLIC__/Admin/index_js/morris.js-0.4.3/morris.min.js" type="text/javascript"></script>
+<script src="__PUBLIC__/Admin/index_js/morris.js-0.4.3/raphael-min.js" type="text/javascript"></script>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <section class="wrapper">
+        <!--state overview start-->
+        <div class="row state-overview">
+           <style>
+			   .panel-heading{text-align: center;font-size: 18px;}
+			   .symbol{width:30%!important;}
+			   .state-overview .value {width:70%!important;}
+			</style>
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-user" style="color: #4acea1;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class="count" style="font-size: 24px;">{$alluser} </h1>
+
+                        <p>注册总人数(人)</p>
+                    </div>
+                </section>
+            </div>
+            
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-th" style="color: #fa4b4c;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class=" count2" style="font-size: 24px;">{$allhy} </h1>
+
+                        <p>快速合约未平仓(条)</p>
+                    </div>
+                </section>
+            </div>
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-transfer" style="color: #ffdc3a;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class=" count3" style="font-size: 24px;">{$bball}</h1>
+
+                        <p>币币交易额度(USDT)</p>
+                    </div>
+                </section>
+            </div>
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-tasks" style="color: #4b9afa;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class=" count4" style="font-size: 24px;">{$allkj} </h1>
+
+                        <p>全网有效矿机总数(台)</p>
+                    </div>
+                </section>
+            </div>
+        </div>
+        
+        <div class="row state-overview">
+           <style>
+			   .panel-heading{text-align: center;font-size: 18px;}
+			</style>
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-gift" style="color: #4acea1;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class="count" style="font-size: 24px;">{$allissue}</h1>
+
+                        <p>认购记录数(条)</p>
+                    </div>
+                </section>
+            </div>
+            
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-save" style="color: #fa4b4c;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class=" count2" style="font-size: 24px;">{$allcz}</h1>
+
+                        <p>充值总量(USDT)</p>
+                    </div>
+                </section>
+            </div>
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-open" style="color: #ffdc3a;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class=" count3" style="font-size: 24px;">{$alltx}</h1>
+
+                        <p>提币总量(USDT)</p>
+                    </div>
+                </section>
+            </div>
+            <div class="col-lg-3 col-sm-6">
+                <section class="panel">
+                    <div class="symbol">
+                        <i class="glyphicon glyphicon-check" style="color: #4b9afa;"></i>
+                    </div>
+                    <div class="value">
+                        <h1 class=" count4" style="font-size: 24px;">{$allline}</h1>
+
+                        <p>今日访客量(人)</p>
+                    </div>
+                </section>
+            </div>
+        </div>
+        
+
+        <div id="morris">
+            <div class="row">
+                <div class="col-lg-6">
+                    <section class="panel">
+                        <header class="panel-heading">
+                            用户注册报表(30天)
+                        </header>
+                        <div class="panel-body">
+                            <div id="hero-bar" class="graph"></div>
+                        </div>
+                    </section>
+                </div>
+                <div class="col-lg-6">
+                    <section class="panel">
+                        <header class="panel-heading">
+                            充值/提现 统计图(30天)
+                        </header>
+                        <div class="panel-body">
+                            <div id="hero-graph" class="graph"></div>
+                        </div>
+                    </section>
+                </div>
+            </div>
+        </div>
+    </section>
+</div>
+<script>
+    var Script = function () {
+        $(function () {
+            show_cztx({$cztx});
+            show_reg({$reg});
+
+            //系统 充值/提现 统计图
+            function show_cztx(data) {
+                Morris.Line({
+                    element: 'hero-graph',
+                    data: data,
+                    xkey: 'date',
+                    ykeys: [
+                        'charge',
+                        'withdraw'
+                    ],
+                    labels: [
+                        '充值',
+                        '提现'
+                    ],
+                    lineColors: [
+                        '#8075c4',
+                        '#6883a3'
+                    ],
+                    xLabels: 'day',
+                    postUnits: ' '
+                });
+            }
+
+            //用户注册报表
+            function show_reg(data) {
+                Morris.Bar({
+                    element: 'hero-bar',
+                    data: data,
+                    xkey: 'date',
+                    ykeys: ['sum'],
+                    labels: ['人数'],
+                    barRatio: 0.4,
+                    xLabelAngle: 35,
+                    hideHover: 'auto',
+                    barColors: ['#6883a3'],
+                    xLabels: 'day',
+                    postUnits: ' 人',
+                });
+            }
+
+            //市场交易报表
+            function show_trance(data) {
+                Morris.Area({
+                    element: 'hero-area',
+                    data: [
+
+                    ],
+
+                    xkey: 'date',
+                    ykeys: [
+
+                    ],
+                    labels: [
+
+                    ],
+                    hideHover: 'auto',
+                    lineWidth: 1,
+                    pointSize: 10,
+                    lineColors: [
+                        '#4a8bc2',
+                        '#ff6c60',
+                        '#a9d86e'
+                    ],
+                    fillOpacity: 0.5,
+                    smooth: true,
+                    postUnits: ' 元',
+                    xLabels: 'day',
+                });
+            }
+
+        });
+
+    }();
+</script>
+<include file="Public:footer"/>
+ <div style="display:none">
+  
+
+  </div>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Index/index')}");
+    </script>
+</block>

+ 288 - 0
Application/Admin/View/Issue/edit.html

@@ -0,0 +1,288 @@
+<include file="Public:header"/>
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Issue/index')}">认购配置</a> &gt;&gt;</span>
+			<span class="h1-title"><empty name="data">添加认购<else/>编辑认购</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Issue/save')}" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">认购标题 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="name" value="{$data.name}">
+									</td>
+									<td class="item-note" style="color:red;">* 前台显示的标题</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">认购币种 :</td>
+									<td>
+										<select name="coinname" class="form-control input-10x">
+											<volist name="clist" id="v">
+												<option value="{$v['name']}" <eq name="data['coinname']" value="$v['name']">selected</eq>>{$v['title']}</option>
+											</volist>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">* 认购的币种名称</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">发行总量 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="num" value="{$data['num']*1}">
+									</td>
+									<td class="item-note" style="color:red;">* 项目的发行总量</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">预设认购总量 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="ysnum" value="{$data['ysnum']*1}">
+									</td>
+									<td class="item-note" style="color:red;">*预设认购总量</td>
+								</tr>
+								
+								<tr class="controls" style="border-top:1px dashed #d0d0d0;">
+									<td class="item-label">支付币种 :</td>
+									<td>
+										<select name="buycoin" class="form-control input-10x">
+											<volist name="paylist" id="v">
+												<option value="{$v['name']}" <eq name="data['buycoin']" value="$v['name']">selected</eq>>{$v['title']}</option>
+											</volist>
+										</select>
+									</td>
+									<td class="item-note"  style="color:red;">* 用户购买使用的</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">认购价格 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="price" value="{$data['price']*1}">
+									</td>
+									<td class="item-note" style="color:red;">* 认购币的单价</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">认购限量 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="allmax" value="{$data.allmax}">
+									</td>
+									<td class="item-note"  style="color:red;">* 每个用户认购上限</td>
+								</tr>
+								
+								<tr class="controls" style="border-top:1px dashed #d0d0d0;">
+									<td class="item-label">单次最小数量 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="min" value="{$data['min']}">
+									</td>
+									<td class="item-note" style="color:red;">* 每次购买最小数量</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">单次最大数量 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="max" value="{$data['max']}">
+									</td>
+									<td class="item-note" style="color:red;">* 每次购买最大数量</td>
+								</tr>
+								
+								
+								<tr class="controls" style="border-top:1px dashed #d0d0d0;">
+									<td class="item-label">开启时间 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="starttime" value="{$data['starttime']}" onclick="laydate({istime:true, format:'YYYY-MM-DD hh:mm:ss'})">
+									</td>
+									<td class="item-note" style="color:red;">* 开放认购的时间 </td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">认购周期 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="tian" value="{$data['tian']}">
+									</td>
+									<td class="item-note"  style="color:red;"> * 认购开放至结束的时间</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">冻结时间 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="lockday" value="{$data['lockday']}">
+									</td>
+									<td class="item-note"  style="color:red;"> * 认购后认购币冻结时间,到期后自动释放到可用账户</td>
+								</tr>
+
+								<tr class="controls" style="border-top:1px dashed #d0d0d0;">
+									<td class="item-label">推荐赠送币种 :</td>
+									<td>
+										<select name="jlcoin" class="form-control input-10x">
+											<volist name="alllist" id="v">
+												<option value="{$v['name']}" <eq name="data['jlcoin']" value="$v['name']">selected</eq>>{$v['title']}</option>
+											</volist>
+										</select>
+									</td>
+									<td class="item-note"  style="color:red;">*推荐人赠送的币种名称</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">一代赠送比例 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="one_jl" value="{$data['one_jl']}">
+									</td>
+									<td class="item-note"  style="color:red;">%</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">二代赠送比例 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="two_jl" value="{$data['two_jl']}">
+									</td>
+									<td class="item-note"  style="color:red;">%</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">三代赠送比例 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="three_jl" value="{$data['three_jl']}">
+									</td>
+									<td class="item-note"  style="color:red;">%</td>
+								</tr>
+								
+								<tr class="controls" style="border-top:1px dashed #d0d0d0;">
+									<td class="item-label">项目缩略图 :</td>
+									<td>
+										<div id="addpicContainer">
+											<notempty name="data.imgs">
+												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-width:200px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.imgs}">
+												<else/>
+												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-width:200px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="imgs" name="imgs" value="{$data.imgs}">
+											<input type="file" id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+									<td class="item-note"  style="color:red;">* 图片尺寸 200px*200px</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">认购说明 :</td>
+									<td><textarea name="content" class="form-control input-10x">{$data.content}</textarea></td>
+									<td class="item-note"  style="color:red;"></td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">项目状态 :</td>
+									<td>
+										<select name="status" class="form-control input-10x">
+											<option value="1" <eq name="data.status" value="1">selected</eq>>显示</option>
+											<option value="2" <eq name="data.status" value="2">selected</eq>>隐藏</option>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">* 项目显示状态</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">认购状态 :</td>
+									<td>
+										<select name="state" class="form-control input-10x">
+											<option value="1" <eq name="data.state" value="1">selected</eq>>开启</option>
+											<option value="2" <eq name="data.state" value="2">selected</eq>>禁止</option>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">* 项目认购状态</td>
+								</tr>
+
+                                <input type="hidden" id="id" name="id" value="{$data.id}" />
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function () {
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
+<script type="text/javascript">
+	var editor;
+	KindEditor.ready(function (K) {
+		editor = K.create('textarea[name="content"]', {
+			width: '500px',
+			height: '250px',
+			allowPreviewEmoticons: false,
+			allowImageUpload: true,
+			items: [
+				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
+				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
+				'insertunorderedlist', '|', 'emoticons',  'link', 'fullscreen'],
+			afterBlur: function () {
+				this.sync();
+			}
+		});
+	});
+
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#inputfile").change(function () {
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#inputfile')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+
+			//发送数据
+			$.ajax({
+				url: '/Admin/Issue/issueimage',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img').attr("src", '/Upload/public/' + data);
+						$('#imgs').val(data);
+						$('#up_img').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide(); //加载失败移除加载图片
+				}
+			});
+
+		});
+	});
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Issue/index')}");
+	</script>
+</block>

+ 73 - 0
Application/Admin/View/Issue/index.html

@@ -0,0 +1,73 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display:none;">
+		<button class="close fixed" style="margin-top:4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">认购配置</span>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<a class="btn  btn-success" href="{:U('Issue/edit')}" style="    padding: 6px 30px;">新 增</a>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+						<th class="">ID</th>
+						<th class="">项目名称</th>
+						<th class="">认购币种</th>
+						<th class="">发行总量</th>
+						<th class="">预设认购</th>
+						<th class="">实际认购</th>
+						<th class="">认购价格</th>
+						<th class="">认购限量</th>
+						<th class="">锁仓天数</th>
+						<th class="">认购时间</th>
+						<th class="">状态</th>
+						<th class="">操作</th>
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+								<td>{$vo.id}</td>
+								<td>{$vo.name}</td>
+								<td><?php echo strtoupper($vo['coinname']);?></td>
+								<td>{$vo['num']*1}</td>
+								<td>{$vo['ysnum']*1 }</td>
+								<td>{$vo['sellnum']*1 }</td>
+								<td>{$vo['price']*1} {$vo.buycoin}</td>
+								<td>{$vo['allmax']*1}</td>
+								<td>{$vo['lockday']}天</td>
+								<td>开启时间:{$vo['starttime']}<br>结束时间:{$vo['finishtime']}</td>
+								<td><eq name="vo.status" value="1">显示<else/>隐藏</eq></td>
+								<td><a href="{:U('Issue/edit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a></td>
+							</tr>
+						</volist>
+					<else/>
+						<td colspan="14" class="text-center empty-info">
+							<i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+						</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Issue/index')}");
+	</script>
+</block>

+ 99 - 0
Application/Admin/View/Issue/log.html

@@ -0,0 +1,99 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h"> <span class="h1-title">认购记录</span> </div>
+		<div class="cf">
+			<div class="search-form fl cf">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width:160px;float:left;margin-right:10px;" name="field" class="form-control">
+							<option value="username" <eq name="Think.get.field" value="username">selected</eq>>用户名</option>
+						</select>
+						<input type="text" name="name" class="search-input form-control" value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function(){
+							$('#search').click(function(){
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function(e){
+							if(e.keyCode===13){
+								$("#search").click();
+								return false;
+							}
+						});
+					</script> 
+				</div>
+			</div>
+		</div>
+   
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox" /></th>
+						<th class="">ID</th>
+						<th class="">会员账号</th>
+						<th class="">项目名称</th>
+						<th class="">认购</th>
+						<th class="">支付</th>
+						<th class="">时间</th>
+						<th class="">状态</th>
+					</tr>
+				</thead>
+				<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
+								<td>{$vo.id}</td>
+								<td>{$vo.account}</td>
+								<td>{$vo.name}</td>
+								<td>
+								    <span>认购币种:<?php echo strtoupper($vo['coinname']);?></span><br />
+								    <span>认购数量:{$vo.num}</span>
+								</td>
+								<td>
+								    <span>支付币种:<?php echo strtoupper($vo['buycoin']);?></span><br />
+								    <span>认购数量:{$vo.mum}</span>
+								</td>
+								<td>
+								    <span>认购日期:{$vo.addtime}<br />
+								    <span>解冻时间:{$vo.endtime}</span>
+								</td>
+								
+								<td>
+								    <eq name="vo.status" value="1">
+								    <span style="color:red;">冻结中</span>
+								    <else />
+								    <span style="color:green;">已解冻</span>
+								    </eq>
+								</td>
+							</tr>
+						</volist>
+					<else />
+						<td colspan="15" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer" />
+<block name="script"> 
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Issue/log')}");
+	</script> 
+</block>

+ 333 - 0
Application/Admin/View/Kuangm/addkuangj.html

@@ -0,0 +1,333 @@
+<include file="Public:header"/>
+<style>
+	.hoh td.item-label,.hoh td.item-note{
+		height:80px;line-height:80px;
+	}
+	.gezibg {
+		padding:5px;width:168px;background:url('/Public/Admin/ecshe_img/imgbg.png');
+	}
+</style>
+
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">添加矿机/编辑矿机</span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Kuangm/addkj')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+
+								<tr class="controls">
+									<td class="item-label">矿机名称 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="title" value="{$data['title']}">
+									</td>
+									<td class="item-note" style="color:red;">*矿机名称</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">购买类型 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:300px;" name="rtype">
+										    <option value="1" <if condition="$data.rtype eq 1">selected</if>>出售矿机</option>
+										    <option value="2" <if condition="$data.rtype eq 2">selected</if>>赠送矿机</option>
+										</select>
+									</td>
+									<td class="item-note"  style="color:red;">*表示购买和收益都共享</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">矿机类型 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:300px;" name="type">
+										    <option value="1" <if condition="$data.type eq 1">selected</if>>独资</option>
+										    <option value="2" <if condition="$data.type eq 2">selected</if>>共享</option>
+										</select>
+									</td>
+									<td class="item-note"  style="color:red;">*表示购买和收益都共享</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">分享比例 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="sharebl" value="{$data['sharebl']}">
+									</td>
+									<td class="item-note" style="color:red;">*独资请留空,共享请填写分享比例,如:50|50,表示各50%;</td>
+								</tr>
+
+								<if condition="$data.type eq 2">
+								<tr class="controls">
+									<td class="item-label">共享识别码 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" readonly="readonly" value="{$data['sharecode']}">
+									</td>
+									<td class="item-note" style="color:red;">*共享机购买,复制识别码给好友购买</td>
+								</tr>    
+								</if>
+
+								
+								<tr class="controls">
+									<td class="item-label">矿机详情 :</td>
+									<td>
+										<textarea class="form-control" rows="3" cols="26" name="content" style="border: 1px solid #dedede;width: 300px;">{$data['content']}</textarea>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls hoh">
+									<td class="item-label">矿机图片 :</td>
+									<td>
+										<div id="addpicContainer" class="gezibg">
+											<notempty name="data.imgs">
+												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="/Upload/public/{$data.imgs}">
+											<else/>
+												<!--没有图片显示默认图片-->
+												<img id="up_img" onclick="getElementById('inputfile').click()" style="cursor:pointer;max-height:62px;" title="点击添加图片" alt="点击添加图片" src="__PUBLIC__/Admin/images/addimg.png">
+											</notempty>
+											<input type="hidden" id="img" name="imgs" value="{$data.imgs}">
+											<input type="file" id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: 5px;" value=""/>
+										</div>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">产出币种 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:300px;" name="outcoin">
+										    {$data.outcoin}
+										    <foreach name="coind" item="vo">
+										    <option value="{$vo.name}" <?php if(trim($data['outcoin']) == $vo['name']){?>selected<?php }?>>{$vo.name}{$vo.title}</option>
+										    </foreach>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">*产出币种,如是平台币,请选择按币量产出</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">日产量 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:140px;float:left;" name="outtype" >
+										    <option value="1" <if condition="$data.outtype eq 1">selected</if>>按产值</option>
+										    <option value="2" <if condition="$data.outtype eq 2">selected</if>>按币量</option>
+										</select>
+										<input type="text" class="form-control" style="width:140px;float:left;margin-left:20px;" name="dayoutnum" value="{$data['dayoutnum']}">
+									</td>
+									<td class="item-note" style="color:red;">*按产值是按USDT折合产值,产出币量随价格波动,按币量则是定量</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">矿机单价 :</td>
+									<td style="width:300px;">
+									    <input type="text" class="form-control" style="width:140px;float:left;;" name="pricenum" value="{$data['pricenum']}">
+										<select type="text" class="form-control" style="width:140px;float:left;margin-left:20px" name="pricecoin">
+										    <foreach name="coind" item="vo">
+										    <option value="{$vo.name}"<?php if(trim($data['pricecoin']) == $vo['name']){?>selected<?php }?>>{$vo.name}{$vo.title}</option>
+										    </foreach>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">*矿机购买单价</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">购买上限 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="buymax" value="{$data['buymax']}">
+									</td>
+									<td class="item-note" style="color:red;">*账号单笔最低买多少</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">最低购买 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="di" value="{$data['di']}">
+									</td>
+									<td class="item-note" style="color:red;">*账号单笔最高买多少</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">最高购买 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="gao" value="{$data['gao']}">
+									</td>
+									<td class="item-note" style="color:red;">*每个账号购买的上限</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">矿机周期 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="cycle" value="{$data['cycle']}">
+									</td>
+									<td class="item-note" style="color:red;">*矿机到期周期</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">矿机算力 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control" style="width:300px;" name="suanl" value="{$data['suanl']}">
+									</td>
+									<td class="item-note" style="color:red;">*矿机算力</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">矿机库存总量 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control"  style="width:300px;" name="allnum" value="{$data['allnum']}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">预设出售量 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control" style="width:300px;" name="ycnum" value="{$data['ycnum']}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">参与奖励币种 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:300px;" name="jlcoin">
+										    <foreach name="coind" item="vo">
+										    <option value="{$vo.name}" <?php if(trim($data['jlcoin']) == $vo['name']){?>selected<?php }?>>{$vo.name}{$vo.title}</option>
+										    </foreach>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">参与奖励币量 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control" style="width:300px;" name="jlnum" value="{$data['jlnum']}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">矿机状态 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:300px;" name="status" value="{$data['status']}">
+										    <option value="1" <if condition="$data.status eq 1">selected</if>>可用</option>
+										    <option value="2" <if condition="$data.status eq 2">selected</if>>禁用</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">产币冻结 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:300px;" name="djout" value="{$data['djout']}">
+										    <option value="1" <if condition="$data.djout eq 1">selected</if>>否</option>
+										    <option value="2" <if condition="$data.djout eq 2">selected</if>>是</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">产币冻结时间 :</td>
+									<td style="width:300px;">
+										<input type="text" class="form-control" style="width:300px;" name="djday" value="{$data['djday']}">
+									</td>
+									<td class="item-note" style="color:red;">*不冻结请留空,输入纯数字,表示天数!</td>
+								</tr>
+								
+								
+								<tr class="controls">
+									<td class="item-label">申购要求 :</td>
+									<td style="width:300px;">
+										<select type="text" class="form-control" style="width:140px;float:left;" name="buyask" >
+										    <option value="1" <if condition="$data.buyask eq 1">selected</if>>按持币</option>
+										    <option value="2" <if condition="$data.buyask eq 2">selected</if>>按团队</option>
+										</select>
+										<input type="text" class="form-control" style="width:140px;float:left;margin-left:20px;" name="asknum" value="{$data['asknum']}">
+									</td>
+									<td class="item-note" style="color:red;">*按持币表示持有多少平台币,按团队表示推荐多会员</td>
+								</tr>
+								
+
+	                            <input type="hidden" id="kid" name="kid" value="{$data['id']}"  />
+
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" target-form="form-horizontal" id="submit" type="submit">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function () {
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script type="text/javascript">
+	/** 主LOGO上传 **/
+	$(document).ready(function () {
+		//响应文件添加成功事件
+		$("#inputfile").change(function () {
+
+			//创建FormData对象
+			var data = new FormData();
+			//为FormData对象添加数据
+			$.each($('#inputfile')[0].files, function (i, file) {
+				data.append('upload_file' + i, file);
+			});
+
+			//发送数据
+			$.ajax({
+				url: '/Admin/Kuangm/image',
+				type: 'POST',
+				data: data,
+				cache: false,
+				contentType: false,		//不可缺参数
+				processData: false,		//不可缺参数
+				success: function (data) {
+					if (data) {
+						$('#up_img').attr("src", '/Upload/public/' + $.trim(data));
+						$('#img').val($.trim(data));
+						$('#up_img').show();
+					}
+				},
+				error: function () {
+					alert('上传出错');
+					$(".loading").hide();	//加载失败移除加载图片
+				}
+			});
+
+		});
+	});
+	
+
+</script>
+
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Kuangm/index')}");
+	</script>
+</block>

+ 90 - 0
Application/Admin/View/Kuangm/djprofit.html

@@ -0,0 +1,90 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">矿机管理</span>
+			<span class="h2-title">>><a href="{:U('Kuangm/djprofit')}">收益列表</a></span>
+		</div>
+		<div class="cf">
+            <div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="输入用户账号" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">冻结金额</th>
+					<th class="">冻结币种</th>
+					<th class="">状态</th>
+					<th class="">冻结时间</th>
+					<th class="">解冻结时间</th>
+					<th class="">冻结说明</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td>{$vo.num}</td>
+							<td><?php echo strtoupper($vo['coin']);?></td>
+							<td>
+							    <if condition="$vo.status eq 1">
+							    <span style="color:green">待释放</span>
+							    <elseif  condition="$vo.status eq 2" />
+							    <span style="color:red">已释放</span>
+							    </if>
+							</td>
+							<td>{$vo.addday}</td>
+							<td>{$vo.thawday}</td>
+							<td>{$vo.remark}</td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Kuangm/djprofit')}");
+	</script>
+</block>

+ 89 - 0
Application/Admin/View/Kuangm/index.html

@@ -0,0 +1,89 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">矿机管理</span>
+			<span class="h2-title">>><a href="{:U('Kuangm/index')}">矿机列表</a></span>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<a class="btn btn-success " href="{:U('Kuangm/addkuangj')}">新 增</a>
+				<button class="btn ajax-post btn-info " url="{:U('Kuangm/kuangjStatus',array('type'=>'1','mobile'=>'Admin'))}" target-form="ids">启 用</button>
+				<button class="btn ajax-post btn-warning " url="{:U('Kuangm/kuangjStatus',array('type'=>'2','mobile'=>'Admin'))}" target-form="ids">禁 用</button>
+				<button class="btn ajax-post confirm btn-danger " confirm-msg="批量删除不可恢复,确定删除?" url="{:U('Kuangm/kuangjStatus',array('type'=>'3','mobile'=>'Admin'))}" target-form="ids">删 除</button>
+			</div>
+
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">类型</th>
+					<th class="">购买类型</th>
+					<th class="">矿机标题</th>
+					<th class="">矿机图片</th>
+					<th class="">矿机产出</th>
+					<th class="">购买单价</th>
+					<th class="">购买上限</th>
+					<th class="">周期</th>
+					<th class="">状态</th>
+					<th class="">添加时间</th>
+					<th class="">操作</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td><if condition="$vo.type eq 1">独资<elseif condition="$vo.type eq 2" />共享</if></td>
+							<td>
+							    <if condition="$vo.rtype eq 1">
+							        <span style="color:green;">购买</span>
+							    <elseif condition="$vo.rtype eq 2" />
+							        <span style="color:red;">赠送</span>
+							    </if>
+							</td>
+							<td>{$vo.title}</td>
+							<td><img src="/Upload/public/{$vo.imgs}" style="height:50px;"></td>
+							<td>
+							    <span>产出类型:<if condition="$vo.outtype eq 1">按产值<elseif condition="$vo.outtype eq 2" />按币量</if></span>
+							    <br />
+							    <span>日产量:{$vo.dayoutnum}<if condition="$vo.outtype eq 1">USDT<elseif condition="$vo.outtype eq 2" />{$vo.outcoin}</if></span>
+							</td>
+							
+							<td>{$vo.pricenum}{$vo.pricecoin}</td>
+							<td>{$vo.buymax}台</td>
+							<td>{$vo.cycle}天</td>
+							<td><if condition="$vo.status eq 1">正常<elseif condition="$vo.status eq 2" />禁用</if></td>
+							<td>{$vo.addtime}</td>
+							<td>
+								<a href="{:U('Kuangm/addkuangj?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+							</td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Kuangm/index')}");
+	</script>
+</block>

+ 107 - 0
Application/Admin/View/Kuangm/kjlist.html

@@ -0,0 +1,107 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">矿机管理</span>
+			<span class="h2-title">>><a href="{:U('Kuangm/kjlist')}">运行中的矿机</a></span>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<button class="btn ajax-post btn-info " url="{:U('Kuangm/userkjStatus',array('type'=>'1','mobile'=>'Admin'))}" target-form="ids">启动收益</button>
+				<button class="btn ajax-post btn-warning " url="{:U('Kuangm/userkjStatus',array('type'=>'2','mobile'=>'Admin'))}" target-form="ids">禁止收益</button>
+				<button class="btn ajax-post confirm btn-danger " confirm-msg="批量删除不可恢复,确定删除?" url="{:U('Kuangm/userkjStatus',array('type'=>'3','mobile'=>'Admin'))}" target-form="ids">删除矿机</button>
+			</div>
+            <div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="输入用户账号" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">类型</th>
+					<th class="">名称</th>
+					<th class="">图片</th>
+					<th class="">购买时间</th>
+					<th class="">过期时间</th>
+					<th class="">矿机状态</th>
+					<th class="">收益次数</th>
+					<th class="">产出币种</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td>
+							    <if condition="$vo.type eq 1">
+							        独资
+							    <elseif condition="$vo.type eq 2" />
+							        <span>共享</span>
+							        <br />
+							        {$vo.sharebl}%
+							    </if>
+							</td>
+							<td>{$vo.kjtitle}</td>
+							<td><img src="/Upload/public/{$vo.imgs}" style="height:50px;"></td>
+							<td><?php echo date("m-d H:i",strtotime($vo['addtime']));?></td>
+							<td><?php echo date("m-d H:i",strtotime($vo['endtime']));?></td>
+							<td>
+							    <if condition="$vo.status eq 1">
+							        <span style="color:green;">正常</span>
+							    <elseif condition="$vo.status eq 2" />
+							        <span style="color:red;">停止</span>
+							    </if>
+							</td>
+							<td><?php echo ($vo['cycle'] - $vo['synum']);?></td>
+                            <td><?php echo strtoupper($vo['outcoin']);?></td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Kuangm/kjlist')}");
+	</script>
+</block>

+ 80 - 0
Application/Admin/View/Kuangm/kjsylist.html

@@ -0,0 +1,80 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">矿机管理</span>
+			<span class="h2-title">>><a href="{:U('Kuangm/kjsylist')}">收益列表</a></span>
+		</div>
+		<div class="cf">
+            <div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="输入用户账号" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">矿机名称</th>
+					<th class="">收益额度</th>
+					<th class="">收益币种</th>
+					<th class="">收益时间</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td>{$vo.ktitle}</td>
+							<td>{$vo.num}</td>
+							<td>{$vo.coin}</td>
+							<td>{$vo.addtime}</td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Kuangm/kjsylist')}");
+	</script>
+</block>

+ 69 - 0
Application/Admin/View/Kuangm/overlist.html

@@ -0,0 +1,69 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">矿机管理</span>
+			<span class="h2-title">>><a href="{:U('Kuangm/overlist')}">过期的矿机</a></span>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">类型</th>
+					<th class="">名称</th>
+					<th class="">图片</th>
+					<th class="">购买时间</th>
+					<th class="">结束时间</th>
+					<th class="">矿机状态</th>
+					<th class="">收益次数</th>
+					<th class="">产出币种</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td>
+							    <if condition="$vo.type eq 1">
+							        独资
+							    <elseif condition="$vo.type eq 2" />
+							        共享
+							    </if>
+							</td>
+							<td>{$vo.kjtitle}</td>
+							<td><img src="/Upload/public/{$vo.imgs}" style="height:50px;"></td>
+							<td><?php echo date("m-d H:i",strtotime($vo['addtime']));?></td>
+							<td><?php echo date("m-d H:i",strtotime($vo['endtime']));?></td>
+							<td><span style="color:red;">过期</span></td>
+							<td><?php echo ($vo['cycle'] - $vo['synum']);?></td>
+                            <td><?php echo strtoupper($vo['outcoin']);?></td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Kuangm/overlist')}");
+	</script>
+</block>

+ 122 - 0
Application/Admin/View/Levertade/ccinfo.html

@@ -0,0 +1,122 @@
+<include file="Public:header" />
+
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">永续合约持仓详情</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+							    
+							    <tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">会员账号 :</td>
+									<td style="width:200px;">
+									    <span>{$info.username}</span>
+									</td>
+								</tr>
+                                
+                                <tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约交易对 :</td>
+									<td style="width:200px;">
+									    <span>{$info.symbol}</span>
+									</td>
+								</tr>
+								
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约交易方向 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.direction eq 1">
+						                    <span style="color:#0ecb81;">做多</span>
+						                <elseif condition="$info.direction eq 2" />
+						                    <span style="color:#f5465c;">做空</span>
+						                </if>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">委托单价 :</td>
+									<td style="width:200px;">
+									    <span>{$info.wt_price}</span>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">开仓单价 :</td>
+									<td style="width:200px;">
+									    <span>{$info.price}</span>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">止盈止损单价 :</td>
+									<td style="width:200px;">
+									    <span>{$info.zyprice}/{$info.zsprice}</span>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约手数 :</td>
+									<td style="width:200px;">
+									    <span>{$info.num}</span>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">杠杆倍数 :</td>
+									<td style="width:200px;">
+									    <span>{$info.ggan}</span>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">手续费 :</td>
+									<td style="width:200px;">
+									    <span>{$info.fee}</span>
+									</td>
+								</tr>
+								
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">委托时间 :</td>
+									<td style="width:200px;">
+									    <span>{$info.wttime}</span>
+									</td>
+								</tr>
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">开仓时间 :</td>
+									<td style="width:200px;">
+									    <span>{$info.addtime}</span>
+									</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+<include file="Public:footer" />
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Levertade/ccinfo')}");
+	</script>
+</block>

+ 147 - 0
Application/Admin/View/Levertade/index.html

@@ -0,0 +1,147 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">永续合约持仓订单</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Levertade/index')}'">初始化搜索</a>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="direction" class="form-control">
+							<option value=""
+							<empty name="Think.get.direction">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.direction" value="1">selected</eq>
+							>做多</option>
+							<option value="2"
+							<eq name="Think.get.direction" value="2">selected</eq>
+							>做空</option>
+						</select>
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">委托单价</th>
+					<th class="">开仓单价</th>
+					<th class="">止盈/止损单价</th>
+					<th class="">合约手数</th>
+					<th class="">杠杆倍数</th>
+					<th class="">委托时间</th>
+					<th class="">建仓时间</th>
+					<th class="">手续费</th>
+					<th class="">详情</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+						<td>{$vo.id}</td>
+						<td>{$vo.username}</td>
+						<td>{$vo.symbol}</td>
+						<td>
+						    <if condition="$vo.direction eq 1">
+						        <span style="color:#0ecb81;">做多</span>
+						    <elseif condition="$vo.direction eq 2" />
+						        <span style="color:#f5465c;">做空</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 2">
+						        <span style="color:#707A8A;">待结算</span>
+						    <elseif condition="$vo.status eq 3" />
+						        <span style="color:#0ecb81;">已完成</span>
+						    <elseif condition="$vo.status eq 4" />
+						        <span style="color:#f5465c;">爆仓</span>
+						    </if>
+						</td>
+						<td>{$vo.wt_price}</td>
+						<td>{$vo.price}</td>
+						<td>{$vo.zyprice}/{$vo.zsprice}</td>
+						<td>{$vo.num}</td>
+						<td>{$vo.ggan}</td>
+						<td>{$vo.wttime}</td>
+						<td>{$vo.addtime}</td>
+						<td>{$vo.fee}</td>
+						<td>
+						    <a href="{:U('Levertade/ccinfo')}?id={$vo.id}">查看</a>
+						    <input type="button" class="ajax-get btn btn-danger btn-xs" value="强制平仓" onclick="closeorder('{$vo['id']}');"/>
+						</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+<include file="Public:footer"/>
+<script type="text/javascript">
+    function closeorder(id){
+        var oid  = id;
+        if(oid == '' || oid <= 0){
+            layer.msg("缺少重要参数");return false;
+        }
+        $.post("{:U('Levertade/closeorder')}",{'id':oid},function(data){
+            if(data.code == 1){
+                layer.msg(data.info);
+                setTimeout(function(args){
+                    window.location.reload();
+                },2000);
+            }else{
+                layer.msg(data.info);return false;
+            }
+        });
+    }
+</script>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Levertade/index')}");
+	</script>
+</block>

+ 146 - 0
Application/Admin/View/Levertade/pclist.html

@@ -0,0 +1,146 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">永续合约平仓订单</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Levertade/pclist')}'">初始化搜索</a>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="direction" class="form-control">
+							<option value=""
+							<empty name="Think.get.direction">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.direction" value="1">selected</eq>
+							>做多</option>
+							<option value="2"
+							<eq name="Think.get.direction" value="2">selected</eq>
+							>做空</option>
+						</select>
+						
+						<select style="width: 120px; float: left; margin-right: 10px;" name="yk_status" class="form-control">
+							<option value=""
+							<empty name="Think.get.yk_status">selected</empty>
+							>盈亏状态</option>
+							<option value="1"
+							<eq name="Think.get.yk_status" value="1">selected</eq>
+							>盈利</option>
+							<option value="2"
+							<eq name="Think.get.yk_status" value="2">selected</eq>
+							>亏损</option>
+						</select>
+
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">开仓单价</th>
+					<th class="">平仓单价</th>
+					<th class="">止盈/止损单价</th>
+					<th class="">合约手数</th>
+					<th class="">杠杆倍数</th>
+					<th class="">建仓时间</th>
+					<th class="">平仓时间</th>
+					<th class="">手续费</th>
+					<th class="">盈亏</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+						<td>{$vo.id}</td>
+						<td>{$vo.username}</td>
+						<td>{$vo.symbol}</td>
+						<td>
+						    <if condition="$vo.direction eq 1">
+						        <span style="color:#0ecb81;">做多</span>
+						    <elseif condition="$vo.direction eq 2" />
+						        <span style="color:#f5465c;">做空</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 2">
+						        <span style="color:#707A8A;">待结算</span>
+						    <elseif condition="$vo.status eq 3" />
+						        <span style="color:#0ecb81;">已完成</span>
+						    <elseif condition="$vo.status eq 4" />
+						        <span style="color:#f5465c;">爆仓</span>
+						    </if>
+						</td>
+						<td>{$vo.price}</td>
+						<td>{$vo.pc_price}</td>
+						<td>{$vo.zyprice}/{$vo.zsprice}</td>
+						<td>{$vo.num}</td>
+						<td>{$vo.ggan}</td>
+						<td>{$vo.addtime}</td>
+						<td>{$vo.endtime}</td>
+						<td>{$vo.fee}</td>
+						<td>
+						    <if condition="$vo.yk_status eq 1">
+						    <span style="color:#0ecb81;">+{$vo.ylmoney}</span>
+						    <elseif condition="$vo.yk_status eq 2" />
+						    <span style="color:#f5465c;">-{$vo.ylmoney}</span>
+						    </if>
+						 </td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+<include file="Public:footer"/>
+
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Levertade/pclist')}");
+	</script>
+</block>

+ 77 - 0
Application/Admin/View/Levertade/setting.html

@@ -0,0 +1,77 @@
+<include file="Public:header" />
+
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">永续合约参数设置</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Levertade/setting')}" method="post" class="form-horizontal" >
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+                                <tr class="controls">
+									<td class="item-label" style="width:100px;">手续费费率 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="lever_fee" value="{$info['lever_fee']}"></p>
+									    <p style="color:red;">注意:交易的手续费费率,如:0.02%写成0.02</p>
+									</td>
+								</tr>
+                                
+                                <tr class="controls">
+									<td class="item-label">交易开关 :</td>
+									<td>
+										<select name="lever_kg" class="form-control  input-10x">
+											<option value="0" <eq name="info['lever_kg']" value="0">selected</eq>>开放</option>
+											<option value="1" <eq name="info['lever_kg']" value="1">selected</eq>>关闭</option>
+										</select>
+									</td>
+									<td class="item-note" style="color:red;">*交易开关</td>
+								</tr>
+								
+                                <input type="hidden" name="hy_id" value="{$info['id']}" />
+
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class= "btn submit-btn ajax-post"  target-form="form-horizontal" id="submit" type="submit">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+<script type="text/javascript">
+	$(function(){
+		//主导航高亮
+		$('.config-box').addClass('current');
+		//边导航高亮
+		$('.config-contact').addClass('current');
+	});
+</script>
+
+<include file="Public:footer" />

+ 149 - 0
Application/Admin/View/Levertade/trustlist.html

@@ -0,0 +1,149 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">永续合约委托订单</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Levertade/trustlist')}'">初始化搜索</a>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="direction" class="form-control">
+							<option value=""
+							<empty name="Think.get.direction">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.direction" value="1">selected</eq>
+							>做多</option>
+							<option value="2"
+							<eq name="Think.get.direction" value="2">selected</eq>
+							>做空</option>
+						</select>
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">委托单价</th>
+					<th class="">止盈/止损单价</th>
+					<th class="">合约手数</th>
+					<th class="">杠杆倍数</th>
+					<th class="">委托时间</th>
+					<th class="">操作</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+						<td>{$vo.id}</td>
+						<td>{$vo.username}</td>
+						<td>{$vo.symbol}</td>
+						<td>
+						    <if condition="$vo.direction eq 1">
+						        <span style="color:#0ecb81;">做多</span>
+						    <elseif condition="$vo.direction eq 2" />
+						        <span style="color:#f5465c;">做空</span>
+						    </if>
+						</td>
+						<td>{$vo.wt_price}</td>
+						<td>{$vo.zyprice}/{$vo.zsprice}</td>
+						<td>{$vo.num}</td>
+						<td>{$vo.ggan}</td>
+						<td>{$vo.wttime}</td>
+						<td>
+						    <input type="button" class="ajax-get btn btn-info btn-xs" value="撤消委托" onclick="clearorder('{$vo['id']}');"/>
+						    <input type="button" class="ajax-get btn btn-danger btn-xs" value="市价开仓" onclick="addorder('{$vo['id']}');"/>
+						</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+<include file="Public:footer"/>
+<script type="text/javascript">
+    function addorder(id){
+        var oid = id;
+        if(oid == '' || oid <= 0){
+            layer.msg("{:L('缺少重要参数')}");return false;
+        }
+        $.post("{:U('Levertade/addorder')}",{'id':oid},function(data){
+            if(data.code == 1){
+                layer.msg(data.info);
+                setTimeout(function(args){
+                    $("#pcconfim").hide();
+                    window.location.reload();
+                },2000);
+            }else{
+                layer.msg(data.info);return false;
+            }
+        });
+    }
+    function clearorder(id){
+        var oid = id;
+        if(oid == '' || oid <= 0){
+            layer.msg("{:L('缺少重要参数')}");return false;
+        }
+        $.post("{:U('Levertade/clearorder')}",{'id':oid},function(data){
+            if(data.code == 1){
+                layer.msg(data.info);
+                setTimeout(function(args){
+                    $("#pcconfim").hide();
+                    window.location.reload();
+                },2000);
+            }else{
+                layer.msg(data.info);return false;
+            }
+        });
+    }
+</script>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Levertade/trustlist')}");
+	</script>
+</block>

+ 84 - 0
Application/Admin/View/Login/index.html

@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<meta charset="utf-8" />
+	<meta name="renderer" content="webkit">
+	<title>__WEBTITLE__</title>
+	<link rel="stylesheet" href="__PUBLIC__/Admin/ecshe_css/login.css" />
+</head>
+<body style="background:#f5f5f5;">
+<div style="width:100%;height:120px;margin-top:50px;text-align:center;">
+    <img src="/Public/Admin/ecshe_img/alogn.png" style="height: 120px;border-radius: 10px;"/>
+</div>
+<div class="logsbox" style="margin-top:25px;background:#fff;">
+	<h2 class="tc" style="margin-bottom:35px;color:#8a8a8a;">网站管理中心</h2>
+	<form action="{:U('Login/index')}" method="post" id="forms">
+	    
+		<div class="form-group" style="background:#f5f5f5;">
+			<div class="inputs" style="background:#f5f5f5;border: 1px solid #f5f5f5f5;" >
+				<i class="icon-login-user"></i>
+				<input type="text"  style="background:#f5f5f5;color:#000;" name="username" autocomplete="off" placeholder="用户名">
+			</div>
+		</div>
+
+		<div class="form-group">
+			<div class="inputs" style="background:#f5f5f5;border: 1px solid #f5f5f5f5;" >
+				<i class="icon-login-pwd"></i>
+				<input type="password"  style="background:#f5f5f5;color:#000;" name="password" autocomplete="off" placeholder="密码">
+			</div>
+		</div>
+
+		<div class="form-group">
+			<div class="inputs" style="width:60%; background:#f5f5f5;border: 1px solid #f5f5f5f5;">
+				<i class="icon-login-verifycode"></i>
+				<input type="text" name="verify" autocomplete="off" placeholder="图形验证码" id="login_verify" style="width:75%;background:#f5f5f5;color:#000;">
+			</div>
+			<div class="imgcode">
+				<img src="{:U('Verify/code')}" onclick="this.src=this.src+'?t='+Math.random()" title="{:L('换一张')}" id="verifycode">
+			</div>
+		</div>
+
+		<div class="form-button" style="margin-top:20px;">
+			<button class="btn btn-primary login-btn" type="submit">
+				<span class="in"><i class="icon-loading"></i>登 录 中 ...</span> <span class="on">登 录</span>
+			</button>
+		</div>
+		<div class="check-tips"></div>
+	</form>
+</div>
+
+<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.min.js"></script>
+<script type="text/javascript">
+	/* 登陆表单获取焦点变色 */
+	$("#forms").on("focus", "input", function () {
+		$(this).closest('.inputs').addClass('focus');
+	}).on("blur", "input", function () {
+		$(this).closest('.inputs').removeClass('focus');
+	});
+
+	//表单提交
+	$(document).ajaxStart(function () {
+		$("button:submit").addClass("log-in").attr("disabled", true);
+	}).ajaxStop(function () {
+		$("button:submit").removeClass("log-in").attr("disabled", false);
+	});
+
+	$("form").submit(function () {
+		var self = $(this);
+		$.post(self.attr("action"), self.serialize(), success, "json");
+		return false;
+
+		function success(data) {
+			if (data.status) {
+				window.location.href = data.url;
+			} else {
+				self.find(".check-tips").text(data.info);
+				//刷新验证码
+				$("#login_verify").val('');
+				$('#verifycode').click();
+			}
+		}
+	});
+</script>
+</body>
+</html>

+ 162 - 0
Application/Admin/View/Login/lockScreen.html

@@ -0,0 +1,162 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>锁屏休息</title>
+<link href="__PUBLIC__/Admin/images/favicon.ico" type="image/x-icon" rel="shortcut icon">
+	<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.min.js"></script>
+	<script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
+	<link href="__PUBLIC__/Admin/css/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+	<style>
+		a{
+			font-size: 12px;
+			color: white;
+		}
+		a:hover{
+			color: white!important;
+		}
+		.copy{
+			font-size: 12px;
+			color: white;
+		}
+		/*lock screen*/
+
+		.lock-screen {
+			background:#02bac6 url("__PUBLIC__/Admin/img/lock-bg.jpg");
+			background-size: cover;
+			background-repeat: repeat;
+		}
+
+		.lock-wrapper {
+			margin: 10% auto;
+			max-width: 330px;
+		}
+
+		.lock-box {
+			background: rgba(255,255,255,.3);
+			padding: 20px;
+			border-radius: 10px;
+			-webkit-border-radius: 10px;
+			position: relative;
+			height: 200px;
+		}
+
+		.lock-wrapper img {
+			position: absolute;
+			left: 40%;
+			top: -40px;
+			border-radius: 50%;
+			-webkit-border-radius: 50%;
+			border: 5px solid #fff;
+		}
+
+		.lock-wrapper h1 {
+			text-align: center;
+			color: #fff;
+			font-size: 18px;
+			text-transform: uppercase;
+			padding: 20px 0 0 0;
+		}
+
+		.lock-wrapper .locked {
+			margin-bottom: 20px;
+			display: inline-block;
+			color: #026f7a;
+		}
+
+		.btn-lock,.btn-lock:hover {
+			background: #02b5c2;
+			color: #fff;
+		}
+
+		.lock-input {
+			width: 83%;
+			border: none;
+			float: left;
+			margin-right: 3px;
+		}
+
+		#time {
+			width: 100%;
+			color: #fff;
+			font-size: 60px;
+			margin-bottom: 80px;
+			display: inline-block;
+			text-align: center;
+			font-family: 'Open Sans', sans-serif;
+			font-weight: 300;
+		}
+	</style>
+</head>
+
+<body class="lock-screen" onload="startTime()">
+
+<div class="lock-wrapper">
+
+	<div id="time"></div>
+
+
+	<div class="lock-box text-center">
+		<img src="/Upload/coin/dsc.png" alt="lock avatar"/>
+		<span class="locked">锁屏保护中...</span>
+			<div class="form-group col-lg-12">
+				<input type="password" placeholder="输入密码" id="unlock_pass" name="pass"
+					   class="form-control lock-input">
+				<button class="btn btn-lock" type="button" onclick="unlocka();">
+					<i class="glyphicon glyphicon-arrow-right"></i>
+				</button>
+			</div>
+	</div>
+</div>
+<script>
+	$(document).ready(
+			function() {
+				$("#unlock_pass").keydown(function(event) {
+					if (event.keyCode == 13) {
+						unlocka();
+					}
+				})
+			}
+	);
+
+	function unlocka(){
+			var pass = $('#unlock_pass').val();
+			if(!pass){
+				layer.tips('输入解锁密码或者登录密码', '#unlock_pass', {
+					tips: [1, '#02b5c2']
+				});
+				return;
+			}
+
+			$.post("{:U('Login/unlock')}",{pass:pass},function(data){
+				layer.msg(data.info);
+				if(data.url){
+					window.location.href = data.url;
+				}
+			},'json');
+	}
+
+	function startTime()
+	{
+		var today=new Date();
+		var h=today.getHours();
+		var m=today.getMinutes();
+		var s=today.getSeconds();
+		// add a zero in front of numbers<10
+		m=checkTime(m);
+		s=checkTime(s);
+		document.getElementById('time').innerHTML=h+":"+m+":"+s;
+		t=setTimeout(function(){startTime()},500);
+	}
+
+	function checkTime(i)
+	{
+		if (i<10)
+		{
+			i="0" + i;
+		}
+		return i;
+	}
+</script>
+</body>
+</html>

+ 261 - 0
Application/Admin/View/Orepool/addorepool.html

@@ -0,0 +1,261 @@
+<include file="Public:header" />
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main" style="margin-top:30px;">
+		<div class="main-title-h"> 
+			<span class="h1-title"><a href="{:U('Orepool/index')}">矿池配置</a> &gt;</span> 
+			<span class="h1-title">新增矿池项目</span> 
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Orepool/orepoolsave')}" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+
+						<div class="form-item cf">
+							<table>
+							
+								<tr class="controls">
+									<td class="item-label">矿池名称 :</td>
+									<td><input type="text" class=" form-control input-4x" placeholder="请输入矿池名称"  name="oretitle" value=""></td>
+									<td class="item-note">* 必须输入矿池名称</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">项目LOGO :</td>
+									<td>
+										<div class="upload-box" style="text-align: center;height:80px;">
+											<div class="imgs">
+												<img id="up_img_idimg1" onclick="getElementById('idimg1').click()" style="width: 30%;" src="__PUBLIC__/Home/images/up.png">
+											</div>
+											<input type="hidden" id="idimg1" name="idimg1" value="">
+											<input type="file" id="file_idimg1"accept="image/gif, image/jpeg, image/jpg, image/png" value="" style="position:relative;top:-60px;width:200px;height:60px;opacity: 0;"/>
+										</div>
+									</td>
+								</tr>
+								
+								
+								
+								<tr class="controls">
+									<td class="item-label">参与币种 :</td>
+									<td><input type="text" name="coinname" class="form-control input-4x" placeholder="请输入参与矿池的币种" value=""></td>
+										<!--<empty name="data">
+											<select name="coinname" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+												<volist name="C['coin_list']" id="v"> 
+													<option value="{$v['name']}" <eq name="data['coinname']" value="$v['name']">selected</eq>>{$v['title']}</option>
+												</volist>
+											</select>
+										<else />
+											{$data['coinname']} 
+										</empty>-->
+									</td>
+									<td class="item-note">* 必填(可填写多币种),按此格式填写USDT|BTC|,(当前可填写币种<volist name="C['coin_list']" id="v">{$v['name']},</volist></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">释放币种 :</td>
+									<td>
+										<empty name="data">
+											<select name="cc_coin" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+												<volist name="C['coin_list']" id="v"> 
+													<option value="{$v['name']}" <eq name="data['cc_coin']" value="$v['name']">selected</eq>>{$v['title']}</option>
+												</volist>
+											</select>
+										<else />
+											{$data['cc_coin']} 
+										</empty>
+									</td>
+									<td class="item-note">* 矿池释放的币种</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">矿池总价值 :</td>
+									<td><input type="number"  name="summoney" class="form-control input-4x"  placeholder="请输入矿池总价值"  value=""></td>
+									<td class="item-note">* 必填,矿池总价值</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">模拟参与额度 :</td>
+									<td><input type="number"  name="fmoney"  class="form-control input-4x" placeholder="请输入模拟参与额度" value="" /></td>
+									<td class="item-note">* 非必填,填写后会减少可投资额度</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单次最低额度 :</td>
+									<td><input type="number"  name="minmoney" class="form-control input-4x" placeholder="请输入单次最低额度" value=""></td>
+									<td class="item-note">* 必填,单次最低买入金额</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">单次最高额度 :</td>
+									<td><input type="number" name="maxmoney" class="form-control input-4x" placeholder="请输入单次最高额度" value=""></td>
+									<td class="item-note">* 必填,单次最高买入金额</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">币释放规则 :</td>
+									<td>
+										<select name="rtype" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+											<option value="1">按固定比例释放</option>
+											<option value="2">按固定额度释放</option>
+											<option value="3">按固定额度比例释放</option>
+										</select>
+									</td>
+									<td class="item-note">* 必须选择币释放方式,选择后则按设置方式释放</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">固定比例释放 :</td>
+									<td><input type="number" name="sfbl"  class="form-control input-4x" placeholder="请输入固定释放比例" value=""></td>
+									<td class="item-note">* 必填,按设置的固定比例释放,10%,写成10。</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">固定额度释放 :</td>
+									<td><input type="number" name="gdnum"  class="form-control input-4x" placeholder="请输入固定释放额度" value=""></td>
+									<td class="item-note">* 必填,按固定额度释放,固定数量,如1000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">固定额度比例释放 :</td>
+									<td><input type="text" name="gdbl" class="form-control input-4x" placeholder="请输入固定额度比例额度" value=""></td>
+									<td class="item-note">* 必填,按固定数量比例释放额度,固定数量比例,比如1000的 10% 写成1000|10</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单用户参与次数 :</td>
+									<td><input type="text" name="buynum" class="form-control input-4x" placeholder="请输入固定额度比例额度" value=""></td>
+									<td class="item-note">* 必填,单个用户最多能够参与的次料</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">释放方法 :</td>
+									<td>
+										<select name="rway" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+											<option value="1">每天自动释放</option>
+											<option value="2">后台手动释放</option>
+										</select>
+									</td>
+									<td class="item-note">* 必须选择释放方法</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">购买方式 :</td>
+									<td>
+										<select name="buytype" id="buytype"   onchange="func()" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+											<option value="1">自由输入金额</option>
+											<option value="2">下拉框选择金额</option>
+										</select>
+									</td>
+									<td class="item-note">* 购买方式选择</td>
+								</tr>
+								<tr class="controls" id="selectid" style="display:none;">
+									<td class="item-label">购买金额 :</td>
+									<td><input type="text"  name="arrmoney"   class="form-control input-4x"placeholder="请输入用于选择的购买金额"   value=""></td>
+									<td class="item-note">* 必须填写,请参照此格式填写 100|200|300|400|</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">排序 :</td>
+									<td><input type="number"  name="sort"   class="form-control input-4x"placeholder="请输入排序编号"   value=""></td>
+									<td class="item-note">* 必须填写,数字越小,排序越靠前</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td>
+										<select name="status" class="input-small   input-4x"  style="height: 36px;border-radius: 5px;">
+											<option value="1" <eq name="data.status" value="1">selected</eq>>可用</option>
+											<option value="2" <eq name="data.status" value="0">selected</eq>>禁用</option>
+										</select>
+									</td>
+									<td class="item-note">* 必选</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id">
+												<input type="hidden" name="id" value="{$data.id}" />
+											</notempty>
+										</div>
+									</td>
+								</tr>
+								
+							</table>
+						</div>
+					</div>
+				</form>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	function func(){
+		var id = $("#buytype").val();
+		if(id == 2){
+			$("#selectid").fadeIn();
+		}
+		if(id == 1){
+			$("#selectid").hide();
+		}
+	}
+</script>
+<script type="text/javascript">
+$(document).ready(function () {
+	//响应文件添加成功事件
+	$("#file_idimg1").change(function () {
+		//创建FormData对象
+		var data = new FormData();
+		//为FormData对象添加数据
+		$.each($('#file_idimg1')[0].files, function (i, file) {
+			data.append('upload_file' + i, file);
+		});
+
+		//发送数据
+		$.ajax({
+			url: '/Home/Ajax/upimgs',
+			type: 'POST',
+			data: data,
+			cache: false,
+			contentType: false, //不可缺参数
+			processData: false, //不可缺参数
+			success: function (data) {
+				if (data) {
+					$('#up_img_idimg1').attr("src", '/Upload/payimg/' + $.trim(data));
+					$('#idimg1').val($.trim(data));
+					$('#up_img_idimg1').show();
+				}
+			},
+			error: function () {
+				alert('上传出错');
+				$(".loading").hide(); //加载失败移除加载图片
+			}
+		});
+
+	});
+});
+</script>
+
+<script type="text/javascript">
+//提交表单
+$('#submit').click(function(){
+	$('#form').submit();
+});
+</script>
+
+<script type="text/javascript">
+$(function(){
+	//主导航高亮
+	$('.Money-box').addClass('current');
+	//边导航高亮
+	$('.Money-index').addClass('current');
+});
+</script> 
+<include file="Public:footer" />

+ 265 - 0
Application/Admin/View/Orepool/editorepool.html

@@ -0,0 +1,265 @@
+<include file="Public:header" />
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main" style="margin-top:30px;">
+		<div class="main-title-h"> 
+			<span class="h1-title"><a href="{:U('Orepool/index')}">矿池配置</a> &gt;</span> 
+			<span class="h1-title">矿池项目修改</span> 
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Orepool/orepoolesave')}" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>							
+								<tr class="controls">
+									<td class="item-label">矿池名称 :</td>
+									<td><input type="text" class=" form-control input-4x" placeholder="请输入矿池名称"  name="oretitle" value="{$info.oretitle}"></td>
+									<td class="item-note">* 必须输入矿池名称</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">项目LOGO :</td>
+									<td>
+										
+										<div class="upload-box" style="text-align: center;height:80px;">
+											<div class="imgs">
+												<img id="up_img_idimg1" onclick="getElementById('idimg1').click()" style="width: 30%;" src="../../../../Upload/payimg/{$info.oreimg}">
+											</div>
+											<input type="hidden" id="idimg1" name="idimg1" value="">
+											<input type="file" id="file_idimg1"accept="image/gif, image/jpeg, image/jpg, image/png" value="" style="position:relative;top:-60px;width:200px;height:60px;opacity: 0;"/>
+										</div>
+									</td>
+								</tr>
+								
+								
+								
+								<tr class="controls">
+									<td class="item-label">参与币种 :</td>
+									<td><input type="text" name="coinname" class="form-control input-4x" placeholder="请输入参与矿池的币种" value="{$info.coinname}">
+										<!--<empty name="data">
+											<select name="coinname" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+												<option>{$info.coinname}</option>
+												<volist name="C['coin_list']" id="v"> 
+													<option value="{$v['name']}" <eq name="data['coinname']" value="$v['name']">selected</eq>>{$v['title']}</option>
+												</volist>
+											</select>
+										<else />
+											{$data['coinname']} 
+										</empty>-->
+									</td>
+									<td class="item-note">* 必填(可填写多币种),按此格式填写USDT|BTC|,(当前可填写币种<volist name="C['coin_list']" id="v">{$v['name']},</volist></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">释放币种 :</td>
+									<td>
+										<empty name="data">
+											<select name="cc_coin" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+												<option>{$info.cc_coin}</option>
+												<volist name="C['coin_list']" id="v"> 
+													<option value="{$v['name']}" <eq name="data['cc_coin']" value="$v['name']">selected</eq>>{$v['title']}</option>
+												</volist>
+											</select>
+										<else />
+											{$data['cc_coin']} 
+										</empty>
+									</td>
+									<td class="item-note">* 矿池释放的币种</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">矿池总价值 :</td>
+									<td><input type="number"  name="summoney" class="form-control input-4x"  placeholder="请输入矿池总价值"  value="{$info.summoney}"></td>
+									<td class="item-note">* 必填,矿池总价值</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">模拟参与额度 :</td>
+									<td><input type="number"  name="fmoney"  class="form-control input-4x" placeholder="请输入模拟参与额度" value="{$info.fmoney}" /></td>
+									<td class="item-note">* 非必填,填写后会减少可投资额度</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单次最低额度 :</td>
+									<td><input type="number"  name="minmoney" class="form-control input-4x" placeholder="请输入单次最低额度" value="{$info.minmoney}"></td>
+									<td class="item-note">* 必填,单次最低买入金额</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">单次最高额度 :</td>
+									<td><input type="number" name="maxmoney" class="form-control input-4x" placeholder="请输入单次最高额度" value="{$info.maxmoney}"></td>
+									<td class="item-note">* 必填,单次最高买入金额</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">币释放规则 :</td>
+									<td>
+										<select name="rtype" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+											<option value="1" <?php if($vo['info']==1){echo "selected";}?>>按固定比例释放</option>
+											<option value="2" <?php if($vo['info']==2){echo "selected";}?>>按固定额度释放</option>
+											<option value="3" <?php if($vo['info']==3){echo "selected";}?>>按固定额度比例释放</option>
+										</select>
+									</td>
+									<td class="item-note">* 必须选择币释放方式,选择后则按设置方式释放</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">固定比例释放 :</td>
+									<td><input type="number" name="sfbl"  class="form-control input-4x" placeholder="请输入固定释放比例" value="{$info.sfbl}"></td>
+									<td class="item-note">* 必填,按设置的固定比例释放,10%,写成10。</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">固定额度释放 :</td>
+									<td><input type="number" name="gdnum"  class="form-control input-4x" placeholder="请输入固定释放额度" value="{$info.gdnum}"></td>
+									<td class="item-note">* 必填,按固定额度释放,固定数量,如1000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">固定额度比例释放 :</td>
+									<td><input type="text" name="gdbl" class="form-control input-4x" placeholder="请输入固定额度比例额度" value="{$info.gdbl}"></td>
+									<td class="item-note">* 必填,按固定数量比例释放额度,固定数量比例,比如1000的 10% 写成1000|10</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单用户参与次数 :</td>
+									<td><input type="text" name="buynum" class="form-control input-4x" placeholder="请输入固定额度比例额度" value="{$info.buynum}"></td>
+									<td class="item-note">* 必填,单个用户最多能够参与的次料</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">释放方法 :</td>
+									<td>
+										<select name="rway" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+											<option value="1" <?php if($info['rway']==1){echo "selected";}?>>每天自动释放</option>
+											<option value="2" <?php if($info['rway']==2){echo "selected";}?>>后台手动释放</option>
+										</select>
+									</td>
+									<td class="item-note">* 必须选择释放方法</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">购买方式 :</td>
+									<td>
+										<select name="buytype"  id="buytype"   onchange="func()" class="input-small  input-4x" style="height: 36px;border-radius: 5px;">
+											<option value="1">自由输入金额</option>
+											<option value="2">下拉框选择金额</option>
+										</select>
+									</td>
+									<td class="item-note">* 购买方式选择</td>
+								</tr>
+								
+								<tr class="controls" id="selectid" style="display:none;">
+									<td class="item-label">购买金额 :</td>
+									<td><input type="text"  name="arrmoney"   class="form-control input-4x"placeholder="请输入用于选择的购买金额"   value="{$info.arrmoney}"></td>
+									<td class="item-note">* 必须填写,请参照此格式填写 100|200|300|400|</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">排序 :</td>
+									<td><input type="number"  name="sort"   class="form-control input-4x"placeholder="请输入排序编号"   value="{$info.sort}"></td>
+									<td class="item-note">* 必须填写,数字越小,排序越靠前</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td>
+										<select name="status" class="input-small   input-4x"  style="height: 36px;border-radius: 5px;">
+											<option value="1" <?php if($info['status']==1){echo "selected";}?>>可用</option>
+											<option value="2" <?php if($info['status']==2){echo "selected";}?> >禁用</option>
+										</select>
+									</td>
+									<td class="item-note">* 必选</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<input type="hidden" name="oid" value="{$info.id}" />
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id">
+												<input type="hidden" name="id" value="{$data.id}" />
+											</notempty>
+										</div>
+									</td>
+								</tr>
+								
+							</table>
+						</div>
+					</div>
+				</form>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script type="text/javascript">
+	function func(){
+		var id = $("#buytype").val();
+		if(id == 2){
+			$("#selectid").fadeIn();
+		}
+		if(id == 1){
+			$("#selectid").hide();
+		}
+	}
+</script>
+<script type="text/javascript">
+$(document).ready(function () {
+	//响应文件添加成功事件
+	$("#file_idimg1").change(function () {
+		//创建FormData对象
+		var data = new FormData();
+		//为FormData对象添加数据
+		$.each($('#file_idimg1')[0].files, function (i, file) {
+			data.append('upload_file' + i, file);
+		});
+
+		//发送数据
+		$.ajax({
+			url: '/Home/Ajax/upimgs',
+			type: 'POST',
+			data: data,
+			cache: false,
+			contentType: false, //不可缺参数
+			processData: false, //不可缺参数
+			success: function (data) {
+				if (data) {
+					$('#up_img_idimg1').attr("src", '/Upload/payimg/' + $.trim(data));
+					$('#idimg1').val($.trim(data));
+					$('#up_img_idimg1').show();
+				}
+			},
+			error: function () {
+				alert('上传出错');
+				$(".loading").hide(); //加载失败移除加载图片
+			}
+		});
+
+	});
+});
+</script>
+
+<script type="text/javascript">
+//提交表单
+$('#submit').click(function(){
+	$('#form').submit();
+});
+</script>
+
+<script type="text/javascript">
+$(function(){
+	//主导航高亮
+	$('.Money-box').addClass('current');
+	//边导航高亮
+	$('.Money-index').addClass('current');
+});
+</script> 
+<include file="Public:footer" />

+ 99 - 0
Application/Admin/View/Orepool/index.html

@@ -0,0 +1,99 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main" style="margin-top:25px;">
+		<div class="main-title-h" style="margin-bottom:0px;"> <span class="h1-title">矿池挖矿</span> </div>
+		<div class="cf">
+		
+			<div class="fl"> 
+				<a style="width: 120px;" class="btn btn-success navbar-btn btn-sm" href="{:U('Orepool/addorepool')}">新增矿池</a>
+				<a style="width: 120px;" class="btn btn-info navbar-btn btn-sm" href="{:U('Orepool/orepoolconfig')}">奖励制度设置</a>
+				<!--<button class="btn ajax-post btn-info navbar-btn btn-sm" url="{:U('Money/status',array('method'=>'resume'))}" target-form="ids">启 用</button>
+				<button class="btn ajax-post btn-warning navbar-btn btn-sm" url="{:U('Money/status',array('method'=>'forbid'))}" target-form="ids">禁 用</button>
+				<button class="btn ajax-post confirm btn-danger navbar-btn btn-sm" url="{:U('Money/status',array('method'=>'delete'))}" target-form="ids">删 除</button>
+				<button class="btn ajax-post confirm btn-danger navbar-btn btn-sm" url="{:U('Money/status',array('method'=>'delete'))}" target-form="ids">手动释放利息</button>-->
+			</div>
+		</div>
+		
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+					<tr>
+						<th class="">矿池名称</th>
+						<th class="">参与币种</th>
+						<th class="">总价值</th>
+						<th class="">最低额度</th>
+						<th class="">最高额度</th>
+						<th class="">释放规则</th>
+						<th class="">释放方式</th>
+						<th class="">添加时间</th>
+						<th class="">状态</th>
+						<th class="">操作</th>
+					</tr>
+				</thead>
+				
+        		<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td>{$vo.oretitle}</td>
+								<td>{$vo.coinname}</td>
+								<td>{$vo.summoney}CNY</td>
+								<td>{$vo.minmoney}CNY</td>
+								<td>{$vo.maxmoney}CNY</td>
+								<td>
+									<?php if($vo['rtype']==1){?>
+										<span>固定比例</span>
+									<?php }elseif($vo['rtype']==2){?>
+										<span>固定额度</span>
+									<?php }elseif($vo['rtype']==3){?>
+										<span>固定额度比例</span>
+									<?php }?>
+								</td>
+								<td>
+									<?php if($vo['rway']==1){?>
+										<span>自动释放</span>
+									<?php }elseif($vo['rway']==2){?>
+										<span>手动释放</span>
+									<?php }?>
+								</td>
+								<td>{$vo['addtime']}</td>
+								<td>
+									<?php if($vo['status']==1){?>
+										<span>正常</span>
+									<?php }elseif($vo['status']==2){?>
+										<span>关闭</span>
+									<?php }?>
+								</td>
+								<td>
+									<a href="{:U('Orepool/editorepool?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a> 
+									<a href="{:U('Orepool/delore?id='.$vo['id'])}" class="btn btn-danger btn-xs">删除</a> 
+									<a href="{:U('Orepool/orerelease?id='.$vo['id'])}" class="btn btn-success btn-xs">释放收益 </a> 
+									<a href="{:U('Orepool/orelog',array('oid' => $vo['id']))}" class="btn btn-warning btn-xs">参与记录</a>
+								</td>
+							</tr>
+						</volist>
+					<else />
+						<td colspan="15" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+				</tbody>
+				
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	$(function(){
+		//主导航高亮
+		$('.Money-box').addClass('current');
+		//边导航高亮
+		$('.Money-index').addClass('current');
+	});
+</script> 
+<include file="Public:footer" />

+ 328 - 0
Application/Admin/View/Public/edit.html

@@ -0,0 +1,328 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h" style="font-size: 24px;">
+            <span class="h1-title">{$title|htmlspecialchars}</span>
+            <if condition="$suggest">({$suggest|htmlspecialchars})</if>
+            <notempty name="titleList">
+                <i class="ca"></i>[<a href="{$titleList['url']}"> {$titleList['title']|htmlspecialchars}</a> ]
+            </notempty>
+        </div>
+        <div class="tab-wrap">
+            <div class="tab-content">
+                <form id="form" action="{$savePostUrl}" method="post" class="form-horizontal">
+                    <div id="tab" class="tab-pane in tab">
+                        <div class="form-item cf">
+                            <table>
+                                <volist name="keyList" id="field">
+                                    <switch name="field.type">
+                                        <case value="hidden">
+                                            <input type="hidden" name="{$field.name}" value="{$field.value}" class="text input-large"/>
+                                        </case>
+                                        <case value="readonly">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <input type="text" class="form-control" name="{$field.name}" value="{$field.value|htmlspecialchars}" disabled="disabled" style="background-color: #ECECEC;min-width: 400px;color: red;">
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+                                        <case value="text">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <input type="text" class="form-control" name="{$field.name}" value="{$field.value|htmlspecialchars}" style="min-width: 400px;">
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+                                        <case value="pass">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <input type="password" class="form-control" name="{$field.name}" value="{$field.value|htmlspecialchars}" style="min-width: 400px;">
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+                                        <case value="time">
+                                            <script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <input type="text" class="form-control" name="{$field.name}" value="{$field.value|htmlspecialchars}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" style="min-width: 400px;">
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+                                        <case value="select">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <select name="{$field.name}" class="form-control" style="min-width: 400px;">
+                                                        <volist name="field.opt" id="option">
+                                                            <option value="{$key}"
+                                                            <eq name="field['value']" value="$key">selected</eq>
+                                                            >{$option|htmlspecialchars}</option>
+                                                        </volist>
+                                                    </select>
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+                                        <case value="radio">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <volist name="field.opt" id="option">
+                                                        <label><input type="radio" name="{$field.name}" value="{$key}" style=""
+                                                            <eq name="field['value']" value="$key">checked="checked"</eq>
+                                                            > {$option|htmlspecialchars}
+                                                        </label>
+                                                    </volist>
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+
+
+                                        <case value="checkbox">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td style="    width: 400px;">
+                                                    <php>
+                                                        $field['value_array'] = explode('|', $field['value']);
+                                                    </php>
+                                                    <volist name="field.opt" id="option">
+                                                        <php>
+                                                            $checked = in_array($key,$field['value_array']) ? 1 : 0;
+                                                            $checkName = $field['name'].'_'.$key;
+                                                        </php>
+                                                        <label><input type="checkbox" name="{$checkName}" value="{$key}"
+                                                            <eq name="checked" value="1">checked="checked"</eq>
+                                                            > {$option|htmlspecialchars}
+                                                        </label>
+                                                    </volist>
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+
+
+
+
+
+
+
+
+                                        <case value="textarea">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <textarea name="{$field.name}" class="form-control " style="margin: 10px 0px;height: 100px;min-width: 400px;">{$field.value|htmlspecialchars}</textarea>
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                        </case>
+
+                                        <case value="editor">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <textarea name="{$field.name}" id="iframeName_{$field.name}" >{$field['value']}</textarea>
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                            <script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
+                                            <script type="text/javascript">
+
+
+                                                var editor;
+                                                KindEditor.ready(function (K) {
+                                                    editor = K.create('textarea', {
+                                                        width: '496px',
+                                                        minWidth: 490,
+                                                        height: '220px',
+                                                        allowPreviewEmoticons: false,
+                                                        allowImageUpload: true,
+                                                        afterBlur: function () { this.sync(); },
+                                                        uploadJson: "{$field.subtitle}",//图片上传后的处理地址
+                                                        items: [
+                                                            'source',
+                                                            'removeformat',
+                                                            'fontname',
+                                                            'fontsize',
+                                                            '|',
+                                                            'forecolor',
+                                                            'hilitecolor',
+                                                            'bold',
+                                                            'italic',
+                                                            'underline',
+                                                            '|',
+                                                            'justifyleft',
+                                                            'justifycenter',
+                                                            'justifyright',
+                                                            'insertorderedlist',
+                                                            'insertunorderedlist',
+                                                            '|',
+                                                            'emoticons',
+                                                            'image',
+                                                            'link',
+                                                            'fullscreen'
+                                                        ]
+                                                    });
+                                                });
+                                            </script>
+                                        </case>
+
+
+
+
+
+
+                                        <case value="singleImage">
+                                            <tr class="controls">
+                                                <td class="item-label">{$field.title|htmlspecialchars} :</td>
+                                                <td>
+                                                    <div id="upload_single_image_{$field.name}" style="padding-bottom: 5px;">选择图片</div>
+                                                    <input id="upload_single_{$field.name}" class="attach" type="hidden" name="{$field.name}" value="{$field['value']}"/>
+                                                </td>
+                                                <td class="item-note">{$field.subtitle}</td>
+                                            </tr>
+                                            <tr id="upload_single_image_img_{$field.name}" class="controls  popup-gallery" style="display: none;">
+                                            </tr>
+                                            <notempty name="field['value']">
+                                                <tr id="upload_single_image_imga_{$field.name}" class="controls  popup-gallery">
+                                                    <td class="item-label"></td>
+                                                    <td>
+                                                        <div class="each">
+                                                            <a href="{$field.value|htmlspecialchars}" title="点击查看大图"><img src="{$field.value|htmlspecialchars}" width="{$field.opt.width}" height="{$field.opt.height}" style="margin: 10px 0px;"></a>
+                                                        </div>
+                                                    </td>
+                                                    <td class="item-note"></td>
+                                                </tr>
+                                            </notempty>
+                                            <link type="text/css" rel="stylesheet" href="__PUBLIC__/magnific/magnific-popup.css"/>
+                                            <link type="text/css" rel="stylesheet" href="__PUBLIC__/webuploader/css/webuploader.css" >
+                                            <script type="text/javascript" src="__PUBLIC__/magnific/jquery.magnific-popup.min.js"></script>
+                                            <script type="text/javascript" src="__PUBLIC__/webuploader/js/webuploader.js"></script>
+
+                                            <script>
+                                                $(function () {
+                                                    var uploader_{$field.name} = WebUploader.create({
+                                                        // 选完文件后,是否自动上传。
+                                                        auto: true,
+                                                        // swf文件路径
+                                                        swf: 'Uploader.swf',
+                                                        // 文件接收服务端。
+                                                        server: "{$field.opt.url}",
+                                                        // 选择文件的按钮。可选。
+                                                        // 内部根据当前运行是创建,可能是input元素,也可能是flash.
+                                                        pick: '#upload_single_image_{$field.name}',
+                                                        // 只允许选择图片文件
+                                                        accept: {
+                                                            title: 'Images',
+                                                            extensions: 'gif,jpg,jpeg,bmp,png',
+                                                            mimeTypes: 'image/*'
+                                                        }
+                                                    });
+                                                    uploader_{$field.name}.on('fileQueued', function (file) {
+                                                        uploader_{$field.name}.upload();
+                                                    });
+                                                    /*上传成功**/
+                                                    uploader_{$field.name}.on('uploadSuccess', function (file, data) {
+                                                        if (data.error==0) {
+                                                            $("#upload_single_image_imga_{$field.name}").hide();
+                                                            $("#upload_single_image_img_{$field.name}").show();
+                                                            $("#upload_single_{$field.name}").val(data.url);
+
+
+                                                            $("#upload_single_image_img_{$field.name}").html(
+                                                                    '<td class="item-label"></td>' +
+                                                                    '<td><div class="each"><a href="' + data.url + '" title="点击查看大图"><img src="' + data.url + '" width="{$field.opt.width}" height="{$field.opt.height}" style="margin: 10px 0px;"></a></div></td>' +
+                                                                    '<td class="item-note"></td>'
+                                                            );
+
+
+                                                            uploader_{$field.name}.reset();
+                                                        } else {
+                                                            updateAlert(data.info);
+                                                            setTimeout(function () {
+                                                                $('#top-alert').find('button').click();
+                                                                $(that).removeClass('disabled').prop('disabled', false);
+                                                            }, 1500);
+                                                        }
+                                                    });
+                                                })
+                                            </script>
+                                            <script>
+                                                $(document).ready(function () {
+                                                    $('.popup-gallery').each(function () { // the containers for all your galleries
+
+                                                        $(this).magnificPopup({
+                                                            delegate: 'a',
+                                                            type: 'image',
+                                                            tLoading: '加载中#%curr%...',
+                                                            mainClass: 'mfp-img-mobile',
+                                                            gallery: {
+                                                                enabled: true,
+                                                                navigateByImgClick: true,
+                                                                preload: [
+                                                                    0,
+                                                                    1
+                                                                ] // Will preload 0 - before current, and 1 after the current image
+
+                                                            },
+                                                            image: {
+                                                                tError: '<a href="%url%">图片#%curr%</a>图片不能加载',
+                                                                titleSrc: function (item) {
+                                                                    /*           return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';*/
+                                                                    return '';
+                                                                },
+                                                                verticalFit: true
+                                                            }
+                                                        });
+                                                    });
+
+                                                });
+                                            </script>
+                                        </case>
+
+
+
+
+                                    </switch>
+                                </volist>
+                                <tr class="controls" style="margin: 10px 0px;height: 80px;">
+                                    <td class="item-label"></td>
+                                    <td>
+                                        <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交</button>
+                                        <a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+                                    </td>
+                                    <td class="item-note"></td>
+                                </tr>
+                            </table>
+                        </div>
+                    </div>
+                </form>
+                <script type="text/javascript">
+                    //提交表单
+                    $('#submit').click(function () {
+                        $('#form').submit();
+                    });
+                </script>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    $(function () {
+
+    });
+</script>
+<include file="Public:footer"/>

+ 90 - 0
Application/Admin/View/Public/footer.html

@@ -0,0 +1,90 @@
+<script type="text/javascript" src="__PUBLIC__/Admin/js/common.js"></script>
+<script type="text/javascript">
+	+function(){
+		//$("select").select2({dropdownCssClass: 'dropdown-inverse'});//下拉条样式
+		layer.config({
+			extend: 'extend/layer.ext.js'
+		});
+
+		var $window = $(window), $subnav = $("#subnav"), url;
+		$window.resize(function(){
+			//$("#main").css("min-height", $window.height() - 90);
+		}).resize();
+
+		/* 左边菜单高亮 */
+		url = window.location.pathname + window.location.search;
+
+		url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
+		$subnav.find("a[href='" + url + "']").parent().addClass("current");
+
+		/* 左边菜单显示收起 */
+		$("#subnav").on("click", "h3", function(){
+			var $this = $(this);
+			$this.find(".icon").toggleClass("icon-fold");
+			$this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
+			prev("h3").find("i").addClass("icon-fold").end().end().hide();
+		});
+
+		$("#subnav h3 a").click(function(e){e.stopPropagation()});
+
+		/* 头部管理员菜单 */
+		$(".user-bar").mouseenter(function(){
+			var userMenu = $(this).children(".user-menu ");
+			userMenu.removeClass("hidden");
+			clearTimeout(userMenu.data("timeout"));
+		}).mouseleave(function(){
+			var userMenu = $(this).children(".user-menu");
+			userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
+			userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
+		});
+
+		/* 表单获取焦点变色 */
+		$("form").on("focus", "input", function(){
+			$(this).addClass('focus');
+		}).on("blur","input",function(){
+			$(this).removeClass('focus');
+		});
+		$("form").on("focus", "textarea", function(){
+			$(this).closest('label').addClass('focus');
+		}).on("blur","textarea",function(){
+			$(this).closest('label').removeClass('focus');
+		});
+
+		// 导航栏超出窗口高度后的模拟滚动条
+		var sHeight = $(".sidebar").height();
+		var subHeight  = $(".subnav").height();
+		var diff = subHeight - sHeight; //250
+		var sub = $(".subnav");
+
+	}();
+
+	//导航高亮
+	function highlight_subnav(url){
+		$('.side-sub-menu').find('a[href="'+url+'"]').closest('li').addClass('current');
+	}
+
+	function lockscreen(){
+		layer.prompt({
+			title: '输入一个锁屏密码',
+			formType: 1,
+			btn: ['锁屏','取消'] //按钮
+		}, function(pass){
+			if(!pass){
+				layer.msg('需要输入一个密码!');
+			}else{
+				$.post("{:U('Login/lockScreen')}",{pass:pass},function(data){
+					layer.msg(data.info);
+					layer.close();
+					if(data.status){
+						window.location.href = "{:U('Login/lockScreen')}";
+					}
+				},'json');
+			}
+		});
+	}
+</script>
+<div style="display:none;">
+
+</div>
+</body>
+</html>

+ 165 - 0
Application/Admin/View/Public/header.html

@@ -0,0 +1,165 @@
+<!doctype html>
+<html>
+<head>
+	<meta charset="UTF-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+	<title>后台 | 管理中心 - ADMIN EX</title>
+	<!-- Loading Bootstrap -->
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/vendor/bootstrap/css/bootstrap.min.css">
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/base.css" media="all">
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/common.css" media="all">
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/module.css">
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/style.css" media="all">
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/default_color.css" media="all">
+	<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.min.js"></script>
+	<script type="text/javascript" src="__PUBLIC__/layer/layer.js"></script>
+	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/flat-ui.css">
+	<script src="__PUBLIC__/Admin/js/flat-ui.min.js"></script>
+	<script src="__PUBLIC__/Admin/js/application.js"></script>
+</head>
+<body>
+<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+	<div class="navbar-header">
+		<a class="navbar-brand" style="width:200px;text-align:center;background-color:#3c434d;" href="{:U('Index/index')}">
+			<img src="__PUBLIC__/Admin/ecshe_img/logo_text.png" />
+		</a>
+	</div>
+	<div class="navbar-collapse collapse">
+		<ul class="nav navbar-nav">
+			<!-- 主导航 -->
+			<volist name="__MENU__.main" id="menu">
+				<li <eq name="menu.class" value="current">class="active"</eq> > 
+					<a href="{$menu.url|U}">
+						{$menu.title} 
+					</a>
+				</li>
+			</volist>
+		</ul>
+		<ul class="nav navbar-nav navbar-rights" style="margin-right:10px;">
+			<li class="dropdown">
+				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
+					 {:session('admin_username')}<b class="caret"></b>
+				</a>
+				<ul class="dropdown-menu">
+					<li>
+						<a href="{:U('User/setpwd')}">
+							<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> 修改密码 
+						</a>
+					</li>
+					<li class="center">
+						<a href="javascript:void(0);" onclick="lockscreen()">
+							<span class="glyphicon glyphicon-lock" aria-hidden="true"></span> 锁屏休息 
+						</a>
+					</li>
+					<li class="dividers"></li>
+					<li>
+						<a href="{:U('Login/loginout')}">
+							<span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> 退出后台 
+						</a>
+					</li>
+				</ul>
+			</li>
+			<li>
+				<a href="{:U('Tools/delcache')}" class="dropdown-toggle" title="清除缓存">
+					<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
+				</a>
+			</li>
+			<li>
+				<a class="dropdown-toggle" title="打开前台" href="__ROOT__/" target="_blank">
+					<span class="glyphicon glyphicon-share" aria-hidden="true"></span>
+				</a>
+			</li>
+		</ul>
+	</div>
+</div>
+<!-- 边栏 -->
+<div class="sidebar">
+	<!-- 子导航 -->
+	<block name="sidebar">
+		<div id="subnav" class="subnav" style="max-height: 94%;overflow-x: hidden;overflow-y: auto;">
+			<notempty name="_extra_menu">
+				{// 动态扩展菜单 //} {:extra_menu($_extra_menu,$__MENU__)}
+			</notempty>
+			<volist name="__MENU__.child" id="sub_menu">
+				<!-- 子导航 -->
+				<notempty name="sub_menu">
+					<notempty name="key"><h3><i class="icon icon-unfold"></i>{$key}</h3></notempty>
+					<ul class="side-sub-menu">
+						<volist name="sub_menu" id="menu">
+							<li>
+								<a class="item" href="{$menu.url|U}">
+									<empty name="menu.ico_name">
+										<span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
+										<else/>
+										<span class="glyphicon glyphicon-{$menu.ico_name}" aria-hidden="true"></span>
+									</empty>
+									{$menu.title}
+								</a>
+							</li>
+						</volist>
+					</ul>
+					_
+					    <div>
+				         <audio  id="remind">
+				            <source src="__PUBLIC__/Admin/images/5f71a0c7a5c27778.mp3"  type="audio/mpeg">
+				          </audio>
+				        </div>
+				</notempty>
+				<!-- /子导航 -->
+			</volist>
+		</div>
+	</block>
+	<!-- /子导航 -->
+</div>
+<!-- /边栏 -->
+<script type="text/javascript">
+    $(function(){
+        setInterval("tzfc()",5000);
+    });
+  
+    function tzfc(){
+   
+        var st = 1;
+         $.post("{:U('Admin/Trade/getmyzrtz')}",
+                {'st':st},
+        function(data){
+            if(data.code == 1){
+                var audio = document.getElementById('remind')
+		        audio.play()
+            }   
+        });
+        $.post("{:U('Admin/Trade/gethyorder')}",
+        {'st':st},
+        function(data){
+            if(data.code == 1){
+                layer.confirm('有新的合约订单', {
+                  btn: ['知道了'] //按钮
+                }, function(){
+                    
+                    $.post("{:U('Admin/Trade/settzstatus')}",
+                    function(data){
+                        if(data.code == 1){
+                            window.location.reload();  
+                        } 
+                    });
+                });
+            }   
+        });
+        
+         
+       
+    }
+</script>
+
+
+
+<eq name="versionUp" value="1">
+	<script type="text/javascript" charset="utf-8">
+		/**顶部警告栏*/
+		var top_alert = $('#top-alerta');
+		top_alert.find('.close').on('click', function () {
+			top_alert.removeClass('block').slideUp(200);
+			// content.animate({paddingTop:'-=55'},200);
+		});
+	</script>
+</eq>

+ 103 - 0
Application/Admin/View/Public/list.html

@@ -0,0 +1,103 @@
+<include file="Public:header"/>
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h" style="font-size: 24px;">
+			<span class="h1-title">{$title|htmlspecialchars}</span>
+			<if condition="$suggest">({$suggest|htmlspecialchars})</if>
+			<present name="Think.get.name">
+				11<i class="ca"></i>[<a href="{$titleList['url']}"> {$titleList['title']|htmlspecialchars}</a> ]
+			</present>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<present name="buttonList['add']">
+					<a class="btn add-btn btn-success" href="{$buttonList['add']['url']}">{$buttonList['add']['title']}</a>
+				</present>
+				<present name="buttonList['resume']">
+					<button class="btn ajax-post btn-info" url="{$buttonList['resume']['url']}" target-form="ids">{$buttonList['resume']['title']}</button>
+				</present>
+				<present name="buttonList['forbid']">
+					<button class="btn ajax-post btn-warning" url="{$buttonList['forbid']['url']}" target-form="ids">{$buttonList['forbid']['title']}</button>
+				</present>
+				<present name="buttonList['delete']">
+					<button class="btn ajax-post confirm delete-btn btn-danger" url="{$buttonList['delete']['url']}" target-form="ids">{$buttonList['delete']['title']}</button>
+				</present>
+			</div>
+			<div class="search-form fr cf">
+				<div class="sleft">
+					<form action="{$searchPostUrl||default='__SELF__'}" name="formSearch" id="formSearch" method="get" name="form1">
+						<volist name="searches" id="search">
+							<if condition="$search['type'] == 'select'">
+								<select size="1" name="{$search['name']}" class="search-input form-control form-input-width" style="height: 32px; font-size: 14px; width: 110px; float: left; margin-right: 5px;" name="field">
+									<volist name="search['attr']" id="svo">
+										<php>$search_name=isset($_GET[$search['name']])?$_GET[$search['name']]:''</php>
+										<option value="{$key}"
+										<eq name="key" value="$search_name">selected</eq>
+										>{$svo}</option>
+									</volist>
+								</select>
+								<elseif condition="$search['type'] == 'time'"/>
+								<input type="text" class="search-input input-1x" name="{$search.name}" value="{:I($search['name'])}" placeholder="{$search.attr}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"></td>
+								<else/>
+								<input type="text" name="{$search.name}" class="search-input" value="{:I($search['name'])}" placeholder="{$search.attr}" style="width: 150px">
+								<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a></if>
+						</volist>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<!-- 数据表格 -->
+		<if condition="$keyList">
+			<div class="data-table table-striped">
+				<table class="">
+					<thead>
+					<tr>
+						<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+						<volist name="keyList" id="field">
+							<th>{$field.title|htmlspecialchars}</th>
+						</volist>
+					</tr>
+					</thead>
+					<tbody>
+					<notempty name="list">
+						<volist name="list" id="e">
+							<tr>
+								<td><input class="ids" type="checkbox" name="id[]" value="{$e['id']}"/></td>
+								<volist name="keyList" id="field">
+									<td class="text-ellipsis">{$e[$field['name']]}</td>
+								</volist>
+							</tr>
+						</volist>
+						<else/>
+						<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+					</tbody>
+				</table>
+				<div class="page">
+					<div>{$pagination}</div>
+				</div>
+			</div>
+		</if>
+	</div>
+</div>
+<include file="Public:footer"/>

+ 96 - 0
Application/Admin/View/Tools/cache.html

@@ -0,0 +1,96 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">清理缓存</span>
+		</div>
+		<block name="body">
+			<div class="container-span">
+				<div class="span4" style="margin: 0 0px;width: 100%;">
+					<div class="columns-mod">
+						<div class="hd cf">
+							<h5>系统信息</h5>
+						</div>
+						<div class="bd">
+							<div class="sys-info">
+								<table>
+									<tr>
+										<td>当前缓存数据大小:{$cacheSize}KB</td>
+										<td><div id="loader"></div></td>
+									</tr>
+									<tr>
+										<td><button class="btn" onclick="animateFunc();">清理</button></td>
+									</tr>
+								</table>
+							</div>
+						</div>
+						<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.percentageloader-0.1.min.js"></script>
+						<script type="text/javascript">
+							var $loader;
+							var totalKb = '{$cacheSize}';
+							var kb = 0;
+							var clearCacheFlag = 0;
+							$loader  = $("#loader").percentageLoader({
+								width : 200,
+								height : 200,
+								progress : 0
+							});
+							function animateFunc() {
+								kb += 17;
+								if (kb > totalKb) {
+									kb = totalKb;
+								}
+								$loader.setProgress(kb / totalKb);
+								$loader.setValue(kb.toString() + 'kb');
+								if((kb/totalKb) > 0.98 && clearCacheFlag == 0){
+									clearCacheFlag = 1;
+									clearCache();
+								}
+								if (kb < totalKb) {
+									setTimeout(animateFunc, 25);
+								}
+							}
+
+							function clearCache(){
+								$.get('/Admin/Tools/delcache').success(function(data){
+									if (data.status==1) {
+										if (data.url) {
+											updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
+										}else{
+											updateAlert(data.info+ ' 页面即将自动跳转~','alert-success');
+										}
+										setTimeout(function(){
+											if (data.url) {
+												location.href=data.url;
+											}else if( $(this).hasClass('no-refresh')){
+												$('#top-alert').find('button').click();
+											}else{
+												location.reload();
+											}
+										},1500);
+									}else{
+										updateAlert(data.info);
+										setTimeout(function(){
+											if (data.url) {
+												location.href=data.url;
+											}else{
+												$('#top-alert').find('button').click();
+											}
+										},1500);
+									}
+								});
+							}
+						</script>
+					</div>
+				</div>
+			</div>
+		</block>
+	</div>
+</div>
+
+<!-- /内容区 -->
+<include file="Public:footer" />

+ 92 - 0
Application/Admin/View/Tools/delcahe.html

@@ -0,0 +1,92 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<block name="body">
+		<div class="container-span">
+			<div class="span4">
+				<div class="columns-mod">
+					<div class="hd cf">
+						<h5>系统信息</h5>
+						<div class="title-opt">当前缓存数据大小:{$cacheSize}KB</div>
+					</div>
+					<div class="bd">
+						<div class="sys-info">
+							<table>
+								<tr>
+									<th><button class="btn" onclick="animateFunc();">清理</button></th>
+									<td><div id="loader"></div></td>
+								</tr>
+							</table>
+						</div>
+					</div>
+					<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.percentageloader-0.1.min.js"></script>
+					<script type="text/javascript">
+							var $loader;
+							var totalKb = '{$cacheSize}';
+							var kb = 0;
+							var clearCacheFlag = 0;
+							$loader  = $("#loader").percentageLoader({
+								width : 200,
+								height : 200,
+								progress : 0
+							});
+							function animateFunc() {
+								kb += 17;
+								if (kb > totalKb) {
+									kb = totalKb;
+								}
+								$loader.setProgress(kb / totalKb);
+								$loader.setValue(kb.toString() + 'kb');
+								if((kb/totalKb) > 0.98 && clearCacheFlag == 0){
+									clearCacheFlag = 1;
+									clearCache();
+								}
+								if (kb < totalKb) {
+									setTimeout(animateFunc, 25);
+								}
+							}
+
+							function clearCache(){
+								$.get('/Admin/Tools/delcache').success(function(data){
+									if (data.status==1) {
+										if (data.url) {
+											updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
+										}else{
+											updateAlert(data.info,'alert-success');
+										}
+										setTimeout(function(){
+											if (data.url) {
+												location.href=data.url;
+											}else if( $(that).hasClass('no-refresh')){
+												$('#top-alert').find('button').click();
+											}else{
+												location.reload();
+											}
+										},1500);
+									}else{
+										updateAlert(data.info);
+										setTimeout(function(){
+											if (data.url) {
+												location.href=data.url;
+											}else{
+												$('#top-alert').find('button').click();
+											}
+										},1500);
+									}
+								});
+							}
+					</script>
+
+				</div>
+			</div>
+		</div>
+		</block>
+	</div>
+</div>
+
+<!-- /内容区 -->
+<include file="Public:footer" />

+ 132 - 0
Application/Admin/View/Tools/export.html

@@ -0,0 +1,132 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">数据备份</span>
+		</div>
+
+		<div class="cf">
+			<div class="fl">
+				<a id="export" class="btn" href="javascript:;" autocomplete="off">立即备份</a>
+				<a id="optimize" class="btn" href="{:U('Tools/optimize')}">优化表</a>
+				<a id="repair" class="btn" href="{:U('Tools/repair')}">修复表</a>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<form id="export-form" method="post" action="{:U('Tools/export')}">
+				<table>
+					<thead>
+						<tr>
+							<th width="48"><input class="check-all" type="checkbox" value="" checked="checked"></th>
+							<th>表名</th>
+							<th width="120">数据量</th>
+							<th width="120">数据大小</th>
+							<th width="160">创建时间</th>
+							<th width="160">备份状态</th>
+							<th width="">操作</th>
+						</tr>
+					</thead>
+					<tbody>
+						<volist name="list" id="table">
+						<tr>
+							<td class="num"><input class="ids" type="checkbox" name="tables[]" value="{$table.name}" checked="checked"></td>
+							<td>{$table.name}</td>
+							<td>{$table.rows}</td>
+							<td>{$table.data_length|format_bytes}</td>
+							<td>{$table.create_time}</td>
+							<td class="info">未备份</td>
+							<td class="action">
+								<a class="no-refresh btn-success btn-xs" href="{:U('Tools/excel?tables='.$table['name'])}">导出表</a> |
+								<a class="ajax-get no-refresh btn-info btn-xs" href="{:U('Tools/optimize?tables='.$table['name'])}">优化表</a> |
+								<a class="ajax-get no-refresh btn-warning btn-xs" href="{:U('Tools/repair?tables='.$table['name'])}">修复表</a>
+							</td>
+						</tr>
+						</volist>
+					</tbody>
+				</table>
+			</form>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	(function($){
+		var $form=$("#export-form"),$export=$("#export"),tables
+		$optimize=$("#optimize"),$repair=$("#repair");
+		$optimize.add($repair).click(function(){
+			$.post(this.href,$form.serialize(),function(data){
+				if(data.status){
+					updateAlert(data.info,'alert-success');
+				}else{
+					updateAlert(data.info,'alert-error');
+				}
+				setTimeout(function(){
+					$('#top-alert').find('button').click();
+					$(that).removeClass('disabled').prop('disabled',false);
+				},1500);
+			},"json");
+			return false;
+		});
+		$export.click(function(){
+			$export.parent().children().addClass("disabled");
+			$export.html("正在发送备份请求...");
+			$.post($form.attr("action"),$form.serialize(),function(data){
+				if(data.status){
+					tables=data.tables;
+					$export.html(data.info+"开始备份,请不要关闭本页面!");
+					backup(data.tab);
+					window.onbeforeunload=function(){
+						return "正在备份数据库,请不要关闭!"
+					}
+				}else{
+					updateAlert(data.info,'alert-error');
+					$export.parent().children().removeClass("disabled");
+					$export.html("立即备份");
+					setTimeout(function(){
+						$('#top-alert').find('button').click();
+						$(that).removeClass('disabled').prop('disabled',false);
+					},1500);
+				}
+			},"json");
+			return false;
+		});
+		function backup(tab,status){
+			status&&showmsg(tab.id,"开始备份...(0%)");
+			$.get($form.attr("action"),tab,function(data){
+				if(data.status){
+					//alert(tab.id + '|' +data.info);
+					showmsg(tab.id,data.info);
+					if(!$.isPlainObject(data.tab)){
+						$export.parent().children().removeClass("disabled");
+						$export.html("备份完成,点击重新备份");
+						window.onbeforeunload=function(){
+							return null
+						}
+						return;
+					}
+					backup(data.tab,tab.id!=data.tab.id);
+				}else{
+					updateAlert(data.info,'alert-error');
+					$export.parent().children().removeClass("disabled");
+					$export.html("立即备份");
+					setTimeout(function(){
+						$('#top-alert').find('button').click();
+						$(that).removeClass('disabled').prop('disabled',false);
+					},1500);
+				}
+			},"json");
+		}
+		function showmsg(id,msg){
+			$form.find("input[value="+tables[id]+"]").closest("tr").find(".info").html(msg);
+		}
+	})(jQuery);
+</script>
+<script type="text/javascript">
+	//主导航高亮
+	$('.index-box').addClass('current');
+	$('.index-export').addClass('current');
+</script>
+<include file="Public:footer" />

+ 94 - 0
Application/Admin/View/Tools/import.html

@@ -0,0 +1,94 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">数据还原</span>
+        </div>
+
+		<div class="data-table table-striped">
+			<table>
+            <thead>
+                <tr>
+                    <th width="200">备份名称</th>
+                    <th width="80">卷数</th>
+                    
+                    <th width="80">数据大小</th>
+                    <th width="200">备份时间</th>
+                    <th>状态</th>
+                    <th width="120">操作</th>
+                </tr>
+            </thead>
+            <tbody>
+                <volist name="list" id="data">
+                    <tr>
+                        <td>{$data.time|date='Ymd-His',###}</td>
+                        <td>{$data.part}</td>
+                       
+                        <td>{$data.size}</td>
+                        <td>{$data.key}</td>
+                        <td>-</td>
+                        <td class="action">
+                            <a class=" btn-xs btn-info"  href="{:U('Tools/xiazai')}?file={$data.time|date='Ymd-His',###}-1.sql.gz">下载</a>
+
+
+                            <a class="db-import  btn-primary btn-xs" href="{:U('Tools/import?time='.$data['time'])}">还原</a>
+                          <a class="ajax-get confirm btn-danger btn-xs" href="{:U('Tools/del?time='.$data['time'])}">删除</a>
+                        </td>
+                    </tr>
+                </volist>
+            </tbody>
+        </table>
+			
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+        $(".db-import").click(function(){
+            var self = this, status = ".";
+            $.get(self.href, success, "json");
+            window.onbeforeunload = function(){ return "正在还原数据库,请不要关闭!" }
+            return false;
+        
+            function success(data){
+                if(data.status){
+                    if(data.gz){
+                        data.info += status;
+                        if(status.length === 5){
+                            status = ".";
+                        } else {
+                            status += ".";
+                        }
+                    }
+                    $(self).parent().prev().text(data.info);
+                    if(data.part){
+                        $.get(self.href, 
+                            {"part" : data.part, "start" : data.start}, 
+                            success, 
+                            "json"
+                        );
+                    }  else {
+                        window.onbeforeunload = function(){ return null; }
+                    }
+                } else {
+                    updateAlert(data.info,'alert-error');
+                }
+            }
+        });
+    </script>
+
+
+<script type="text/javascript">
+	//主导航高亮
+	$('.index-box').addClass('current');
+	$('.index-import').addClass('current');
+</script>
+<include file="Public:footer" />
+
+
+
+
+

+ 100 - 0
Application/Admin/View/Tools/qianbao.html

@@ -0,0 +1,100 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">钱包检查</span>
+		</div>
+		<block name="body">
+		<div class="container-span">
+			<div class="span4" style="margin: 0 0px;width: 100%;">
+				<div class="columns-mod">
+					<div class="hd cf">
+						<h5>检查钱包状态</h5>
+					</div>
+					<div class="bd">
+						<div class="sys-info">
+							<table id="qianbao_table">
+								<tr>
+									<th><button class="btn" onclick="start_chk_qianbao();">检查钱包</button></th>
+									<td><div id="loader"></div></td>
+								</tr>
+							</table>
+						</div>
+					</div>
+					<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.percentageloader-0.1.min.js"></script>
+					<script type="text/javascript">
+							var $loader;
+							var totalKb = '{$cacheSize}';
+							var kb = 0;
+							var clearCacheFlag = 0;
+							var list_len = '{$list_len}';
+							$loader  = $("#loader").percentageLoader({
+								width : 200,
+								height : 200,
+								progress : 0
+							});
+							$loader.setValue('检查');
+
+							function init(){
+								$('#qianbao_table').html('<tr> <th><button class="btn" onclick="start_chk_qianbao();">检查钱包</button></th> <td><div id="loader"></div></td> </tr>');
+								$loader  = $("#loader").percentageLoader({
+									width : 200,
+									height : 200,
+									progress : 0
+								});
+								$loader.setValue('检查');
+							}
+
+							var lock_click = 0;
+							var first = 1;
+							function start_chk_qianbao(){
+								if(lock_click){
+									layer.msg('点击太频繁...');
+									return;
+								}
+								lock_click = 1;
+								if(!first){
+									init();
+								}
+								first = 0;
+								request(-1);
+							}
+
+							function request(id){
+								$loader.setProgress((id +1 )/ list_len);
+								$loader.setValue('检查第' + id + '个');
+
+
+								console.log(id);
+								$.getJSON('/Admin/Tools/qianbao',{id:id}).success(function(data){
+								/*	console.log(data);*/
+									if(data.status ===1){
+										$('#qianbao_table').append('<tr><td colspan="2" style="color: green">'+data.info+'</td></tr>');
+										request(++id);
+									}else if(data.status === -1){
+										$('#qianbao_table').append('<tr><td colspan="2" style="color: yellowgreen;font-weight: bold">'+data.info+'</td></tr>');
+										request(++id);
+									}else if(data.status == -2){
+										$('#qianbao_table').append('<tr><td colspan="2" style="color: red;font-weight: bold">'+data.info+'</td></tr>');
+										request(++id);
+									}else if(data.status == 100){
+										lock_click = 0;
+										$('#qianbao_table').append('<tr><td colspan="2">'+data.info+'</td></tr>');
+									}
+								});
+							}
+					</script>
+
+				</div>
+			</div>
+		</div>
+		</block>
+	</div>
+</div>
+
+<!-- /内容区 -->
+<include file="Public:footer" />

+ 39 - 0
Application/Admin/View/Tools/queue.html

@@ -0,0 +1,39 @@
+<include file="Public:header" />
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+
+		<div class="main-title-h">
+			<span class="h1-title">服务器队列</span>
+		</div>
+
+
+		<block name="body">
+		<div class="container-span">
+			<div class="span4" style="margin: 0 0px;width: 100%;">
+				<div class="columns-mod">
+					<div class="hd cf">
+						<h5>队列信息</h5>
+					</div>
+					<div class="bd">
+						<div class="sys-info">
+							<table>
+								<tr>
+									<th>{$str}</th>
+									<td>{$status}</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+		</block>
+	</div>
+</div>
+
+<!-- /内容区 -->
+<include file="Public:footer" />

+ 70 - 0
Application/Admin/View/Trade/bbsetting.html

@@ -0,0 +1,70 @@
+<include file="Public:header" />
+
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">币币交易参数设置</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Trade/bbsetting')}" method="post" class="form-horizontal" >
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">合约开市时间 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="bb_kstime" value="{$info['bb_kstime']}"></p>
+									    <p style="color:red;">填写格式如:00:00~24:00</p>
+									</td>
+
+								</tr>
+
+
+                                <input type="hidden" name="bbid" value="{$info['id']}" />
+
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class= "btn submit-btn ajax-post"  target-form="form-horizontal" id="submit" type="submit">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+<script type="text/javascript">
+	$(function(){
+		//主导航高亮
+		$('.config-box').addClass('current');
+		//边导航高亮
+		$('.config-contact').addClass('current');
+	});
+</script>
+
+<include file="Public:footer" />

+ 149 - 0
Application/Admin/View/Trade/bbsjlist.html

@@ -0,0 +1,149 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">币币交易市价交易订单</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Trade/bbsjlist')}'">初始化搜索</a>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="type" class="form-control">
+							<option value=""
+							<empty name="Think.get.type">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.type" value="1">selected</eq>
+							>购买</option>
+							<option value="2"
+							<eq name="Think.get.type" value="2">selected</eq>
+							>出售</option>
+						</select>
+						
+						<select style="width: 120px; float: left; margin-right: 10px;" name="status" class="form-control">
+							<option value=""
+							<empty name="Think.get.status">selected</empty>
+							>交易状态</option>
+							<option value="1"
+							<eq name="Think.get.status" value="1">selected</eq>
+							>委托中</option>
+							<option value="2"
+							<eq name="Think.get.status" value="2">selected</eq>
+							>已完成</option>
+						</select>
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">交易额度</th>
+					<th class="">USDT额度</th>
+					<th class="">交易价格</th>
+					<th class="">委托时间</th>
+					<th class="">交易时间</th>
+					<th class="">手续费比例</th>
+					<th class="">手续费</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td>{$vo.id}</td>
+						<td>{$vo.account}</td>
+						<td>{$vo.symbol}</td>
+						<td>
+						    <if condition="$vo.type eq 1">
+						        <span style="color:#0ecb81;">购买</span>
+						    <elseif condition="$vo.type eq 2" />
+						        <span style="color:#f5465c;">出售</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 1">
+						        <span style="color:#707A8A;">委托中</span>
+						    <elseif condition="$vo.status eq 2" />
+						        <span style="color:#0ecb81;">已交易</span>
+						    </if>
+						</td>
+						<td>{$vo.coinnum}</td>
+						<td>{$vo.usdtnum}</td>
+						<td>{$vo.price}</td>
+						<td>{$vo.addtime}</td>
+						<td>{$vo.tradetime}</td>
+						<td><?php echo ($vo['sxfbl'] / 100);?>%</td>
+						<td>{$vo.fee}</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+    function setwinloss(id){
+        var id  = id;
+        var kongyk = $("#kongyk").val();
+        $.post("{:U('Trade/setwinloss')}",
+        {'id':id,'kongyk':kongyk},
+        function(data){
+            if(data.code == 1){
+                alert(data.info);
+                setTimeout(function(){
+                    window.location.reload();
+                },2000);
+            }else{
+                alert(data.info);
+                setTimeout(function(){
+                    window.location.reload();
+                },2000);
+            }
+        });
+    }
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/bbsjlist')}");
+	</script>
+</block>

+ 153 - 0
Application/Admin/View/Trade/bbxjlist.html

@@ -0,0 +1,153 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">币币交易限价委托订单</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Trade/bbxjlist')}'">初始化搜索</a>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="type" class="form-control">
+							<option value=""
+							<empty name="Think.get.type">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.type" value="1">selected</eq>
+							>购买</option>
+							<option value="2"
+							<eq name="Think.get.type" value="2">selected</eq>
+							>出售</option>
+						</select>
+						
+						<select style="width: 120px; float: left; margin-right: 10px;" name="status" class="form-control">
+							<option value=""
+							<empty name="Think.get.status">selected</empty>
+							>交易状态</option>
+							<option value="1"
+							<eq name="Think.get.status" value="1">selected</eq>
+							>委托中</option>
+							<option value="2"
+							<eq name="Think.get.status" value="2">selected</eq>
+							>已完成</option>
+							<eq name="Think.get.status" value="3">selected</eq>
+							>已撤消</option>
+						</select>
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">委托额度</th>
+					<th class="">USDT额度</th>
+					<th class="">交易限价</th>
+					<th class="">交易价格</th>
+					<th class="">委托时间</th>
+					<th class="">交易时间</th>
+					<th class="">手续费比例</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td>{$vo.id}</td>
+						<td>{$vo.account}</td>
+						<td>{$vo.symbol}</td>
+						<td>
+						    <if condition="$vo.type eq 1">
+						        <span style="color:#0ecb81;">购买</span>
+						    <elseif condition="$vo.type eq 2" />
+						        <span style="color:#f5465c;">出售</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 1">
+						        <span style="color:#707A8A;">委托中</span>
+						    <elseif condition="$vo.status eq 2" />
+						        <span style="color:#0ecb81;">已交易</span>
+						    <elseif condition="$vo.status eq 3" />
+						        <span style="color:#f5465c;">已撤消</span>
+						    </if>
+						</td>
+						<td>{$vo.coinnum}</td>
+						<td>{$vo.usdtnum}</td>
+						<td>{$vo.xjprice}</td>
+						<td>{$vo.price}</td>
+						<td>{$vo.addtime}</td>
+						<td>{$vo.tradetime}</td>
+						<td><?php echo ($vo['sxfbl'] / 100);?>%</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+    function setwinloss(id){
+        var id  = id;
+        var kongyk = $("#kongyk").val();
+        $.post("{:U('Trade/setwinloss')}",
+        {'id':id,'kongyk':kongyk},
+        function(data){
+            if(data.code == 1){
+                alert(data.info);
+                setTimeout(function(){
+                    window.location.reload();
+                },2000);
+            }else{
+                alert(data.info);
+                setTimeout(function(){
+                    window.location.reload();
+                },2000);
+            }
+        });
+    }
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/bbxjlist')}");
+	</script>
+</block>

+ 103 - 0
Application/Admin/View/Trade/comment.html

@@ -0,0 +1,103 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">币种评论</span>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<button class="btn ajax-post confirm btn-danger " url="{:U('Trade/commentStatus',array('type'=>'del'))}" target-form="ids">删 除
+				</button>
+			</div>
+			<div class="search-form fr cf">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 160px; float: left; margin-right: 10px;" name="coinname" class="form-control">
+							<option value=""
+							<empty name="Think.get.coinname">selected</empty>
+							>交易币种</option>
+							<volist name="C['coin']" id="vo">
+								<option value="{$vo['name']}"
+								<eq name="vo['name']" value="$Think.get.coinname">selected</eq>
+								>{$vo['title']}</option>
+							</volist>
+						</select>
+						<select style=" width: 160px; float: left; margin-right: 10px;" name="field" class="form-control">
+							<option value="username"
+							<eq name="Think.get.field" value="username">selected</eq>
+							>用户名</option>
+						</select>
+						<input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">用户名</th>
+					<th class="">币种</th>
+					<th class="">内容</th>
+					<th class="">超级赞</th>
+					<th class="">太中庸</th>
+					<th class="">瞎扯淡</th>
+					<th class="">时间</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+
+							<td>{$vo['username']}</td>
+							<td>{$vo['coinname']}</td>
+							<td>{$vo['content']}</td>
+							<td>{$vo['cjz']}</td>
+							<td>{$vo['tzy']}</td>
+							<td>{$vo['xcd']}</td>
+							<td>{$vo.addtime|addtime}</td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/comment')}");
+	</script>
+</block>

+ 121 - 0
Application/Admin/View/Trade/hylog.html

@@ -0,0 +1,121 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">合约订单平仓记录</span>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<input type="text" name="invit" class="search-input form-control" value="<?php if(isset($_GET['invit'])){ echo $_GET['invit'];}?>" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">委托额度</th>
+					<th class="">建仓单价</th>
+					<th class="">平仓单价</th>
+					<th class="">建仓时间</th>
+					<th class="">盈亏金额</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+						<td>{$vo.id}</td>
+						<td>{$vo.username}</td>
+						<td>{$vo.coinname}</td>
+						<td>
+						    <if condition="$vo.hyzd eq 1">
+						        <span style="color:#0ecb81;">买涨</span>
+						    <elseif condition="$vo.hyzd eq 2" />
+						        <span style="color:#f5465c;">买跌</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 1">
+						        <span style="color:#707A8A;">待结算</span>
+						    <elseif condition="$vo.status eq 2" />
+						        <span style="color:#0ecb81;">已完成</span>
+						    <elseif condition="$vo.status eq 3" />
+						        <span style="color:#f5465c;">无效</span>
+						    </if>
+						</td>
+						<td>{$vo.num}</td>
+						<td>{$vo.buyprice}</td>
+						<td>
+						    <if condition="$vo.is_win eq 0">
+						        <span style="color:#707A8A;">{$vo.sellprice}</span>    
+						    <elseif condition="$vo.is_win eq 1" />  
+						        <span style="color:#0ecb81;">{$vo.sellprice}</span>
+						    <elseif condition="$vo.is_win eq 2" />
+						        <span style="color:#f5465c;">{$vo.sellprice}</span>
+						    </if>
+						</td>
+						
+						<td>{$vo.buytime}</td>
+						<td>
+						    <if condition="$vo.is_win eq 0">
+						        <span style="color:#707A8A;">{$vo.ploss}</span>    
+						    <elseif condition="$vo.is_win eq 1" />  
+						        <span style="color:#0ecb81;">+{$vo.ploss}</span>
+						    <elseif condition="$vo.is_win eq 2" />
+						        <span style="color:#f5465c;">-{$vo.ploss}</span>
+						    </if>
+						</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/hylog')}");
+	</script>
+</block>

+ 169 - 0
Application/Admin/View/Trade/index.html

@@ -0,0 +1,169 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">合约订单列表</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Trade/index')}'">初始化搜索</a>
+			<span class="h1-title" style="color:red;">如果用户ID被指定盈亏,不受单控影响</span>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="hyzd" class="form-control">
+							<option value=""
+							<empty name="Think.get.hyzd">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.hyzd" value="1">selected</eq>
+							>买涨</option>
+							<option value="2"
+							<eq name="Think.get.hyzd" value="2">selected</eq>
+							>买跌</option>
+						</select>
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">委托额度</th>
+					<th class="">建仓单价</th>
+					<th class="">平仓单价</th>
+					<th class="">建仓时间</th>
+					<th class="">盈亏金额</th>
+					<th class="">单控操作</th>
+					<th class="">详情</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+						<td>{$vo.id}</td>
+						<td>{$vo.username}</td>
+						<td>{$vo.coinname}</td>
+						<td>
+						    <if condition="$vo.hyzd eq 1">
+						        <span style="color:#0ecb81;">买涨</span>
+						    <elseif condition="$vo.hyzd eq 2" />
+						        <span style="color:#f5465c;">买跌</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 1">
+						        <span style="color:#707A8A;">待结算</span>
+						    <elseif condition="$vo.status eq 2" />
+						        <span style="color:#0ecb81;">已完成</span>
+						    <elseif condition="$vo.status eq 3" />
+						        <span style="color:#f5465c;">无效</span>
+						    </if>
+						</td>
+						<td>{$vo.num}</td>
+						<td>{$vo.buyprice}</td>
+						<td>
+						    <if condition="$vo.is_win eq 0">
+						        <span style="color:#707A8A;">{$vo.sellprice}</span>    
+						    <elseif condition="$vo.is_win eq 1" />  
+						        <span style="color:#0ecb81;">{$vo.sellprice}</span>
+						    <elseif condition="$vo.is_win eq 2" />
+						        <span style="color:#f5465c;">{$vo.sellprice}</span>
+						    </if>
+						</td>
+						
+						<td>{$vo.buytime}</td>
+						<td>
+						    <if condition="$vo.is_win eq 0">
+						        <span style="color:#707A8A;">{$vo.ploss}</span>    
+						    <elseif condition="$vo.is_win eq 1" />  
+						        <span style="color:#0ecb81;">+{$vo.ploss}</span>
+						    <elseif condition="$vo.is_win eq 2" />
+						        <span style="color:#f5465c;">-{$vo.ploss}</span>
+						    </if>
+						</td>
+						<td>
+						    <select name="kongyk" class="kongyk_{$vo.id}"  style="width:60px;" onchange="setwinloss({$vo.id});">
+						        <option value="0" <?php if($vo['kongyk'] == 0){?>selected<?php }?>>正常</option>
+						        <option value="1" <?php if($vo['kongyk'] == 1){?>selected<?php }?>>盈利</option>
+						        <option value="2" <?php if($vo['kongyk'] == 2){?>selected<?php }?>>亏损</option>
+						    </select>
+						</td>
+						<td>
+						    <a href="{:U('Trade/orderinfo')}?id={$vo.id}">查看</a>
+						</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script type="text/javascript">
+    function setwinloss(id){
+        var id  = id;
+        var classname = ".kongyk_" + id;
+        var kongyk = $(classname).val();
+        $.post("{:U('Trade/setwinloss')}",
+        {'id':id,'kongyk':kongyk},
+        function(data){
+            if(data.code == 1){
+                alert(data.info);
+                setTimeout(function(){
+                    //window.location.reload();
+                },2000);
+            }else{
+                alert(data.info);
+                setTimeout(function(){
+                    //window.location.reload();
+                },2000);
+            }
+        });
+    }
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/index')}");
+	</script>
+</block>

+ 127 - 0
Application/Admin/View/Trade/market.html

@@ -0,0 +1,127 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">交易市场</span>
+        </div>
+
+        <div class="cf">
+            <div class="fl">
+                <a class="btn btn-success " href="{:U('Trade/marketEdit')}">新 增</a>
+                <button class="btn ajax-post btn-info"
+                        url="{:U('Trade/marketStatus',array('type'=>'resume'))}" target-form="ids">启 用
+                </button>
+                <button class="btn ajax-post btn-warning "
+                        url="{:U('Trade/marketStatus',array('type'=>'forbid'))}" target-form="ids">禁 用
+                </button>
+                <button class="btn ajax-post confirm btn-danger "
+                        url="{:U('Trade/marketStatus',array('type'=>'del'))}" target-form="ids">删 除
+                </button>
+            </div>
+            <div class="search-form fr cf">
+                <div class="sleft">
+                    <form name="formSearch" id="formSearch" method="get" name="form1" >
+                        <select style=" width: 160px; float: left; margin-right: 10px;" name="field" class="form-control">
+                            <option value="name"
+                            <eq name="Think.get.field" value="name">selected</eq>
+                            >市场名</option>
+                        </select>
+                        <input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+                        <a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+                    </form>
+                    <script>
+                        //搜索功能
+                        $(function () {
+                            $('#search').click(function () {
+                                $('#formSearch').submit();
+                            });
+                        });
+                        //回车搜索
+                        $(".search-input").keyup(function (e) {
+                            if (e.keyCode === 13) {
+                                $("#search").click();
+                                return false;
+                            }
+                        });
+                    </script>
+                </div>
+            </div>
+        </div>
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+                <tr>
+                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+                    <th class="">ID</th>
+                    <th class="">市场名称</th>
+                    <th class="">小数位数</th>
+                    <th class="">买入手续费</th>
+                    <th class="">卖出手续费</th>
+                    <!-- <th class="">买入最小交易价</th>
+                    <th class="">买入最大交易价</th>
+                    <th class="">卖出最小交易价</th>
+                    <th class="">卖出最大交易价</th> -->
+                    <th class="">是否刷单</th>
+                    <th class="">开启交易</th>
+                    <th class="">状态</th>
+                    <th class="" style="text-align: center;">操作</th>
+                </tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.name}</td>
+                            <td>{$vo.round}</td>
+                            <td>{$vo.fee_buy}</td>
+                            <td>{$vo.fee_sell}</td>
+                            <!-- <td>{$vo.buy_min}</td>
+                            <td>{$vo.buy_max}</td>
+                            <td>{$vo.sell_min}</td>
+                            <td>{$vo.sell_max}</td> -->
+                            <td>
+                                <eq name="vo.shuadan" value="1"><b style="color: #028E16;">已开启</b><else/>未启动</eq>
+                            </td>
+                            <td>
+                                <eq name="vo.trade" value="1"><b style="color: #028E16;">开启交易</b><else/>禁止交易</eq>
+                            </td>
+                            <td>
+                                <eq name="vo.status" value="1">可用
+                                    <else/>
+                                    禁用
+                                </eq>
+                            </td>
+
+                            <td style="text-align: center;">
+                                <neq name="vo.name" value="cny">
+                                    <a href="{:U('Trade/marketEdit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+                                    <a onClick="javascript:if(!confirm('此操作会清理价格不在刷单价格区间的未成交刷单订单(不包含用户订单),确认吗?'))  return  false; "   href="{:U('Trade/tradeclear?type=2&id='.$vo['id'])}" class="btn btn-info btn-xs">清理刷单(部分)</a>
+                                    <a onClick="javascript:if(!confirm('此操作会清理所有未成交刷单订单(不包含用户订单),确认吗?'))  return  false; " href="{:U('Trade/tradeclear?type=1&id='.$vo['id'])}" class="btn btn-info btn-xs">清理刷单(全部)</a>
+                                </neq>
+                            </td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+    <script type="text/javascript" charset="utf-8">
+        //导航高亮
+        highlight_subnav("{:U('Trade/market')}");
+    </script>
+</block>

+ 436 - 0
Application/Admin/View/Trade/marketEdit.html

@@ -0,0 +1,436 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('Trade/market')}">市场列表</a> >></span>
+            <span class="h1-title"><empty name="data">新增市场<else/>编辑市场</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Trade/marketEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<empty name="data['id']">
+									<tr class="controls">
+										<td class="item-label">买方币种 :</td>
+										<td><select name="buyname" class="form-control input-10x">
+											<volist name="C['coin']" id="v">
+												<option value="{$v['name']}">{$v['title']}</option>
+											</volist>
+										</select>
+										</td>
+										<td class="item-note"></td>
+									</tr>
+									<tr class="controls">
+										<td class="item-label">卖方币种 :</td>
+										<td><select name="sellname" class="form-control input-10x">
+											<volist name="C['coin']" id="v">
+												<option value="{$v['name']}">{$v['title']}</option>
+											</volist>
+										</select>
+										</td>
+										<td class="item-note"></td>
+									</tr>
+									<else/>
+									<tr class="controls">
+										<td class="item-label">市场名称 :</td>
+										<td>{$data.name}</td>
+										<td class="item-note"></td>
+									</tr>
+								</empty>
+								<tr class="controls">
+									<td class="item-label">所属交易区</td>
+									<td>
+										<select name="jiaoyiqu">
+											<volist name="getCoreConfig" id="v">
+												<option value="{$key}"
+												<eq name="data.jiaoyiqu" value="$key">
+													selected
+												</eq>
+												>{$v}</option>
+											</volist>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">小数位数:</td>-->
+<!--									<td>-->
+<!--										<input type="text" class="form-control input-10x" name="round" value="{$data.round}">-->
+<!--									</td>-->
+<!--									<td class="item-note">填1&#45;&#45;6整数,比如填3就表示3位小数</td>-->
+<!--								</tr>-->
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">买入手续费:</td>-->
+<!--									<td>-->
+<!--										<input type="text" class="form-control input-10x" name="fee_buy" value="{$data.fee_buy}">-->
+<!--									</td>-->
+<!--									<td class="item-note">%有挂单的时候不能再修改</td>-->
+<!--								</tr>-->
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">卖出手续费:</td>-->
+<!--									<td>-->
+<!--										<input type="text" class="form-control input-10x" name="fee_sell" value="{$data.fee_sell}">-->
+<!--									</td>-->
+<!--									<td class="item-note">%有挂单的时候不能再修改</td>-->
+<!--								</tr>-->
+								<tr class="controls">
+									<td class="item-label">买入最小交易价:</td>
+									<td>
+                                        <empty name="data['buy_min']">
+                                                <input type="text" class="form-control input-10x" name="buy_min" value="0.0001">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="buy_min" value="{$data.buy_min}">
+                                        </empty>
+									</td>
+									<td class="item-note">买入最小交易价 默认0.000001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">买入最大交易价:</td>
+									<td>
+                                        <empty name="data['buy_max']">
+                                                <input type="text" class="form-control input-10x" name="buy_max" value="10000000">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="buy_max" value="{$data.buy_max}">
+                                        </empty>
+									</td>
+									<td class="item-note">买入最大交易价 默认10000000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">卖出最小交易价:</td>
+									<td>
+                                        <empty name="data['sell_min']">
+                                                <input type="text" class="form-control input-10x" name="sell_min" value="0.0001">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="sell_min" value="{$data.sell_min}">
+                                        </empty>
+									</td>
+									<td class="item-note">卖出最小交易价 默认0.000001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">卖出最大交易价:</td>
+									<td>
+                                        <empty name="data['sell_max']">
+                                                <input type="text" class="form-control input-10x" name="sell_max" value="10000000">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="sell_max" value="{$data.sell_max}">
+                                        </empty>
+									</td>
+									<td class="item-note">卖出最大交易价 默认10000000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔最小交易额:</td>
+									<td>
+                                        <empty name="data['trade_min']">
+                                                <input type="text" class="form-control input-10x" name="trade_min" value="0.0001">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_min" value="{$data.trade_min}">
+                                        </empty>
+									</td>
+									<td class="item-note">单笔最小交易额 默认10000000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔最大交易额:</td>
+									<td>
+                                        <empty name="data['trade_max']">
+                                                <input type="text" class="form-control input-10x" name="trade_max" value="10000000">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_max" value="{$data.trade_max}">
+                                        </empty>
+									</td>
+									<td class="item-note">单笔最大交易额 默认10000000</td>
+								</tr>
+
+
+								<tr class="controls">
+									<td class="item-label">单笔买入最小交易数量:</td>
+									<td>
+                                        <empty name="data['trade_buy_num_min']">
+                                                <input type="text" class="form-control input-10x" name="trade_buy_num_min" value="0.0001">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_buy_num_min" value="{$data.trade_buy_num_min}">
+                                        </empty>
+									</td>
+									<td class="item-note">单笔买入最小交易量 默认0.0001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔买入最大交易数量:</td>
+									<td>
+                                        <empty name="data['trade_buy_num_max']">
+                                                <input type="text" class="form-control input-10x" name="trade_buy_num_max" value="10000000">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_buy_num_max" value="{$data.trade_buy_num_max}">
+                                        </empty>
+									</td>
+									<td class="item-note">单笔买入最大交易量 默认1000</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔卖出最小交易数量:</td>
+									<td>
+                                        <empty name="data['trade_sell_num_min']">
+                                                <input type="text" class="form-control input-10x" name="trade_sell_num_min" value="0.0001">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_sell_num_min" value="{$data.trade_sell_num_min}">
+                                        </empty>
+									</td>
+									<td class="item-note">单笔卖出最小交易量 默认0.0001</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">单笔卖出最大交易数量:</td>
+									<td>
+                                       <empty name="data['trade_sell_num_max']">
+                                                <input type="text" class="form-control input-10x" name="trade_sell_num_max" value="10000000">
+                                            <else />
+                                                <input type="text" class="form-control input-10x" name="trade_sell_num_max" value="{$data.trade_sell_num_max}">
+                                        </empty>
+									</td>
+									<td class="item-note">单笔卖出最大交易量 默认1000</td>
+								</tr>
+
+<!--								<tr class="controls" >-->
+<!--									<td class="item-label">一代赠送比例:</td>-->
+<!--									<td>-->
+<!--										<input type="text" class="form-control input-10x" name="invit_1" value="{$data.invit_1}">-->
+<!--									</td>-->
+<!--									<td class="item-note">%根据单笔交易手续费计算</td>-->
+<!--								</tr>-->
+<!--								<tr class="controls" >-->
+<!--									<td class="item-label">二代赠送比例:</td>-->
+<!--									<td>-->
+<!--										<input type="text" class="form-control input-10x" name="invit_2" value="{$data.invit_2}">-->
+<!--									</td>-->
+<!--									<td class="item-note">%根据单笔交易手续费计算</td>-->
+<!--								</tr>-->
+<!--								<tr class="controls" >-->
+<!--									<td class="item-label">三代赠送比例:</td>-->
+<!--									<td>-->
+<!--										<input type="text" class="form-control input-10x" name="invit_3" value="{$data.invit_3}">-->
+<!--									</td>-->
+<!--									<td class="item-note">%根据单笔交易手续费计算</td>-->
+<!--								</tr>-->
+<!--								<tr class="controls" >-->
+<!--									<td class="item-label">买家上家赠送 :</td>-->
+<!--									<td><select name="invit_buy" class="form-control input-10x">-->
+<!--										<option value="1"-->
+<!--										<eq name="data.invit_buy" value="1">selected</eq>-->
+<!--										>开启赠送</option>-->
+<!--										<option value="0"-->
+<!--										<eq name="data.invit_buy" value="0">selected</eq>-->
+<!--										>禁止赠送</option>-->
+<!--									</select></td>-->
+<!--									<td class="item-note"></td>-->
+<!--								</tr>-->
+<!--								<tr class="controls" >-->
+<!--									<td class="item-label">卖家上家赠送 :</td>-->
+<!--									<td><select name="invit_sell" class="form-control input-10x">-->
+<!--										<option value="1"-->
+<!--										<eq name="data.invit_sell" value="1">selected</eq>-->
+<!--										>开启赠送</option>-->
+<!--										<option value="0"-->
+<!--										<eq name="data.invit_sell" value="0">selected</eq>-->
+<!--										>禁止赠送</option>-->
+<!--									</select></td>-->
+<!--									<td class="item-note"></td>-->
+<!--								</tr>-->
+								<tr class="controls">
+									<td class="item-label">涨幅限制:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="zhang" value="{$data.zhang}">
+									</td>
+									<td class="item-note">%根据昨日最后一笔交易计算</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">跌幅限制:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="die" value="{$data.die}">
+									</td>
+									<td class="item-note">%根据昨日最后一笔交易计算</td>
+								</tr>
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">开盘交易时间 :</td>-->
+<!--									<td>-->
+<!--										<select name="start_time" class="form-control input-10x" style="width:48%;float:left;">-->
+<!--											<volist name="time_arr" id="vo" key="k">-->
+<!--												<option value="{$k-1}"-->
+<!--													<eq name="data.start_time" value="$k-1">selected</eq>-->
+<!--												>{$vo}时</option>-->
+<!--											</volist>-->
+<!--										</select>-->
+<!--										<select name="start_minute" class="form-control input-10x" style="width:48%;float:right;">-->
+<!--											<volist name="time_minute" id="vo" key="k">-->
+<!--												<option value="{$k-1}"-->
+<!--													<eq name="data.start_minute" value="$k-1">selected</eq>-->
+<!--												>{$vo}分</option>-->
+<!--											</volist>-->
+<!--										</select>-->
+<!--									</td>-->
+<!--									<td class="item-note"></td>-->
+<!--								</tr>-->
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">闭盘交易时间 :</td>-->
+<!--									<td>-->
+<!--										<select name="stop_time" class="form-control input-10x" style="width:48%;float:left;">-->
+<!--											<volist name="time_arr" id="vo" key="k">-->
+<!--												<option value="{$k-1}"-->
+<!--													<eq name="data.stop_time" value="$k-1">selected</eq>-->
+<!--												>{$vo}时</option>-->
+<!--											</volist>-->
+<!--										</select>-->
+<!--										<select name="stop_minute" class="form-control input-10x" style="width:48%;float:right;">-->
+<!--											<volist name="time_minute" id="vo" key="k">-->
+<!--												<option value="{$k-1}"-->
+<!--													<eq name="data.stop_minute" value="$k-1">selected</eq>-->
+<!--												>{$vo}分</option>-->
+<!--											</volist>-->
+<!--										</select>-->
+<!--									</td>-->
+<!--									<td class="item-note"></td>-->
+<!--								</tr>-->
+
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">周六 :</td>-->
+<!--									<td><select name="agree6" class="form-control input-10x">-->
+<!--										<option value="1"-->
+<!--										<eq name="data.agree6" value="1">selected</eq>-->
+<!--										>可交易</option>-->
+<!--										<option value="0"-->
+<!--										<eq name="data.agree6" value="0">selected</eq>-->
+<!--										>不可交易</option>-->
+<!--									</select></td>-->
+<!--									<td class="item-note"></td>-->
+<!--								</tr>-->
+
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">周日 :</td>-->
+<!--									<td><select name="agree7" class="form-control input-10x">-->
+<!--										<option value="1"-->
+<!--										<eq name="data.agree7" value="1">selected</eq>-->
+<!--										>可交易</option>-->
+<!--										<option value="0"-->
+<!--										<eq name="data.agree7" value="0">selected</eq>-->
+<!--										>不可交易</option>-->
+<!--									</select></td>-->
+<!--									<td class="item-note"></td>-->
+<!--								</tr>-->
+								<tr class="controls">
+									<td class="item-label">开启交易 :</td>
+									<td><select name="trade" class="form-control input-10x">
+										<option value="1"
+										<eq name="data.trade" value="1">selected</eq>
+										>开启交易</option>
+										<option value="0"
+										<eq name="data.trade" value="0">selected</eq>
+										>禁止交易</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td><select name="status" class="form-control input-10x">
+										<option value="1"
+										<eq name="data.status" value="1">selected</eq>
+										>可用</option>
+										<option value="0"
+										<eq name="data.status" value="0">selected</eq>
+										>禁用</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">开启刷单 :</td>
+									<td><select name="shuadan" class="form-control input-10x">
+										<option value="1"
+										<eq name="data.shuadan" value="1">selected</eq>
+										>开启</option>
+										<option value="0"
+										<eq name="data.shuadan" value="0">selected</eq>
+										>关闭</option>
+									</select></td>
+									<td class="item-note"></td>
+								</tr>
+<!--								<tr class="controls">-->
+<!--									<td class="item-label">调用外部价格 :</td>-->
+<!--									<td><select name="sdtype" class="form-control input-10x">-->
+<!--										<option value="1"-->
+<!--										<eq name="data.sdtype" value="1">selected</eq>-->
+<!--										>开启</option>-->
+<!--										<option value="0"-->
+<!--										<eq name="data.sdtype" value="0">selected</eq>-->
+<!--										>关闭</option>-->
+<!--									</select></td>-->
+<!--									<td class="item-note">使用前需修改文件代码,调用比特儿海外交易所gate.io的价格</td>-->
+<!--								</tr>-->
+								<tr class="controls">
+									<td class="item-label">发行价:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="faxingjia" value="{$data.faxingjia}">
+									</td>
+									<td class="item-note">发行价</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label">刷单上限价格:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdhigh" value="{$data.sdhigh}">
+									</td>
+									<td class="item-note">当前价:{$data.new_price}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">刷单下限价格:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdlow" value="{$data.sdlow}">
+									</td>
+									<td class="item-note">当前价:{$data.new_price}</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">刷单最高数量:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdhigh_num" value="{$data.sdhigh_num}">
+									</td>
+									<td class="item-note">刷单最高数量</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">刷单最低数量:</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="sdlow_num" value="{$data.sdlow_num}">
+									</td>
+									<td class="item-note">刷单最低数量</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交
+											</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+				<script type="text/javascript">
+				//提交表单
+				$('#submit').click(function () {
+					$('#form').submit();
+				});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/market')}");
+	</script>
+</block>

+ 137 - 0
Application/Admin/View/Trade/orderinfo.html

@@ -0,0 +1,137 @@
+<include file="Public:header" />
+
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">合约订单详情</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+							    
+							    <tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">会员账号 :</td>
+									<td style="width:200px;">
+									    <span>{$info.username}</span>
+									</td>
+								</tr>
+                                
+                                <tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约交易对 :</td>
+									<td style="width:200px;">
+									    <span>{$info.coinname}</span>
+									</td>
+								</tr>
+								
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约交易方向 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.hyzd eq 1">
+						                    <span style="color:#0ecb81;">买涨</span>
+						                <elseif condition="$info.hyzd eq 2" />
+						                    <span style="color:#f5465c;">买跌</span>
+						                </if>
+									</td>
+								</tr>
+								
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">委托额度 :</td>
+									<td style="width:200px;">
+									    <span>{$info.num}USDT</span>
+									</td>
+								</tr>
+								
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约状态 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.status eq 1">
+						                    <span style="color:#707A8A;">待结算</span>
+						                <elseif condition="$info.status eq 2" />
+						                    <span style="color:#0ecb81;">已完成</span>
+						                <elseif condition="$info.status eq 3" />
+						                    <span style="color:#f5465c;">无效</span>
+						                </if>
+									</td>
+								</tr>
+								
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">建仓单价 :</td>
+									<td style="width:200px;">
+									    <span>{$info.buyprice}</span>
+									</td>
+								</tr>
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">建仓时间 :</td>
+									<td style="width:200px;">
+									    <span>{$info.buytime}</span>
+									</td>
+								</tr>
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">平仓单价 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.is_win eq 0">
+						                    <span style="color:#707A8A;">{$info.sellprice}</span>    
+						                <elseif condition="$info.is_win eq 1" />  
+						                    <span style="color:#0ecb81;">{$info.sellprice}</span>
+						                <elseif condition="$info.is_win eq 2" />
+						                    <span style="color:#f5465c;">{$info.sellprice}</span>
+						                </if>
+									</td>
+								</tr>
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">平仓时间 :</td>
+									<td style="width:200px;">
+									    <span>{$info.selltime}</span>
+									</td>
+								</tr>
+								
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">盈亏额度 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.is_win eq 0">
+						                    <span style="color:#707A8A;">{$info.ploss}</span>    
+						                <elseif condition="$info.is_win eq 1" />  
+						                    <span style="color:#0ecb81;">+{$info.ploss}</span>
+						                <elseif condition="$info.is_win eq 2" />
+						                    <span style="color:#f5465c;">-{$info.ploss}</span>
+						                </if>
+									</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+<include file="Public:footer" />
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/index')}");
+	</script>
+</block>

+ 137 - 0
Application/Admin/View/Trade/orderinfo_ty.html

@@ -0,0 +1,137 @@
+<include file="Public:header" />
+
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">合约订单详情</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+							    
+							    <tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">会员账号 :</td>
+									<td style="width:200px;">
+									    <span>{$info.username}</span>
+									</td>
+								</tr>
+                                
+                                <tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约交易对 :</td>
+									<td style="width:200px;">
+									    <span>{$info.coinname}</span>
+									</td>
+								</tr>
+								
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约交易方向 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.hyzd eq 1">
+						                    <span style="color:#0ecb81;">买涨</span>
+						                <elseif condition="$info.hyzd eq 2" />
+						                    <span style="color:#f5465c;">买跌</span>
+						                </if>
+									</td>
+								</tr>
+								
+								<tr class="controls" style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">委托额度 :</td>
+									<td style="width:200px;">
+									    <span>{$info.num}USDT</span>
+									</td>
+								</tr>
+								
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">合约状态 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.status eq 1">
+						                    <span style="color:#707A8A;">待结算</span>
+						                <elseif condition="$info.status eq 2" />
+						                    <span style="color:#0ecb81;">已完成</span>
+						                <elseif condition="$info.status eq 3" />
+						                    <span style="color:#f5465c;">无效</span>
+						                </if>
+									</td>
+								</tr>
+								
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">建仓单价 :</td>
+									<td style="width:200px;">
+									    <span>{$info.buyprice}</span>
+									</td>
+								</tr>
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">建仓时间 :</td>
+									<td style="width:200px;">
+									    <span>{$info.buytime}</span>
+									</td>
+								</tr>
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">平仓单价 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.is_win eq 0">
+						                    <span style="color:#707A8A;">{$info.sellprice}</span>    
+						                <elseif condition="$info.is_win eq 1" />  
+						                    <span style="color:#0ecb81;">{$info.sellprice}</span>
+						                <elseif condition="$info.is_win eq 2" />
+						                    <span style="color:#f5465c;">{$info.sellprice}</span>
+						                </if>
+									</td>
+								</tr>
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">平仓时间 :</td>
+									<td style="width:200px;">
+									    <span>{$info.selltime}</span>
+									</td>
+								</tr>
+								
+								<tr class="controls"  style="height: 40px;line-height:40px;">
+									<td class="item-label" style="width:100px;">盈亏额度 :</td>
+									<td style="width:200px;">
+									    <if condition="$info.is_win eq 0">
+						                    <span style="color:#707A8A;">{$info.ploss}</span>    
+						                <elseif condition="$info.is_win eq 1" />  
+						                    <span style="color:#0ecb81;">+{$info.ploss}</span>
+						                <elseif condition="$info.is_win eq 2" />
+						                    <span style="color:#f5465c;">-{$info.ploss}</span>
+						                </if>
+									</td>
+								</tr>
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+<include file="Public:footer" />
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/tyorder')}");
+	</script>
+</block>

+ 130 - 0
Application/Admin/View/Trade/sethy.html

@@ -0,0 +1,130 @@
+<include file="Public:header" />
+
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">快速合约参数设置</span>
+		</div>
+
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('Trade/sethy')}" method="post" class="form-horizontal" >
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+                                
+                                <tr class="controls">
+									<td class="item-label" style="width:100px;">交易手续费 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_sxf" value="{$info['hy_sxf']}"></p>
+									    <p style="color:red;">注意:交易的手续费,如:10%;写成10;</p>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">合约结单时间 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_time" value="{$info['hy_time']}"></p>
+									    <p style="color:red;">注意: 如时间为:1分钟、3分钟、5分钟、30分钟,则请用字母逗号将时间分开,如输入:1,3,5,8。如没有此玩法则留空。必须为四个</p>
+									</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">合约盈亏比例 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_ykbl" value="{$info['hy_ykbl']}"></p>
+									    <p style="color:red;">注意: 如比例为:75%、77%,80%、85%,则请用字母逗号将比例分开,如输入:75,77,80,85。必须为四个,且不得为空</p>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">投资额度 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_tzed" value="{$info['hy_tzed']}"></p>
+									    <p style="color:red;">注意: 如额度为:10USDT、50USDT,100USDT、1000USDT,则请用字母逗号将比例分开,如输入:10,50,100,1000。</p>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">合约开市时间 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_kstime" value="{$info['hy_kstime']}"></p>
+									    <p style="color:red;">填写格式如:00:00~24:00</p>
+									</td>
+
+								</tr>
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">指定亏损ID :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_ksid" value="{$info['hy_ksid']}"></p>
+									    <p style="color:red;">说明: 此处设置会员ID(如:8888),多个用户用|符号分开(如:8888|9999)设置之后该会员所有订单都会亏损,请谨慎操作。如停止该功能请在上面留空或者填0,并提交。</p>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">指定盈利ID :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_ylid" value="{$info['hy_ylid']}"></p>
+									    <p style="color:red;">说明: 此处设置会员ID(如:8888),多个用户用|符号分开(如:8888|9999)设置之后该会员所有订单都会亏损,请谨慎操作。如停止该功能请在上面留空或者填0,并提交。</p>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">风控概率 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_fkgl" value="{$info['hy_fkgl']}"></p>
+									    <p style="color:red;">表示总盈利比例,填写20表示20%订单盈利,例 如同时结算10单,其中只有2单盈利</p>
+									</td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label" style="width:100px;">投资最低额度 :</td>
+									<td style="width:300px;">
+									    <p><input type="text" class="form-control input-10x" name="hy_min" value="{$info['hy_min']}"></p>
+									    <p style="color:red;">每单最低投资额度</p>
+									</td>
+								</tr>
+
+                                <input type="hidden" name="hy_id" value="{$info['id']}" />
+
+
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class= "btn submit-btn ajax-post"  target-form="form-horizontal" id="submit" type="submit">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+
+				<script type="text/javascript">
+					//提交表单
+					$('#submit').click(function(){
+						$('#form').submit();
+					});
+				</script>
+			</div>
+		</div>
+	</div>
+</div>
+
+
+<script type="text/javascript">
+	$(function(){
+		//主导航高亮
+		$('.config-box').addClass('current');
+		//边导航高亮
+		$('.config-contact').addClass('current');
+	});
+</script>
+
+<include file="Public:footer" />

+ 166 - 0
Application/Admin/View/Trade/tyorder.html

@@ -0,0 +1,166 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">体验订单列表</span>
+			<a class="btn btn-warning" onClick="location.href='{:U('Trade/tyorder')}'">初始化搜索</a>
+		</div>
+		<div class="cf">
+			<div class="search-form fr cf" style="43px;float: none !important;">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select style="width: 120px; float: left; margin-right: 10px;" name="hyzd" class="form-control">
+							<option value=""
+							<empty name="Think.get.hyzd">selected</empty>
+							>全部类型</option>
+							<option value="1"
+							<eq name="Think.get.hyzd" value="1">selected</eq>
+							>买涨</option>
+							<option value="2"
+							<eq name="Think.get.hyzd" value="2">selected</eq>
+							>买跌</option>
+						</select>
+
+						<input type="text" name="username" class="search-input form-control" value="" placeholder="请输入用户名" />
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">交易对</th>
+					<th class="">方向</th>
+					<th class="">状态</th>
+					<th class="">委托额度</th>
+					<th class="">建仓单价</th>
+					<th class="">平仓单价</th>
+					<th class="">建仓时间</th>
+					<th class="">盈亏金额</th>
+					<th class="">单控操作</th>
+					<th class="">详情</th>
+				</tr>
+				</thead>
+				<tbody>
+                    <notempty name="list">
+                    <volist name="list" id="vo">
+					<tr>
+						<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+						<td>{$vo.id}</td>
+						<td>{$vo.username}</td>
+						<td>{$vo.coinname}</td>
+						<td>
+						    <if condition="$vo.hyzd eq 1">
+						        <span style="color:#0ecb81;">买涨</span>
+						    <elseif condition="$vo.hyzd eq 2" />
+						        <span style="color:#f5465c;">买跌</span>
+						    </if>
+						</td>
+						<td>
+						    <if condition="$vo.status eq 1">
+						        <span style="color:#707A8A;">待结算</span>
+						    <elseif condition="$vo.status eq 2" />
+						        <span style="color:#0ecb81;">已完成</span>
+						    <elseif condition="$vo.status eq 3" />
+						        <span style="color:#f5465c;">无效</span>
+						    </if>
+						</td>
+						<td>{$vo.num}</td>
+						<td>{$vo.buyprice}</td>
+						<td>
+						    <if condition="$vo.is_win eq 0">
+						        <span style="color:#707A8A;">{$vo.sellprice}</span>    
+						    <elseif condition="$vo.is_win eq 1" />  
+						        <span style="color:#0ecb81;">{$vo.sellprice}</span>
+						    <elseif condition="$vo.is_win eq 2" />
+						        <span style="color:#f5465c;">{$vo.sellprice}</span>
+						    </if>
+						</td>
+						
+						<td>{$vo.buytime}</td>
+						<td>
+						    <if condition="$vo.is_win eq 0">
+						        <span style="color:#707A8A;">{$vo.ploss}</span>    
+						    <elseif condition="$vo.is_win eq 1" />  
+						        <span style="color:#0ecb81;">+{$vo.ploss}</span>
+						    <elseif condition="$vo.is_win eq 2" />
+						        <span style="color:#f5465c;">-{$vo.ploss}</span>
+						    </if>
+						</td>
+						<td>
+						    <select name="kongyk" id="kongyk" style="width:60px;" onchange="setwinloss({$vo.id});">
+						        <option value="0" <?php if($vo['kongyk'] == 0){?>selected<?php }?>>正常</option>
+						        <option value="1" <?php if($vo['kongyk'] == 1){?>selected<?php }?>>盈利</option>
+						        <option value="2" <?php if($vo['kongyk'] == 2){?>selected<?php }?>>亏损</option>
+						    </select>
+						</td>
+						<td>
+						    <a href="{:U('Trade/orderinfo_ty')}?id={$vo.id}">查看</a>
+						</td>
+					</tr>
+					</volist>
+                    <else/>
+					<td colspan="12" class="text-center empty-info">
+					    <i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据
+					</td>
+					</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+    function setwinloss(id){
+        var id  = id;
+        var kongyk = $("#kongyk").val();
+        $.post("{:U('Trade/setwinloss_ty')}",
+        {'id':id,'kongyk':kongyk},
+        function(data){
+            if(data.code == 1){
+                alert(data.info);
+                setTimeout(function(){
+                    window.location.reload();
+                },2000);
+            }else{
+                alert(data.info);
+                setTimeout(function(){
+                    window.location.reload();
+                },2000);
+            }
+        });
+    }
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('Trade/tyorder')}");
+	</script>
+</block>

+ 104 - 0
Application/Admin/View/User/admin.html

@@ -0,0 +1,104 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">管理员管理</span>
+			<notempty name="name">
+				<span class="h2-title">>><a href="{:U('User/adminUser')}">管理列表</a></span>
+			</notempty>
+		</div>
+		<div class="cf">
+			<div class="fl">
+				<a class="btn btn-success " href="{:U('User/adminEdit')}">新 增</a>
+				<button class="btn ajax-post btn-info " url="{:U('User/adminStatus',array('type'=>'resume','mobile'=>'Admin'))}" target-form="ids">启 用</button>
+				<button class="btn ajax-post btn-warning " url="{:U('User/adminStatus',array('type'=>'forbid','mobile'=>'Admin'))}" target-form="ids">禁 用</button>
+				<button class="btn ajax-post confirm btn-danger " confirm-msg="批量删除不可恢复,确定删除?" url="{:U('User/adminStatus',array('type'=>'del','mobile'=>'Admin'))}" target-form="ids">删 除</button>
+			</div>
+			<div class="search-form fr cf">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+						<select name="status" class="form-control" style="width:160px;float:left;margin-right:10px;">
+							<option value="" <empty name="Think.get.status">selected</empty>>全部状态</option>
+							<option value="1" <eq name="Think.get.status" value="1">selected</eq>>冻结状态</option>
+							<option value="2" <eq name="Think.get.status" value="2">selected</eq>>正常状态</option>
+						</select>
+						<select name="field" class="form-control" style="width:160px;float:left;margin-right:10px;">
+							<option value="username" <empty name="Think.get.field">selected</empty>>用户名</option>
+							<option value="moble" <eq name="Think.get.field" value="moble">selected</eq>>手机号码</option>
+						</select>
+						<input type="text" name="name" class="search-input form-control" value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">用户名</th>
+					<th class="">昵称</th>
+					<th class="">手机号</th>
+					<th class="">邮箱</th>
+					<th class="">状态</th>
+					<th class="">操作</th>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td>{$vo.username}</td>
+							<td>{$vo.nickname}</td>
+							<td>{$vo.moble}</td>
+							<td>{$vo.email}</td>
+							<td>
+								<eq name="vo.status" value="0">禁用</eq>
+								<eq name="vo.status" value="1">正常</eq>
+							</td>
+							<td>
+								<a href="{:U('User/adminEdit?id='.$vo['id'])}" class="btn btn-primary btn-xs">编辑</a>
+							</td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('User/admin')}");
+	</script>
+</block>

+ 87 - 0
Application/Admin/View/User/adminEdit.html

@@ -0,0 +1,87 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('User/admin')}">管理员管理</a> &gt;&gt;</span>
+             <span class="h1-title"><empty name="data">添加管理员<else/>编辑管理员</empty></span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('User/adminEdit')}" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+								<tr class="controls">
+									<td class="item-label">用户名 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="username" value="{$data.username}">
+									</td>
+									<td class="item-note">* 长度5~15位</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">昵称 :</td>
+									<td>
+										<input type="text" class="form-control input-10x" name="nickname" value="{$data.nickname}">
+									</td>
+									<td class="item-note">备注</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">登录密码 :</td>
+									<td><input type="password" class="form-control input-10x" name="password" value=""></td>
+									<td class="item-note">留空不更新</td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">手机 :</td>
+									<td><input type="text" class="form-control input-10x" name="moble" value="{$data.moble}"></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">邮箱 :</td>
+									<td><input type="text" class="form-control input-10x" name="email" value="{$data.email}"></td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">状态 :</td>
+									<td>
+										<select name="status" class="form-control input-10x">
+											<option value="1" <eq name="data.status" value="1">selected</eq>>正常</option>
+											<option value="0" <eq name="data.status" value="0">selected</eq>>冻结</option>
+										</select>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">提交</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/></notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	//提交表单
+	$('#submit').click(function () {
+		$('#form').submit();
+	});
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('User/admin')}");
+	</script>
+</block>

+ 119 - 0
Application/Admin/View/User/adminUser.html

@@ -0,0 +1,119 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">后台用户管理</span>
+            <notempty name="name">
+                <span class="h2-title">>><a href="{:U('User/adminUser')}">管理列表</a></span>
+            </notempty>
+        </div>
+
+        <div class="cf">
+            <div class="fl">
+                <a class="btn btn-success navbar-btn btn-sm" href="{:U('User/adminUserEdit')}">新 增</a>
+                <button class="btn ajax-post btn-info navbar-btn btn-sm"
+                        url="{:U('User/status',array('type'=>'resume','mobile'=>'Admin'))}" target-form="ids">启 用
+                </button>
+                <button class="btn ajax-post btn-warning navbar-btn btn-sm"
+                        url="{:U('User/status',array('type'=>'forbid','mobile'=>'Admin'))}" target-form="ids">禁 用
+                </button>
+                <button class="btn ajax-post confirm btn-danger navbar-btn btn-sm" confirm-msg="批量删除不可恢复,确定删除?"
+                        url="{:U('User/status',array('type'=>'del','mobile'=>'Admin'))}" target-form="ids">删 除
+                </button>
+            </div>
+
+
+            <div class="search-form fr cf">
+                <div class="sleft">
+                    <form name="formSearch" id="formSearch" method="get" name="form1">
+                        <select style="height: 32px; font-size: 14px; width: 100px; float: left; margin-right: 5px;"
+                                name="field">
+                            <option value="uid"
+                            <option value="username">用户名</option>
+                        </select> <input type="text" name="name" class="search-input" value="{$name}"
+                                         placeholder="查找管理员" style="width: 150px">
+                        <a class="sch-btn" href="javascript:;" id="search">
+                            <i class="btn-search"></i>
+                        </a>
+                    </form>
+                </div>
+            </div>
+        </div>
+        <div class="data-table table-striped">
+            <table class="">
+                <thead>
+                <tr>
+                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+                    <th class="">ID</th>
+                    <th class="">用户名</th>
+                    <th class="">真实姓名</th>
+                    <th class="">手机号</th>
+                    <th class="">邮箱</th>
+                    <th class="">状态</th>
+                    <th class="">操作</th>
+                </tr>
+                </thead>
+                <tbody>
+                <notempty name="list">
+                    <volist name="list" id="vo">
+                        <tr>
+                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+                            <td>{$vo.id}</td>
+                            <td>{$vo.username}</td>
+                            <td>{$vo.nickname}</td>
+                            <td>{$vo.mobile}</td>
+                            <td>{$vo.email}</td>
+                            <td>
+                                <eq name="vo.status" value="0">禁用</eq>
+                                <eq name="vo.status" value="1">正常</eq>
+                            </td>
+                            <td>
+                                <a href="{:U('User/adminUserEdit?id='.$vo['id'])}" class="btn btn-info btn-xs">编辑</a>
+                            </td>
+                        </tr>
+                    </volist>
+                    <else/>
+                    <td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+                </notempty>
+                </tbody>
+            </table>
+            <div class="page">
+                <div>{$page}</div>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    function del_adminuser() {
+        var aaa = confirm("确定要清空数据吗?");
+        alert(aaa);
+        return false;
+
+    }
+    //搜索功能
+    $(function () {
+        $('#search').click(function () {
+            $('#formSearch').submit();
+        });
+    });
+    //回车搜索
+    $(".search-input").keyup(function (e) {
+        if (e.keyCode === 13) {
+            $("#search").click();
+            return false;
+        }
+    });
+</script>
+<script type="text/javascript">
+    $(function () {
+        //主导航高亮
+        $('.user-box').addClass('current');
+        //边导航高亮
+        $('.user-index').addClass('current');
+    });
+</script>
+<include file="Public:footer"/>

+ 101 - 0
Application/Admin/View/User/adminUserEdit.html

@@ -0,0 +1,101 @@
+<include file="Public:header"/>
+<div id="main-content">
+    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
+        <button class="close fixed" style="margin-top: 4px;">&times;</button>
+        <div class="alert-content">警告内容</div>
+    </div>
+    <div id="main" class="main">
+        <div class="main-title-h">
+            <span class="h1-title">编辑后台用户</span>
+            <span class="h1-title">>><a href="{:U('User/adminUser')}">管理员列表</a></span>
+        </div>
+
+        <div class="tab-wrap">
+
+            <div class="tab-content">
+                <form id="form" action="{:U('User/adminUserEdit')}" method="post" class="form-horizontal">
+                    <div id="tab" class="tab-pane in tab">
+                        <div class="form-item cf">
+                            <table>
+                                <tr class="controls">
+                                    <td class="item-label">用户名 :</td>
+                                    <td><input type="text" class="form-control" name="username"
+                                               value="{$data.username}"></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">昵称 :</td>
+                                    <td><input type="text" class="form-control" name="nickname"
+                                               value="{$data.nickname}"></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">登录密码 :</td>
+                                    <td><input type="password" class="form-control" name="password" value=""></td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label">手机 :</td>
+                                    <td><input type="text" class="form-control" name="mobile" value="{$data.mobile}"></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">邮箱 :</td>
+                                    <td><input type="text" class="form-control" name="email" value="{$data.email}"></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+                                <tr class="controls">
+                                    <td class="item-label">状态 :</td>
+                                    <td><select name="status" class="input-small">
+                                        <option value="1"
+                                        <eq name="data.status" value="1">selected</eq>
+                                        >正常</option>
+                                        <option value="0"
+                                        <eq name="data.status" value="0">selected</eq>
+                                        >冻结</option>
+                                    </select></td>
+                                    <td class="item-note"></td>
+                                </tr>
+
+
+                                <tr class="controls">
+                                    <td class="item-label"></td>
+                                    <td>
+                                        <div class="form-item cf">
+                                            <button class="btn submit-btn ajax-post" id="submit" type="submit"
+                                                    target-form="form-horizontal">提交
+                                            </button>
+                                            <a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+                                            <notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+                                            </notempty>
+                                        </div>
+                                    </td>
+                                </tr>
+                            </table>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    //提交表单
+    $('#submit').click(function () {
+        $('#form').submit();
+    });
+</script>
+<script type="text/javascript">
+    $(function () {
+        //主导航高亮
+        $('.user-box').addClass('current');
+        //边导航高亮
+        $('.user-index').addClass('current');
+    });
+</script>
+<include file="Public:footer"/>

+ 109 - 0
Application/Admin/View/User/agent.html

@@ -0,0 +1,109 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">代理管理</span>
+		</div>
+
+		<div class="data-table table-striped">
+			<form id="form"  method="post" class="form-horizontal">
+				<table class="">
+					<thead>
+					<tr>
+						<th class="row-selected row-selected">
+							<input class="check-all" type="checkbox"/>
+						</th>
+						<th class="">ID</th>
+						<th class="">代理账号</th>
+						<th class="">注册IP/时间</th>
+						<th class="">三代总人数</th>
+						<th class="">一代人数</th>
+						<th class="">二代人数</th>
+						<th class="">三代人数</th>
+						<th class="">邀请码</th>
+						<th class="">操作</th>
+					</tr>
+					</thead>
+					<tbody>
+					<notempty name="list">
+						<volist name="list" id="vo">
+							<tr>
+								<td>
+									<input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/>
+								</td>
+								<td>{$vo.id}</td>
+								<td>{$vo.username}</a></td>
+								<td>
+								    <span>IP:{$vo.addip}</span><br />
+								    <span>时间:<?php echo date("Y-m-d H:i:s",$vo['addtime']);?></span>
+								</td>
+                                <td>{$vo.all}人</td>
+                                <td>{$vo.one}人</td>
+                                <td>{$vo.two}人</td>
+                                <td>{$vo.three}人</td>
+                                <td>{$vo.invit}</td>
+                                <td>
+						            <input type="button" class="ajax-get btn btn-danger btn-xs" value="取消代理" onclick="cancelagent('{$vo['id']}');"/>
+						            </eq>
+						        </td>
+							</tr>
+						</volist>
+						<else/>
+						<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+					</notempty>
+					</tbody>
+				</table>
+			</form>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<include file="Public:footer" />
+<script type="text/javascript">
+    function cancelagent(id) {
+        var uid = parseInt(id);
+        if (uid == "" || uid == null || uid <=0) {
+            layer.alert('参数错误!');
+            return false;
+        }
+        layer.load(0, {shade: [0.5,'#8F8F8F']});
+        $.post("{:U('User/cancelagent')}", {
+            id: uid
+        }, function (data) {
+            setTimeout("closetanchu()",2000);
+            if (data.status == 1) {
+                layer.msg(data.info, {
+                    icon: 1
+                });
+                setTimeout("shuaxin()",1000);
+            } else {
+                layer.msg(data.info, {
+                    icon: 2
+                });
+            }
+        }, "json");
+    }
+</script>
+<script type="text/javascript">
+    function closetanchu(){
+        layer.closeAll('loading');
+    }
+    function shuaxin(){
+        window.location.href=window.location.href;
+    }
+</script>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('User/agent')}");
+	</script>
+</block>
+
+

+ 121 - 0
Application/Admin/View/User/amountlog.html

@@ -0,0 +1,121 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">资金变更日志</span>
+			<div class="fr">
+				<button class="btn btn-warning" onClick="location.href='{:U('User/amountlog')}'">初始化搜索</button>
+			</div>
+		</div>
+		<div>
+			<div class="cf">
+			    <div class="fl">
+				<button class="btn ajax-post confirm btn-danger " url="{:U('User/billdel',array('type'=>'1'))}" target-form="ids">删 除</button>
+			    </div>
+				<div class="search-form fr cf" style="float: none !important;">
+					<div class="sleft">
+						<form name="formSearch" id="formSearch" method="get" name="form1">
+							<!-- 类型 -->
+							<select style="width: 80px; float: left; margin-right: 10px;" name="st" class="form-control">
+								<option value="all"
+								<eq name="Think.get.st" value="">selected</eq>
+								>加/减</option>
+								<option value="1"
+								<eq name="Think.get.st" value="1">selected</eq>
+								>增加</option>
+								<option value="2"
+								<eq name="Think.get.st" value="2">selected</eq>
+								>减少</option>
+							</select>
+							<!-- 全部资金类型 -->
+							<select style="width: 120px; float: left; margin-right: 10px;" name="coinname" class="form-control">
+								<option value=""
+								>全部币种</option>
+								<volist name="coinlist" id="vos" >
+									<option value="{$vos.name}"
+									<?php if($_GET['cointype']==$vos['name']){ echo "selected";}?>
+									>{$vos.name|strtoupper}</option>
+								</volist>
+							</select>
+
+							<input type="text" name="username" class="search-input form-control  " value="{$Think.get.username}" placeholder="请输入查询内容" style="">
+							<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+						</form>
+						<script>
+							//搜索功能
+							$(function () {
+								$('#search').click(function () {
+									$('#formSearch').submit();
+								});
+							});
+							//回车搜索
+							$(".search-input").keyup(function (e) {
+								if (e.keyCode === 13) {
+									$("#search").click();
+									return false;
+								}
+							});
+						</script>
+					</div>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+				    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th class="">会员账号</th>
+					<th class="">币种</th>
+					<th class="">变动金额</th>
+					<th class="">变动后金额</th>
+					<th class="">操作类型</th>
+					<th class="">时间</th>
+					<th class="">备注</th>
+					
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+						    <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<td>{$vo['username']}</td>
+							<td><?php echo strtoupper($vo['coinname']);?></td>
+                            <td>
+                                <if condition="$vo.st eq 1">
+                                <span style="color:green;">+{$vo.num}</span>
+                                <elseif condition="$vo.st eq 2" />
+                                <span style="color:red;">-{$vo.num}</span>
+                                </if>
+                            </td>
+                            <td>{$vo.afternum}</td>
+                            <td><?php echo gettype_info($vo['type']);?></td>
+                            <td>{$vo.addtime}</td>
+                            <td>{$vo.remark}</td>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('User/amountlog')}");
+	</script>
+</block>

+ 140 - 0
Application/Admin/View/User/authrz.html

@@ -0,0 +1,140 @@
+<include file="Public:header"/>
+<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title"><a href="{:U('User/index')}">用户管理</a> &gt;&gt;</span>
+			<span class="h1-title">认证审核</span>
+		</div>
+		<div class="tab-wrap">
+			<div class="tab-content">
+				<form id="form" action="{:U('User/upanthrz')}" method="post" class="form-horizontal">
+					<div id="tab" class="tab-pane in tab">
+						<div class="form-item cf">
+							<table>
+
+								<tr class="controls">
+									<td class="item-label">用户名 :</td>
+									<td>
+										<input type="text" style="color:#000;"   readonly="readonly"  class="form-control input-10x" name="username" value="{$info.username}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">姓名 :</td>
+									<td>
+										<input type="text" style="color:#000;"  readonly="readonly" class="form-control input-10x"  value="{$info.name}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">证件号 :</td>
+									<td>
+										<input type="text" style="color:#000;"  readonly="readonly" class="form-control input-10x"  value="{$info.zhengjian}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								<tr class="controls">
+									<td class="item-label">手机号码 :</td>
+									<td>
+										<input type="text" style="color:#000;"  readonly="readonly" class="form-control input-10x" name="phone" value="{$info.phone}">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">身份证正面 :</td>
+									<td>
+									    <a target="_blank" href="/Upload/public/{$info.cardzm}">
+							            <img src="/Upload/public/{$info.cardzm}" style="height:100px;" /></a>
+										
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">身份证反面 :</td>
+									<td>
+										
+										<a target="_blank" href="/Upload/public/{$info.cardfm}">
+							           <img src="/Upload/public/{$info.cardfm}" style="height:100px;" /></a>
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">申请时间 :</td>
+									<td>
+										<input type="text" style="color:#000;" readonly="readonly" class="form-control input-10x" name="rztime" value="<?php echo date('Y-m-d H:i:s',$info['rztime']);?>">
+									</td>
+									<td class="item-note"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">认证赠送 :</td>
+									<td>
+									    <select name="kjid" class="form-control input-10x">
+									        <foreach name="klist" item="vo">
+										    <option  value="{$vo.id}" <eq name="vo.txstate" value="$vo.id}">selected</eq>>{$vo.title}</option>
+										    </foreach>
+									    </select>
+									</td>
+									<td class="item-note" style="color:red;"></td>
+								</tr>
+								
+								<tr class="controls">
+									<td class="item-label">操作类型 :</td>
+									<td>
+									    <select name="rzstatus" class="form-control input-10x">
+										<option value="2"  <eq name="data.rzstatus" value="2">selected</eq>>通过认证</option>
+										<option value="3"  <eq name="data.rzstatus" value="3">selected</eq>>驳回认证</option>
+									</select></td>
+									<td class="item-note" style="color:red;"></td>
+								</tr>
+
+								<input type="hidden" name="uid"  value="{$info.id}" />
+								
+								<tr class="controls">
+									<td class="item-label"></td>
+									<td>
+										<div class="form-item cf">
+											<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确定</button>
+											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
+											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
+											</notempty>
+										</div>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</div>
+				</form>
+			</div>
+		</div>
+	</div>
+</div>
+<script type="text/javascript">
+	//提交表单
+	$('#submit').click(function () {
+		$('#form').submit();
+	});
+	$(function(){
+  $('.active').onclick(function(){
+    $('#bg').show();$('#div').show();
+  });
+  $('#div').onclick(function(){
+    $('#bg').hide();$('#div').hide();
+  });
+});
+</script>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('User/index')}");
+	</script>
+</block>

+ 97 - 0
Application/Admin/View/User/coin.html

@@ -0,0 +1,97 @@
+<include file="Public:header"/>
+<div id="main-content">
+	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
+		<button class="close fixed" style="margin-top: 4px;">&times;</button>
+		<div class="alert-content">警告内容</div>
+	</div>
+	<div id="main" class="main">
+		<div class="main-title-h">
+			<span class="h1-title">用户资产管理</span>
+			<div class="fr">
+			    <button class="btn btn-warning" onClick="location.href='{:U('User/coin')}'">初始化搜索</button>
+			</div>
+		</div>
+		<div class="cf">
+			
+			<div class="search-form fl cf">
+				<div class="sleft">
+					<form name="formSearch" id="formSearch" method="get" name="form1">
+
+						<select style=" width: 160px; float: left; margin-right: 10px;" name="field" class="form-control">
+							<option value="username"
+							<eq name="Think.get.field" value="username">selected</eq>
+							>用户名</option>
+						</select>
+						<input type="text" name="name" class="search-input form-control  " value="{$Think.get.name}" placeholder="请输入查询内容" style="">
+						<a class="sch-btn" href="javascript:;" id="search"> <i class="btn-search"></i> </a>
+					</form>
+					<script>
+						//搜索功能
+						$(function () {
+							$('#search').click(function () {
+								$('#formSearch').submit();
+							});
+						});
+						//回车搜索
+						$(".search-input").keyup(function (e) {
+							if (e.keyCode === 13) {
+								$("#search").click();
+								return false;
+							}
+						});
+					</script>
+				</div>
+			</div>
+		</div>
+		<div class="data-table table-striped">
+			<table class="">
+				<thead>
+				<tr>
+					<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
+					<th class="">ID</th>
+					<th>编辑</th>
+					<th class="">用户名</th>
+					<volist name="coinlist" id="v">
+						<th class="">{$v.title}(<?php echo strtoupper($v['name']);?>)</th>
+					</volist>
+				</tr>
+				</thead>
+				<tbody>
+				<notempty name="list">
+					<volist name="list" id="vo">
+						<tr>
+							<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
+							<td>{$vo.id}</td>
+							<th><a href="{:U('User/coinEdit?id='.$vo['userid'])}" class="btn btn-primary btn-xs">编辑</a></th>
+							<td>{$vo['username']}</td>
+							
+							<volist name="coinlist" id="v">
+								<td>
+								    可用:{$vo[$v['name']] * 1}<br>冻结:
+									<php>echo $vo[$v['name'].'d'] * 1;</php>
+									<br> 总计:
+									<php>echo $vo[$v['name'].'d'] * 1 + $vo[$v['name']] * 1;</php>
+									<br>
+								</td>
+							</volist>
+						</tr>
+					</volist>
+					<else/>
+					<td colspan="12" class="text-center empty-info"><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</td>
+				</notempty>
+					
+				</tbody>
+			</table>
+			<div class="page">
+				<div>{$page}</div>
+			</div>
+		</div>
+	</div>
+</div>
+<include file="Public:footer"/>
+<block name="script">
+	<script type="text/javascript" charset="utf-8">
+		//导航高亮
+		highlight_subnav("{:U('User/coin')}");
+	</script>
+</block>

Some files were not shown because too many files changed in this diff