index.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. $this->title = '名下账户历史报表';
  3. ?>
  4. <?php $this->beginBlock('header_script'); ?>
  5. <link href="<?= STATIC_URL ?>/ui/css/plugins/dataTables/datatables.min.css" rel="stylesheet">
  6. <?php $this->endBlock(); ?>
  7. <div class="row">
  8. <div class="col-md-3">
  9. <?= $this->render('/common/_inner_left_menu.php', ['login' => $login]) ?>
  10. </div>
  11. <div class="col-md-9">
  12. <div class="ibox">
  13. <div class="ibox-title">
  14. <h2>历史报表</h2>
  15. </div>
  16. <form>
  17. <input type="hidden" name="login" value="<?= $login ?>" />
  18. <div class="ibox-content m-b-sm border-bottom">
  19. <div class="row">
  20. <div class="col-sm-4">
  21. <div class="form-group">
  22. <label class="control-label" for="price">开始时间</label>
  23. <input readonly="readonly" type="text" id="sTime" name="sTime" value="<?= $sTime ?>" placeholder="开始时间" class="data form-control">
  24. </div>
  25. </div>
  26. <div class="col-sm-4">
  27. <div class="form-group">
  28. <label class="control-label" for="quantity">结束时间</label>
  29. <input readonly="readonly" type="text" id="eTime" name="eTime" value="<?= $eTime ?>" placeholder="结束时间" class="data form-control">
  30. </div>
  31. </div>
  32. <div class="col-sm-4">
  33. <div class="form-group">
  34. <label class="control-label" for="quantity">操作</label>
  35. <input type="submit" class="btn btn-primary form-control" value="搜索">
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </form>
  41. <div class="ibox-content">
  42. <div class="table-responsive">
  43. <table id="datatables" class="table table-striped table-bordered table-hover dataTables-example">
  44. <thead>
  45. <tr>
  46. <th>订单号</th>
  47. <th>类型</th>
  48. <th>品种</th>
  49. <th>SL</th>
  50. <th>TP</th>
  51. <th>手数</th>
  52. <th>开仓价格</th>
  53. <th>开仓时间</th>
  54. <th>平仓价格</th>
  55. <th>平仓时间</th>
  56. <th>利息</th>
  57. <th>佣金</th>
  58. <th>获利</th>
  59. </tr>
  60. </thead>
  61. </table>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <?php $this->beginBlock('footer_script'); ?>
  68. <!-- Mainly scripts -->
  69. <script src="<?= STATIC_URL ?>/ui/js/plugins/dataTables/datatables.min.js"></script>
  70. <script>
  71. var table;
  72. $(document).ready(function() {
  73. table = $('#datatables').DataTable({
  74. <?php if (isset($isHaveAdmin) && $isHaveAdmin == true) : ?>
  75. "aLengthMenu": [[20,50,100,500,999999999], [20,50,100,500,"ALL"]],
  76. <?php else : ?>
  77. "aLengthMenu": [[20,50,100,500], [20,50,100,500]],
  78. <?php endif; ?>
  79. language: {
  80. "sProcessing": "处理中...",
  81. "sLengthMenu": "显示 _MENU_ 项结果",
  82. "sZeroRecords": "没有匹配结果",
  83. "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
  84. "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
  85. "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
  86. "sInfoPostFix": "",
  87. "sSearch": "搜索:",
  88. "sUrl": "",
  89. "sEmptyTable": "表中数据为空",
  90. "sLoadingRecords": "载入中...",
  91. "sInfoThousands": ",",
  92. "oPaginate": {
  93. "sFirst": "首页",
  94. "sPrevious": "上页",
  95. "sNext": "下页",
  96. "sLast": "末页"
  97. },
  98. "oAria": {
  99. "sSortAscending": ": 以升序排列此列",
  100. "sSortDescending": ": 以降序排列此列"
  101. }
  102. },
  103. "processing": true,
  104. "serverSide": true,
  105. "ajax": '/ib/strades?type=<?= $type ?>&login=<?= $login ?>&sTime=<?= $sTime ?>&eTime=<?= $eTime ?>',
  106. "order": [[0, "desc"]],
  107. "columns": [{
  108. "data": "TICKET"
  109. },
  110. {
  111. "data": "CMD"
  112. },
  113. {
  114. "data": "SYMBOL"
  115. },
  116. {
  117. "data": "SL"
  118. },
  119. {
  120. "data": "TP"
  121. },
  122. {
  123. "data": "VOLUME"
  124. },
  125. {
  126. "data": "OPEN_PRICE"
  127. },
  128. {
  129. "data": "OPEN_TIME"
  130. },
  131. {
  132. "data": "CLOSE_PRICE"
  133. },
  134. {
  135. "data": "CLOSE_TIME"
  136. },
  137. {
  138. "data": "SWAPS"
  139. },
  140. {
  141. "data": "COMMISSION"
  142. },
  143. {
  144. "data": "PROFIT"
  145. }],
  146. columnDefs: [{
  147. targets: 1,
  148. render: function(data, type, row, meta) {
  149. if(data==0){
  150. return 'BUY';
  151. }else if (data==1){
  152. return 'SELL';
  153. }else if (data==2){
  154. return 'BUY LIMIT';
  155. }else if (data==3){
  156. return 'SELL LIMIT';
  157. }else if (data==4){
  158. return 'BUY STOP';
  159. }else if (data==5){
  160. return 'SELL STOP';
  161. }else if (data==6){
  162. return 'BALANCE';
  163. }else if (data==7){
  164. return 'CREDIT';
  165. }else{
  166. return '';
  167. }
  168. },
  169. "orderable": true
  170. },{
  171. targets: 5,
  172. render: function(data, type, row, meta) {
  173. return data/100;
  174. },
  175. "orderable": true
  176. }],
  177. "sPaginationType": "full_numbers",
  178. dom: '<"html5buttons"B>lTfgitp',
  179. buttons: [{
  180. extend: 'copy'
  181. },
  182. {
  183. extend: 'csv'
  184. },
  185. {
  186. extend: 'excel'
  187. },
  188. {
  189. extend: 'pdf'
  190. },
  191. {
  192. extend: 'print',
  193. customize: function(win) {
  194. $(win.document.body).addClass('white-bg');
  195. $(win.document.body).css('font-size', '10px');
  196. $(win.document.body).find('table').addClass('compact').css('font-size', 'inherit');
  197. }
  198. }]
  199. });
  200. $('#datatables tbody').on('click', 'tr', function() {
  201. if ($(this).hasClass('selected')) {
  202. $(this).removeClass('selected');
  203. } else {
  204. table.$('tr.selected').removeClass('selected');
  205. $(this).addClass('selected');
  206. }
  207. });
  208. });
  209. </script>
  210. <?php $this->endBlock(); ?>