Guest User

Untitled

a guest
Apr 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require 'config.php';
  4.  
  5.  
  6. $id = $_SESSION['login_user'];
  7. $jobid = $_POST['job_id'];
  8. $poster_id = $_POST['poster_id'];
  9. $accepted_bidder = $_POST['accepted_bidder'];
  10. $accepted_bid = (int) $_POST['accepted_bid'];
  11. $poster_id = $_POST['poster_id'];
  12.  
  13. $query = "SELECT credit FROM `customer` WHERE email_adress = '$id'";
  14.  
  15. $success = $conn->query($query);
  16.  
  17.  
  18. $result = mysqli_fetch_array($success);
  19.  
  20. while($row = mysqli_fetch_array($result)):
  21. $credit = (int)$row['credit'];
  22. endwhile;
  23.  
  24. //var_dump($result);
  25. //var_dump($accepted_bid);
  26. $updated_credit = $credit - $accepted_bid;
  27. //echo $updated_credit;
  28.  
  29.  
  30. $query2 = "UPDATE job SET start_escrow = '1' WHERE job_id = '$jobid'";
  31. $success2 = $conn->query($query2);
  32.  
  33. $query3 = " UPDATE customer SET credit = '$updated_credit' WHERE email_adress = '$id'";
  34. $success3 = $conn->query($query3);
  35.  
  36.  
  37.  
  38. if (!$success) {
  39. die("Couldn't enter data: ".$conn->error);
  40.  
  41. }
  42.  
  43. echo "Thank You For Contacting Us <br>";
  44. //header("location: myjobs.php");
  45.  
  46.  
  47.  
  48. $conn->close();
  49.  
  50.  
  51.  
  52.  
  53. ?>
Add Comment
Please, Sign In to add comment