Withdrawal.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. session_start();
  3. include_once("../../untils/conn.php");
  4. mysqli_query($con, "set names utf8");
  5. // 获取当前正在登录的账号信息的代理
  6. $proxy_acc = $_SESSION["account"];
  7. // 防止 SQL 注入攻击
  8. $proxy_acc = mysqli_real_escape_string($con, $proxy_acc);
  9. // 查询 withdrawal 表,根据 proxy_acc 来查找数据并将数据存储在数组中
  10. $sql = "SELECT * FROM withdrawal WHERE proxy_acc = '$proxy_acc'";
  11. $result = mysqli_query($con, $sql);
  12. if ($result) {
  13. $data = array();
  14. // 循环遍历数据并将每条数据存储在一个数组中
  15. while ($row = mysqli_fetch_assoc($result)) {
  16. $proxy_acc = $row['proxy_acc'];
  17. $tx_name = $row['tx_name'];
  18. $tx_acc = $row['tx_acc'];
  19. $tx_type = $row['tx_type'];
  20. $tx_price = $row['tx_price'];
  21. $dk_price = $row['dk_price'];
  22. $tax = $row['tax'];
  23. $state = $row['state'];
  24. $cr_time = date('Y-m-d H:i:s', $row['cr_time']);
  25. $cl_time = date('Y-m-d H:i:s', $row['cl_time']);
  26. $tx_bank_name = $row['tx_bank_name'];
  27. $tx_bank_zh = $row['tx_bank_zh'];
  28. $notes = $row['notes'];
  29. $data[] = array(
  30. "proxy_acc" => $proxy_acc,
  31. "tx_name" => $tx_name,
  32. "tx_acc" => $tx_acc,
  33. "tx_type" => $tx_type,
  34. "tx_price" => $tx_price,
  35. "dk_price" => $dk_price,
  36. "tax" => $tax,
  37. "state" => $state,
  38. "cr_time" => $cr_time,
  39. "cl_time" => $cl_time,
  40. "tx_bank_name" => $tx_bank_name,
  41. "tx_bank_zh" => $tx_bank_zh,
  42. "notes" => $notes
  43. );
  44. }
  45. // 将数据转换为 JSON 格式并输出到前端
  46. echo json_encode($data);
  47. }
  48. // 关闭数据库连接
  49. mysqli_close($con);