-
Notifications
You must be signed in to change notification settings - Fork 0
/
cod.php
50 lines (36 loc) · 1.01 KB
/
cod.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
44
45
46
47
48
49
50
<?php
include('session.php');
$addid=$_GET['id'];
$mysqli=new mysqli("localhost","root","","userdetails");
$sql="select * from sellingitems where addid='$addid'";
$res=$mysqli->query($sql);
$row=$res->fetch_assoc();
$s="select * from wishlistitems where addid='$addid'";
$result=$mysqli->query($s);
if($result->num_rows>0)
{
$sq="delete from wishlistitems where addid='$addid'";
$mysqli->query($sq);
}
$sid=$row["sellerid"];
$bid=$login_session[0];
$p=$row["price"];
$image=$row["image"];
$des=$row["description"];
$w=$row["who"];
$card=0;
$cvv=0;
$mode='cod';
if($sid!=$bid){
$s="INSERT into purchaseditems(sellerid,buyerid,price,who,mode,cardno,cvv,image,description,addid)"." values('$sid','$bid','$p','$w','$mode','$card','$cvv','$image','$des','$addid')";
if($mysqli->query($s)){
$sq="delete from sellingitems where addid='$addid'";
$mysqli->query($sq);
}
echo "Item Was Placed";
header('Location:mail.php');
}
else{
echo "Buyer and Seller should not be same";
}
?>