index.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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/_left_menu.php') ?>
  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. <div class="ibox-content m-b-sm border-bottom">
  18. <div class="row">
  19. <div class="col-sm-3">
  20. <div class="form-group">
  21. <label class="control-label" for="price">上级代理商</label>
  22. <select name="ibId" class="form-control select22">
  23. <option value="">请选择</option>
  24. <?php foreach ($ibs as $k => $v) : ?>
  25. <option value="<?= $v['id'] ?>" <?= $ibId == $v['id'] ? 'selected="selected"' : '' ?> ><?= $v['name'] ?></option>
  26. <?php endforeach; ?>
  27. </select>
  28. </div>
  29. </div>
  30. <div class="col-sm-3">
  31. <div class="form-group">
  32. <label class="control-label" for="quantity">操作</label>
  33. <input type="submit" class="btn btn-primary form-control" value="搜索">
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </form>
  39. <div class="ibox-content">
  40. <div class="table-responsive">
  41. <table id="datatables" class="table table-striped table-bordered table-hover dataTables-example">
  42. <thead>
  43. <tr>
  44. <th>代理商</th>
  45. <th>账户</th>
  46. <th>姓名</th>
  47. <th>杠杆</th>
  48. <th>余额</th>
  49. <th>保证金</th>
  50. <th>可用保证金</th>
  51. <th>保证金比例</th>
  52. <th>净值</th>
  53. <th>最后更新时间</th>
  54. </tr>
  55. </thead>
  56. </table>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <?php $this->beginBlock('footer_script'); ?>
  63. <!-- Mainly scripts -->
  64. <script src="<?= STATIC_URL ?>/ui/js/plugins/dataTables/datatables.min.js"></script>
  65. <script>
  66. var table;
  67. $(document).ready(function() {
  68. table = $('#datatables').DataTable({
  69. <?php if ($isHaveAdmin) : ?>
  70. "aLengthMenu": [[20,50,100,500,999999999], [20,50,100,500,"ALL"]],
  71. <?php else : ?>
  72. "aLengthMenu": [[20,50,100], [20,50,100]],
  73. <?php endif; ?>
  74. language: {
  75. "sProcessing": "处理中...",
  76. "sLengthMenu": "显示 _MENU_ 项结果",
  77. "sZeroRecords": "没有匹配结果",
  78. "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
  79. "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
  80. "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
  81. "sInfoPostFix": "",
  82. "sSearch": "搜索账户,姓名:",
  83. "sUrl": "",
  84. "sEmptyTable": "表中数据为空",
  85. "sLoadingRecords": "载入中...",
  86. "sInfoThousands": ",",
  87. "oPaginate": {
  88. "sFirst": "首页",
  89. "sPrevious": "上页",
  90. "sNext": "下页",
  91. "sLast": "末页"
  92. },
  93. "oAria": {
  94. "sSortAscending": ": 以升序排列此列",
  95. "sSortDescending": ": 以降序排列此列"
  96. }
  97. },
  98. "processing": true,
  99. "serverSide": true,
  100. "ajax": '/ib/users/list?ibId=<?= $ibId ?>',
  101. "order": [[1, "desc"]],
  102. "columns": [{
  103. "data": "name"
  104. },{
  105. "data": "LOGIN"
  106. },{
  107. "data": "NAME"
  108. },
  109. {
  110. "data": "LEVERAGE"
  111. },
  112. {
  113. "data": "BALANCE"
  114. },
  115. {
  116. "data": "MARGIN"
  117. },
  118. {
  119. "data": "MARGIN_FREE"
  120. },
  121. {
  122. "data": "MARGIN_LEVEL"
  123. },
  124. {
  125. "data": "EQUITY"
  126. },
  127. {
  128. "data": "MODIFY_TIME"
  129. }],
  130. columnDefs: [{
  131. targets: 1,
  132. "orderable": false
  133. }],
  134. "sPaginationType": "full_numbers",
  135. dom: '<"html5buttons"B>lTfgitp',
  136. buttons: [{
  137. extend: 'copy'
  138. },
  139. {
  140. extend: 'csv'
  141. },
  142. {
  143. extend: 'excel'
  144. },
  145. {
  146. extend: 'pdf'
  147. },
  148. {
  149. extend: 'print',
  150. customize: function(win) {
  151. $(win.document.body).addClass('white-bg');
  152. $(win.document.body).css('font-size', '10px');
  153. $(win.document.body).find('table').addClass('compact').css('font-size', 'inherit');
  154. }
  155. }]
  156. });
  157. $('#datatables tbody').on('click', 'tr', function() {
  158. if ($(this).hasClass('selected')) {
  159. $(this).removeClass('selected');
  160. } else {
  161. table.$('tr.selected').removeClass('selected');
  162. $(this).addClass('selected');
  163. }
  164. var data=table.row('.selected').data();
  165. if(data!=undefined&&data.LOGIN!=""){
  166. var url="/ib/statistics?login="+data.LOGIN;
  167. window.location.href=url;
  168. }
  169. });
  170. });
  171. </script>
  172. <?php $this->endBlock(); ?>