gantan.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. session_start();
  3. if (isset($_SESSION["username"])) {
  4. ?>
  5. <?php require_once('common/header.php'); ?>
  6. <!--页面主要内容-->
  7. <main class="lyear-layout-content">
  8. <div class="container-fluid">
  9. <div class="row">
  10. <div class="col-lg-12">
  11. <div class="card">
  12. <ul class="nav nav-tabs page-tabs">
  13. <li > <a href="other.php">同源系统</a> </li>
  14. <li class="active"> <a href="gantan.php">敢探号配置</a> </li>
  15. <li > <a href="haoke.php">号氪云配置</a> </li>
  16. </ul>
  17. <?php
  18. include_once("../untils/conn.php");
  19. $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://';
  20. $domain = $_SERVER['HTTP_HOST'];
  21. $url = $protocol . $domain;
  22. $groups = 'gantanhao';
  23. $sql = "SELECT * FROM config_api WHERE groups = '$groups'";
  24. $result = mysqli_query($con, $sql);
  25. // 检查查询结果是否为空
  26. if (mysqli_num_rows($result) > 0) {
  27. // 获取第一行数据
  28. $row = mysqli_fetch_assoc($result);
  29. $userid = $row['userid'];
  30. $token = $row['token'];
  31. } else {
  32. }
  33. ?>
  34. <div class="">
  35. <div class="card-body">
  36. <form class="form-horizontal" action="controller/doApiConfig.php" method="POST">
  37. <div class="form-group">
  38. <label for="title" class="col-xs-12">感探号share_id:</label>
  39. <div class="col-xs-12">
  40. <input type="text" class="form-control" name="userid" placeholder="号卡氪云id" value="<?php echo $userid ?>" required>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label for="title" class="col-xs-12">感探号token:</label>
  45. <div class="col-xs-12">
  46. <input type="text" class="form-control" name="token" placeholder="号氪云Token" value="<?php echo $token ?>" >
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label for="title" class="col-xs-12">敢探号回调地址:</label>
  51. <div class="col-xs-12">
  52. <input class="form-control" type="text" value="<?php echo $url ?>/api/open/callback.php?type=gantanhao" readonly>
  53. </div>
  54. </div>
  55. <div class="form-group">
  56. <input type="hidden" name="type" value="<?php echo $groups ?>">
  57. <div class="offset-2 col-xs-12">
  58. <button class="btn btn-success" type="submit" value="添加">确认修改</button>
  59. <!-- <button class="btn btn-danger ml-3" type="reset" value="重置">返回</button> -->
  60. </div>
  61. </div>
  62. </form>
  63. </div>
  64. </div>
  65. </div>
  66. </main>
  67. <!--End 页面主要内容-->
  68. <?php require_once('common/footer.php'); ?>
  69. <?php
  70. } else {
  71. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  72. }