forked from Crizana/Triple-J-CO
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
205 lines (191 loc) · 6.87 KB
/
Copy pathindex.php
File metadata and controls
205 lines (191 loc) · 6.87 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Healthspenditure | HOME</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="style2.css">
<script src="jquery-2.1.4.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
</head>
<body>
<div class="wrapper">
<div class="navbar transparent navbar-inverse">
<img class="logo" src="images/logo2.png">
</div>
<div style="background-color: rgba(0,0,0,.5);">
<div class="text-center header">
<h1>Spend your money wisely for your health</h1>
<h3>Know the right foods you should eat</h3>
<h3>Find delicious recipes safe for you</h3>
</div>
<div class="controller-wrapper">
<form action="index.php" method="post">
<input type ="text" class="hidden" name="illnessValue" id="illnessValue">
<input type ="text" class="hidden" name="marketValue" id="marketValue">
<input type ="text" class="hidden" name="autoValue" id="autoValue">
<div class="form-inline text-center">
<div class="dropdown illness">
<button class="I_design dropdown-toggle" type="button" data-toggle="dropdown" id="illness">Select your illness
<span class="caret"></span>
</button>
<ul class="dropdown-menu illness">
<li><a>Highblood</a></li>
<li><a>Diabetes</a></li>
<li><a>Cholesterol</a></li>
<li><a>Anemia</a></li>
<li><a>Diarrhea</a></li>
<li><a>Heart_Disease</a></li>
<li><a>Stress</a></li>
<li><a>Goiter</a></li>
</ul>
</div>
<div class="dropdown market">
<button class="I_design dropdown-toggle" type="button" data-toggle="dropdown" id="market">Select market
<span class="caret"></span>
</button>
<ul class="dropdown-menu market">
<li><a>SM Supermarket</a></li>
<li><a>Meadows Grocery</a></li>
</ul>
</div>
<button type="submit" class="btn btn-default btn-lg" id="gobtn" name="gobtn"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</div>
<div class="checkbox highlight4 text-center center-block">
<label><input type="checkbox" value="" name="auto" id="auto">Automatically Search Nearby Market</label>
</div>
</form>
</div>
<div class="mobile-info text-center hide">
<button class="I_design" style="width:50%;">Mobile Application Soon...</button>
</div>
<script>
$(function(){
$(".dropdown-menu.illness li a").click(function(){
$("#illness:first-child").text($(this).text());
$("#illness:first-child").val($(this).text());
$("#illness:first-child").append(' <span class="caret"></span>');
$("#illnessValue").val($(this).text());
});
$(".dropdown-menu.market li a").click(function(){
$("#market:first-child").text($(this).text());
$("#market:first-child").val($(this).text());
$("#market:first-child").append(' <span class="caret"></span>');
$("#marketValue").val($(this).text());
});
$("#auto").click(function(){
if ($('#auto').prop('checked')) {
$("#autoValue").val('true');
$("#market").prop('disabled',true);
$("#market").removeClass("I_design").addClass("disabledbtn");
$('#auto').prop('unchecked')
}
else{
$("#autoValue").val('false');
$("#market").prop('disabled',false);
$("#market").removeClass("disabledbtn").addClass("I_design");
$('#auto').prop('checked')
}
});
});
</script>
<?php
if(isset($_POST['gobtn']))
{
$con = mysql_connect("localhost","username","password"); // Change connection here
if(!$con){
die("can not connect:" . mysql_error());
}
mysql_select_db("databasename",$con); // Database name
$sql = "SELECT * FROM decision";
$insertData = "INSERT INTO `decision` (illness, market, autox) VALUES ('$_POST[illnessValue]', '$_POST[marketValue]', '$_POST[autoValue]')";
$result = mysql_query($sql,$con);
if(mysql_num_rows($result) == 0)
{
mysql_query($insertData,$con);
}
else
{
$sql = "TRUNCATE TABLE `decision`";
mysql_query($sql);
mysql_query($insertData,$con);
}
header("Location: Page1.php");
exit();
mysql_close($con);
}
?>
</div>
</div>
<div class="middle">
<div class='text-center how-it-works'>
<h4>HOW HEALTHSPENDITURE WORKS</h4>
<p>Healthspenditure is a web application that helps you cure your illness in a simple way.<br>
Providing healthy foods you need and prices for ingredients helping you to budget your money.<br>
With Healthspenditure, we can spend our money wisely and have a longer and better life.
</p>
</div>
<div class="row text-center">
<div class="col-md-4">
<div class="icon-holder">
<span class="glyphicon glyphicon-list-alt"></span>
</div>
<div class="content">
<div class="content-header">
<h4>Recommended Foods</h4>
</div>
Automatically list top 10 recommended and non-recommended foods for your illness together with the price.
</div>
</div>
<div class="col-md-4">
<div class="icon-holder">
<span class="glyphicon glyphicon-map-marker"></span>
</div>
<div class="content">
<div class="content-header">
<h4>Market Location</h4>
</div>
Display nearby markets on your current location or specific market where you can buy foods automatically for you.
</div>
</div>
<div class="col-md-4">
<div class="icon-holder">
<span class="glyphicon glyphicon-pencil"></span>
</div>
<div class="content">
<div class="content-header">
<h4>Available Recipes</h4>
</div>
Suggest foods that helps cure your illness providing the ingredients and steps on how to cook it.
</div>
</div>
</div>
<div class="about">
<div class="content-holder">
<h2>ABOUT US</h2>
<p>The Developers are Jerico Rillo, Raga Czarina Pangcoga, Ernest John Jashuel Callo, John Russel Alfonso, and Omega Mina.<br/>
The Healthspenditure web application was developed during the DLSU Hackercup 2015 happened on November 21-22, 2015.
</p>
<p>Healthspenditure is currently in its beta phase. You can help us improve this app by providing suggestions and leaving us a feedback. CHEERS!</p>
</div>
</div>
<div class="footer">
All rights reserved © 2016
</div>
</div>
</body>
<script>
$(function(){
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
$(".controller-wrapper").addClass("hide");
$(".mobile-info").addClass("show");
}
else{
$(".controller-wrapper").addClass("show");
$(".mobile-info").addClass("hide");
}
});
</script>
</html>