-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshopredmi.php
More file actions
150 lines (115 loc) · 4.57 KB
/
Copy pathshopredmi.php
File metadata and controls
150 lines (115 loc) · 4.57 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redmi details</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" integrity="sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="Style.css">
</head>
<body>
<?php include'navbar.php'?>
<section>
<div style='margin-top:100px;' class='container-fluid pt-3'>
<div class='row'>
<div class='col-lg-5'>
<img src='spec view/xiaomi-redmi-note11-pro-1.jpg' alt='' width= 70% height='400px' id='main'>
<div style='padding:10px;'>
<img name='image' src='spec view/xiaomi-redmi-note11-pro-1.jpg' class='small' alt='' width=30% >
<img src='Phones/redmi.jpg' class='small' alt='' width=30% >
</div>
</div>
<div class='col-lg-7'>
<?php
include 'connection/dbase.php';
$stmt = $con->prepare("SELECT * FROM product WHERE Name = 'Redmi Note 11' ");
$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()):
?>
<h6>Phone</h6>
<h4><?= $row['Name']?></h4>
<h3>₦<?= $row['Price']?></h3>
<form action="" class='form-submit'></form>
<input type='number' class='pqty' name='quantity' value="<?= $row['Quantity']?>" style=' width: 70px;
padding: 10px 5px 10px 15px;'>
<input type="hidden" class='pid' value="<?= $row['Id']?>">
<input type="hidden" class='pname' value="<?= $row['Name']?>">
<input type="hidden" class='pprice' value="<?= $row['Price']?>">
<input type="hidden" class='pimage' value="<?= $row['File']?>">
<input type="hidden" class='pcode' value="<?= $row['Code']?>">
<button id='not' type='submit' name='submit' style='color: white; background-color: #003399;border: none;margin: 2px; text-decoration:none;' class='btn addItemBtn'>Add to cart <span> <i class='fas fa-shopping-cart'></i> </span></button>
</form>
<h4 class=pt-5>PRODUCT DETAILS</h4>
<span><?= $row['Description']?></span>
<?php endwhile; ?>
</div>
</div>
</div>
</div>
</div>
</section>
<?php include'news.php'?>
<?php include'footer.php'?>
<script>
var x = document.getElementById("main");
var y = document.getElementsByClassName("small");
y[0].onclick = function(){
x.src = y[0].src;
}
y[1].onclick = function() {
x.src = y[1].src;
}
</script>
<script type='text/javascript'>
$(document).ready(function(){
$(".addItemBtn").click(function(e){
e.preventDefault();
var $form = $(this).closest(".form-submit");
var pid = $form.find(".pid").val();
var pname = $form.find(".pname").val();
var pprice = $form.find(".pprice").val();
var pimage = $form.find(".pimage").val();
var pcode = $form.find(".pcode").val();
var pqty = $form.find(".pqty").val();
$.ajax({
url: 'action.php',
method: 'post'
data: {
pid: pid,
pname: pname,
pprice: pprice,
pqty: pqty,
pimage: pimage,
pcode: pcode
},
success: function(response) {
$('#message').html(response);
window.scrollTo(0, 0);
load_cart_item_number();
}
});
});
load_cart_item_number();
function load_cart_item_number(){
$.ajax({
url: 'action.php'
method: 'get',
data: {
cartItem: "cart_item"
},
success: function(response){
$("#cart-item").html(response);
}
});
}
});
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/js/bootstrap.min.js'></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>