-
Notifications
You must be signed in to change notification settings - Fork 0
/
trackMed.html
248 lines (212 loc) · 11.6 KB
/
trackMed.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
<!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">
<title>Meditation</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="styleTry.css" />
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<button class="navbar-toggler" data-toggle="collapse" data-target="#navMenu">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navMenu">
<ul class="navbar-nav">
<li class="nav-item"><a href="Timer.html" class="nav-link">Timer</a></li>
<li class="nav-item"><a href="blog%20page%20template.php" class="nav-link">Blog</a></li>
<li class="nav-item is-active"><a href="trackMed.html" class="nav-link">Tracker</a></li>
<li class="nav-item"><a href="resources.html" class="nav-link">Resources</a></li>
<li class="nav-item"><a href="contactUs.html" class="nav-link">Contact Us</a></li>
<input type="button" class = "btn btn-light btn-sm active" value="1" aria-pressed ="true" onclick="document.body.style.cssText+=';background-image: url(wow.jpg);background-repeat: no-repeat;background-size: cover;';" />
<input type="button" class = "btn btn-secondary btn-sm active" value="2" onclick="document.body.style.cssText+=';background-image: url(wow2.jpg);background-repeat: no-repeat;';" />
<input type="button" class = "btn btn-info btn-sm" value="3" onclick="document.body.style.cssText+=';background-image: url(wow3.jpg);background-repeat: no-repeat;';" />
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a href="index.php?logout=1" class="nav-link">Logout</a></li>
</ul>
</div>
</nav>
<!--
<div class="item active">
<img src="boat.jpg" class="rounded mx-auto d-block" alt="First slide"/>
</div>
-->
<div class="form-row text-center" style="padding-top: 5px; padding-bottom: 5px">
<div class="col-12">
<button class="btn btn-outline-primary btn-sm" onclick="quote()">Motivation</button>
</div>
</div>
<div class=" form-row text-center" >
<div class="col-12" id="quoteHere">
</div>
</div>
<!-- ADD Modal -->
<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Meditation Information</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="exampleInputEmail1">Enter date</label>
<input type="text" class="form-control" id="Date" placeholder="Enter date">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Enter duration</label>
<input type="text" class="form-control" id="Dur" placeholder="Enter duration">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Enter notes</label>
<input type="text" class="form-control" id="Note" placeholder="Enter notes">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" id="Save">Add</button>
</div>
</div>
</div>
</div>
<!-- EDIT Modal -->
<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="exampleInputEmail1">Enter date</label>
<input type="text" class="form-control" id="date" placeholder="Enter date">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Enter duration</label>
<input type="text" class="form-control" id="dur" placeholder="Enter duration">
</div>
<div class="form-group">
<label for="exampleInputEmail1">Enter notes</label>
<input type="text" class="form-control" id="note" placeholder="Enter notes">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" id="Edit">Save changes</button>
</div>
</div>
</div>
</div>
<div class="container">
<!-- <div class="jumbotron">-->
<div class="card">
<div class="card-header">
Meditation Tracking: Use this page to keep track of meditaiton sessions with notes.
</div>
<div class="card-body">
<h5 class="card-title">Meditation Statistics</h5>
<div class="row">
<div class="col-md-12 text-right">
<button class="btn btn-success badge-pill" data-toggle="modal" data-target="#add" style="width: 80px;">ADD</button>
</div>
</div>
<br>
<table class="table table-dark table-hover table-bordered">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Date</th>
<th scope="col">Duration</th>
<th scope="col">Notes</th>
<th class="text-right">Actions</th>
</tr>
</thead>
<tbody id="tableBody">
<!--
<tr>
<th scope="row">-</th>
<td>September 17</td>
<td>30 mins</td>
<td>Rain sounds</td>
<td class="text-right">
<button class="btn btn-primary badge-pill" data-toggle="modal" data-target="#edit" style="width: 80px;"> EDIT</button>
<button class="btn btn-danger badge-pill" style="width: 80px;"> DELETE</button>
</td>
</tr>
-->
</tbody>
</table>
</div>
</div>
</div>
<!-- </div>-->
<script>
var btn = $("#Save");
btn.click(saveChanges);
function saveChanges() {
var date = $("#Date").val();
var dur = $("#Dur").val();
var note = $("#Note").val();
$("#tableBody").append(
"<tr class='myParent'>" +
"<th> - </th>" +
"<td>" + date + "</td>" +
"<td>" + dur + "</td>" +
"<td>" + note + "</td>" +
"<td class='text-right'> <button class='btn btn-primary badge-pill' data-toggle='modal' data-target='#edit' style='width: 80px;' onclick='deleteRow(this);'> EDIT</button> <button class='btn btn-danger badge-pill' style='width: 80px;' onclick='deleteRow(this);'> DELETE</button></td>" +
"</tr>"
);
$("#Date").val("");
$("#Dur").val("");
$("#Note").val("");
}
var but = $(".btn-danger");
but.click(deleteRow);
function deleteRow(r) {
var row = r.parentNode.parentNode;
row.parentNode.removeChild(row);
}
var EB = $('#edit');
EB.click(deleteRow);
var nr = $('#Edit');
nr.click(editRow);
function editRow() {
var dates = $("#date").val();
var durr = $("#dur").val();
var notee = $("#note").val();
$("#tableBody").append(
"<tr class='myParent'>" +
"<th> - </th>" +
"<td>" + dates + "</td>" +
"<td>" + durr + "</td>" +
"<td>" + notee + "</td>" +
"<td class='text-right'> <button class='btn btn-primary badge-pill' data-toggle='modal' data-target='#edit' style='width: 80px;' onclick='deleteRow(this);'> EDIT</button> <button class='btn btn-danger badge-pill' style='width: 80px;' onclick='deleteRow(this);'> DELETE</button></td>" +
"</tr>"
);
$("#date").val("");
$("#dur").val("");
$("#note").val("");
}
var quotes = ['You are doing great!', 'Keep it up!', 'School is hard but your future self will be proud!', 'It does not matter how slowly you go, as long as you do not stop.', 'Only I can change my life. No one can do it for me.', 'Life is 10% what happens to you and 90% how you react to it', 'Optimism is the faith that leads to achievement. Nothing can be done without hope and confidence.']
function quote(){
var num = Math.floor(Math.random() * (quotes.length));
document.getElementById('quoteHere').innerHTML = quotes[num];
}
</script>
</body>
</html>