-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbmi.html
413 lines (337 loc) · 12.6 KB
/
bmi.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link rel="stylesheet" href="" />
<link rel="stylesheet" href="style.css">
</head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="CareMed demo project">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styles/bootstrap4/bootstrap.min.css">
<link href="plugins/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="plugins/OwlCarousel2-2.2.1/owl.carousel.css">
<link rel="stylesheet" type="text/css" href="plugins/OwlCarousel2-2.2.1/owl.theme.default.css">
<link rel="stylesheet" type="text/css" href="plugins/OwlCarousel2-2.2.1/animate.css">
<link rel="stylesheet" type="text/css" href="styles/main_styles.css">
<link rel="stylesheet" type="text/css" href="styles/responsive.css">
<link rel="stylesheet" type="text/css" href="styles/about.css">
<link rel="stylesheet" type="text/css" href="styles/about_responsive.css">
</head>
<body>
<div class="super_container">
<!-- Header -->
<header class="header trans_200">
<!-- Top Bar -->
<div class="top_bar">
<div class="container">
<div class="row">
<div class="col">
<div class="top_bar_content d-flex flex-row align-items-center justify-content-start">
<div class="emergencies d-flex flex-row align-items-center justify-content-start ml-auto">For Emergencies: 102</div>
</div>
</div>
</div>
</div>
</div>
<!-- Header Content -->
<div class="header_container">
<div class="container">
<div class="row">
<div class="col">
<div class="header_content d-flex flex-row align-items-center justify-content-start">
<nav class="main_nav ml-auto">
<ul>
<li class="menu_item menu_mm"><a href="home.html">Home</a></li>
<li class="menu_item menu_mm"><a href="bmi.html">BMI & BMR Analysis</a></li>
<li class="menu_item menu_mm"><a href="disease.php">Malaria Analysis </a></li>
<li class="menu_item menu_mm"><a href="dsearch.php">Disease Search</a></li>
<li class="menu_item menu_mm"><a href="msearch.php">Medicine Search</a></li>
<li class="menu_item menu_mm"><a href="javascript:myFunction();">Log Out</a></li>
</ul>
</nav>
<div class="hamburger ml-auto"><i class="fa fa-bars" aria-hidden="true"></i></div>
</div>
</div>
</div>
</div>
</div>
<!-- Logo -->
<div class="logo_container_outer">
<div class="container">
<div class="row">
<div class="col">
<div class="col-lg-5">
<div class="logo_container">
<a href="#">
<div class="about_image"><img src="imagehac.png" alt=""></div>
</a>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Menu -->
<div class="menu_container menu_mm">
<!-- Menu Close Button -->
<div class="menu_close_container">
<div class="menu_close"></div>
</div>
<!-- Menu Items -->
<div class="menu_inner menu_mm">
<div class="menu menu_mm">
<ul class="menu_list menu_mm">
<li class="menu_item menu_mm"><a href="home.html">Home</a></li>
<li class="menu_item menu_mm"><a href="bmi.html">BMI & BMR Analysis</a></li>
<li class="menu_item menu_mm"><a href="disease.php">Malaria Analysis </a></li>
<li class="menu_item menu_mm"><a href="dsearch.php">Disease Search</a></li>
<li class="menu_item menu_mm"><a href="msearch.php">Medicine Search</a></li>
<li class="menu_item menu_mm"><a href="logout.html">Log Out</a></li>
</ul>
</div>
<div class="menu_extra">
<div class="menu_emergencies">For Emergencies: 102</div>
</div>
<
</div>
</div>
<!-- Home -->
<div class="home">
<div class="home_background parallax-window" data-parallax="scroll" data-image-src="images/about.jpg" data-speed="0.8"></div>
<div class="home_container">
<div class="container">
<div class="row">
<div class="col">
<div class="home_content">
<div class="home_title">BMI & BMR <span>Calculator</span></div>
<div class="breadcrumbs">
<ul>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<h1 class="brand"><span>BMI & BMR Calculator</span> Plan your Diet Chart</h1>
<div class="wrapper">
<div class="company-info">
</div>
<div class="contact">
<div class="alert">Database have been updated.</div>
<form id="contactForm" action="#" method="post">
<p>
<label>Name</label>
<input type="text" name="name" id="name" required placeholder="Enter your name">
</p>
<p>
<label>Age</label>
<input type="text" name="age" id="age" required placeholder="Age">
</p>
<p>
<label>Weight</label>
<input type="text" name="weight" id="weight" required placeholder="Weight in KG">
</p>
<p>
<label>Height</label>
<input type="text" name="height" id="height" required placeholder="Height in feet">
</p>
<p>
<label>Gender</label>
<input type="text" name="gender" id="gender" required placeholder="Gender">
</p>
<br>
<label> Activity Factor</label>
<br><select name="activity" id="activity">
<option value="Little or no exercise"> Little or no exercise<br>
<option value="Light exercise/sports 1-3 days/week">Light exercise/sports 1-3 days/week<br>
<option value="Moderate exercise/sports 3-5 days/week"> Moderate exercise/sports 3-5 days/week<br>
<option value="Hard exercise/sports 6-7 days a week"> Hard exercise/sports 6-7 days a week<br>
<option value="Very hard exercise/sports & physical job or 2x training"> Very hard exercise/sports & physical job or 2x training<br>
</select>
<br>
<p class="full">
<input type="submit" name="submit" id="submit" >
</p>
<p id="demo">
</p>
</form>
Diet Plan:
<br>
<textarea rows="8" cols="80" id="info">
</textarea>
</div>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/4.3.0/firebase.js"></script>
<br>
<br>
<script>
function myFunction() {
var txt;
if (confirm("Are you sure you want to log out ?")) {
window.location.href = "index.html";
} else {
}
document.getElementById("demo").innerHTML = txt;
}
</script>
<p id="demo"></p>
<script>
// Initialize Firebase (ADD YOUR OWN DATA)
var firebaseConfig = {
apiKey: "AIzaSyC72TTnfW6r2DGyBlQQJSAYIJyIpKCt4QA",
authDomain: "edoc-b5de1.firebaseapp.com",
databaseURL: "https://edoc-b5de1.firebaseio.com",
projectId: "edoc-b5de1",
storageBucket: "edoc-b5de1.appspot.com",
messagingSenderId: "1072128580110",
appId: "1:1072128580110:web:b5037102bfd030ca2e7a5f",
measurementId: "G-L9MH4YK8SH"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
// Reference messages collection
var messagesRef = firebase.database().ref('messages');
// Listen for form submit
document.getElementById('contactForm').addEventListener('submit', submitForm);
// Submit form
function submitForm(e){
e.preventDefault();
// Get values
var name = getInputVal('name');
var age = getInputVal('age');
var weight = getInputVal('weight');
var height = getInputVal('height');
var gender = getInputVal('gender');
var activity=getInputVal('activity');
var heightm=height*0.30;
//BMI
var bmi=(weight)/(heightm*heightm);
var bmr=0;
var cn=0;
var dietplan="";
if(gender.toLowerCase()=="male")
{
bmr=66+(13.7*weight)+(5*heightm*100)-(6.8*age);
}
else
{
bmr=655 + (9.6*weight) + (1.8 *height*100) - (4.7 *age);
}
//Calories Needed
if(activity.toLowerCase()=='little or no exercise')
{
cn=bmr*1.2;
if(gender.toLowerCase()=="male")
{
dietplan="Cereals-460gm,Pulses-40gm,Green Leafy Vegetable-40gm,Other Vegetable-60,Roots and Tubers-50,Milk and milk products-150,Oils and fats-40,Fruits-60,Sugar and jaggery-30";
}
else
{
dietplan="Cereals-410gm,Pulses-40gm,Green Leafy Vegetable-100gm,Other Vegetable-40,Roots and Tubers-50,Milk and milk products-100,Oils and fats-20,Fruits-60,Sugar and jaggery-20";
}
}
else if(activity.toLowerCase()=='light exercise/sports 1-3 days/week')
{
cn=bmr*1.375;
if(gender.toLowerCase()=="male")
{
dietplan="Cereals-460gm,Pulses-40gm,Green Leafy Vegetable-40gm,Other Vegetable-60,Roots and Tubers-50,Milk and milk products-150,Oils and fats-40,Fruits-60,Sugar and jaggery-30";
}
else
{
dietplan="Cereals-410gm,Pulses-40gm,Green Leafy Vegetable-100gm,Other Vegetable-40,Roots and Tubers-50,Milk and milk products-100,Oils and fats-20,Fruits-60,Sugar and jaggery-20";
}
}
else if(activity.toLowerCase()=='moderate exercise/sports 3-5 days/week')
{
cn=bmr*1.55;
if(gender.toLowerCase()=="male")
{
dietplan="Cereals-520gm,Pulses-50gm,Green Leafy Vegetable-40gm,Other Vegetable-70,Roots and Tubers-60,Milk and milk products-200,Oils and fats-45,Fruits-60,Sugar and jaggery-35";
}
else
{
dietplan="Cereals-410gm,Pulses-40gm,Green Leafy Vegetable-100gm,Other Vegetable-40,Roots and Tubers-50,Milk and milk products-100,Oils and fats-20,Fruits-60,Sugar and jaggery-20";
}
}
else if(activity.toLowerCase()=='hard exercise/sports 6-7 days a week')
{
cn=bmr*1.725;
if(gender.toLowerCase()=="male")
{
dietplan="Cereals-670gm,Pulses-60gm,Green Leafy Vegetable-40gm,Other Vegetable-80,Roots and Tubers-80,Milk and milk products-250,Oils and fats-65,Fruits-60,Sugar and jaggery-55";
}
else
{
dietplan="Cereals-440gm,Pulses-45gm,Green Leafy Vegetable-100gm,Other Vegetable-40,Roots and Tubers-50,Milk and milk products-120,Oils and fats-25,Fruits-60,Sugar and jaggery-20";
}
}
else if(activity.toLowerCase()=='very hard exercise/sports & physical job or 2x training')
{
cn=bmr*1.9;
if(gender.toLowerCase()=="male")
{
dietplan="Cereals-670gm,Pulses-60gm,Green Leafy Vegetable-40gm,Other Vegetable-80,Roots and Tubers-80,Milk and milk products-250,Oils and fats-65,Fruits-60,Sugar and jaggery-55";
}
else
{
dietplan="Cereals-440gm,Pulses-45gm,Green Leafy Vegetable-100gm,Other Vegetable-40,Roots and Tubers-50,Milk and milk products-120,Oils and fats-25,Fruits-60,Sugar and jaggery-20";
}
}
//var message = getInputVal('message');
// Save message
saveMessage(name, age, weight, height,gender,activity,bmi,bmr,cn,dietplan);
// Show alert
document.querySelector('.alert').style.display = 'block';
// Hide alert after 3 seconds
setTimeout(function(){
document.querySelector('.alert').style.display = 'none';
},3000);
// Clear form
// document.getElementById('contactForm').reset();
}
// Function to get get form values
function getInputVal(id){
return document.getElementById(id).value;
}
function saveMessage(name, age, weight, height,gender,activity,bmi,bmr,cn,dietplan){
var newMessageRef = messagesRef.push();
newMessageRef.set({
name: name,
age:age,
weight:weight,
height:height,
gender:gender,
activity:activity,
bmi:bmi,
bmr:bmr,
cn:cn,
dietplan:dietplan
});
document.getElementById("info").innerHTML="Diet Plan:-"+dietplan;
// Save message to firebase
}</script>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="styles/bootstrap4/popper.js"></script>
<script src="styles/bootstrap4/bootstrap.min.js"></script>
<script src="plugins/greensock/TweenMax.min.js"></script>
<script src="plugins/greensock/TimelineMax.min.js"></script>
<script src="plugins/scrollmagic/ScrollMagic.min.js"></script>
<script src="plugins/greensock/animation.gsap.min.js"></script>
<script src="plugins/greensock/ScrollToPlugin.min.js"></script>
<script src="plugins/progressbar/progressbar.min.js"></script>
<script src="plugins/OwlCarousel2-2.2.1/owl.carousel.js"></script>
<script src="plugins/easing/easing.js"></script>
<script src="plugins/parallax-js-master/parallax.min.js"></script>
<script src="js/about.js"></script>
</body>
</html>