index.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <?php
  2. $this->title = '名下账户统计概要';
  3. ?>
  4. <div class="row">
  5. <div class="col-md-3">
  6. <?= $this->render('/common/_inner_left_menu.php', ['login' => $login]) ?>
  7. </div>
  8. <div class="col-md-9">
  9. <div class="ibox">
  10. <div class="ibox-title">
  11. <h5>所属代理</h5>
  12. </div>
  13. <div class="ibox-content">
  14. <table class="table table-striped">
  15. <tbody>
  16. <tr>
  17. <th>姓名</th>
  18. <td><?= $ib['name'] ?></td>
  19. <th>返佣账户</th>
  20. <td><?= $ib['logins'] ?></td>
  21. </tr>
  22. <tr>
  23. <th>邮箱</th>
  24. <td><?= $ib['username'] ?></td>
  25. <th>手机</th>
  26. <td><?= $ib['mobile'] ?></td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. </div>
  32. <div class="ibox">
  33. <div class="ibox-title">
  34. <h5>账户信息</h5>
  35. </div>
  36. <div class="ibox-content">
  37. <table class="table table-striped">
  38. <tbody>
  39. <tr>
  40. <th>邮箱</th>
  41. <td><?= isset($member['username']) ? $member['username'] : '' ?></td>
  42. <th>手机</th>
  43. <td><?= isset($member['mobile']) ? $member['mobile'] : '' ?></td>
  44. </tr>
  45. <tr>
  46. <tr>
  47. <th>账户</th>
  48. <td><?= $mt4User['LOGIN'] ?></td>
  49. <th>杠杆</th>
  50. <td>1:<?= $mt4User['LEVERAGE'] ?></td>
  51. </tr>
  52. <tr>
  53. <th>余额</th>
  54. <td><?= $mt4User['BALANCE'] ?></td>
  55. <th>保证金</th>
  56. <td><?= $mt4User['MARGIN'] ?></td>
  57. </tr>
  58. <tr>
  59. <th>可用保证金</th>
  60. <td><?= $mt4User['MARGIN_FREE'] ?></td>
  61. <th>保证金比例</th>
  62. <td><?= $mt4User['MARGIN_LEVEL'] ?></td>
  63. </tr>
  64. <tr>
  65. <th>净值</th>
  66. <td><?= $mt4User['EQUITY'] ?></td>
  67. <th>总交易次数</th>
  68. <td><?= $tradeCount['totalCount'] ?></td>
  69. </tr>
  70. <tr>
  71. <th>盈利交易</th>
  72. <td><?php if ($tradeCount['totalCount'] != 0) { echo $tradeCount['winCount'] . ' (' . $tradeCount['winPercent'] . '%)'; } else { echo 0; } ?></td>
  73. <th>亏损交易</th>
  74. <td><?php if ($tradeCount['totalCount'] != 0) { echo $tradeCount['lossCount'] . ' (' . $tradeCount['lossPercent'] . '%)'; } else { echo 0; } ?></td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. <div class="row">
  81. <div class="col-md-12">
  82. <div class="ibox-title">
  83. <h5>总收益</h5>
  84. </div>
  85. <div class="ibox-content">
  86. <div class="flot-chart">
  87. <div class="flot-chart-content" id="sumProfitByDay"></div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <hr>
  93. <div class="row">
  94. <div class="col-md-12">
  95. <div class="ibox-title">
  96. <h5>交易手数</h5>
  97. </div>
  98. <div class="ibox-content">
  99. <div class="flot-chart">
  100. <div class="flot-chart-content" id="volumeSumByDay"></div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <hr>
  106. <div class="row">
  107. <div class="col-md-4">
  108. <div class="ibox-title">
  109. <h5>总笔数</h5>
  110. <span class="pull-right label label-warning"><?= $tradeCount['totalCount'] ?></span>
  111. </div>
  112. <div class="ibox-content">
  113. <div class="flot-chart">
  114. <div class="flot-chart-pie-content" id="totalCount"></div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="col-md-4">
  119. <div class="ibox-title">
  120. <h5>交易货币分布</h5>
  121. </div>
  122. <div class="ibox-content">
  123. <div class="flot-chart">
  124. <div class="flot-chart-pie-content" id="symbolCount"></div>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="col-md-4">
  129. <div class="ibox-title">
  130. <h5>交易来源分布</h5>
  131. </div>
  132. <div class="ibox-content">
  133. <div class="flot-chart">
  134. <div class="flot-chart-pie-content" id="reasonCount"></div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <?php $this->beginBlock('footer_script'); ?>
  142. <!-- Mainly scripts -->
  143. <!-- Flot -->
  144. <script src="<?= STATIC_URL ?>/ui/js/plugins/flot/jquery.flot.js"></script>
  145. <script src="<?= STATIC_URL ?>/ui/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
  146. <script src="<?= STATIC_URL ?>/ui/js/plugins/flot/jquery.flot.resize.js"></script>
  147. <script src="<?= STATIC_URL ?>/ui/js/plugins/flot/jquery.flot.pie.js"></script>
  148. <script src="<?= STATIC_URL ?>/ui/js/plugins/flot/jquery.flot.time.js"></script>
  149. <script>
  150. $(document).ready(function() {
  151. var profitSumByDay = <?= $profitSumByDay ?>;
  152. $.plot($("#sumProfitByDay"), [{
  153. data: profitSumByDay
  154. }], {
  155. xaxes: [{
  156. mode: 'time',
  157. timeformat: "%y/%m/%d"
  158. }],
  159. colors: ["#1ab394"],
  160. grid: {
  161. color: "#999999",
  162. hoverable: true,
  163. clickable: true,
  164. tickColor: "#D4D4D4",
  165. borderWidth:0,
  166. hoverable: true //IMPORTANT! this is needed for tooltip to work,
  167. },
  168. tooltip: true,
  169. tooltipOpts: {
  170. content: "截止 %x 的总收益 %y ",
  171. xDateFormat: "%y/%m/%d",
  172. onHover: function(flotItem, $tooltipEl) {
  173. // console.log(flotItem, $tooltipEl);
  174. }
  175. }
  176. });
  177. var volumeSumByDay = <?= $volumeSumByDay ?>;
  178. $.plot($("#volumeSumByDay"), [{
  179. data: volumeSumByDay
  180. }], {
  181. xaxes: [{
  182. mode: 'time',
  183. timeformat: "%y/%m/%d"
  184. }],
  185. yaxis: {
  186. tickDecimals: 2
  187. },
  188. colors: ["#1ab394"],
  189. grid: {
  190. color: "#999999",
  191. hoverable: true,
  192. clickable: true,
  193. tickColor: "#D4D4D4",
  194. borderWidth:0,
  195. hoverable: true //IMPORTANT! this is needed for tooltip to work,
  196. },
  197. tooltip: true,
  198. tooltipOpts: {
  199. content: "截止 %x 的总交易手数 %y 手",
  200. xDateFormat: "%y/%m/%d",
  201. onHover: function(flotItem, $tooltipEl) {
  202. // console.log(flotItem, $tooltipEl);
  203. }
  204. }
  205. });
  206. var data1 = <?= $symbolCount ?>;
  207. if (!$.isEmptyObject(data1)) {
  208. var plotObj1 = $.plot($("#symbolCount"), data1, {
  209. series: {
  210. pie: {
  211. show: true
  212. }
  213. },
  214. grid: {
  215. hoverable: true
  216. },
  217. tooltip: true,
  218. tooltipOpts: {
  219. content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
  220. shifts: {
  221. x: 20,
  222. y: 0
  223. },
  224. defaultTheme: false
  225. }
  226. });
  227. }
  228. var data2 = <?= $reasonCount ?>;
  229. if (!$.isEmptyObject(data2)) {
  230. var plotObj2 = $.plot($("#reasonCount"), data2, {
  231. series: {
  232. pie: {
  233. show: true
  234. }
  235. },
  236. grid: {
  237. hoverable: true
  238. },
  239. tooltip: true,
  240. tooltipOpts: {
  241. content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
  242. shifts: {
  243. x: 20,
  244. y: 0
  245. },
  246. defaultTheme: false
  247. }
  248. });
  249. }
  250. var data3 = [
  251. {
  252. label: "Win",
  253. data: <?= $tradeCount['winCount'] ?>,
  254. },
  255. {
  256. label: "Loss",
  257. data: <?= $tradeCount['lossCount'] ?>,
  258. }
  259. ];
  260. var plotObj3 = $.plot($("#totalCount"), data3, {
  261. series: {
  262. pie: {
  263. show: true
  264. }
  265. },
  266. grid: {
  267. hoverable: true
  268. },
  269. tooltip: true,
  270. tooltipOpts: {
  271. content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
  272. shifts: {
  273. x: 20,
  274. y: 0
  275. },
  276. defaultTheme: false
  277. }
  278. });
  279. });
  280. </script>
  281. <?php $this->endBlock(); ?>