-
Notifications
You must be signed in to change notification settings - Fork 1
/
topmenu.php
141 lines (127 loc) · 5.72 KB
/
topmenu.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
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Online Store</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>-->
<script language="JavaScript" type="text/javascript">
function makeRequestObject() {
var xmlhttp = false;
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (this.readyState==4 && this.status==200) {
var ajaxCart = document.getElementById("cartcountinfo");
ajaxCart.innerHTML = xmlhttp.responseText;
}
}
return xmlhttp;
}
function updateCart() {
var xmlhttp = makeRequestObject();
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var ajaxCart = document.getElementById("cartcountinfo");
ajaxCart.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "countcart.php", true);
xmlhttp.send();
}
</script>
</head>
<!--<body>-->
<!--
<table width="100%" cellspacing="0">
<tr>
-->
<!-- Top navigation bar STARTS -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.php"><img src="images/cart.png"> <span>Online Retail Store</span></a>
</div>
<ul class="nav navbar-nav">
</ul>
<form class="navbar-form navbar-left" method="post" action="searchitems.php">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" name="tosearch">
</div>
<button type="submit" class="btn btn-default search-button">Search</button>
</form>
<ul class="nav navbar-nav navbar-right">
<?php
if(session_status() == PHP_SESSION_NONE) {
session_start();
}
if(isset($_SESSION['emailaddress'])) {
echo '<li><a href="cart.php"><img style="max-width: 20px;" src="images/cart.png"><span id="cartcountinfo"></span></a></li>';
echo "<li><a href='profile.php'>Welcome " . $_SESSION['complete_name'] . "</a></li>";
echo "<li><a href=\"logout.php\">Logout</a></li>";
} else {
echo '<li><a href="cart.php"><img style="max-width: 20px;" src="images/cart.png"><span id="cartcountinfo"></span></a></li>';
echo "<li><a href='signin.php'>Login</a></li>";
echo "<li><a href=\"signup.php\">Sign Up</a></li>";
}
?>
</ul>
</div>
</nav>
<!-- Top navbar ENDS -->
<!-- Navigation bar ENDS -->
<!--
<tr>
<td style="font-size: 35px; color: blue;">
<b>Online Store</b>
</td>
<td>
<form method="post" action="searchitems.php">
<input size="50" type="text" name="tosearch">
<input type="submit" name="submit" value="Search">
</form>
</td>
<td>
<a href="cart.php"><img style="max-width: 40px; max-height: 40px; width: auto; height: auto;" src="images/corner-logo.png"><span id="cartcountinfo"></span></a>
</td>
</tr>
</table>
<div class="container">
<nav>
<ul class="nav">
<li><a href="index.php">Home</a></li>
<li class="dropdown">
<a href="#">Electronics</a>
<ul>
<li><a href="itemlist.php?category=CellPhone">Smart Phones</a></li>
<li><a href="itemlist.php?category=Laptops">Laptops</a></li>
<li><a href="itemlist.php?category=Camera">Cameras</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#">Home & Furniture</a>
<ul class="large">
<li><a href="index.php">Kitchen Essentials</a></li>
<li><a href="index.php">Bath Essentials</a></li>
<li><a href="index.php">Furniture</a></li>
<li><a href="index.php">Dining & Serving</a></li>
<li><a href="index.php">Cookware</a></li>
</ul>
</li>
<li><a href="index.php">Books</a></li>
</ul>
</nav>
</div>
<p></p>
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>