ltapi.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 class="active"> <a href="ltapi.php">联通配置</a> </li>
  14. <li> <a href="dxapi.php">电信配置</a> </li>
  15. <li> <a href="ydapi.php">移动配置</a> </li>
  16. </ul>
  17. <?php
  18. include_once("../untils/conn.php");
  19. $groups = 'Unicom';
  20. $sql = "SELECT * FROM config_api WHERE groups = '$groups'";
  21. $result = mysqli_query($con, $sql);
  22. // 检查查询结果是否为空
  23. if (mysqli_num_rows($result) > 0) {
  24. // 获取第一行数据
  25. $row = mysqli_fetch_assoc($result);
  26. // 提取需要的字段值
  27. $channel = $row['channel'];
  28. $uid = $row['uid'];
  29. $historyId = $row['historyId'];
  30. $unicomMallUid = $row['unicomMallUid'];
  31. $referer = $row ['referer'];
  32. $pageKey = $row ['pageKey'];
  33. } else {
  34. // 没有找到匹配的数据
  35. // 可以在此处设置默认值或其他处理方式
  36. // $channel = '';
  37. // $uid = '';
  38. // $historyId = '';
  39. }
  40. ?>
  41. <div class="">
  42. <div class="card-body">
  43. <form class="form-horizontal" action="controller/doLtConfig.php" method="POST">
  44. <div class="form-group">
  45. <label for="title" class="col-xs-12">联通渠道码:</label>
  46. <div class="col-xs-12">
  47. <input type="text" class="form-control" name="channel" placeholder="联通渠道码" value="<?php echo $channel; ?>" required>
  48. </div>
  49. </div>
  50. <div class="form-group">
  51. <label for="title" class="col-xs-12">联通UID:</label>
  52. <div class="col-xs-12">
  53. <input type="text" class="form-control" name="uid" placeholder="联通UID" value="<?php echo $uid; ?>" required>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label for="title" class="col-xs-12">联通历史id:</label>
  58. <div class="col-xs-12">
  59. <input type="text" class="form-control" name="historyId" placeholder="未知参数但是必填" value="<?php echo $historyId; ?>" required>
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <label for="title" class="col-xs-12">未知参数(unicomMallUid):</label>
  64. <div class="col-xs-12">
  65. <input type="text" class="form-control" name="unicomMallUid" placeholder="未知参数但是必填" value="<?php echo $unicomMallUid; ?>" required>
  66. </div>
  67. </div>
  68. <div class="form-group">
  69. <label for="title" class="col-xs-12">下单链接(接口需要校验):</label>
  70. <div class="col-xs-12">
  71. <input type="text" class="form-control" name="referer" placeholder="下单链接必填" value="<?php echo $referer; ?>" required>
  72. </div>
  73. </div>
  74. <div class="form-group">
  75. <label for="title" class="col-xs-12">页码key(接口需要校验):</label>
  76. <div class="col-xs-12">
  77. <input type="text" class="form-control" name="pageKey" placeholder="下单页pageKey需校验" value="<?php echo $pageKey ;?>" required>
  78. </div>
  79. </div>
  80. <div class="form-group">
  81. <input type="hidden" name="groups" value="<?php echo $groups ?>">
  82. <div class="offset-2 col-xs-12">
  83. <button class="btn btn-success" type="submit" value="添加">确认修改</button>
  84. </div>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </main>
  94. <!--End 页面主要内容-->
  95. <?php require_once('common/footer.php'); ?>
  96. <?php
  97. } else {
  98. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  99. }