-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewShop.php
More file actions
161 lines (157 loc) · 8.88 KB
/
Copy pathviewShop.php
File metadata and controls
161 lines (157 loc) · 8.88 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
151
152
153
154
155
156
157
158
159
160
161
<?php
session_start();
require_once "includes/Connection.php";
if(count($_SESSION['cart'])<=0){
header("location:/findParts.php");
}
$conn = new Connection();
?>
<html lang="en">
<head>
<title><?php echo WEBSITE_NAME." - Find Parts"; ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/logo.png" type="image/png" sizes="32x32">
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="assets/fontawesome/css/all.min.css" rel="stylesheet" type="text/css">
<link href="assets/bootstrap-social/bootstrap-social.css" rel="stylesheet" type="text/css">
<link href="assets/animate/animate.min.css" rel="stylesheet" type="text/css">
<link href="assets/main.css" rel="stylesheet" type="text/css">
<style type="text/css">
.dropdown-toggle::after{
display: none; !important;
}
</style>
</head>
<body>
<?php require_once "includes/header.php"?><br><br>
<div class="container-fluid p-5" style="min-height: 62vh;"><?php
include "admin/functions/responses.php";
if(isset($_SESSION['cart']) && count($_SESSION['cart']) > 0) { ?>
<div class="card border-0">
<div class="card-header bg-white">
<h2 class="text-center"><u>For All Selected Parts</u></h2>
</div>
<div class="card-body p-0">
<?php
$shoppes = $conn->getShopForParts($_SESSION['cart']);
if($shoppes != null) { ?>
<table class="table table-bordered table-responsive-sm table-hover table-striped">
<thead class="text-center bg-dark text-white">
<tr>
<th>No</th>
<th>Name</th>
<th>Contact no.</th>
<th>Address</th>
</tr>
</thead>
<tbody class="text-center">
<?php
$count = 1;
foreach ($shoppes as $sid) {
$shop = $conn->getShopInfo($sid); ?>
<tr>
<td><?php echo $count++; ?></td>
<td>
<u data-toggle="popover"
data-full="../images/shop/<?php echo $shop['image']; ?>"
data-height="150"
data-width="200"><?php echo $shop['name']; ?></u>
</td>
<td><?php echo $shop['phone_no']; ?></td>
<td><?php echo $shop['addr_fline'] . "<br>" . $shop['addr_sline'] . "<br>" . $shop['city'] . ", " . $shop['state'] . " (" . $shop['pin_code'] . ")"; ?></td>
</tr><?php
}
?>
</tbody>
</table><?php
} else {
echo "<div class='text-grey text-center bg-black-10 p-5'>No Shop Found For This Part</div>";
}
?>
</div>
</div><?php
}
?>
<br><br>
<h2 class="text-center"><u>For Individual Parts</u></h2>
<?php
if(isset($_SESSION['cart']) && count($_SESSION['cart']) > 0) {
foreach ($_SESSION['cart'] as $id) {
/** @var Shop[] $shoppes */
$shoppes = $conn->getShopForPart($id);
$part = $conn->getPartBasicInfo($id);?>
<div class="card border-0">
<div class="card-header bg-white">
<h5 class="text-center">
<u data-toggle="popover" data-full="../images/parts/<?php echo $part['image']; ?>" data-height="150" data-width="200"><?php echo $part['name']; ?></u>
</h5>
</div>
<div class="card-body p-0">
<?php if($shoppes != null) { ?>
<table class="table table-bordered table-responsive-sm table-hover table-striped">
<thead class="text-center bg-dark text-white">
<tr>
<th>No</th>
<th>Name</th>
<th>Contact no.</th>
<th>Address</th>
</tr>
</thead>
<tbody class="text-center">
<?php
$count = 1;
foreach ($shoppes as $shop) { ?>
<tr>
<td><?php echo $count++; ?></td>
<td>
<u data-toggle="popover" data-full="../images/shop/<?php echo $shop->getImage(); ?>" data-height="150" data-width="200"><?php echo $shop->getName(); ?></u>
</td>
<td><?php echo $shop->getPhone(); ?></td>
<td><?php echo $shop->getAddrFline()."<br>".$shop->getAddrSline()."<br>".$shop->getCity().", ".$shop->getState()." (".$shop->getPinCode().")"; ?></td>
</tr><?php
}
?>
</tbody>
</table><?php
} else {
echo "<div class='text-grey text-center bg-black-10 p-5'>No Shop Found For These Parts</div>";
}
?>
</div>
</div><br><br><?php
}
}
?>
<br>
<div class="text-center">
<a href="findParts.php" class="btn btn-dark btn-lg bg-black">Go Back</a>
</div>
</div>
<?php require_once "includes/footer.php"?>
<script src="assets/jquery.min.js" type="text/javascript"></script>
<script src="assets/popper/popper.min.js" type="text/javascript"></script>
<script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/fontawesome/js/fontawesome.min.js" type="text/javascript"></script>
<script src="assets/main.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function($) {
$(".alert").fadeTo(1000, 500).slideUp(500, function(){
$("#success-alert").alert('close');
});
$('[data-toggle="popover"]').popover({
html: true,
placement: 'auto',
trigger: 'hover',
boundary: 'viewport',
content: function() {
let url = $(this).data('full');
let hei = $(this).data('height');
let wid = $(this).data('width');
return '<img src="' + url + '" height="' + hei + '" width="'+ wid +'" alt="Image">'
}
});
});
</script>
</body>
</html>