forked from DhananjayPurohit/ISO-12-E1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
newtemp.html
executable file
·371 lines (340 loc) · 16 KB
/
newtemp.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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link rel="stylesheet" type="text/css" href="CreativeButtons/css/default.css" />
<link rel="stylesheet" type="text/css" href="CreativeButtons/css/component.css" />
<script src="CreativeButtons/js/modernizr.custom.js"></script>
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<style>
.theme {
background-color: #0c2461;
}
.btn-2h {
margin-top:10px;
}
.btn-2h:hover {
background: #800000;
color: #226fbe;
}
.temp2 {
display: none;
}
.usp{
font-size: 30px;
border: 1px solid grey;
font-family: Roboto;
margin: 1px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="row">
<form class="col s12 m4" style="margin-right: 0px;" name="myForm" method="POST">
<div class="row" style="margin:20px ">
<p>
<label style="margin-right:50px">
<input name="group1" type="radio" id="rad" value="blue" checked />
<span>Blue</span>
</label>
<label>
<input name="group1" type="radio" id="rad" />
<span>Red</span>
</label>
</p>
<p>
<label style="margin-right:35px">
<input name="group2" type="radio" id="cs" value="def" checked />
<span>Temp1</span>
</label>
<label>
<input name="group2" type="radio" id="cs" />
<span>Temp2</span>
</label>
</p>
<div class="input-field col s12">
<input id="inst_name" type="text" class="validate" name="inst_name">
<label for="inst_name">Institute name</label>
</div>
<br />
<br />
<br />
<div class="file-field input-field">
<div class="btn1">
<span>Logo</span>
<input type="file" onchange="onFileSelected(event)" id="logo" name="logo">
</div>
<div class="file-path-wrapper">
<input placeholder="Upload Logo" class="file-path validate" type="text">
</div>
</div>
<div class="file-field input-field">
<div class="btn1">
<span>Carousel Images</span>
<input type="file" multiple onchange="onMultipleFileSelect(event)" id="caro" name="caro">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Upload one or more images">
</div>
</div>
<div class="input-field col s12">
<textarea id="vision" class="materialize-textarea" name="vis"></textarea>
<label for="vision">Vision</label>
</div>
<div class="input-field col s12">
<input id="location" type="text" class="validate" name="loc">
<label for="location">Location</label>
</div>
<div class="input-field col s12">
<input id="contact" type="text" class="validate" name="contact">
<label for="contact">Contact no.</label>
</div>
</div>
<center>
<button class="btn waves-effect waves-light" type="button" style="font-weight:bolder"
onClick="onSubmit()">Submit
</button>
</center>
</form>
<div class="col s12 m8">
<nav style="height:20vh" class="theme">
<div class="nav-wrapper">
<img src="https://source.unsplash.com/random" id="logo"
style="width:120px; height:120px; margin:20px" />
<a href="#" id="inst_l" class="brand-logo" style="margin:10px; font-size:30px">Institute Name</a>
<!-- <ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>
</ul> -->
</div>
</nav>
<div class="temp1">
<div class="carousel carousel-slider center" style="height:40vh">
<!-- <div class="carousel-fixed-item center">
<a class="btn waves-effect white grey-text darken-text-2">button</a>
</div> -->
<div class="carousel-item red white-text" href="#one!">
<img src="" alt="" style="width: 100%; height: 100%" id="img1" />
<h2>First Panel</h2>
<p class="white-text">This is your first panel</p>
</div>
<div class="carousel-item amber white-text" href="#two!">
<img src="" alt="" style="width: 100%; height: 100%" id="img2" />
<h2>Second Panel</h2>
<p class="white-text">This is your second panel</p>
</div>
<div class="carousel-item green white-text" href="#three!">
<img src="" alt="" style="width: 100%; height: 100%" id="img3" />
<h2>Third Panel</h2>
<p class="white-text">This is your third panel</p>
</div>
<div class="carousel-item blue white-text" href="#four!">
<img src="" alt="" style="width: 100%; height: 100%" id="img4" />
<h2>Fourth Panel</h2>
<p class="white-text">This is your fourth panel</p>
</div>
</div>
</div>
<div class="temp2">
<div class="carousel carousel-slider center col s12 m8" style="height:40vh">
<!-- <div class="carousel-fixed-item center">
<a class="btn waves-effect white grey-text darken-text-2">button</a>
</div> -->
<div class="carousel-item red white-text" href="#one!">
<img src="" alt="" style="width: 100%; height: 100%" id="img1" />
<h2>First Panel</h2>
<p class="white-text">This is your first panel</p>
</div>
<div class="carousel-item amber white-text" href="#two!">
<img src="" alt="" style="width: 100%; height: 100%" id="img2" />
<h2>Second Panel</h2>
<p class="white-text">This is your second panel</p>
</div>
<div class="carousel-item green white-text" href="#three!">
<img src="" alt="" style="width: 100%; height: 100%" id="img3" />
<h2>Third Panel</h2>
<p class="white-text">This is your third panel</p>
</div>
<div class="carousel-item blue white-text" href="#four!">
<img src="" alt="" style="width: 100%; height: 100%" id="img4" />
<h2>Fourth Panel</h2>
<p class="white-text">This is your fourth panel</p>
</div>
</div>
<div class="col s12 m4">
<div class="card" style="min-height:40vh">
<div class="card-content">
<span class="card-title" style="font-weight: bolder;" id="notifg">Notifications</span>
<p style="font-size:large"></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12 m4 noti">
<div class="card" style="min-height:40vh">
<div class="card-content">
<span class="card-title" style="font-weight: bolder;" id="notifg1">Notifications</span>
<p style="font-size:large"></p>
</div>
</div>
</div>
<div class="col s12 m4">
<div class="card" style="min-height:40vh">
<div class="card-content">
<span class="card-title" style="font-weight: bolder;">Vision</span>
<p style="font-size:large" id="vision_l">I am a very simple card. I am good at containing
small bits of information.
I am convenient because I require little markup to use effectively.</p>
</div>
</div>
</div>
</div>
<div class="row">
<a href="add_syllabus.html"><button class="btn btn-2 btn-2h col s5">Add new Syllabus</button></a>
<a href="syllabus.html" ><button class="btn btn-2 btn-2h col s5">Syllabus/ Revision</button></a>
<a href="question.html"><button class="btn btn-2 btn-2h col s5">Feedback by students</button></a>
<a href="dashboard_teacher.html"><button class="btn btn-2 btn-2h col s5">Dashboard for teacher</button></a>
</div>
<footer class="page-footer theme">
<div class="container">
<h5 class="white-text" style="font-weight: bolder;">Contact</h5>
<div class="row">
<div class="col l6 s12">
<p class="grey-text text-lighten-4" style="font-weight:bold">Address</p>
<p class="grey-text text-lighten-4" id="address_l">P-22, x-steet, Noida</p>
</div>
<div class="col l6 s12">
<p class="grey-text text-lighten-4" style="font-weight:bold">Contact no.</p>
<p class="grey-text text-lighten-4" id="cont_l">022-555-666</p>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2020 Copyright
<a class="grey-text text-lighten-4 right" href="#!">More Links</a>
</div>
</div>
</footer>
</div>
</div>
<script>
$('.carousel.carousel-slider').carousel({
fullWidth: true,
indicators: true
});
$("input[type='radio']").click(function () {
var radioValue = $("input[name='group1']:checked").val();
if (radioValue !== "blue") {
$('.theme').css('background-color', "#8c1515");
}
else
$('.theme').css('background-color', "#0c2461")
});
$("input[type='radio']").click(function () {
var radioValue = $("input[name='group2']:checked").val();
if (radioValue !== "def") {
$('.temp1').hide();
$('.temp2').show();
$('.noti').hide();
}
else {
$('.temp2').hide();
$('.temp1').show();
$('.noti').show();
}
});
$("#inst_name").bind('keyup', function (event) {
event.preventDefault();
let instl = document.getElementById('inst_l');
let instName = document.getElementById('inst_name').value;
instl.innerText = instName;
// TREATS EVERY CONTENT AS TEXT.
});
function onFileSelected(event) {
var selectedFile = event.target.files[0];
var reader = new FileReader();
var imgtag = document.getElementById("logo");
reader.onload = function (event) {
imgtag.src = event.target.result;
};
reader.readAsDataURL(selectedFile);
}
function onMultipleFileSelect(event) {
var selectedFile = event.target.files[0];
var reader = new FileReader();
var imgtag = document.getElementById("img1");
reader.onload = function (event) {
imgtag.src = event.target.result;
};
reader.readAsDataURL(selectedFile);
}
$("#vision").bind('keyup', function (event) {
event.preventDefault();
let instl = document.getElementById('vision_l');
let instName = document.getElementById('vision').value;
instl.innerText = instName;
// TREATS EVERY CONTENT AS TEXT.
});
$("#location").bind('keyup', function (event) {
event.preventDefault();
let instl = document.getElementById('address_l');
let instName = document.getElementById('location').value;
instl.innerText = instName;
// TREATS EVERY CONTENT AS TEXT.
});
$("#contact").bind('keyup', function (event) {
event.preventDefault();
let instl = document.getElementById('cont_l');
let instName = document.getElementById('contact').value;
instl.innerText = instName;
// TREATS EVERY CONTENT AS TEXT.
});
var myHeaders = new Headers();
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("http://127.0.0.1:5000/notif", requestOptions)
.then(response => response.text())
.then(result => notify(result))
.catch(error => console.log('error', error));
function notify(resp){
$("#notifg").text(resp);
$("#notifg1").text(resp);
}
function onSubmit(event) {
// event.preventDefault();
var formData = {
inst_name: document.getElementById("inst_name").value,
group1: document.getElementById("rad").value,
group2: document.getElementById("cs").value,
logo: document.getElementById("logo").value,
caro: document.getElementById("caro").value,
vis: document.getElementById("vision").value,
loc: document.getElementById("location").value,
contact: document.getElementById("contact").value,
};
console.log(formData);
fetch("http://localhost:5000/get_json_data", {
method: 'POST',
body: formData,
headers: {
'Accept': 'application/json, application/xml, text/plain, text/html, *.*',
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
},
})
.then(res => res.json())
.then(res => console.log(res))
}
</script>
</body>
</html>