-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcardio.php
423 lines (326 loc) · 12.6 KB
/
cardio.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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<link rel="stylesheet" type="text/css" href="./style2.css">
<?php
session_start();
$mysql_host = 'localhost';
$mysql_user = 'root';
$mysql_password = '';
$db = 'emed';
$con = new mysqli($mysql_host, $mysql_user, $mysql_password, $db) or die();
$status = "";
if (isset($_POST['code']) && $_POST['code'] != "") {
$code = $_POST['code'];
$result = mysqli_query($con, "SELECT * FROM `cart` WHERE `code`='$code'");
$row = mysqli_fetch_assoc($result);
$name = $row['name'];
$code = $row['code'];
$price = $row['price'];
$image = $row['image'];
$cartArray = array(
$code => array(
'name' => $name,
'code' => $code,
'price' => $price,
'quantity' => 1,
'image' => $image
)
);
if (empty($_SESSION["shopping_cart"])) {
$_SESSION["shopping_cart"] = $cartArray;
$status = "<div class='box'>Product is added to your cart!</div>";
} else {
$array_keys = array_keys($_SESSION["shopping_cart"]);
if (in_array($code, $array_keys)) {
$status = "<div class='box' style='color:red;'>
Product is already added to your cart!</div>";
} else {
$_SESSION["shopping_cart"] = array_merge($_SESSION["shopping_cart"], $cartArray);
$status = "<div class='box'>Product is added to your cart!</div>";
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Medical Store</title>
<link rel="stylesheet" type="text/css" href="diab.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="store.js"></script>
</head>
<body style="font-family: verdana; ">
<header>
<center>
<i class="fa fa-ambulance" aria-hidden="true"></i>
<h2>EMED.COM</h2>
</center>
<div>
<div class="topnav">
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="home.html">Home <i class="fa fa-home" aria-hidden="true"></i></a>
<div class="dropdown">
<div class="dropbtn">Category <i class="fa fa-list-alt" aria-hidden="true"></i>
</div>
<div class="dropdown-content">
<a href="covid.php" style="color: blanchedalmond;font-size: medium;">Covid Supply</a>
<a href="diabetes.php" style="color: blanchedalmond;font-size: medium;">Diabetics</a>
<a href="cold.php" style="color: blanchedalmond; font-size: medium;">Cold & Fever</a>
<a href="bp.php" style="color: blanchedalmond;font-size: medium;">Blood pressure</a>
<a href="cardio.php" style="color: blanchedalmond;font-size: medium;">CardioVascular
Meds</a>
</div>
</div>
<a href="https://www.medscape.com/">MedUpdates <i class="fa fa-newspaper-o" aria-hidden="true"></i></a>
<a href="cart.php">Cart <i class="fa fa-cart" aria-hidden="true"></i></a>
<a href="log.php">Log Out <i class="fa fa-sign-out" aria-hidden="true"></i></a>
</div>
</div>
<span style="font-size:30px;cursor:pointer" onclick="openNav()">☰ Menu</span>
</header>
<?php
if (!empty($_SESSION["shopping_cart"])) {
$cart_count = count(array_keys($_SESSION["shopping_cart"]));
?>
<div class="cart_div">
<a href="cart.php">Cart<span><?php echo $cart_count; ?></span></a>
</div>
<?php
} ?>
<hr>
<br>
<h2 style="text-align: center;">CardioVascular Medicines</h2>
<p>
Cardiovascular disease (CVD) is a general term for conditions affecting the heart or blood vessels.
It's usually associated with a build-up of fatty deposits inside the arteries (atherosclerosis) and an increased
risk of blood clots.
It can also be associated with damage to arteries in organs such as the brain, heart, kidneys and eyes.
CVD is one of the main causes of death and disability in the UK, but it can often largely be prevented by
leading a healthy lifestyle.
<br><br>
The exact cause of CVD isn't clear, but there are lots of things that can increase your risk of getting it.
These are called "risk factors".
The more risk factors you have, the greater your chances of developing CVD.
If you're over 40, you'll be invited by your GP for an NHS Health Check every 5 years.
Part of this check involves assessing your individual CVD risk and advising you how to reduce it if necessary.
The main risk factors for CVD are outlined below.
</p>
<br>
<h3 style="text-align: center;">Its Types and Causes:</h3>
<center>
<button id="tags"><a href="https://www.nhs.uk/conditions/cardiovascular-disease/#:~:text=Home-,Cardiovascular%20disease,increased%20risk%20of%20blood%20clots.">
Blood pressure class</a></button>
</center>
<br>
<hr>
<?php
$no=1;
$result = mysqli_query($con, "SELECT * FROM `cart` WHERE id>=17 and id<21;");
while ($row = mysqli_fetch_assoc($result)) {
echo "
<div class='card'>
<br>
<div class='prod_info'>
<div class='prodcont'>
<div class='rate' id='points".$no."' >
Reviews : ".$row['location']."
</div>
<br>
<div class='image'><img src='" . $row['image'] . "'; width='350px'; /></div>
<form method='post' action=''>
<input type='hidden' name='code' value=" . $row['code'] . " />
<div class='addbtn3'>
<div class='name'>" . $row['name'] . "</div>
<div class='price'>$" . $row['price'] . "</div>
</div>
<button type='submit' class='buy'>Buy Now</button>
<span onclick='showcmt".$no."()' class='addBtn2'>Comments</span>
<br><br>
<div id='popon".$no."' class='backpop'>
<div id='popin".$no."' class='contpop'>
<span onclick='closecmt".$no."()' class='close'>×</span>
<div id='myDIV' class='header'>
<h2 style='margin:5px'>Comments</h2>
<input type='text' id='myInput".$no."' placeholder='Your comment...'>
<span onclick='newElement".$no."()' class='addBtn'>Add</span>
</div>
<ul id='myUL".$no."'>
<li>The product has worked like a charm. Thank you!!</li>
</ul>
</div>
</div>
<br><br>
</div>
</div>
</form>
</div>";
$no++;
}
mysqli_close($con);
?>
<script type="text/javascript">
var globalcount=0;
function showcmt1() {
var modal1 = document.getElementById("popon1");
modal1.style.display = "block";
}
function showcmt2() {
var modal2 = document.getElementById("popon2");
modal2.style.display = "block";
}
function showcmt3() {
var modal3 = document.getElementById("popon3");
modal3.style.display = "block";
}
function showcmt4() {
var modal4 = document.getElementById("popon4");
modal4.style.display = "block";
}
function closecmt1() {
var modal1 = document.getElementById("popon1");
modal1.style.display = "none";
}
function closecmt2() {
var modal2 = document.getElementById("popon2");
modal2.style.display = "none";
}
function closecmt3() {
var modal3 = document.getElementById("popon3");
modal3.style.display = "none";
}
function closecmt4() {
var modal4 = document.getElementById("popon4");
modal4.style.display = "none";
}
// Create a new list item when clicking on the "Add" button
function newElement1() {
var li = document.createElement("li");
var inputValue = document.getElementById("myInput1").value;
var t = document.createTextNode(inputValue);
li.appendChild(t);
if (inputValue === '') {
alert("You must write something!");
} else {
document.getElementById("myUL1").appendChild(li);
if (globalcount%2 == 0)
{
document.getElementById("points1").innerHTML = "Reviews : 5";
}
else{
document.getElementById("points1").innerHTML = "Reviews : 4";
}
globalcount++;
}
document.getElementById("myInput1").value = "";
for (i = 0; i < close.length; i++) {
close[i].onclick = function() {
var div = this.parentElement;
div.style.display = "none";
}
}
}
function newElement2() {
var li = document.createElement("li");
var inputValue = document.getElementById("myInput2").value;
var t = document.createTextNode(inputValue);
li.appendChild(t);
if (inputValue === '') {
alert("You must write something!");
} else {
document.getElementById("myUL2").appendChild(li);
if (globalcount%2 == 0)
{
document.getElementById("points2").innerHTML = "Reviews : 5";
}
else{
document.getElementById("points2").innerHTML = "Reviews : 4";
}
globalcount++;
}
document.getElementById("myInput2").value = "";
for (i = 0; i < close.length; i++) {
close[i].onclick = function() {
var div = this.parentElement;
div.style.display = "none";
}
}
}
function newElement3() {
var li = document.createElement("li");
var inputValue = document.getElementById("myInput3").value;
var t = document.createTextNode(inputValue);
li.appendChild(t);
if (inputValue === '') {
alert("You must write something!");
} else {
document.getElementById("myUL3").appendChild(li);
if (globalcount%2 == 0)
{
document.getElementById("points3").innerHTML = "Reviews : 5";
}
else{
document.getElementById("points3").innerHTML = "Reviews : 4";
}
globalcount++;
}
document.getElementById("myInput3").value = "";
for (i = 0; i < close.length; i++) {
close[i].onclick = function() {
var div = this.parentElement;
div.style.display = "none";
}
}
}
function newElement4() {
var li = document.createElement("li");
var inputValue = document.getElementById("myInput4").value;
var t = document.createTextNode(inputValue);
li.appendChild(t);
if (inputValue === '') {
alert("You must write something!");
} else {
document.getElementById("myUL4").appendChild(li);
if (globalcount%2 == 0)
{
document.getElementById("points4").innerHTML = "Reviews : 5";
}
else{
document.getElementById("points4").innerHTML = "Reviews : 4";
}
globalcount++;
}
document.getElementById("myInput4").value = "";
for (i = 0; i < close.length; i++) {
close[i].onclick = function() {
var div = this.parentElement;
div.style.display = "none";
}
}
}
</script>
<br><br><br><br><br><br>
<div class="bottom">
<div style="clear:both;"></div>
<div class="message_box" style="margin:10px 0px;">
<?php echo $status; ?>
</div>
<div class="footer">
<br><br>
<h2>About</h2>
This is a medical store website developed using html and css
<br>
<p>for more information contact us:<br> [email protected]
<br>Mobileno-98246XXXXX</p>
</div>
<marquee scrollamount="15">
<h4>We ensure contact free delivery and highest quality. Daily offers on medicine avaliable. Avail now</h4>
</marquee>
</body>
</html>