forked from jewpaltz/2014FallWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
food.php
127 lines (116 loc) · 3.63 KB
/
food.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
<?
include 'inc/global_includes.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fitness Tracker</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="content/css/main.css">
</head>
<body>
<div id="top-nav"></div>
<header>
<div class="container">
<h1>Fitness Tracker - Food</h1>
</div>
</header>
<div class="container content">
<?
$msg = null;
$arr = array('first' => 'breakfast', 'second' => 'lunch' , 'third' => 'dinner');
$arr['fourth'] = 'midnight snack';
//my_print ($arr);
$meal = $arr['first'];
$msg = "Excelent Job. Your $arr[second] has been recorded";
?>
<a class="btn btn-success" data-toggle="modal" data-target="#myModal" href="_food_form.html">
<i class="glyphicon glyphicon-plus"></i>
Add
</a>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" >
<div class="modal-dialog">
<div class="modal-content">
</div>
</div>
</div>
<!-- Alert -->
<? foreach($arr as $key => $meal): ?>
<div class="alert alert-success initialy-hidden" id="myAlert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span><span class="sr-only">Close</span>
</button>
Excelent Job. Your <?=$key?> meal i.e. <?=$meal?> has been recorded
</div>
<? endforeach; ?>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Calories</th>
<th>Fat (g)</th>
<th>Carbs (g)</th>
<th>Fiber (g)</th>
<th>Protien (g)</th>
<th>Time</th>
</tr>
</thead>
<tbody>
<tr>
<td>Pizza</td>
<td>500</td>
<td>18.0</td>
<td>5.0</td>
<td>2.0</td>
<td>3.0</td>
<td> Sunday 9:15am</td>
</tr>
<tr>
<td>Yogurt</td>
<td>80</td>
<td>0.5</td>
<td>0.0</td>
<td>0.0</td>
<td>3.0</td>
<td> Sunday 10:15am</td>
</tr>
<tr>
<td>Slim-Bar</td>
<td>100</td>
<td>2.0</td>
<td>5.0</td>
<td>5.0</td>
<td>3.0</td>
<td> Sunday 11:15am</td>
</tr>
</tbody>
</table>
</div>
</div>
<footer>
<div class="container">
<p>
© Copyright by Moshe
</p>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/holder/2.4.0/holder.js"></script>
<script type="text/javascript">
$(function(){
$("#top-nav").load("inc/_nav.html", function(){
$(".food").addClass("active");
});
$('#myModal').on('hidden.bs.modal', function (e) {
$("#myAlert").show();
})
});
</script>
</body>
</html>