-
Notifications
You must be signed in to change notification settings - Fork 0
/
def.html
269 lines (158 loc) · 6.6 KB
/
def.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
<!--
http://iudcalc/
http://nodesimplified.com/how-to-display-charts-in-the-modal-popup-using-angularjs-and-chart-js/
Try merge the UPSI bar to the datetimepicker
https://eonasdan.github.io/bootstrap-datetimepicker/
https://stackoverflow.com/questions/16573624/get-the-value-of-bootstrap-datetimepicker-in-javascript
Cleaner code:
https://www.makeuseof.com/tag/10-tips-writing-cleaner-better-code/
https://google.github.io/styleguide/javascriptguide.xml
Multiple Apps in one Angularjs project
https://www.codeproject.com/Articles/862602/Define-Multiple-Angular-Apps-In-One-Page
*****Body rootApp*****
|
*****rootAp****
<!doctype html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="angular-material.min.css">
<script
src="https://code.jquery.com/jquery-2.2.4.js"
integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<!--link rel="stylesheet" href="style.css"-->
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href='style.css' />
</head>
<body ng-app="rootApp" ng-controller='rootCon' >
<div class="container">
</div>
<div class="container-fluid">
<section ng-app="firstApp" >
<form name="myForm" ng-controller="hourController" >
<!--p >Todays Date = {{ today | date }}</p-->
<div class='row'>
<div class='slidecontainer col-md-offset-1 col-md-10' >
<h3>UPSI Occurance</h3>
<br>
Choose Date of the UPSI
</div>
</div><!--End row-->
<div class="row">
<div class="col-md-offset-3 col-md-6 ">
<br>
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input id='dateInput' type='text' class="form-control" placeholder="Pick a date" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<h5 class='DateChosen'></h5>
<div class='hourRes'>
<h4>
<input id='hourz' type='number'hidden><br>
<span id='daysAgo'>
</span><br>
<span id='hoursAgo'>
</span><br>
</h4>
<h3 class='hourMsg'>Under 120 Hours since UPSI</h3>
</div>
</div>
<hr>
<!--After first condition-->
</div>
</div><!--End row-->
<div >
<div id='prangeC' ng-controller='prangeController' class='row'>
<div id='totalcycle' class="col-md-offset-4 col-md-4" >
<h4>*Over 120 Hours since UPSI</h4>
<h3>IUD Calculator Available</h3>
<div id='secondApp' ng-app="secondApp" >
<h4 >Period Cycle</h4>
<label for="fullc">Between 21 to 42</label>
<input id='fullc' placeholder="Cycle"
name="input" type="number" ng-model="totalcycle" min="21" max="42" ng-click="addDays1();" required><br>
<br/>
<span ng-if='myForm.input.$valid'><h4>HOW LONG IS YOUR MENSTRUAL CYCLE ? {{totalcycle}} Days long</h4></span>
<!--span>Min:{{min}}</span>
Max:<span>{{max}}</span-->
<div id='alertanderrors'>
<div role="alert">
<span class="error" ng-show="myForm.totalcycle.$error.required">
Required!</span>
<span class="error" ng-show="myForm.totalcycle.$error.number">
Not valid number!</span>
</div>
<div class='errors'>
<span ng-if='!!myForm.$error.required'>
<h4>Please enter a number</h4>
</span>
<span ng-if='myForm.input.$error.min'><h4>Cycle Length is too Low</h4></span>
<span ng-if='myForm.input.$error.max'><h4>Cycle Length is too high</h4></span>
</div>
<!--tt>myForm.$valid = {{myForm.$valid}}</tt><br/-->
</div>
<hr>
<span ng-if='myForm.input.$valid'>
<md-content ng-controller="AppCtrl as ctrl" layout-padding layout-margin>
<h4>When did your last period start?<br> {{ctrl.myDate | date}} </h4>
<md-datepicker ng-model="ctrl.myDate" ng-change="ctrl.onDateChanged();"
md-placeholder="Enter date"></md-datepicker><br>
<span ng-if ='ctrl.periodDateTrue' >
<br>
<div class='results'>
<h3>Results!</h3>
1st Day Ovulation: {{ctrl.firstOv | date:shortDate}} <br>
Your last day for IUD: {{ctrl.iudLast | date:shortDate}} <br>
Your next Period Date : {{ctrl.Date | date:shortDate}} <br>
<div id='iudValid' ng-if='ctrl.IUDright == true'>Still Time for an IUD</div>
<div id='iudInvalid' ng-if='ctrl.IUDright == false'>Its too late for an IUD</div>
</div>
</span>
<button id='cleard' ng-click='ctrl.clearDate();' >Clear Date</button>
</md-content>
</span><!--ng-if myForm.input.$valid-->
</div><!--End of secondApp-->
</span>
</div><!--End of totalcycle-->
</div><!--End of prangeController and row-->
<br>
</section><!--End firstApp-->
</div><!--End condition -->
</form>
</div><!--End Container-->
<script>
function validateIudMessagetest() {
var wang = true;
return wang;
}
//alert('Wang is ' + validateIudMessagetest());
</script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular-messages.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.7/angular-sanitize.js"></script>
<script src="angular-material.min.js"></script>
<script src="cool.js"></script>
<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
<!--script src="components.js"></script-->
<script src="app.js"></script>
</body>
</html>