doUpdate.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. $id = $_POST["id"];
  3. $yqrid = $_POST['yqrid'];
  4. $name = $_POST['name'];
  5. $api_type = $_POST['api_type'];
  6. $productType = $_POST['productType'];
  7. $goodsCode = $_POST['goodsCode'];
  8. $sku = $_POST['sku'];
  9. $se_num = $_POST['se_num'];
  10. $downtel = $_POST['downtel'];
  11. $jieshao = $_POST['jieshao'];
  12. $yys = $_POST['yys'];
  13. $ltime = $_POST['ltime'];
  14. $zhutu = $_POST['zhutu'];
  15. $link = $_POST['link'];
  16. $price = $_POST['price'];
  17. $proxy_price = $_POST['proxy_price'];
  18. $notes = $_POST['notes'];
  19. $xuanhao = $_POST['xuanhao'];
  20. $baoyou = $_POST['baoyou'];
  21. $gsd = $_POST['gsd'];
  22. $other = $_POST['other'];
  23. $haokaid = ''; // 初始化$haokaid变量
  24. if ($api_type === 'yqrapi') {
  25. $haokaid = $yqrid;
  26. } elseif ($api_type === 'hnhklt') {
  27. $haokaid = $productType;
  28. }elseif ($api_type === 'haokeyun') {
  29. $haokaid = $goodsCode;
  30. }elseif ($api_type === 'gantanhao') {
  31. $haokaid = $sku;
  32. }
  33. include_once("../../untils/conn.php");
  34. if ($con) {
  35. mysqli_query($con, "set names utf8");
  36. $data = $con->query("UPDATE list SET name='" . $name . "',jieshao='" . $jieshao . "',haokaid='" . $haokaid . "',yys='" . $yys . "',ltime='" . $ltime . "',zhutu='" . $zhutu . "' ,link='" . $link . "',price='" . $price . "',proxy_price='" . $proxy_price . "',notes='" . $notes . "',xuanhao='" . $xuanhao . "',other='" . $other . "',baoyou='" . $baoyou . "',gsd='" . $gsd . "', api_type='" . $api_type . "', se_num='" . $se_num . "' ,downtel='" . $downtel . "' WHERE id=" . $id);
  37. if ($data > 0) {
  38. echo "<script>alert('更新成功');window.location.href='../list.php'</script> ";
  39. } else {
  40. echo ("<script>alert('更新失败');window.location.replace(document.referrer)</script>");
  41. // echo "Error updating record: " . $con->error;
  42. }
  43. }
  44. $con->close();