Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require 'config.php';
- $id = $_SESSION['login_user'];
- $jobid = $_POST['job_id'];
- $poster_id = $_POST['poster_id'];
- $accepted_bidder = $_POST['accepted_bidder'];
- $accepted_bid = (int) $_POST['accepted_bid'];
- $poster_id = $_POST['poster_id'];
- $query = "SELECT credit FROM `customer` WHERE email_adress = '$id'";
- $success = $conn->query($query);
- $result = mysqli_fetch_array($success);
- while($row = mysqli_fetch_array($result)):
- $credit = (int)$row['credit'];
- endwhile;
- //var_dump($result);
- //var_dump($accepted_bid);
- $updated_credit = $credit - $accepted_bid;
- //echo $updated_credit;
- $query2 = "UPDATE job SET start_escrow = '1' WHERE job_id = '$jobid'";
- $success2 = $conn->query($query2);
- $query3 = " UPDATE customer SET credit = '$updated_credit' WHERE email_adress = '$id'";
- $success3 = $conn->query($query3);
- if (!$success) {
- die("Couldn't enter data: ".$conn->error);
- }
- echo "Thank You For Contacting Us <br>";
- //header("location: myjobs.php");
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment