index.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <style>
  2. .basicinfo {
  3. margin: 15px 0;
  4. }
  5. .basicinfo .row > .col-xs-4 {
  6. padding-right: 0;
  7. }
  8. .basicinfo .row > div {
  9. margin: 5px 0;
  10. }
  11. </style>
  12. <div id="content-container" class="container">
  13. <div class="row">
  14. <div class="col-md-3">
  15. {include file="common/sidenav" /}
  16. </div>
  17. <div class="col-md-9">
  18. <div class="panel panel-default ">
  19. <div class="panel-body">
  20. <h2 class="page-header">
  21. {:__('Member center')}
  22. <a href="{:url('user/profile')}" class="btn btn-success pull-right"><i class="fa fa-pencil"></i>
  23. {:__('Profile')}</a>
  24. </h2>
  25. <div class="row user-baseinfo">
  26. <div class="col-md-3 col-sm-3 col-xs-2 text-center user-center">
  27. <a href="{:url('user/profile')}" title="{:__('Click to edit')}">
  28. <span class="avatar-img"><img src="{$user.avatar|cdnurl}" alt=""></span>
  29. </a>
  30. </div>
  31. <div class="col-md-9 col-sm-9 col-xs-10">
  32. <!-- Content -->
  33. <div class="ui-content">
  34. <!-- Heading -->
  35. <h4><a href="{:url('user/profile')}">{$user.nickname}</a></h4>
  36. <!-- Paragraph -->
  37. <p>
  38. <a href="{:url('user/profile')}">
  39. {$user.bio|default=__("This guy hasn't written anything yet")}
  40. </a>
  41. </p>
  42. <!-- Success -->
  43. <div class="basicinfo">
  44. <div class="row">
  45. <div class="col-xs-4 col-md-2">{:__('Money')}</div>
  46. <div class="col-xs-8 col-md-4">
  47. <a href="javascript:;" class="viewmoney">{$user.money}</a>
  48. </div>
  49. <div class="col-xs-4 col-md-2">{:__('Score')}</div>
  50. <div class="col-xs-8 col-md-4">
  51. <a href="javascript:;" class="viewscore">{$user.score}</a>
  52. </div>
  53. </div>
  54. <div class="row">
  55. <div class="col-xs-4 col-md-2">{:__('Successions')}</div>
  56. <div class="col-xs-8 col-md-4">{$user.successions} {:__('Day')}</div>
  57. <div class="col-xs-4 col-md-2">{:__('Maxsuccessions')}</div>
  58. <div class="col-xs-8 col-md-4">{$user.maxsuccessions} {:__('Day')}</div>
  59. </div>
  60. <div class="row">
  61. <div class="col-xs-4 col-md-2">{:__('Logintime')}</div>
  62. <div class="col-xs-8 col-md-4">{$user.logintime|date="Y-m-d H:i:s",###}</div>
  63. <div class="col-xs-4 col-md-2">{:__('Prevtime')}</div>
  64. <div class="col-xs-8 col-md-4">{$user.prevtime|date="Y-m-d H:i:s",###}</div>
  65. <div class="col-xs-4 col-md-2">总流量</div>
  66. <div class="col-xs-8 col-md-4">
  67. <?php
  68. $val = $user->total_traffic;
  69. $kb = 1024;
  70. $Mb = 1024 * $kb;
  71. $Gb = 1024 * $Mb;
  72. $Tb = 1024 * $Gb;
  73. if($val < $Mb){
  74. echo number_format($val/$kb,2) .' Kb';
  75. }else if($val < $Gb){
  76. echo number_format($val/$Mb,2) .' Mb';
  77. }else if($val < $Tb){
  78. echo number_format($val/$Gb,2) .' Gb';
  79. }else{
  80. echo $val + 'b';
  81. }
  82. ?>
  83. </div>
  84. <div class="col-xs-4 col-md-2">已使用流量</div>
  85. <div class="col-xs-8 col-md-4">
  86. <?php
  87. $val = $user->traffic;
  88. $kb = 1024;
  89. $Mb = 1024 * $kb;
  90. $Gb = 1024 * $Mb;
  91. $Tb = 1024 * $Gb;
  92. if($val < $Mb){
  93. echo number_format($val/$kb,2) .' Kb';
  94. }else if($val < $Gb){
  95. echo number_format($val/$Mb,2) .' Mb';
  96. }else if($val < $Tb){
  97. echo number_format($val/$Gb,2) .' Gb';
  98. }else{
  99. echo $val + 'b';
  100. }
  101. ?>
  102. </div>
  103. <div class="col-xs-4 col-md-2">剩余流量</div>
  104. <div class="col-xs-8 col-md-4">
  105. <?php
  106. $val = $user->total_traffic - $user->traffic;
  107. $kb = 1024;
  108. $Mb = 1024 * $kb;
  109. $Gb = 1024 * $Mb;
  110. $Tb = 1024 * $Gb;
  111. if($val < $Mb){
  112. echo number_format($val/$kb,2) .' Kb';
  113. }else if($val < $Gb){
  114. echo number_format($val/$Mb,2) .' Mb';
  115. }else if($val < $Tb){
  116. echo number_format($val/$Gb,2) .' Gb';
  117. }else{
  118. echo $val + 'b';
  119. }
  120. ?>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>