-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSell.php
43 lines (31 loc) · 1.26 KB
/
Sell.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
if(!isset($_SESSION)) { session_start(); }
class Sell
{
public $table;
public function __construct()
{
$this->table = "sell_requests";
date_default_timezone_set('Africa/Lagos');
}
public function postRequest($intern_id, $amount, $trade_limit=2, $price_per_coin, $account, $preferred_buyer=0, $status="Open", $db)
{
$sql = "insert into ".$this->table." (intern_id, amount, trade_limit, price_per_coin, account, preferred_buyer, status) values (:intern_id, :amount, :trade_limit, :price_per_coin, :account, :preferred_buyer, :status)";
$stmt = $db->prepare($sql);
$stmt->bindParam(':intern_id', $intern_id);
$stmt->bindParam(':amount', $amount);
$stmt->bindParam(':trade_limit', $trade_limit);
$stmt->bindParam(':price_per_coin', $price_per_coin);
$stmt->bindParam(':account', $account);
$stmt->bindParam(':preferred_buyer', $preferred_buyer);
$stmt->bindParam(':status', $status);
if ($stmt->execute()) {
return true;
}
else {
return false;
//echo $db->error;
}
}
//member class ends here
}