-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmyCart.php
98 lines (84 loc) · 2.99 KB
/
myCart.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
session_start();
require 'db.php';
if(!isset($_SESSION['logged_in']) OR $_SESSION['logged_in'] == 0)
{
$_SESSION['message'] = "You need to first login to access this page !!!";
header("Location: Login/error.php");
}
$bid = $_SESSION['id'];
if(isset($_GET['flag']))
{
$pid = $_GET['pid'];
$sql = "INSERT INTO mycart (bid,pid)
VALUES ('$bid', '$pid')";
$result = mysqli_query($conn, $sql);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AgroCulture: My Cart</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link href="bootstrap\css\bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="bootstrap\js\bootstrap.min.js"></script>
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="login.css"/>
<script src="js/jquery.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/skel-layers.min.js"></script>
<script src="js/init.js"></script>
<noscript>
<link rel="stylesheet" href="css/skel.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-xlarge.css" />
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
</head>
<body class>
<?php
require 'menu.php';
function dataFilter($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<!-- One -->
<section id="main" class="wrapper style1 align-center" >
<div class="container">
<h2>My Cart</h2>
<section id="two" class="wrapper style2 align-center">
<div class="container">
<div class="row">
<?php
$sql = "SELECT * FROM mycart WHERE bid = '$bid'";
$result = mysqli_query($conn, $sql);
while($row = $result->fetch_array()):
$pid = $row['pid'];
$sql = "SELECT * FROM fproduct WHERE pid = '$pid'";
$result1 = mysqli_query($conn, $sql);
$row1 = $result1->fetch_array();
$picDestination = "images/productImages/".$row1['pimage'];
?>
<div class="col-md-4">
<section>
<strong><h2 class="title" style="color:black; "><?php echo $row1['product'].'';?></h2></strong>
<a href="review.php?pid=<?php echo $row1['pid'] ;?>" > <img class="image fit" src="<?php echo $picDestination;?>" alt="" /></a>
<div style="align: left">
<blockquote><?php echo "Type : ".$row1['pcat'].'';?><br><?php echo "Price : ".$row1['price'].' /-';?><br></blockquote>
</section>
</div>
<?php endwhile; ?>
</div>
</section>
</header>
</section>
</body>
</html>