-
Notifications
You must be signed in to change notification settings - Fork 0
/
Purchases.php
64 lines (56 loc) · 1.72 KB
/
Purchases.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
include 'Header.html';
include 'connection.php';
$product_id = $_GET["id"];
$user_id=$_SESSION["uid"];
$sqlgetproduct = "select * from products where id =".$product_id;
$sqlgetuser = "select *from users where id=".$user_id;
$resultUser = mysqli_query($con,$sqlgetuser);
$resultProduct = mysqli_query($con,$sqlgetproduct);
if(!$resultUser)
{
}
else {
while($row = mysqli_fetch_assoc($resultUser))
{
$Name = $row["Name"];
$sur = $row["surname"];
$country = $row["country"];
}
}
if(!$resultProduct)
{
}
else {
while($row = mysqli_fetch_assoc($resultProduct))
{
$NameOfProduct = $row["name"];
$photo = $row["photo"];
$decimal = $row["price"];
$cents = $row["cents"];
$desc = $row["description"];
}
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="HeaderCSS.css">
<link rel="stylesheet" href="ProductsCSS.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<center><form class="SubmitPur" action="CheckOut.php" method="get">
<img src=<?=$photo?> alt="" height="256px" width="256px"><h1><?=$NameOfProduct?></h1><br>
<b><span id="decimalfontpur"><?=$decimal?></span>.<?=$cents?>€</b>
<br> <button type="submit" name="id" value=<?=$product_id?>> <i class="fa fa-shopping-cart"></i> <b>Add To Cart</b></button>
<h2> <i class="fa fa-id-badge"></i> <b><i><u>customer details</u></i></b></h2>
<h3> <b> Name: <?=$Name?></b> </h3>
<h3> <b> Surname: <?=$sur?></b> </h3>
<h3> <b> Country: <?=$country?></b> </h3>
</center>
</form>
</body>
</html>