forked from DhananjayPurohit/ISO-12-E1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_syllabus.html
143 lines (131 loc) · 5.67 KB
/
add_syllabus.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Syllabus</title>
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway|Roboto&display=swap" rel="stylesheet">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<style media="screen">
.bg-zig-zag{
background-color: #ffffff;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1640' height='1640' viewBox='0 0 200 200'%3E%3Cdefs%3E%3ClinearGradient id='a' gradientUnits='userSpaceOnUse' x1='88' y1='88' x2='0' y2='0'%3E%3Cstop offset='0' stop-color='%23064e77'/%3E%3Cstop offset='1' stop-color='%230a7dbe'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' gradientUnits='userSpaceOnUse' x1='75' y1='76' x2='168' y2='160'%3E%3Cstop offset='0' stop-color='%238f8f8f'/%3E%3Cstop offset='0.09' stop-color='%23b3b3b3'/%3E%3Cstop offset='0.18' stop-color='%23c9c9c9'/%3E%3Cstop offset='0.31' stop-color='%23dbdbdb'/%3E%3Cstop offset='0.44' stop-color='%23e8e8e8'/%3E%3Cstop offset='0.59' stop-color='%23f2f2f2'/%3E%3Cstop offset='0.75' stop-color='%23fafafa'/%3E%3Cstop offset='1' stop-color='%23FFFFFF'/%3E%3C/linearGradient%3E%3Cfilter id='c' x='0' y='0' width='200%25' height='200%25'%3E%3CfeGaussianBlur in='SourceGraphic' stdDeviation='12' /%3E%3C/filter%3E%3C/defs%3E%3Cpolygon fill='url(%23a)' points='0 174 0 0 174 0'/%3E%3Cpath fill='%23000' fill-opacity='0.79' filter='url(%23c)' d='M121.8 174C59.2 153.1 0 174 0 174s63.5-73.8 87-94c24.4-20.9 87-80 87-80S107.9 104.4 121.8 174z'/%3E%3Cpath fill='url(%23b)' d='M142.7 142.7C59.2 142.7 0 174 0 174s42-66.3 74.9-99.3S174 0 174 0S142.7 62.6 142.7 142.7z'/%3E%3C/svg%3E");
background-attachment: fixed;
background-repeat: no-repeat;
background-position: top left;
}
#subject, .input-field{
border: 2px solid #FFA500;
border-radius: 15px;
font-size:30px;
padding:10px;
color: black;
background: #fff;
opacity: 0.75
}
label{
font-size:20px;
font-family:Roboto;
}
.added{
border: 2px solid green;
padding: 10px;
background: lightgreen;
color: black;
font-family: sans-serif;
border-radius: 15px;
opacity: 0.65;
width: 300px;
font-size: 20px;
}
.added_con{
position: absolute;
top: 80%;
left: 30%;
}
</style>
</head>
<body class="bg-zig-zag">
<div class="container">
<h1 style="margin-left:0px;font-family:Roboto;color:#FFA500;font-weight:800;border-bottom:2px solid white;border-radius:3px;padding:5px;display:inline-block"> Add Syllabus </h1>
</div>
<br>
<div class="container row">
<div class="col s7">
<label for="subject" color="red">Subject:</label>
<input id="subject" type="text" class="myinp">
</div>
<div class="col s12">
<div class="input-field col s3">
<select id="year">
<option value="1">1 year</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<p class="col s1">
<div class="input-field col s3">
<select>
<option value="1">CS</option>
<option value="2">IT</option>
<option value="3">Mechanical</option>
</select>
</div>
</div>
<div class="col s8">
<form action="#">
<div class="file-field input-field">
<div class="btn">
<span>File</span>
<input type="file" id="fileUpload">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
</form>
<div class="row center">
<a class="waves-effect waves-light btn" id="submitB"><i class="material-icons right">add</i>Submit</a>
</div>
<div class="container center added_con">
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('select').formSelect();
});
$("#submitB").click(function(){
var sub_ = $('#subject').val()
var year_ = $('#year :selected').val()
var branch_ = $('#branch :selected').val()
var file_ = $('#fileUpload').value;
var myHeaders = new Headers();
var input = document.querySelector('input[type="file"]');
var formdata = new FormData();
formdata.append("year", year_);
formdata.append("branch", branch_);
formdata.append("subject", sub_);
formdata.append("syllabus", input.files[0]);
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("http://127.0.0.1:5000/add_syllabus", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
$(".added_con").append('<div class="row added"><p>'+sub_+'</p></div>')
});
</script>
</body>
</html>