jrChannel.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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="card">
  10. <div class="card-header bg-primary">
  11. <h4>加入渠道</h4>
  12. </div>
  13. <div class="card-body">
  14. <form class="form-horizontal" action="controller/uplistchannel.php" method="POST">
  15. <div class="form-group">
  16. <label class="col-xs-12">加入渠道:</label>
  17. <div class="col-xs-12">
  18. <select name="channel_name" id="channel_name" class="form-control">
  19. <option value="">请选择渠道</option>
  20. <?php
  21. include_once("../untils/conn.php");
  22. mysqli_query($con, "set names utf8");
  23. $id = $_GET['id'];
  24. // 获取所有渠道
  25. $channel_sql = "SELECT `channel_name` FROM `channel`";
  26. $channel_data = mysqli_query($con, $channel_sql);
  27. // 将查询结果转换为关联数组
  28. $channel_array = mysqli_fetch_all($channel_data, MYSQLI_ASSOC);
  29. foreach($channel_array as $channel) {
  30. echo "<option value='{$channel['channel_name']}'>{$channel['channel_name']}</option>";
  31. }
  32. ?>
  33. </select>
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <input type="hidden" name="id" value="<?php echo $id ?>">
  38. <div class="offset-2 col-xs-12">
  39. <button class="btn btn-success" type="submit" value="添加">确认修改</button>
  40. </div>
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </main>
  52. <!--End 页面主要内容-->
  53. <?php require_once('common/footer.php'); ?>
  54. <?php
  55. } else {
  56. echo "<script>alert('您尚未登录,没有权限访问该页面');location.href='login.php';</script>";
  57. }