-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtry.html
210 lines (198 loc) · 8.14 KB
/
try.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Waste</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js">
<script src="js/control.js"></script>
</head>
<body ng-app="myApp">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Logo</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Home</a></li>
<li><input type="text" class="form-control" placeholder="Search" id="search"></li>
<li><button style="border-radius:10px" onclick="searchContent()">submit</button>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="index.html"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>
<div class="container" style="margin-top:5%">
<div class="row slideanim">
<div class="col-sm-6" height="100%">
<img src="img/washingmachine.png" height="60%" width="60%" alt="Image" class="img-responsive">
</div>
<div class="col-sm-6 col-xs-12">
<div class="panel panel-default text-center">
<div class="panel-heading">
<h1 id="title"></h1>
</div>
<div class="panel-body">
<p>Total Poluttion Release(made on creation,use and destruction of product):<strong id="totalpollution"></strong></p>
<p>Durability:<strong id="durability"></strong></p>
<p>Avaibility of spare parts:<strong id="avai"></strong></p>
<p>Plastic Content:<strong id="plasticcontent"></strong></p>
<p><i>Sustainable Point:</i><b id="sp"></b></p>
</div>
<div class="panel-footer">
<h3>₹<strong id="description"></strong></h3>
<button class="btn btn-lg">Buy Now</button>
</div>
</div>
</div>
<div class="col-sm-6" height="100%">
<img src="img/washingmachine.jpg" height="60%" width="60%" alt="Image" class="img-responsive">
</div>
<div class="col-sm-6 col-xs-12">
<div class="panel panel-default text-center">
<div class="panel-heading">
<h1 id="title1"></h1>
</div>
<div class="panel-body">
<p>Total Poluttion Release(made on creation,use and destruction of product):<strong id="totalpollution1"></strong></p>
<p>Durability:<strong id="durability1"></strong></p>
<p>Avaibility of spare parts:<strong id="avaibility1"></strong></p>
<p>Plastic Content:<strong id="plasticcontent1"></strong></p>
<p><i>Sustainable Point:</i><b id="sp1"></b></p>
</div>
<div class="panel-footer">
<h3>₹<strong id="description1"></strong></h3>
<button class="btn btn-lg">Buy Now</button>
</div>
</div>
</div>
</div>
</div>
<footer class="container-fluid text-center">
<div>
<ul>
<li>Contact Us</li>
<li>Terms & Conditions</li>
</ul>
</div>
</footer>
</body>
<script src="https://www.gstatic.com/firebasejs/5.4.0/firebase.js"></script>
<script src="js/script.js"></script>
<script>
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
var reqParamsearch = getUrlParameter('search');
var config = {
apiKey: "AIzaSyD-DxWbF_xEc45PG0g-byOzviU3vS0HXLQ",
authDomain: "wman-12.firebaseapp.com",
databaseURL: "https://wman-12.firebaseio.com",
projectId: "wman-12",
storageBucket: "wman-12.appspot.com",
messagingSenderId: "465471242460"
};
firebase.initializeApp(config);
var item = reqParamsearch;
var title=document.getElementById("title");
var titleRef=firebase.database().ref("products/"+ item+"/1");
titleRef.on('value',function(snapchild) {
var name=snapchild.child("name").val();
var poc=snapchild.child("poc").val();
var pou=snapchild.child("pou").val();
var pod=snapchild.child("pod").val();
var du=snapchild.child("du").val();
var aua=snapchild.child("av").val();
var pu=snapchild.child("pu").val();
var price=snapchild.child("price").val();
document.getElementById("title").innerHTML=name;
document.getElementById("totalpollution").innerHTML=pou+poc+pod;
document.getElementById("durability").innerHTML=du;
document.getElementById("avai").innerHTML=aua;
document.getElementById("plasticcontent").innerHTML=pu;
document.getElementById("description").innerHTML=price;
document.getElementById("sp").innerHTML=(du*10)+aua-pu-poc-pou-pod;
});
var title2=document.getElementById("title");
var title2Ref=firebase.database().ref("products/"+ item+"/2");
title2Ref.on('value',function(snapchild1) {
var name1=snapchild1.child("name").val();
var poc1=snapchild1.child("poc").val();
var pou1=snapchild1.child("pou").val();
var pod1=snapchild1.child("pod").val();
var du1=snapchild1.child("du").val();
var aua1=snapchild1.child("av").val();
var pu1=snapchild1.child("pu").val();
var price1=snapchild1.child("price").val();
document.getElementById("title1").innerHTML=name1;
document.getElementById("totalpollution1").innerHTML=pou1+poc1+pod1;
document.getElementById("durability1").innerHTML=du1;
document.getElementById("avaibility1").innerHTML=aua1;
document.getElementById("plasticcontent1").innerHTML=pu1;
document.getElementById("description1").innerHTML=price1;
document.getElementById("sp1").innerHTML=(du1*10)+aua1-pu1-poc1-pou1-pod1;
});
function searchContent(){
item=document.getElementById("search").value;
var title=document.getElementById("title");
var titleRef=firebase.database().ref("products/"+ item+"/1");
titleRef.on('value',function(snapchild) {
var name=snapchild.child("name").val();
var poc=snapchild.child("poc").val();
var pou=snapchild.child("pou").val();
var pod=snapchild.child("pod").val();
var du=snapchild.child("du").val();
var aua=snapchild.child("av").val();
var pu=snapchild.child("pu").val();
var price=snapchild.child("price").val();
document.getElementById("title").innerHTML=name;
document.getElementById("totalpollution").innerHTML=pou+poc+pod;
document.getElementById("durability").innerHTML=du;
document.getElementById("avai").innerHTML=aua;
document.getElementById("plasticcontent").innerHTML=pu;
document.getElementById("description").innerHTML=price;
document.getElementById("sp").innerHTML=du*10+av-pu-poc-pou-pod;
});
var title2=document.getElementById("title");
var title2Ref=firebase.database().ref("products/"+ item+"/2");
title2Ref.on('value',function(snapchild1) {
var name1=snapchild1.child("name").val();
var poc1=snapchild1.child("poc").val();
var pou1=snapchild1.child("pou").val();
var pod1=snapchild1.child("pod").val();
var du1=snapchild1.child("du").val();
var aua1=snapchild1.child("av").val();
console.log(aua1);
var pu1=snapchild1.child("pu").val();
var price1=snapchild1.child("price").val();
document.getElementById("title1").innerHTML=name1;
document.getElementById("totalpollution1").innerHTML=pou1+poc1+pod1;
document.getElementById("durability1").innerHTML=du1;
document.getElementById("avaibility1").innerHTML=aua1;
document.getElementById("plasticcontent1").innerHTML=pu1;
document.getElementById("description1").innerHTML=price1;
document.getElementById("sp1").innerHTML=(du1*10)+aua1-pu1-poc1-pou1-pod1;
});}
</script>
</html>