-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsent.php
140 lines (125 loc) · 4.13 KB
/
consent.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
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
require_once("models/config.php");
//REDIRECT USERS THAT ARE ALREADY LOGGED IN AND CONSENTED TO THE PORTAL PAGE
if(isUserLoggedIn() && isUserActive()) {
$destination = $websiteUrl . "dashboard/index.php";
header("Location: " . $destination);
exit;
}else if(!isUserLoggedIn()) {
$destination = $websiteUrl . "login.php";
header("Location: " . $destination);
exit;
}
$pg_title = "Consent | $websiteName";
$body_classes = "consent";
include("models/inc/gl_header.php");
?>
<div id="content" class="container" role="main" tabindex="0">
<div class="row">
<div id="main-content" class="col-md-8 col-md-offset-2" role="main">
<div class="well row">
<img src="assets/img/well_logo.png" class="print"/>
<ul id="register_steps">
<li><span>1</span> <?php echo lang("STEP_REGISTER") ?></li>
<li><span>2</span> <?php echo lang("STEP_VERIFY") ?></li>
<li class="on"><span>3</span> <?php echo lang("STEP_CONSENT") ?></li>
<li><span>4</span> <?php echo lang("STEP_SECURITY") ?></li>
</ul>
<div class="consent_slides">
<section class="consent_disclaim">
<h2><?php echo lang("CONSENT_WELCOME") ?></h2>
<div id='irbexp'><i><?php echo lang("IRB_EXPIRATION") ?> : August 31, 2018</i></div>
<ul>
<li><?php echo lang("CONSENT_BULLET_1") ?></li>
<li><?php echo lang("CONSENT_BULLET_2") ?></li>
</ul>
<p><?php echo lang("CONSENT_CONTACT") ?></p>
</section>
<?php
include("models/inc/well_consent_doc_ss.php");
?>
</div>
<div class="submits">
<form method="POST" action="account_setup.php" class="submits">
<input type="hidden" name="consented" value="true"/>
<button class="btn btn-info" role="back"><?php echo lang("GENERAL_BACK") ?></button>
<button class="btn btn-info" role="next"><?php echo lang("GENERAL_NEXT") ?></button>
<button type="submit" role="consent" class="btn btn-info agree"><?php echo lang("CONSENT_I_AGREE") ?></button>
<button role="print" class="btn btn-info print"><?php echo lang("CONSENT_PRINT") ?></button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
include("models/inc/gl_footer.php");
?>
<style>
button[role='back'],
button[role='next'] {display:none; }
</style>
<script>
//LOAD UP FIRST SLIDE
$(".consent_slides section").first().addClass("active");
// //I AGREE
// $("button[role='consent']").click(function(){
// var _this = $(this);
// //REDIRECT TO HOME WITH A MESSAGE
// var dataURL = "consent.php?ajax=1&consent_actual=1";
// $.ajax({
// url: dataURL,
// type:'POST',
// success:function(result){
// console.log(result);
// }
// });
// });
//NEXT BUTTON
$("button[role='next']").click(function(){
var _this = $(this);
$(".consent_slides section.active").each(function(idx){
var prevpanel = $( ".consent_slides section" ).index( $(this) );
// console.log(prevpanel, $( ".consent_slides section" ).length);
//make sure there is a previous section before showing backbutton
if($(this).next().length){
$(".consent .submits button[role='back']").show();
}
//IF THERE IS ANOTHER SECTION THEN ITS A "NEXT" ACTION OTHERWISE, FINAL SUBMIT
if($(this).next().length){
if($(this).hasClass("active")){
$(this).removeClass("active").addClass("inactive");
$(this).next().addClass("active");
if(prevpanel == $( ".consent_slides section" ).length - 2){
_this.hide();
$(".submits button[role='consent']").show();
}
return false;
}
}
});
return false;
});
$("button[role='back']").click(function(){
var _this = $(this);
$(".consent_slides section.active").each(function(idx){
var prevpanel = $( ".consent_slides section" ).index( $(this) );
//IF THERE IS ANOTHER SECTION THEN ITS A "NEXT" ACTION OTHERWISE, FINAL SUBMIT
if($(this).prev().length){
if($(this).hasClass("active")){
$(this).removeClass("active").addClass("inactive");
$(this).prev().addClass("active");
if(prevpanel == 1){
_this.hide();
}
return false;
}
}
});
return false;
});
$("button[role='print']").click(function(){
window.print();
return false;
});
</script>