-
Notifications
You must be signed in to change notification settings - Fork 2
/
create.html
137 lines (125 loc) · 4.09 KB
/
create.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Masai | Create Panel</title>
<link rel="stylesheet" href="style/adminNavbar.css">
<style>
#container {
width: 20%;
margin: auto;
margin-top: 50px;
padding: 30px;
box-shadow: rgba(6, 24, 44, 0.4) 0px 0px 0px 2px;
border-radius: 10px;
}
#container input {
width: 100%;
margin-top: 10px;
border-radius: 10px;
padding: 10px 15px;
border: 1px solid #ccc;
font-size: 18px;
}
select {
padding: 5px;
border-radius: 10px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div id="navbar">
<div id="navbar_div">
<img id="logo" src="https://www.masaischool.com/img/navbar/logo.svg" onclick="window.location.href='admin.html'">
<div onclick="window.location.href='lecture.html'">Lectures</div>
<div onclick="window.location.href='Assignments.html'">Assignments</div>
<div>Quizzes</div>
<div>Tickets</div>
<div>Discussions</div>
<div>Notifications</div>
<div>Electives</div>
</div>
<div id="navbar_div2">
<div id="name"></div>
<button id="logout" onclick="window.location.href='login.html'">LOG OUT</button>
</div>
</div>
<div id="sub_navbar">
<div>Today's Schedule</div>
</div>
<div id="container">
<form>
<select id="LecAssign">
<option value="Select Type">Select Type</option>
<option value="Lecture">Lecture</option>
<option value="Assignment">Assignment</option>
</select>
<select id="Subject">
<option value="Select Subject">Select Subject</option>
<option value="Scrum">Scrum</option>
<option value="DSA">DSA</option>
<option value="CSBT">CSBT</option>
<option value="Coding">Coding</option>
</select>
<label>Enter Time</label>
<input type="time" id="time">
<label>Enter Date</label>
<input type="date" id="date">
<label>Instructor Name</label>
<input type="text" id="instructorname">
<input type="submit">
</div>
</form>
</body>
</html>
<script src="script/adminNavbar.js"></script>
<script>
class lecture{
constructor(t,s,ti,d,n){
this.instructorname=n;
this.type=t;
this.subject=s;
this.time=ti;
this.date=d;
}
}
class assignment{
constructor(t,s,ti,d,n){
this.instructorname=n;
this.type=t;
this.subject=s;
this.time=ti;
this.date=d;
}
}
let lec=JSON.parse(localStorage.getItem("lecture"))||[];
let assign=JSON.parse(localStorage.getItem("assignment"))||[];
let form=document.querySelector("form");
form.addEventListener("submit",getdata);
function getdata(){
event.preventDefault();
let type=form.LecAssign.value;
let subject=form.Subject.value;
let time=form.time.value;
let date=form.date.value;
let name=form.instructorname.value;
if(type=='Lecture'){
let c1=new lecture(type,subject,time,date,name);
console.log('c1:', c1)
lec.push(c1)
localStorage.setItem("lecture",JSON.stringify(lec))
alert("lecture Created")
window.location.reload();
}else{
let c1=new assignment(type,subject,time,date,name);
console.log('c1:', c1)
assign.push(c1);
localStorage.setItem("assignment",JSON.stringify(assign))
alert("Assignment Created")
window.location.reload();
}
}
</script>