-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtop.php
225 lines (211 loc) · 12.2 KB
/
top.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
<?php
require('connection.inc.php');
require('function.inc.php');
require('add_to_cart.inc.php');
$cat_res = mysqli_query($con, "select * from categories where status=1 order by categories desc limit 4");
$cat_arr = array();
while ($row = mysqli_fetch_assoc($cat_res)) {
$cat_arr[] = $row;
}
$obj = new add_to_cart();
$totalProduct = $obj->totalProduct();
if (isset($_SESSION['USER_LOGIN'])) {
$uid = $_SESSION['USER_ID'];
if (isset($_GET['wishlist_id'])) {
$wid = get_safe_value($con, $_GET['wishlist_id']);
mysqli_query($con, "delete from wishlist where id='$wid' and user_id='$uid'");
}
$sql = "SELECT p.name, p.image, p.price, p.mrp, w.id FROM wishlist AS w";
$sql .= " INNER JOIN product AS p ON w.product_id=p.id";
$sql .= " WHERE w.user_id='$uid'";
$wishlist_count = mysqli_num_rows(mysqli_query($con, $sql));
}
$script_name = $_SERVER['SCRIPT_NAME'];
$script_name_arr = explode('/', $script_name);
$mypage = $script_name_arr[count($script_name_arr) - 1];
$meta_title = 'Online Shopping Site for Fashion, Electronics';
$meta_desc = 'Online Shopping Site for Fashion, Electronics';
$meta_keyword = 'Online Shopping Site for Fashion, Electronics';
$meta_url = SITE_PATH;
$meta_image = "general.png";
if ($mypage == 'product.php') {
$product_id = get_safe_value($con, $_GET['id']);
$product_meta = mysqli_fetch_assoc(mysqli_query($con, "select * from product where id='$product_id'"));
$meta_title = $product_meta['meta_title'];
$meta_desc = $product_meta['meta_desc'];
$meta_keyword = $product_meta['meta_keyword'];
$meta_url = SITE_PATH . "product.php?id=" . $product_id;
$meta_image = PRODUCT_IMAGE_SITE_PATH . $product_meta['image'];
}
if ($mypage == 'contact.php') {
$meta_title = 'Contact Us';
}
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title><?php echo $meta_title ?></title>
<meta name="description" content="<?php echo $meta_desc ?>">
<meta name="keyword" content="<?php echo $meta_keyword ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="<?php echo $meta_title ?>">
<meta property="og:image" content="<?php echo $meta_image ?>">
<meta property="og:url" content="<?php echo $meta_url ?>">
<meta property="og:site_name" content="<?php echo SITE_PATH ?>">
<!-- Place favicon.ico in the root directory -->
<link rel="shortcut icon" type="image/x-icon" href="images/favicon_meri.ico">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- All css files are included here. -->
<!-- Bootstrap fremwork main css -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Owl Carousel min css -->
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/owl.theme.default.min.css">
<!-- This core.css file contents all plugings css file. -->
<link rel="stylesheet" href="css/core.css">
<!-- Theme shortcodes/elements style -->
<link rel="stylesheet" href="css/shortcode/shortcodes.css">
<!-- Theme main style -->
<link rel="stylesheet" href="style.css">
<!-- Responsive css -->
<link rel="stylesheet" href="css/responsive.css">
<!-- User style -->
<link rel="stylesheet" href="css/custom.css">
<!-- Modernizr JS -->
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
</head>
<body>
<div class="wrapper">
<header id="htc__header" class="htc__header__area header--one">
<div id="sticky-header-with-topbar" class="mainmenu__wrap sticky__header">
<div class="container">
<div class="row">
<div class="menumenu__container clearfix">
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-5">
<div class="logo">
<a href="index.php"><img src="images/logo/4.png" alt="logo images"></a>
</div>
</div>
<div class="col-md-7 col-lg-6 col-sm-5 col-xs-3">
<nav class="main__menu__nav hidden-xs hidden-sm">
<ul class="main__menu">
<li class="drop"><a href="index.php">Home</a></li>
<?php
foreach ($cat_arr as $list) {
?>
<li class="drop"><a href="categories.php?id=<?php echo $list['id'] ?>"><?php echo $list['categories'] ?></a>
<?php
$cat_id = $list['id'];
$sub_cat_res = mysqli_query($con, "select * from sub_categories where status='1' and categories_id='$cat_id'");
if (mysqli_num_rows($sub_cat_res) > 0) {
?>
<ul class="dropdown">
<?php while ($sub_cat_row = mysqli_fetch_assoc($sub_cat_res)) {
echo '<li><a href="categories.php?id=' . $list['id'] . '&sub_categories=' . $sub_cat_row['id'] . '">' . $sub_cat_row['sub_categories'] . '</a></li>';
}
?>
</ul>
<?php } ?>
</li>
<?php
}
?>
<li><a href="contact.php">contact</a></li>
</ul>
</nav>
<div class="mobile-menu clearfix visible-xs visible-sm">
<nav id="mobile_dropdown">
<ul>
<li><a href="index.php">Home</a></li>
<?php
foreach ($cat_arr as $list) {
?>
<li><a href="categories.php?id=<?php echo $list['id'] ?>"><?php echo $list['categories'] ?></a></li>
<?php
}
?>
<li><a href="contact.php">contact</a></li>
</ul>
</nav>
</div>
</div>
<div class="col-md-3 col-lg-4 col-sm-4 col-xs-4">
<div class="header__right">
<?php
$class = "mr15";
if (isset($_SESSION['USER_LOGIN'])) {
$class = "";
}
?>
<div class="header__search search search__open <?php echo $class ?>">
<a href="#"><i class="icon-magnifier icons"></i></a>
</div>
<div class="header__account">
<?php if (isset($_SESSION['USER_LOGIN'])) {
?>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
User
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="my_order.php">Order</a>
<a class="dropdown-item" href="profile.php">Profile</a>
<a class="dropdown-item" href="logout.php">Logout</a>
</div>
</li>
</ul>
</div>
</nav>
<?php
} else {
echo '<a href="login.php" class="mr15">Log/Sign</a>';
}
?>
</div>
<div class="htc__shopping__cart">
<?php if (isset($_SESSION['USER_ID'])) { ?>
<a class="cart__menu" href="wishlist.php"><i class="icon-heart icons"></i></a>
<a href="wishlist.php"><span class="htc__wishlist"><?php echo $wishlist_count ?></span></a>
<?php } ?>
</div>  
<div class="htc__shopping__cart">
<a class="cart__menu" href="cart.php"><i class="icon-handbag icons"></i></a>
<a href="cart.php"><span class="htc__qua"><?php echo $totalProduct ?></span></a>
</div>
</div>
</div>
</div>
</div>
<div class="mobile-menu-area"></div>
</div>
</div>
<!-- Start Offset Wrapper -->
<div class="offset__wrapper">
<!-- Start Search Popap -->
<div class="search__area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="search__inner">
<form action="search.php" method="get">
<input placeholder="Search here... " type="text" name="str">
<button type="submit"></button>
</form>
<div class="search__close__btn">
<span class="search__close__btn_icon"><i class="zmdi zmdi-close"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>