-
Notifications
You must be signed in to change notification settings - Fork 0
/
shop.php
71 lines (63 loc) · 2.58 KB
/
shop.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
/**
* @author Jatin Tiwari
* @copyright 2024 Jatin Tiwari
* @license https://github.com/jatintiwari0/OTTbuy/blob/main/LICENSE Apache License 2.0
* @version 1.0
* @link https://github.com/jatintiwari0/OTTbuy
*/
<?php include("./auth.php"); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
<title>Readymade Account</title>
</head>
<body>
<?php
$sql = $conn->query("SELECT * FROM categorys");
while($data = $sql->fetch_assoc()){
$cat_id = $data['id'];
$sql2 = $conn->query("SELECT * FROM sell where category_id='$cat_id' and status='1'");
$count = mysqli_num_rows($sql2);
?>
<div class="card m-3 shadow">
<div class="card-body d-flex flex-column p-2">
<div class="card-text space-y-4">
<div class="d-flex align-items-center mb-0">
<img src="<?php echo $data['logo_url'];?>" class=" rounded-circle " style="margin-right:20px; font-size:20px;" height="55" width="55">
<div class="flex-grow-1">
<p class="mb-0" style="font-size: 15px; font-weight: bold;"><?php echo $data['name'];?></p>
<p class="text-LG mb-2" style="font-size: 15px;font-weight: bold; color: blueviolet;">Stocks : <?php echo $count;?></p>
</div>
<div class="mb-2">
<span class="badge rounded-pill bg-warning text-dark" style="font-size: 20px; font-weight: bold;">₹<?php echo $data['amount'];?></span>
</div>
</div>
<div class=" mx-auto mb-3 px-3 pt-3 m-3 align-items-center rounded " style="background-color: #f3f5f7;">
<p><?php echo $data['info'];?>
</div>
</div>
<?php
if($count > 0){
?>
<div>
<a href="check.php?id=<?php echo $cat_id;?>"><button class="btn btn-primary w-100 ">BUY NOW</button></a>
</div>
<?php
}else{
?>
<div>
<button class="btn btn-danger w-100 ">OUT OF STOCK</button>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php } ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>