-
Notifications
You must be signed in to change notification settings - Fork 1
/
college-request.js
203 lines (192 loc) · 7.42 KB
/
college-request.js
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
/*
Replace with instructors from the array:
<div class="mb-3">
<label for="course" class="form-label
">Course</label>
<select class="form-select" id="course" name="course" required>
<option value="">Select Course</option>
<option value="Web Development">Web Development</option>
<option value="Software Engineering">Software Engineering</option>
<option value="Software Applications">Software Applications</option>
<option value="Graphics Design">Graphics Design</option>
</select>
</div>
<div class="mb-3">
<label for="instructor" class="form-label
">Instructor</label>
<select class="form-select" id="instructor" name="instructor" required>
<option value="">Select Instructor</option>
<option value="John Doe">John Doe</option>
<option value="Jane Doe">Jane Doe</option>
<option value="James Doe">James Doe</option>
<option value="Jenny Doe">Jenny Doe</option>
</select>
</div>
// Array of instructors
window.instructors = [
{
id: 1,
name: "L Munyaka",
title: "Web Development",
image: "img/instructor-l-munyaka.jpg",
facebook: "#",
twitter: "#",
instagram: "#",
bio: "L Munyaka is a web developer with over 5 years of experience. He has worked on a wide range of projects, from small websites to large web applications. He is passionate about teaching and sharing his knowledge with others."
},
{
id: 2,
name: "Emmanuel Omondi",
title: "Software Engineering",
image: "img/instructor-emanuel-omondi.jpg",
facebook: "#",
twitter: "#",
instagram: "#",
bio: "Emmanuel Omondi is a software engineer with over 3 years of experience. He has worked on a wide range of projects, from small websites to large web applications. He is passionate about teaching and sharing his knowledge with others.",
courses: [2, 12]
},
{
id: 3,
name: "James Kivuti",
title: "Software Development",
image: "img/instructor-james-kivuti.jpg",
facebook: "#",
twitter: "#",
instagram: "#",
bio: "James Kivuti is a software developer with over 6 years of experience. He has worked on a wide range of projects, from small websites to large web applications. He is passionate about teaching and sharing his knowledge with others.",
courses: [3, 8]
}
]
// Array of courses
// Array of courses
window.courses = [
{
id: 1,
title: "Web Development",
description: "This course is designed to give students a foundational understanding of web development. Students will learn the basics of HTML, CSS, and JavaScript.",
instructorId: instructors[5].id,
instructor: instructors[5].name,
price: 10000,
image: "img/course-web-design.jpg",
duration: "3 months",
level: "Beginner",
students: 27,
rating: 5,
category: "webDevelopment",
isForColleges: true,
isOngoing: true,
topics: [
{
title: "HTML",
subtopics: ["Elements", "Attributes", "Tags"]
},
{
title: "CSS",
subtopics: ["Selectors", "Properties", "Values"]
},
{
title: "JavaScript",
subtopics: ["Variables", "Functions", "Loops"]
}
]
},
{
id: 2,
title: "Data Science",
description: "This course is designed to give students a foundational understanding of data science. Students will learn the basics of Python, R, and SQL.",
instructorId: instructors[4].id,
instructor: instructors[4].name,
price: 15000,
image: "img/course-data-science.jpg",
duration: "4 months",
level: "Intermediate",
students: 65,
rating: 5,
category: "softwareEngineering",
isForColleges: true,
isOngoing: true,
topics: [
{
title: "Python",
subtopics: ["Variables", "Functions", "Loops"]
},
{
title: "R",
subtopics: ["Variables", "Functions", "Loops"]
},
{
title: "SQL",
subtopics: ["Variables", "Functions", "Loops"]
}
]
},
{
id: 3,
title: "Mobile App Development",
description: "This course is designed to give students a foundational understanding of mobile app development. Students will learn the basics of Android and iOS development.",
instructorId: 3,
instructor: instructors[2].name,
price: 20000,
image: "img/course-mobile-development.jpg",
duration: "6 months",
level: "Advanced",
students: 10,
rating: 4,
category: "softwareEngineering",
isForColleges: true,
isOngoing: true,
topics: [
{
title: "Android Development",
subtopics: ["Activities", "Fragments", "Intents"]
},
{
title: "iOS Development",
subtopics: ["View Controllers", "Storyboards", "Auto Layout"]
}
]
},
{
id: 4,
title: "Structured Programming",
description: "This course is designed to give students a foundational understanding of structured programming. Students will learn the basics of supervised and unsupervised learning.",
instructorId: instructors[3].id,
instructor: instructors[3].name,
price: 25000,
image: "img/course-structured-programming-c.jpg",
duration: "1 month",
level: "Expert",
students: 5,
rating: 30,
category: "knecMasterclasses",
isForColleges: true,
isOngoing: true,
topics: [
{
title: "Supervised Learning",
subtopics: ["Classification", "Regression"]
},
{
title: "Unsupervised Learning",
subtopics: ["Clustering", "Association"]
}
]
}
]
*/
const courseSelect = document.getElementById('course');
const instructorSelect = document.getElementById('instructor');
// Populate the options with courses names from data.js
courses.forEach(course => {
const option = document.createElement('option');
option.value = course.id;
option.textContent = course.title;
courseSelect.appendChild(option);
});
// Populate the options with instructors names from data.js
instructors.forEach(instructor => {
const option = document.createElement('option');
option.value = instructor.id;
option.textContent = instructor.name;
instructorSelect.appendChild(option);
});