|
@@ -20,6 +20,14 @@
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
?>
|
|
23
|
+
|
|
24
|
+ <style>
|
|
25
|
+ .popover-content {
|
|
26
|
+ color: #333;
|
|
27
|
+ }
|
|
28
|
+ </style>
|
|
29
|
+
|
|
30
|
+
|
23
|
31
|
<!-- START OF home.php -->
|
24
|
32
|
<body>
|
25
|
33
|
|
|
@@ -60,32 +68,58 @@
|
60
|
68
|
</div>
|
61
|
69
|
|
62
|
70
|
<?php
|
|
71
|
+
|
|
72
|
+ // DISPLAY ALL EXPERIENCES THAT ARE NOT PART OF A PROJECT FIRST
|
|
73
|
+ // THEN CREATE A NEW ROW FOR EACH PROJECT WHICH IS 'POPULATED' BY ITS EXPERIENCES
|
|
74
|
+
|
63
|
75
|
// CHANGE QUERY DEPENDING ON IF USER IS ADMIN OR NOT
|
64
|
76
|
if($_SESSION['dbUserData']['admin'] === '1') {
|
65
|
|
- $query2 = "SELECT * FROM `experience`;";
|
|
77
|
+ $queryProjectlessExperiences = "SELECT E.id AS eid, E.start_date AS start_date, E.end_date AS end_date, E.title AS ename FROM `experience` AS E WHERE E.id NOT IN (SELECT P.id_experience FROM project_experience AS P);";
|
|
78
|
+
|
|
79
|
+// $queryProjectsWithExperiences = "SELECT E.id AS eid, E.start_date AS start_date, E.end_date AS end_date, E.title AS ename, P.id AS pid, P.name AS pname
|
|
80
|
+// FROM experience AS E
|
|
81
|
+// JOIN project_experience AS PE
|
|
82
|
+// JOIN project AS P
|
|
83
|
+// WHERE E.id = PE.id_experience
|
|
84
|
+// AND P.id = PE.id_project
|
|
85
|
+// ORDER BY P.id, E.start_date";
|
|
86
|
+
|
|
87
|
+ $queryProjects = "SELECT * FROM project ORDER BY project.id DESC;";
|
|
88
|
+ $queryCountExperiences = "SELECT COUNT(*) FROM experience;";
|
|
89
|
+
|
66
|
90
|
} else {
|
67
|
|
- $query2 = "SELECT * FROM `experience` WHERE id IN (SELECT id_experience FROM researcher_experience WHERE id_researcher = '" . $_SESSION['dbUserData']['id_researcher'] . "');";
|
|
91
|
+ $queryProjectlessExperiences = "SELECT E.id AS eid, E.start_date AS start_date, E.end_date AS end_date, E.title AS ename FROM `experience` AS E WHERE E.id NOT IN (SELECT P.id_experience FROM project_experience AS P) AND E.id IN (SELECT id_experience FROM researcher_experience WHERE id_researcher = '" . $_SESSION['dbUserData']['id_researcher'] . "');";
|
|
92
|
+
|
|
93
|
+// $queryProjectsWithExperiences = "SELECT E.id AS eid, E.start_date AS start_date, E.end_date AS end_date, E.title AS ename, P.id AS pid, P.name AS pname
|
|
94
|
+// FROM experience AS E
|
|
95
|
+// JOIN project_experience AS PE
|
|
96
|
+// JOIN project AS P
|
|
97
|
+// WHERE E.id = PE.id_experience
|
|
98
|
+// AND P.id = PE.id_project
|
|
99
|
+// AND E.id IN (SELECT id_experience FROM researcher_experience WHERE id_researcher = '" . $_SESSION['dbUserData']['id_researcher'] . "')
|
|
100
|
+// ORDER BY P.id, E.start_date";
|
|
101
|
+
|
|
102
|
+ $queryCountExperiences = "SELECT COUNT(*) FROM experience AS E WHERE E.id IN (SELECT id_experience FROM researcher_experience WHERE id_researcher = '" . $_SESSION['dbUserData']['id_researcher'] . "');";
|
|
103
|
+
|
|
104
|
+ $queryProjects = "SELECT * FROM project WHERE id IN (SELECT id_project FROM project_experience WHERE id_experience IN (SELECT id_experience FROM researcher_experience WHERE id_researcher = '" . $_SESSION['dbUserData']['id_researcher'] . "')) ORDER BY project.id DESC;";
|
68
|
105
|
}
|
69
|
|
- $result2 = mysqli_query($connection, $query2);
|
70
|
106
|
|
71
|
|
- // IF USER HAS EXPERIENCES, SHOW ALL OF THEM
|
72
|
|
- // ELSE PROMPT USER TO CREATE A NEW EXPERIENCE
|
73
|
|
- if($result2->num_rows > 0): // USER HAS EXPERIENCE (STANDARD PAGE)
|
|
107
|
+ $resultProjectlessExperiences = mysqli_query($connection, $queryProjectlessExperiences);
|
|
108
|
+ while($row = mysqli_fetch_array($resultProjectlessExperiences)):
|
|
109
|
+
|
74
|
110
|
?>
|
75
|
111
|
|
76
|
|
- <?php while($row = mysqli_fetch_array($result2)): ?>
|
77
|
|
-
|
78
|
|
- <div class="grid-box" onclick="location='viewExperience.php?view=<?php echo $row['id']; ?>'">
|
|
112
|
+ <div class="grid-box" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'">
|
79
|
113
|
|
80
|
|
- <?php if(mb_strlen($row['title']) == 0): ?>
|
81
|
|
- <span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['id']; ?>'"><small>N/A</small></span>
|
82
|
|
- <?php elseif(mb_strlen($row['title']) < 21): ?>
|
83
|
|
- <span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['id']; ?>'"><?php echo $row['title']; ?></span>
|
|
114
|
+ <?php if(mb_strlen($row['ename']) == 0): ?>
|
|
115
|
+ <span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'"><small>N/A</small></span>
|
|
116
|
+ <?php elseif(mb_strlen($row['ename']) < 21): ?>
|
|
117
|
+ <span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'"><?php echo $row['ename']; ?></span>
|
84
|
118
|
<?php else: ?>
|
85
|
|
-<!--style="white-space: nowrap;"--><span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['id']; ?>'"><?php echo substr($row['title'], 0, 30)."<small>...</small>"; ?></span>
|
|
119
|
+<!--style="white-space: nowrap;"--><span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'"><?php echo substr($row['ename'], 0, 30)."<small>...</small>"; ?></span>
|
86
|
120
|
<?php endif; ?>
|
87
|
121
|
|
88
|
|
- <div class="box-dates" onclick="location='viewExperience.php?view=<?php echo $row['id']; ?>'">
|
|
122
|
+ <div class="box-dates" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'">
|
89
|
123
|
<p style="margin-bottom: 0;">• Starts: <?php echo date("M j, Y", strtotime($row['start_date'])); ?></p>
|
90
|
124
|
<p>• Ends: <?php echo date("M j, Y", strtotime($row['end_date'])); ?></p>
|
91
|
125
|
</div>
|
|
@@ -95,32 +129,102 @@
|
95
|
129
|
if($x <= 0):
|
96
|
130
|
?>
|
97
|
131
|
<span class="box-weeks warning">Finished</span>
|
|
132
|
+ <?php elseif(0 < $x && $x < 1):?>
|
|
133
|
+ <span class="box-weeks" style="font-size: 1.2rem">Less than a week remaining</span>
|
98
|
134
|
<?php else: ?>
|
99
|
|
- <span class="box-weeks"><?php echo round($x); ?> week<?php if(round($x) > 1) echo 's'; ?> remaining</span>
|
|
135
|
+ <span class="box-weeks"><?php echo round($x); ?> week<?php if($x > 0) echo 's'; ?> remaining</span>
|
100
|
136
|
<?php endif; ?>
|
101
|
137
|
<span class="box-edit" style="background: none;">
|
102
|
|
- <a>
|
103
|
|
- <i class="fas fa-pen"></i>
|
104
|
|
- </a>
|
|
138
|
+ <a><i class="fas fa-pen"></i></a>
|
105
|
139
|
</span>
|
106
|
140
|
|
107
|
|
- </div>
|
|
141
|
+ </div><!--grid-box-->
|
108
|
142
|
|
109
|
|
- <?php endwhile; ?>
|
|
143
|
+<?php endwhile; ?>
|
110
|
144
|
|
111
|
|
-<?php else: // USER DOESN'T HAVE EXPERIENCES YET (ALTERNATE PAGE) ?>
|
|
145
|
+ </div><!--experience-content-->
|
112
|
146
|
|
113
|
|
- <script> setTimeout(() => $('#FirstTime').modal('show'), 1000); </script>
|
114
|
|
-
|
115
|
|
-<?php endif; ?>
|
|
147
|
+<?php
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+ $resultProjects = mysqli_query($connection, $queryProjects);
|
|
151
|
+ while($rowP = mysqli_fetch_array($resultProjects)):
|
|
152
|
+
|
|
153
|
+?>
|
116
|
154
|
|
|
155
|
+ <div class="row">
|
|
156
|
+<!-- <div > -->
|
|
157
|
+ <h3 class="col-sm-12" style="color: white;">
|
|
158
|
+ <?php echo $rowP['name']; ?>
|
|
159
|
+ <button type="button" class="btn btn-link btn-lg" data-toggle="popover" title="Project Description" data-content="<?php echo $rowP['description']; ?>" data-placement="right">
|
|
160
|
+ <span style="color: #eee;" class="glyphicon glyphicon-align-left" aria-hidden="true"></span>
|
|
161
|
+ </button>
|
|
162
|
+ </h3>
|
|
163
|
+<!-- </div> -->
|
117
|
164
|
</div>
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+ <div id="experience-content">
|
|
168
|
+
|
|
169
|
+<?php
|
|
170
|
+
|
|
171
|
+ $queryExperiencesInProject = "SELECT E.id AS eid, E.title AS ename, E.start_date, E.end_date
|
|
172
|
+ FROM experience AS E
|
|
173
|
+ WHERE E.id IN (SELECT id_experience FROM project_experience WHERE id_project = '" . $rowP['id'] . "')
|
|
174
|
+ ORDER BY E.start_date DESC";
|
|
175
|
+ $resultExperiencesInProject = mysqli_query($connection, $queryExperiencesInProject);
|
|
176
|
+ while($row = mysqli_fetch_array($resultExperiencesInProject)):
|
|
177
|
+
|
|
178
|
+?>
|
|
179
|
+
|
|
180
|
+ <div class="grid-box" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'">
|
|
181
|
+
|
|
182
|
+ <?php if(mb_strlen($row['ename']) == 0): ?>
|
|
183
|
+ <span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'"><small>N/A</small></span>
|
|
184
|
+ <?php elseif(mb_strlen($row['ename']) < 21): ?>
|
|
185
|
+ <span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'"><?php echo $row['ename']; ?></span>
|
|
186
|
+ <?php else: ?>
|
|
187
|
+<!--style="white-space: nowrap;"--><span class="box-title" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'"><?php echo substr($row['ename'], 0, 30)."<small>...</small>"; ?></span>
|
|
188
|
+ <?php endif; ?>
|
|
189
|
+
|
|
190
|
+ <div class="box-dates" onclick="location='viewExperience.php?view=<?php echo $row['eid']; ?>'">
|
|
191
|
+ <p style="margin-bottom: 0;">• Starts: <?php echo date("M j, Y", strtotime($row['start_date'])); ?></p>
|
|
192
|
+ <p>• Ends: <?php echo date("M j, Y", strtotime($row['end_date'])); ?></p>
|
|
193
|
+ </div>
|
|
194
|
+
|
|
195
|
+ <?php
|
|
196
|
+ $x = (strtotime($row['end_date']) - strtotime('now')) / 604800;
|
|
197
|
+ if($x <= 0):
|
|
198
|
+ ?>
|
|
199
|
+ <span class="box-weeks warning">Finished</span>
|
|
200
|
+ <?php elseif(0 < $x && $x < 1):?>
|
|
201
|
+ <span class="box-weeks" style="font-size: 1.2rem">Less than a week remaining</span>
|
|
202
|
+ <?php else: ?>
|
|
203
|
+ <span class="box-weeks"><?php echo round($x); ?> week<?php if($x > 0) echo 's'; ?> remaining</span>
|
|
204
|
+ <?php endif; ?>
|
|
205
|
+ <span class="box-edit" style="background: none;">
|
|
206
|
+ <a><i class="fas fa-pen"></i></a>
|
|
207
|
+ </span>
|
|
208
|
+
|
|
209
|
+ </div>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+<?php endwhile; ?>
|
|
213
|
+
|
|
214
|
+ </div><!--experience-content-->
|
|
215
|
+
|
|
216
|
+<?php endwhile; ?>
|
118
|
217
|
|
119
|
|
- <br><br>
|
120
|
218
|
|
|
219
|
+ <br><br>
|
|
220
|
+
|
121
|
221
|
</main>
|
122
|
222
|
|
123
|
223
|
|
|
224
|
+<?php if(mysqli_query($connection, $queryCountExperiences)->num_rows === 0): // USER DOESN'T HAVE EXPERIENCES YET (PROMPT MODAL) ?>
|
|
225
|
+ <script> setTimeout(() => $('#FirstTime').modal('show'), 1000); </script>
|
|
226
|
+<?php endif; ?>
|
|
227
|
+
|
124
|
228
|
|
125
|
229
|
<!-- POPUP FOR FIRST TIME -->
|
126
|
230
|
<div class='modal fade' id='FirstTime' tabindex='-1' role='dialog' aria-labelledby='FirstTimeLabel' aria-hidden='true'>
|
|
@@ -223,19 +327,19 @@
|
223
|
327
|
<label class='control-label col-sm-2' for='e_description'>Type:</label>
|
224
|
328
|
<div class='col-sm-9'>
|
225
|
329
|
<select class="form-control text-center" style="text-align-last: center;" id='e_type' name='type' required>
|
226
|
|
- <option selected value="Course-Based Research">Course-Based Research</option>
|
227
|
|
- <option value="Independent Research">Independent Research</option>
|
|
330
|
+ <option selected value="Course-Based Research Experience">Course-Based Research Experience</option>
|
|
331
|
+ <option value="Undergraduate Research Experience">Undergraduate Research Experience</option>
|
228
|
332
|
</select>
|
229
|
333
|
</div>
|
230
|
334
|
</div>
|
231
|
335
|
|
232
|
336
|
<!-- DURATION -->
|
233
|
|
- <div class='form-group'>
|
234
|
|
- <label class='control-label col-sm-2' for='e_description'>Duration:</label>
|
235
|
|
- <div class='col-sm-9'>
|
236
|
|
- <input type='number' class='form-control text-center' id='e_duration' name='duration' placeholder='Duration' min="0" required readonly>
|
237
|
|
- </div>
|
238
|
|
- </div>
|
|
337
|
+<!-- <div class='form-group'> -->
|
|
338
|
+<!-- <label class='control-label col-sm-2' for='e_description'>Duration:</label> -->
|
|
339
|
+<!-- <div class='col-sm-9'> -->
|
|
340
|
+<!-- <input type='number' class='form-control text-center' id='e_duration' name='duration' placeholder='Duration' min="0" required readonly> -->
|
|
341
|
+<!-- </div> -->
|
|
342
|
+<!-- </div> -->
|
239
|
343
|
|
240
|
344
|
<!-- START DATE -->
|
241
|
345
|
<div class='form-group'>
|
|
@@ -306,6 +410,177 @@
|
306
|
410
|
|
307
|
411
|
|
308
|
412
|
<!-- ERROR ALERT FOR USER -->
|
|
413
|
+<!-- <div id="error-newExperience" class="row" style="display: none;"> -->
|
|
414
|
+<!-- <div class="col-sm-12"> -->
|
|
415
|
+<!-- <div class="alert alert-danger mb-1" role="alert"> -->
|
|
416
|
+<!-- <h4 class="error-lead">Error!</h4> -->
|
|
417
|
+<!-- <p class="error-description"></p> -->
|
|
418
|
+<!-- </div> -->
|
|
419
|
+<!-- </div> -->
|
|
420
|
+<!-- </div> -->
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+ </div><!--modal-body-->
|
|
424
|
+
|
|
425
|
+ <!-- SUBMIT OR CANCEL -->
|
|
426
|
+ <div class='modal-footer'>
|
|
427
|
+ <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
|
|
428
|
+ <button id="toProjectModal" type='button' class='btn btn-primary' data-dismiss='modal' onclick="nextModal('#New_3')" disabled>Next</button>
|
|
429
|
+ </div>
|
|
430
|
+
|
|
431
|
+ </div><!--modal-content-->
|
|
432
|
+ </div><!--modal-dialog-->
|
|
433
|
+ </div><!--modal-->
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+ <!-- POPUP FOR NEW EXPERIENCE 3 -->
|
|
440
|
+ <div class='modal fade' id='New_3' tabindex='-1' role='dialog' aria-labelledby='NewLabel_3' aria-hidden='true'>
|
|
441
|
+ <div class='modal-dialog modal-lg' role='document'>
|
|
442
|
+ <div class='modal-content'>
|
|
443
|
+
|
|
444
|
+ <div class='modal-body'>
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+ <!-- CLOSE BUTTON -->
|
|
449
|
+ <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button>
|
|
450
|
+
|
|
451
|
+ <div class='row'>
|
|
452
|
+ <div class='col-sm-10'>
|
|
453
|
+ <h2>Brand New Experience <small>(Additional Info)</small></h2>
|
|
454
|
+ </div>
|
|
455
|
+ </div><!--row-->
|
|
456
|
+
|
|
457
|
+ <hr>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+ <div class="row">
|
|
462
|
+ <div class="col-sm-12 col-sm-offset-1">
|
|
463
|
+ <h4>Is this experience part of a project or standalone?</h4>
|
|
464
|
+ </div>
|
|
465
|
+ </div>
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+ <!-- TYPE OF EXPERIENCE (STANDALONE - PROJECT) -->
|
|
469
|
+ <div class="form-horizontal">
|
|
470
|
+ <div class='form-group'>
|
|
471
|
+ <div class='col-sm-6 col-sm-offset-3'>
|
|
472
|
+ <select class="form-control text-center" style="text-align-last: center;" id='typeOfExperience' name='typeOfExperience' required onchange="standaloneOrNot(event)">
|
|
473
|
+ <option selected value="Standalone">Standalone Experience</option>
|
|
474
|
+ <option value="Part of a Project">Part of a Project</option>
|
|
475
|
+ </select>
|
|
476
|
+ </div>
|
|
477
|
+ </div>
|
|
478
|
+ </div>
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+<div id="standalone" style="display: none;">
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+ <div class="row">
|
|
485
|
+ <div class="col-sm-12 col-sm-offset-1">
|
|
486
|
+ <h4>Does the project already exist, or would you like a new one?</h4>
|
|
487
|
+ </div>
|
|
488
|
+ </div>
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+ <div class="form-horizontal">
|
|
493
|
+
|
|
494
|
+ <!-- IS THE PROJECT EXISTING OR NEW? -->
|
|
495
|
+ <div class='form-group'>
|
|
496
|
+ <div class='col-sm-9 col-sm-offset-2'>
|
|
497
|
+ <select class="form-control text-center" style="text-align-last: center;" id='typeOfProject' name='typeOfProject' onchange="existingOrNot(event)">
|
|
498
|
+ <option selected value="New">New Project</option>
|
|
499
|
+ <option value="Existing">Existing Project</option>
|
|
500
|
+ </select>
|
|
501
|
+ </div>
|
|
502
|
+ </div>
|
|
503
|
+
|
|
504
|
+<div id="newProject">
|
|
505
|
+ <!-- PROJECT NAME -->
|
|
506
|
+ <div class='form-group'>
|
|
507
|
+ <label class='control-label col-sm-2 col-sm-offset-2' for='projectName'>Name:</label>
|
|
508
|
+ <div class='col-sm-7'>
|
|
509
|
+ <input type='text' class='form-control text-center' id='projectName' name='projectName' placeholder="Project Name">
|
|
510
|
+ </div>
|
|
511
|
+ </div>
|
|
512
|
+
|
|
513
|
+ <!-- PROJECT DESCRIPTION -->
|
|
514
|
+ <div class='form-group'>
|
|
515
|
+ <label class='control-label col-sm-2 col-sm-offset-2' for='projectDescription'>Description:</label>
|
|
516
|
+ <div class='col-sm-7'>
|
|
517
|
+ <textarea class='form-control text-center' id='projectDescription' rows="2" name='projectDescription' placeholder="Project Description"></textarea>
|
|
518
|
+ </div>
|
|
519
|
+ </div>
|
|
520
|
+
|
|
521
|
+</div>
|
|
522
|
+
|
|
523
|
+<div id="existingProject" style="display: none;">
|
|
524
|
+ <?php
|
|
525
|
+
|
|
526
|
+ // CHANGE QUERY DEPENDING ON IF USER IS ADMIN OR NOT
|
|
527
|
+ if($_SESSION['dbUserData']['admin'] === '1') {
|
|
528
|
+ $queryProjects = "SELECT * FROM project;";
|
|
529
|
+ } else {
|
|
530
|
+ $queryProjects = "SELECT * FROM project WHERE id IN (SELECT id_project FROM project_experience WHERE id_experience IN (SELECT id_experience FROM researcher_experience WHERE id_researcher = '" . $_SESSION['dbUserData']['id_researcher'] . "'));";
|
|
531
|
+ }
|
|
532
|
+
|
|
533
|
+ $resultProjects = mysqli_query($connection, $queryProjects);
|
|
534
|
+
|
|
535
|
+ if($resultProjects->num_rows > 0):
|
|
536
|
+ ?>
|
|
537
|
+ <!-- CHOOSE EXISTING PROJECT -->
|
|
538
|
+ <div class='form-group'>
|
|
539
|
+ <label class='control-label col-sm-2 col-sm-offset-2' for='projectID'>Project:</label>
|
|
540
|
+ <div class='col-sm-7'>
|
|
541
|
+ <select class="form-control text-center" style="text-align-last: center;" id='projectID' name='projectID'>
|
|
542
|
+ <?php while($rowProjects = mysqli_fetch_assoc($resultProjects)): ?>
|
|
543
|
+ <option selected value="<?php echo $rowProjects['id']; ?>"><?php echo $rowProjects['name']; ?></option>
|
|
544
|
+ <?php endwhile; ?>
|
|
545
|
+ </select>
|
|
546
|
+ </div>
|
|
547
|
+ </div>
|
|
548
|
+ <?php else: ?>
|
|
549
|
+ <div class="row">
|
|
550
|
+ <div class="col-sm-9 col-sm-offset-3">
|
|
551
|
+ <h4><small>Uh oh! It seems you don't have a project to choose from...</small></h4>
|
|
552
|
+ </div>
|
|
553
|
+ </div>
|
|
554
|
+ <?php endif; ?>
|
|
555
|
+</div>
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+ </div><!--form-horizontal-->
|
|
560
|
+
|
|
561
|
+</div>
|
|
562
|
+
|
|
563
|
+ <br>
|
|
564
|
+
|
|
565
|
+ <!-- TIPS FOR USER -->
|
|
566
|
+ <div class="row">
|
|
567
|
+ <div class="col-sm-10 col-sm-offset-1">
|
|
568
|
+ <div class="alert alert-info alert-dismissable mb-1" role="alert">
|
|
569
|
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
|
570
|
+ <span aria-hidden="true">×</span>
|
|
571
|
+ </button>
|
|
572
|
+ <h4 class="error-lead">Tips</h4>
|
|
573
|
+ <p>If you're not sure what to choose, select "<strong>Standalone</strong>".</p>
|
|
574
|
+ </div>
|
|
575
|
+ </div>
|
|
576
|
+ </div>
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+ <br>
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+ <!-- ERROR ALERT FOR USER -->
|
309
|
584
|
<div id="error-newExperience" class="row" style="display: none;">
|
310
|
585
|
<div class="col-sm-12">
|
311
|
586
|
<div class="alert alert-danger mb-1" role="alert">
|
|
@@ -320,9 +595,8 @@
|
320
|
595
|
|
321
|
596
|
<!-- SUBMIT OR CANCEL -->
|
322
|
597
|
<div class='modal-footer'>
|
323
|
|
- <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
|
|
598
|
+ <button type='button' class='btn btn-default' data-dismiss='modal' onclick="nextModal('#New_2')">Previous</button>
|
324
|
599
|
<button type='submit' class='btn btn-primary' name='newExperience'>Create</button>
|
325
|
|
-<!-- <button type='button' class='btn btn-primary' data-dismiss='modal' onclick="nextModal('#New_3')">Next</button> -->
|
326
|
600
|
</div>
|
327
|
601
|
|
328
|
602
|
</div><!--modal-content-->
|
|
@@ -330,7 +604,68 @@
|
330
|
604
|
</div><!--modal-->
|
331
|
605
|
</form><!--form-->
|
332
|
606
|
|
|
607
|
+ <script>
|
|
608
|
+
|
|
609
|
+ let button = document.getElementById('toProjectModal');
|
|
610
|
+ let title = document.getElementById('e_title');
|
|
611
|
+ let description = document.getElementById('e_description');
|
|
612
|
+// let type = document.getElementById('e_type');
|
|
613
|
+ let start = document.getElementById('e_start');
|
|
614
|
+ let end = document.getElementById('e_end');
|
|
615
|
+ let institution = document.getElementById('e_institution');
|
|
616
|
+// let expiryTime = document.getElementById('expiry_time');
|
|
617
|
+
|
|
618
|
+ title.addEventListener('change', experienceFirstModal);
|
|
619
|
+ description.addEventListener('change', experienceFirstModal);
|
|
620
|
+// type.addEventListener('change', experienceFirstModal);
|
|
621
|
+ start.addEventListener('change', experienceFirstModal);
|
|
622
|
+ end.addEventListener('change', experienceFirstModal);
|
|
623
|
+ institution.addEventListener('change', experienceFirstModal);
|
|
624
|
+// expiryTime.addEventListener('change', experienceFirstModal);
|
|
625
|
+
|
|
626
|
+ function experienceFirstModal() {
|
|
627
|
+
|
|
628
|
+ let validity = true;
|
|
629
|
+ validity &= title.checkValidity();
|
|
630
|
+ validity &= description.checkValidity();
|
|
631
|
+// validity &= type.checkValidity();
|
|
632
|
+ validity &= start.checkValidity();
|
|
633
|
+ validity &= end.checkValidity();
|
|
634
|
+ validity &= institution.checkValidity();
|
|
635
|
+// validity &= expiryTime.checkValidity();
|
|
636
|
+
|
|
637
|
+ button.disabled = !validity;
|
|
638
|
+
|
|
639
|
+ }
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+ function standaloneOrNot(e) {
|
333
|
643
|
|
|
644
|
+ let standalonePart = document.getElementById('standalone');
|
|
645
|
+ let selection = e.currentTarget.value;
|
|
646
|
+ standalonePart.style.display = (selection !== 'Standalone' ? 'block' : 'none');
|
|
647
|
+
|
|
648
|
+ }
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+ function existingOrNot(e) {
|
|
652
|
+
|
|
653
|
+ let existingPart = document.getElementById('existingProject');
|
|
654
|
+ let newPart = document.getElementById('newProject');
|
|
655
|
+ let selection = e.currentTarget.value;
|
|
656
|
+
|
|
657
|
+ if(selection === 'New') {
|
|
658
|
+ existingPart.style.display = 'none';
|
|
659
|
+ newPart.style.display = 'block';
|
|
660
|
+ } else {
|
|
661
|
+ existingPart.style.display = 'block';
|
|
662
|
+ newPart.style.display = 'none';
|
|
663
|
+ }
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+ }
|
|
667
|
+
|
|
668
|
+ </script>
|
334
|
669
|
|
335
|
670
|
|
336
|
671
|
|
|
@@ -348,6 +683,11 @@
|
348
|
683
|
|
349
|
684
|
<script>
|
350
|
685
|
|
|
686
|
+// Enable popovers
|
|
687
|
+$(function () {
|
|
688
|
+ $('[data-toggle="popover"]').popover();
|
|
689
|
+});
|
|
690
|
+
|
351
|
691
|
|
352
|
692
|
["newExperience"].forEach(function(formName) {
|
353
|
693
|
|
|
@@ -371,8 +711,8 @@
|
371
|
711
|
startDate.addEventListener('change', setEndDateRange);
|
372
|
712
|
|
373
|
713
|
// Duration
|
374
|
|
- startDate.addEventListener('change', setDuration);
|
375
|
|
- endDate.addEventListener('change', setDuration);
|
|
714
|
+// startDate.addEventListener('change', setDuration);
|
|
715
|
+// endDate.addEventListener('change', setDuration);
|
376
|
716
|
|
377
|
717
|
}
|
378
|
718
|
|