index.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <?php
  2. session_start();
  3. if (isset($_SESSION["account"])) {
  4. if($_SERVER['REQUEST_URI'] == '404.php'){
  5. include('404.php');
  6. exit;
  7. }
  8. ?>
  9. <?php require_once('common/header.php'); ?>
  10. <?php require_once('common/sidebar.php'); ?>
  11. <div class="main-content app-content mt-0">
  12. <div class="side-app">
  13. <!-- CONTAINER -->
  14. <div class="main-container container-fluid">
  15. <!--占位-->
  16. <div class="card"> </div>
  17. <!--占位-->
  18. </div>
  19. <!-- ROW-1 -->
  20. <div class="row">
  21. <div class="col-lg-12 col-md-12 col-sm-12 col-xl-12">
  22. <div class="row">
  23. <div class="col-lg-6 col-md-6 col-sm-12 col-xl-3">
  24. <div class="card overflow-hidden">
  25. <div class="card-body">
  26. <div class="d-flex">
  27. <div class="mt-2">
  28. <h6 class="">订单数量</h6>
  29. <h2 class="mb-0 number-font" id ="count">0</h2>
  30. </div>
  31. <div class="ms-auto">
  32. <div class="chart-wrapper mt-1">
  33. <canvas id="saleschart"
  34. class="h-8 w-9 chart-dropshadow"></canvas>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="col-lg-6 col-md-6 col-sm-12 col-xl-3">
  42. <div class="card overflow-hidden">
  43. <div class="card-body">
  44. <div class="d-flex">
  45. <div class="mt-2">
  46. <h6 class="">产品数量</h6>
  47. <h2 class="mb-0 number-font" id="list">0</h2>
  48. </div>
  49. <div class="ms-auto">
  50. <div class="chart-wrapper mt-1">
  51. <canvas id="leadschart"
  52. class="h-8 w-9 chart-dropshadow"></canvas>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="col-lg-6 col-md-6 col-sm-12 col-xl-3">
  60. <div class="card overflow-hidden">
  61. <div class="card-body">
  62. <div class="d-flex">
  63. <div class="mt-2">
  64. <h6 class="">本月预估佣金</h6>
  65. <h2 class="mb-0 number-font" id="revenue">0</h2>
  66. </div>
  67. <div class="ms-auto">
  68. <div class="chart-wrapper mt-1">
  69. <canvas id="profitchart"
  70. class="h-8 w-9 chart-dropshadow"></canvas>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="col-lg-6 col-md-6 col-sm-12 col-xl-3">
  78. <div class="card overflow-hidden">
  79. <div class="card-body">
  80. <div class="d-flex">
  81. <div class="mt-2">
  82. <h6 class="">账号总余额</h6>
  83. <h2 class="mb-0 number-font" id="balance">0</h2>
  84. </div>
  85. <div class="ms-auto">
  86. <div class="chart-wrapper mt-1">
  87. <canvas id="costchart"
  88. class="h-8 w-9 chart-dropshadow"></canvas>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <!-- ROW-1 END -->
  99. <!-- ROW-2 -->
  100. <div class="row">
  101. <div class="col-sm-12 col-md-12 col-lg-12 col-xl-9">
  102. <div class="card">
  103. <div class="card-header">
  104. <h3 class="card-title">用户下单记录</h3>
  105. </div>
  106. <div class="card-body">
  107. <div class="d-flex mx-auto text-center justify-content-center mb-4">
  108. <div class="d-flex text-center justify-content-center me-3"><span
  109. class="dot-label bg-primary my-auto"></span>下单记录</div>
  110. <div class="d-flex text-center justify-content-center"><span
  111. class="dot-label bg-secondary my-auto"></span>激活记录</div>
  112. </div>
  113. <div class="chartjs-wrapper-demo">
  114. <canvas id="transactions" class="chart-dropshadow"></canvas>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- COL END -->
  120. <div class="col-sm-12 col-md-12 col-lg-12 col-xl-3">
  121. <div class="card overflow-hidden">
  122. <div class="card-body pb-0 bg-recentorder">
  123. <h3 class="card-title text-white">号卡激活率</h3>
  124. <div class="chartjs-wrapper-demo">
  125. <canvas id="recentorders" class="chart-dropshadow"></canvas>
  126. </div>
  127. </div>
  128. <div id="flotback-chart" class="flot-background"></div>
  129. <div class="card-body">
  130. <div class="d-flex mb-4 mt-3">
  131. <div
  132. class="avatar avatar-md bg-secondary-transparent text-secondary bradius me-3">
  133. <i class="fe fe-check"></i>
  134. </div>
  135. <div class="">
  136. <h6 class="mb-1 fw-semibold">已激活</h6>
  137. <p class="fw-normal fs-12">
  138. 激活率
  139. <span class="text-success" id="active_percentage">3.5%</span>
  140. </p>
  141. </div>
  142. <div class=" ms-auto my-auto">
  143. <p class="fw-bold fs-20" id="active"> 0</p>
  144. </div>
  145. </div>
  146. <div class="d-flex">
  147. <div class="avatar avatar-md bg-pink-transparent text-pink bradius me-3">
  148. <i class="fe fe-x"></i>
  149. </div>
  150. <div class="">
  151. <h6 class="mb-1 fw-semibold">未激活</h6>
  152. <p class="fw-normal fs-12">
  153. 未激活
  154. <span class="text-success" id="inactive_percentage">1.2%</span>
  155. </p>
  156. </div>
  157. <div class=" ms-auto my-auto">
  158. <p class="fw-bold fs-20 mb-0" id="inactive"> 0 </p>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <!-- COL END -->
  165. </div>
  166. <!-- ROW-2 END -->
  167. </div>
  168. <!-- CONTAINER END -->
  169. </div>
  170. </div>
  171. <!--app-content close-->
  172. </div>
  173. <?php
  174. session_start();
  175. include_once("../untils/conn.php");
  176. mysqli_query($con, "set names utf8");
  177. // 获取当前正在登录的账号信息的代理
  178. $proxy_acc = $_SESSION["account"];
  179. // 查询proxy表中的数据
  180. $query = "SELECT proxy_rename_sta FROM proxy WHERE proxy_acc = '$proxy_acc'";
  181. $result = mysqli_query($con, $query);
  182. $row = mysqli_fetch_assoc($result);
  183. if ($row) {
  184. $proxy_rename_sta = $row['proxy_rename_sta'];
  185. ?>
  186. <div class="modal fade" id="modaldemo5" data-bs-backdrop="static" data-bs-keyboard="false">
  187. <div class="modal-dialog modal-dialog-centered text-center" role="document">
  188. <div class="modal-content tx-size-sm">
  189. <div class="modal-body text-center p-4 pb-5">
  190. <i class="icon icon-close fs-70 text-danger lh-1 my-5 d-inline-block"></i>
  191. <h4 class="text-danger">警告: 您的账号未实名!</h4>
  192. <p class="mg-b-20 mg-x-20">平台要求所有代理商必须实名!否则无法使用平台功能!</p>
  193. <a href="profile.php" class="btn btn-primary pd-x-25">去实名</a>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <!--/div-->
  199. <script src="assets/js/jquery.min.js"></script>
  200. <script>
  201. $(document).ready(function() {
  202. $.ajax({
  203. url: 'controller/Index.php',
  204. method: 'POST',
  205. dataType: 'json',
  206. success: function(data) {
  207. // 将返回的数据渲染到页面中的不同位置
  208. $('#count').text(data.count);
  209. $('#list').text(data.list);
  210. $('#revenue').text(data.revenue);
  211. $('#active').text(data.active);
  212. $('#inactive').text(data.inactive);
  213. $('#active_percentage').text(data.active_percentage + '%');
  214. $('#inactive_percentage').text(data.inactive_percentage + '%');
  215. $('#balance').text(data.balance);
  216. },
  217. error: function(xhr, status, error) {
  218. // 处理错误
  219. console.log(error);
  220. }
  221. });
  222. });
  223. </script>
  224. <script>
  225. $(document).ready(function() {
  226. <?php
  227. if ($proxy_rename_sta == 0) {
  228. // 未实名认证
  229. echo '$("#modaldemo5").modal("show");';
  230. echo '$("#modaldemo5").modal({backdrop: "static", keyboard: false});';
  231. } elseif ($proxy_rename_sta == 1) {
  232. // 已实名认证
  233. echo '$("#modaldemo5").modal("hide");';
  234. }
  235. ?>
  236. });
  237. </script>
  238. <?php
  239. } else {
  240. // 未找到相关数据
  241. // echo '数据不存在';
  242. }
  243. ?>
  244. <?php require_once('common/footer.php'); ?>
  245. <?php
  246. } else {
  247. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.html';</script>";
  248. }
  249. ?>