-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayStudentNoteResponse.html
161 lines (146 loc) · 9.29 KB
/
displayStudentNoteResponse.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<title>School One</title>
<link rel="stylesheet" type="text/css" href="w3css/4/w3.css">
<link rel="stylesheet" href="ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style type="text/css">
@media screen and (max-width: 455px) {
.h3 {
font-size:16px;
}
body {
font-size:10px;
}
}
</style>
<script type="text/javascript">
var url = window.location.pathname;
var filename = url.substring(url.lastIndexOf('/')+1);
if(localStorage.t_login=="true" && filename == 'login.html'){
window.location.href = "t_dashboard.html";
} else if (localStorage.t_login == null) {
window.location.href = "login.html";
}else if(localStorage.t_login=="false" && filename != 'login.html'){
window.location.href = "login.html";
}
</script>
</head>
<body>
<!-- Sidebar -->
<div class="w3-sidebar w3-light-grey w3-card-4 w3-animate-left" style="display:none;width:250px;" id="mySidebar">
<div id="t_menu">
</div>
<div class="w3-bar-block">
<a id="t_logout" class="w3-bar-item w3-button" href="javascript:;"><i class="fa fa-power-off"></i> Logout</a>
</div>
</div>
<!-- Page Content -->
<div id="main">
<div class="w3-green w3-display-container">
<button class="w3-button w3-green w3-xlarge" id="openNav" onclick="w3_open()"><i class="fa fa-bars"></i></button>
<div class="w3-container">
<img src="img/logo_white.png" style="width: 52px;height: 52px;margin-right:20px;" class="w3-right w3-margin-bottom">
<h1 class="h3" style="float: left;"><span id="studentFullname"></span></h1>
</div>
</div>
</div>
<img src="img/sub_page_bg.jpg" alt="bg" style="width:100%;border-bottom: 5px solid #4CAF50 !important;">
<div class="w3-container w3-margin-top">
<a href="javascript: history.go(-1)" class="w3-button w3-green w3-tiny w3-right w3-margin-bottom"><i class="fa fa-chevron-circle-left"></i> Go Back</a><br>
<div id="noteForm" class="w3-card-4 w3-margin-bottom w3-margin-top" style="border: 1px solid #4CAF50 !important;">
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script src="ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="js/t_auth.js"></script>
<script type="text/javascript" src="js/t_constant.js"></script>
<script type="text/javascript" src="js/getUrl.js"></script>
<script type="text/javascript" src="js/t_func.js"></script>
<script>
$(document).ready(function(){
var teacher_no = localStorage.teacherSpecialID;
var snc_id = decodeURI(getUrlVars()["snc_id"]);
var snc_school = decodeURI(getUrlVars()["snc_school"]);
var snc_class = decodeURI(getUrlVars()["snc_class"]);
var snc_subject = decodeURI(getUrlVars()["snc_subject"]);
var snc_note_id = decodeURI(getUrlVars()["snc_note_id"]);
var snc_topic = decodeURI(getUrlVars()["snc_topic"]);
var snc_description = decodeURI(getUrlVars()["snc_description"]);
var snc_comment = decodeURI(getUrlVars()["snc_comment"]);
var snc_created_by = decodeURI(getUrlVars()["snc_created_by"]);
var snc_comment_by = decodeURI(getUrlVars()["snc_comment_by"]);
var fname = decodeURI(getUrlVars()["student_firstname"]);
var lname = decodeURI(getUrlVars()["student_lastname"]);
$("#studentFullname").text(lname +' '+fname);
String.prototype.nl2br = function(){
return this.replace(/\n/g, "<br />");
}
if (snc_id) {
$("#noteForm").append('<form class="w3-container"><p><input id="teacher_special_no" class="w3-input w3-border w3-light-grey" type="hidden" value="'+localStorage.teacherSpecialID+'"><input id="note_id" class="w3-input w3-border w3-light-grey" type="hidden" value="'+snc_note_id+'"><input id="snc_school" class="w3-input w3-border w3-light-grey" type="hidden" value="'+snc_school+'"><input id="snc_class" class="w3-input w3-border w3-light-grey" type="hidden" value="'+snc_class+'"><input id="snc_subject" class="w3-input w3-border w3-light-grey" type="hidden" value="'+snc_subject+'"><input id="comment_by" class="w3-input w3-border w3-light-grey" type="hidden" value="'+snc_comment_by+'"></p><p><label class="w3-text-teal"><b>Subject</b></label><input id="note_subject" class="w3-input w3-border w3-light-grey" type="text" value="'+snc_subject+'" readonly></p><p><label class="w3-text-teal"><b>Topic</b></label><input id="note_topic" class="w3-input w3-border w3-light-grey" type="text" value="'+snc_topic+'" readonly></p><p><label class="w3-text-teal"><b>Notes</b></label><textarea id="note_description" class="w3-input w3-border w3-light-grey" style="resize:none">'+snc_description+'</textarea></p><p><label class="w3-text-teal"><b>Comment</b></label><textarea id="note_comment" class="w3-input w3-border w3-light-grey" style="resize:none">'+snc_comment.nl2br()+'</textarea></p><p><label class="w3-text-teal"><b>Academic Year</b></label> <select class="w3-select w3-border w3-light-grey" id="academic_year"><option value="2019-2020" selected>2019-2020</option></select> </p><p><label class="w3-text-teal"><b>Academic Term</b></label> <select class="w3-select w3-border w3-light-grey" id="academic_term"><option value="0" selected>Select option</option><option value="FIRST TERM">FIRST TERM</option><option value="SECOND TERM">SECOND TERM</option><option value="THIRD TERM">THIRD TERM</option></select> </p><p><label class="w3-text-teal"><b>Remark</b></label><textarea id="note_comment_remark" class="w3-input w3-border w3-light-grey" style="resize:none"></textarea></p><p><label class="w3-text-teal"><b>Mark</b></label><input id="mark" class="w3-input w3-border" type="text"></p><p><button id="remark_note" class="w3-btn w3-blue-grey w3-round" style="width:100%;" type="button"><b>Save Remark</b></button></p></form>');
}
//User Registration function
$("#remark_note").click(function(){
var special_no = $("#teacher_special_no").val();
var s_subject = $("#snc_subject").val();
var s_school = $("#snc_school").val();
var s_class = $("#snc_class").val();
var academic_term = $("#academic_term").val();
var academic_year = $("#academic_year").val();
var n_id = $("#note_id").val();
var n_comment_remark = $("#note_comment_remark").val();
var n_mark = $("#mark").val();
var n_comment = $("#comment_by").val();
var dataString = "special_no=" + special_no + "&n_id=" + n_id + "&n_comment_remark=" + n_comment_remark + "&n_mark=" + n_mark + "&s_subject=" + s_subject + "&s_school=" + s_school + "&s_class=" + s_class + "&academic_term=" + academic_term + "&academic_year=" + academic_year + "&n_comment=" + n_comment + "&new_note_remark=";
if ($.trim(special_no).length > 0 & $.trim(n_id).length > 0) {
$.ajax({
type: "POST",
//url: "http://www.alicesons.org/demos/phonegap/schoolone/register.php",
url: "http://www.alicesons.org/demos/phonegap/schoolone/save_note_remark.php",
data: dataString,
crossDomain: true,
cache: false,
beforeSend: function(){
$("#remark_note").html('<img src="img/loader.gif" />');
},
success: function(data){
if (data == "success") {
if(!alert("Your remark is sent successfully!.")){
window.location.reload();
$("#note_comment_remark").val("");
$("#mark").val("");
$("#academic_term").val("");
}
} else if (data == "error") {
if(!alert("Remark can't be sent!.")){
window.location.reload();
$("#note_comment_remark").val("");
$("#mark").val("");
$("#academic_term").val("");
}
}
}
});
}return false;
});
});
</script>
<div style="margin-bottom: 100px;"></div>
<footer id="t_footer"></footer>
</body>
</html>