upsystem.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. ?>
  14. <main class="lyear-layout-content">
  15. <div class="container-fluid">
  16. <div class="row">
  17. <div class="col-sm-6">
  18. <?php
  19. $versions = mysqli_get_server_info($con);
  20. ?>
  21. <div class="card">
  22. <div class="card-header">
  23. <h4>系统信息</h4>
  24. </div>
  25. <div class="card-body">
  26. <p>系统名称:<?php echo $system_name; ?></p>
  27. <p>版本号:V<?php echo $version; ?></p>
  28. <p>版本类型:
  29. <?php
  30. if ($version_type == 0) {
  31. echo "开源版本";
  32. } elseif ($version_type == 1) {
  33. echo "商业版本";
  34. }
  35. ?>
  36. </p>
  37. <p>开发者:<?php echo $developer; ?></p>
  38. <p>QQ:<?php echo $qqnum; ?></p>
  39. <p>微信:<?php echo $wechat; ?></p>
  40. <p>更新日志:<a href="<?php echo $update_log_url; ?>" target="_blank">点击查看</a></p>
  41. <p>开源地址:<a href="<?php echo $oepnrrl; ?>" target="_blank">点击查看</a></p>
  42. </div>
  43. </div>
  44. </div>
  45. <!-- .col-sm-6 -->
  46. <div class="col-sm-6">
  47. <div class="card">
  48. <div class="card-header">
  49. <h4>服务器信息</h4>
  50. </div>
  51. <div class="card-body">
  52. <p>服务器操作系统: <?php echo php_uname(); ?></p>
  53. <p>MYSQL版本: <?php echo $versions; ?></p>
  54. <p>web中间件: <?php echo $_SERVER['SERVER_SOFTWARE']; ?></p>
  55. <p>PHP版本: <?php echo phpversion(); ?></p>
  56. <p>网站目录: <?php echo $_SERVER['DOCUMENT_ROOT']; ?></p>
  57. </div>
  58. </div>
  59. </div>
  60. <!-- .col-sm-6 -->
  61. </div>
  62. <!-- .row -->
  63. <div class="row">
  64. <div class="col-sm-6">
  65. <div class="card">
  66. <div class="card-header">
  67. <h4>在线更新</h4>
  68. </div>
  69. <div class="card-body">
  70. <a href="#" class="btn btn-danger" onclick="checkUpdate()">检查更新</a>
  71. <p style="color:red;">在线更新可能会因为各种因素,比如网络延迟,代码更新超时,手动中断等,导致更新不完整,系统崩溃等等,如果你使用在线更新功能需要自己备份数据和主程序,以防数据丢失,如果使用在线更新功能导致数据丢失,我们概不负责,使用在线功能说明你已经阅读并知悉!</p>
  72. </div>
  73. </div>
  74. </div>
  75. <!-- .col-sm-6 -->
  76. <div class="col-sm-6">
  77. <div class="card">
  78. <div class="card-header">
  79. <h4>赞助支持</h4>
  80. </div>
  81. <div class="card-body">
  82. <p>开源不易续杯咖啡~</p>
  83. <div style="display: flex;">
  84. <img src="https://cdn.qiniu.junes.cn/upload/2023/06/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230622200759.jpg" style="width: 180px; margin-right: 60px;height: 260px;">
  85. <img src="https://cdn.qiniu.junes.cn/upload/2023/06/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230622200755.jpg" style="width: 180px; margin-right: 60px;">
  86. <img src="https://cdn.qiniu.junes.cn/upload/2023/06/%E8%81%9A%E5%90%88%E6%94%B6%E6%AC%BE-%E5%85%AD%E6%9C%88%E7%83%9F%E4%BA%91%E5%B7%A5%E4%BD%9C%E5%AE%A4.png" style="width: 180px; ">
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- .col-sm-6 -->
  92. </div>
  93. <!-- .row -->
  94. <!-- End Cards with Actions -->
  95. </div>
  96. <script>
  97. function checkUpdate() {
  98. // 判断版本是否相同
  99. if ("<?php echo $version; ?>" === "<?php echo $new_version; ?>") {
  100. alert("已经是最新版本");
  101. } else {
  102. var result = confirm("发现新版本(版本号 <?php echo $new_version; ?>),是否更新?");
  103. if (result) {
  104. window.location.href = "DoUpData.php";
  105. }
  106. }
  107. }
  108. </script>
  109. </main>
  110. <?php require_once('common/footer.php'); ?>
  111. <?php
  112. } else {
  113. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  114. }