main.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. use yii\helpers\Html;
  5. use yii\helpers\Url;
  6. use yii\web\YiiAsset;
  7. YiiAsset::register($this);
  8. ?>
  9. <?php $this->beginPage() ?>
  10. <!DOCTYPE html>
  11. <html lang="<?= Yii::$app->language ?>">
  12. <head>
  13. <meta charset="<?= Yii::$app->charset ?>">
  14. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  15. <meta name="viewport" content="width=device-width, initial-scale=1">
  16. <?= Html::csrfMetaTags() ?>
  17. <title><?= Html::encode($this->title) ?></title>
  18. <?php $this->head() ?>
  19. <link href="<?= STATIC_URL ?>/ui/css/bootstrap.min.css" rel="stylesheet">
  20. <link href="<?= STATIC_URL ?>/ui/font-awesome/css/font-awesome.css" rel="stylesheet">
  21. <link href="<?= STATIC_URL ?>/ui/css/animate.css" rel="stylesheet">
  22. <link href="<?= STATIC_URL ?>/ui/css/style.css" rel="stylesheet">
  23. <link href="<?= STATIC_URL ?>/ui/css/plugins/iCheck/custom.css" rel="stylesheet">
  24. <link href="<?= STATIC_URL ?>/ui/css/plugins/toastr/toastr.min.css" rel="stylesheet">
  25. <link href="<?= STATIC_URL ?>/ui/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
  26. <link href="<?= STATIC_URL ?>/ui/css/plugins/select2/select2.min.css" rel="stylesheet">
  27. <style>
  28. #datatables tr.selected {
  29. background: #1ab394;
  30. color: #FFF;
  31. }
  32. .ibox-title {
  33. border-width: 1px 0 0;
  34. }
  35. @media (min-width: 1366px) {
  36. .container {
  37. width: 1170px;
  38. }
  39. }
  40. @media (min-width: 1440px) {
  41. .container {
  42. width: 1170px;
  43. }
  44. }
  45. @media (min-width: 1600px) {
  46. .container {
  47. width: 1170px;
  48. }
  49. }
  50. @media (min-width: 1920px) {
  51. .container {
  52. width: 1170px;
  53. }
  54. }
  55. </style>
  56. <!--[if lt IE 9]>
  57. <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  58. <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  59. <![endif]-->
  60. <?= isset($this->blocks['header_script']) ? trim($this->blocks['header_script']) : '' ?>
  61. </head>
  62. <body class="top-navigation">
  63. <?php $this->beginBody() ?>
  64. <div id="wrapper">
  65. <div id="page-wrapper" class="gray-bg">
  66. <div class="row border-bottom white-bg">
  67. <nav class="navbar navbar-static-top" role="navigation">
  68. <div class="container">
  69. <?php if ($this->context->module instanceof \yii\web\Application): ?>
  70. <div class="navbar-header">
  71. <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
  72. <i class="fa fa-reorder"></i>
  73. </button>
  74. <a href="<?= Url::home() ?>" class="navbar-brand"><b>X</b>Trader</a>
  75. </div>
  76. <div class="navbar-collapse collapse" id="navbar">
  77. <ul class="nav navbar-nav">
  78. <li>
  79. <a href="<?= Url::to(['/account/open']) ?>">真实账户申请</a>
  80. </li>
  81. <!--<li>
  82. <a href="<?= Url::to(['/account/opendemo']) ?>">模拟账户申请</a>
  83. </li>-->
  84. </ul>
  85. <ul class="nav navbar-nav navbar-right">
  86. <!--<li id="navhelp">
  87. <a href="javascript:">在线客服</a>
  88. </li>-->
  89. <li>
  90. <a href="http://www.handz-fx.com">返回官网</a>
  91. </li>
  92. </ul>
  93. </div>
  94. <?php elseif ($this->context->module->id == 'user'): ?>
  95. <div class="navbar-header">
  96. <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
  97. <i class="fa fa-reorder"></i>
  98. </button>
  99. <a href="<?= Url::to(['/user/dashboard']) ?>" class="navbar-brand"><b>X</b>Trader</a>
  100. </div>
  101. <div class="navbar-collapse collapse" id="navbar">
  102. <ul class="nav navbar-nav">
  103. <li id="navdashboard">
  104. <a href="<?= Url::to(['/user/dashboard']) ?>">首页</a>
  105. </li>
  106. <li id="navnotice">
  107. <a href="<?= Url::to(['/user/notice']) ?>">公告
  108. <span class="label label-danger" id="findNotReadCount"></span>
  109. </a>
  110. </li>
  111. <li id="navbankdeposit">
  112. <a href="<?= Url::to(['/user/bankdeposit']) ?>">入金</a>
  113. </li>
  114. <li id="navdw">
  115. <a href="<?= Url::to(['/user/bankwithdraw']) ?>">出金</a>
  116. </li>
  117. <!--<li id="navsameaccount">
  118. <a href="<?= Url::to(['/user/sameaccount']) ?>">同名账号</a>
  119. </li>
  120. <li id="navtransfer">
  121. <a href="<?= Url::to(['/user/transfer']) ?>">同名转账</a>
  122. </li>
  123. <li id="navlever">
  124. <a href="<?= Url::to(['/user/lever']) ?>">修改杠杆</a>
  125. </li>
  126. <li id="navhelp">
  127. <a href="<?= Url::to(['/user/help']) ?>">常见问题</a>
  128. </li>
  129. <li id="navhelp">
  130. <a href="javascript:">在线客服</a>
  131. </li>-->
  132. </ul>
  133. <ul class="nav navbar-nav navbar-right">
  134. <li id="navsetting" class="dropdown">
  135. <a aria-expanded="false" role="button" href="#" class="dropdown-toggle" data-toggle="dropdown">
  136. <?= Yii::$app->getUser()->getIdentity(false)->username ?> <span class="caret"></span>
  137. </a>
  138. <ul role="menu" class="dropdown-menu">
  139. <li><a href="<?= Url::to(['/user/info']) ?>">基本资料</a></li>
  140. <li><a href="<?= Url::to(['/user/password']) ?>">修改密码</a></li>
  141. <li><a href="<?= Url::to(['/account/logout']) ?>">退出</a></li>
  142. </ul>
  143. </li>
  144. </ul>
  145. </div>
  146. <?php endif; ?>
  147. </div>
  148. </nav>
  149. </div>
  150. <div class="wrapper wrapper-content">
  151. <div class="container">
  152. <?= $content ?>
  153. </div>
  154. </div>
  155. <br>
  156. <div class="footer">
  157. <div class="container">
  158. <div class="pull-right">V2.0</div>
  159. <div><strong>Copyright</strong> &copy; <?= date('Y') ?></div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  165. <div class="modal-dialog" role="document">
  166. <div class="modal-content">
  167. <div class="modal-header">
  168. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  169. <h4 class="modal-title" id="myModalLabel"><a href="javascript:;" class="modal-title-a" target="_blank"></a></h4>
  170. </div>
  171. <div class="modal-body"></div>
  172. <div class="modal-footer">
  173. <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <?php $this->endBody() ?>
  179. <!-- Mainly scripts -->
  180. <script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
  181. <script src="<?= STATIC_URL ?>/ui/js/plugins/metisMenu/jquery.metisMenu.js"></script>
  182. <script src="<?= STATIC_URL ?>/ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  183. <script src="<?= STATIC_URL ?>/ui/js/inspinia.js"></script>
  184. <script src="<?= STATIC_URL ?>/ui/js/plugins/pace/pace.min.js"></script>
  185. <script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
  186. <script src="<?= STATIC_URL ?>/ui/js/plugins/datapicker/bootstrap-datepicker.js"></script>
  187. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/jquery.validate.min.js"></script>
  188. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/additional-methods.min.js"></script>
  189. <script src="<?= STATIC_URL ?>/ui/js/plugins/validate/messages.cn.js"></script>
  190. <!-- iCheck -->
  191. <script src="<?= STATIC_URL ?>/ui/js/plugins/iCheck/icheck.min.js"></script>
  192. <script src="<?= STATIC_URL ?>/ui/js/plugins/select2/select2.full.min.js"></script>
  193. <script>
  194. $(document).ready(function () {
  195. $('.i-checks').iCheck({
  196. checkboxClass: 'icheckbox_square-green',
  197. radioClass: 'iradio_square-green'
  198. });
  199. $('.data').datepicker({
  200. startView: 1,
  201. todayBtn: "linked",
  202. keyboardNavigation: true,
  203. forceParse: false,
  204. autoclose: true,
  205. format: "yyyy-mm-dd"
  206. });
  207. $(".select2").select2();
  208. $("#kefu").click(function () {
  209. window.open('http://crm2.qq.com/page/portalpage/wpa.php?uin=800800642&aty=1&a=0&curl=&ty=1', '_blank', 'width=760,height=430,top=0px,left=0px');
  210. });
  211. findNotReadCount();
  212. showLastUnreadNotice();
  213. });
  214. function findNotReadCount() {
  215. $.ajax({
  216. type: "GET",
  217. url: "<?= Url::to(['/user/notice/find-not-read-count']) ?>",
  218. data: $('#form').serialize(),
  219. dataType: "text",
  220. beforeSend: function () {
  221. },
  222. success: function (data) {
  223. if (data != "0") {
  224. $("#findNotReadCount").html(data + "未读");
  225. }
  226. },
  227. complete: function (XMLHttpRequest, textStatus) {
  228. },
  229. error: function () {
  230. }
  231. });
  232. }
  233. function showLastUnreadNotice() {
  234. if (location.pathname === '/user/notice' || location.pathname.indexOf('/user/notice/') === 0) {
  235. return;
  236. }
  237. $.get('<?= Url::to(['notice/last-unread-notice']) ?>', {}, function (response) {
  238. if (response.code == 1 && response.data.notice) {
  239. $('#myModal .modal-title-a').html(response.data.notice.title);
  240. $('#myModal .modal-title-a').attr('href', '/user/notice/nview?id=' + response.data.notice.id);
  241. $('#myModal .modal-body').html(response.data.notice.content);
  242. $('#myModal').modal();
  243. $('#myModal .modal-title-a').on('click', function () {
  244. $('#myModal').modal('hide');
  245. });
  246. }
  247. }, 'json');
  248. }
  249. </script>
  250. <script>
  251. var url = location.href;
  252. if (url.indexOf("/dashboard") != -1) {
  253. $("#navdashboard").addClass("active");
  254. } else if (url.indexOf("/dw") != -1) {
  255. $("#navdw").addClass("active");
  256. } else if (url.indexOf("/lever") != -1) {
  257. $("#navlever").addClass("active");
  258. } else if (url.indexOf("/transfer") != -1) {
  259. $("#navtransfer").addClass("active");
  260. } else if (url.indexOf("/bankdeposit") != -1) {
  261. $("#navbankdeposit").addClass("active");
  262. } else if (url.indexOf("/notice") != -1) {
  263. $("#navnotice").addClass("active");
  264. } else if (url.indexOf("/nview") != -1) {
  265. $("#navnotice").addClass("active");
  266. } else if (url.indexOf("/help") != -1) {
  267. $("#navhelp").addClass("active");
  268. } else if (url.indexOf("/sameaccount") != -1) {
  269. $("#navsameaccount").addClass("active");
  270. }else if (url.indexOf("/bankwithdraw") != -1) {
  271. $("#navdw").addClass("active");
  272. }
  273. </script>
  274. <script>
  275. // 对Date的扩展,将 Date 转化为指定格式的String
  276. // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
  277. // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
  278. // 例子:
  279. // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
  280. // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
  281. Date.prototype.Format = function (fmt) { //author: meizz
  282. var o = {
  283. "M+": this.getMonth() + 1, //月份
  284. "d+": this.getDate(), //日
  285. "h+": this.getHours(), //小时
  286. "m+": this.getMinutes(), //分
  287. "s+": this.getSeconds(), //秒
  288. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  289. "S": this.getMilliseconds() //毫秒
  290. };
  291. if (/(y+)/.test(fmt))
  292. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  293. for (var k in o)
  294. if (new RegExp("(" + k + ")").test(fmt))
  295. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  296. return fmt;
  297. };
  298. function timeStamp2String(time) {
  299. time += new Date().getTimezoneOffset() * 60 * 1000;
  300. var datetime = new Date();
  301. datetime.setTime(parseInt(time));
  302. var year = datetime.getFullYear();
  303. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  304. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  305. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  306. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  307. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  308. return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
  309. }
  310. function timeStamp2StringForEcharts(time) {
  311. time += new Date().getTimezoneOffset() * 60 * 1000;
  312. var datetime = new Date();
  313. datetime.setTime(parseInt(time));
  314. var year = datetime.getFullYear();
  315. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  316. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  317. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  318. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  319. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  320. //return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second;
  321. return month + "/" + date + " " + hour + ":" + minute;
  322. }
  323. function timeStamp2StringMin(time) {
  324. time += new Date().getTimezoneOffset() * 60 * 1000;
  325. var datetime = new Date();
  326. datetime.setTime(parseInt(time));
  327. var year = datetime.getFullYear();
  328. var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
  329. var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
  330. var hour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
  331. var minute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
  332. var second = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
  333. //return hour + ":" + minute + ":" + second;
  334. return hour + ":" + minute;
  335. }
  336. </script>
  337. <?= isset($this->blocks['left_menu_script']) ? trim($this->blocks['left_menu_script']) : '' ?>
  338. <?= isset($this->blocks['footer_script']) ? trim($this->blocks['footer_script']) : '' ?>
  339. </body>
  340. </html>
  341. <?php $this->endPage() ?>