DoUpData.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. session_start();
  3. if (isset($_SESSION["username"])) {
  4. ?>
  5. <?php require_once('common/header.php');
  6. include_once('../updata/version.php');
  7. include_once("../untils/conn.php");
  8. mysqli_query($con, "set names utf8");
  9. // 获取接口返回的 JSON 数据
  10. $json = file_get_contents('http://hk7.ldove.cn/updata/Getversion.php');
  11. $data = json_decode($json, true);
  12. $new_version = $data['version'];// 将 version 字段存储为变量 $new_version
  13. $system_name = $data['system_name'];
  14. $developer = $data['developer'];
  15. $qqnum = $data['qqnum'];
  16. $wechat = $data['wechat'];
  17. $update_log_url = $data['update_log_url'];
  18. ?>
  19. <main class="lyear-layout-content" style="display: flex; justify-content: center; align-items: center;">
  20. <div class="loader"></div>
  21. <div class="text">更新中...</div>
  22. </main>
  23. <style>
  24. .lyear-layout-content {
  25. position: absolute;
  26. top: 0;
  27. bottom: 0;
  28. left: 0;
  29. right: 0;
  30. display: flex;
  31. justify-content: center;
  32. align-items: center;
  33. flex-direction: column;
  34. }
  35. .loader {
  36. width: 200px;
  37. height: 200px;
  38. border-radius: 50%;
  39. position: relative;
  40. border: 4px solid transparent;
  41. border-top-color: #4bc0c8;
  42. animation: run 2s linear infinite;
  43. margin-bottom: 20px;
  44. }
  45. .text {
  46. color: #000;
  47. font-size: 20px;
  48. position: relative;
  49. text-align: center;
  50. }
  51. /* 利用伪元素 */
  52. .loader::before {
  53. content: "";
  54. position: absolute;
  55. left: 5px;
  56. top: 5px;
  57. right: 5px;
  58. bottom: 5px;
  59. border-radius: 50%;
  60. border: 4px solid transparent;
  61. border-top-color: #c779d0;
  62. /* 动画时间不同 */
  63. animation: run 3s linear infinite;
  64. }
  65. .loader::after {
  66. content: "";
  67. position: absolute;
  68. left: 15px;
  69. top: 15px;
  70. right: 15px;
  71. bottom: 15px;
  72. border-radius: 50%;
  73. border: 4px solid transparent;
  74. border-top-color: #feac5e;
  75. /* 动画时间不同 */
  76. animation: run 1.5s linear infinite;
  77. }
  78. .text {
  79. color: #000;
  80. font-size: 20px;
  81. position: relative;
  82. text-align: center;
  83. margin-top: 20px;
  84. }
  85. /* 定义动画 */
  86. @keyframes run {
  87. 0% {
  88. transform: rotate(0deg);
  89. }
  90. 100% {
  91. transform: rotate(360deg);
  92. }
  93. }
  94. </style>
  95. <?php require_once('common/footer.php'); ?>
  96. <?php
  97. } else {
  98. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  99. }