PageSourceSearch

https://kennedyuniv.github.io/dev/kennedy.js

js kennedyuniv.github.io collected 2026-10-03 09:27:13 UTC 36,205 bytes, 975 lines download raw bytes

1let noticeCardDiv = `<div
2                    class="p-1 rounded-xl group sm:flex space-x-6 bg-gradient-to-br from-sky-100 to-white bg-opacity-50 shadow-xl hover:rounded-2xl">
3                    <script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
4    <lottie-player src="https://assets1.lottiefiles.com/packages/lf20_uaaroxwt.json" background="transparent" speed="1"
5        style="width: 200px; height: 200px;" loop autoplay>
6    </lottie-player>
7    <div class="sm:w-7/12 pl-0 p-5">
8        <div class="space-y-2">
9            <div class="space-y-4">
10                <h4 class="text-2xl font-semibold text-gray-900">$nTitle$</h4>
11            </div>
12            <a href="/pages/noticesInner.html?nId=$noticeId$" class="block w-max text-cyan-600">Read more</a>
13        </div>
14    </div>
15    </div>`;
16
17function loadNoticesPublic(htmlRowsDivId) {
18    getNotices(function (res) {
19        let noticesArray = res.data;
20        let finalNoticesDivBody = "";
21        for (let index = 0; index < noticesArray.length; index++) {
22            const notice = noticesArray[index];
23            console.log("status", notice.status);
24            if (notice.status !== 1) {
25                continue;
26            }
27            let noticeDivBody = noticeCardDiv.replace("$nTitle$", notice.title)
28                .replace("$noticeId$", notice.id);
29            finalNoticesDivBody += noticeDivBody;
30        }
31        document.getElementById(htmlRowsDivId).innerHTML = finalNoticesDivBody;
32    })
33}
34
35let noticeFilePreviewTag = `<div class="relative flex items-end w-full bg-black h-60 group"> <a href="$FileSRC_2$" class="relative flex items-end w-full bg-black    h-60 group">
36                <$TAG_TYPE$ src="$FileSRC$"
37                    class="absolute inset-0 object-cover w-full h-full transition-opacity group-hover:opacity-90"></$TAG_TYPE_2$>
38
39                <div
40                    class="relative w-full p-3 tracking-widest text-center text-white transition-colors backdrop-blur-2xl group-hover:bg-black hover:text-sky-500">
41                    <strong class="text-lg uppercase">
42                        $FileName$
43                    </strong>
44                </div></a>
45                $removeEle$
46            </div>`;
47function loadNoticeByIdPublic(noticeId, nTitleId, nDescriptionId, nFilesDiv, nFilePreviewDiv) {
48    document.getElementById(nTitleId).innerHTML = "Loading...";
49    document.getElementById(nDescriptionId).innerHTML = "";
50    document.getElementById(nFilesDiv).innerHTML = "";
51    document.getElementById(nFilePreviewDiv).innerHTML = "";
52    getNoticeById(noticeId, function (res) {
53        let noticeObj = res.data;
54        document.getElementById(nTitleId).innerHTML = noticeObj.title;
55        document.getElementById(nDescriptionId).innerHTML = noticeObj.description;
56        if (!noticeObj.files) {
57            noticeObj.files = [];
58        }
59        let finalNoticeFilesDivBody = "";
60        let finalNoticeFilesPreviewDivBody = "";
61        for (let index = 0; index < noticeObj.files.length; index++) {
62            const noticeFileURL = noticeObj.files[index];
63            // let fileEle = '<span id=eventSectionURL><a target="_blank" href="$FileURL$">$FileName$</a></span>';
64            // let noticeDivBody = fileEle.replace("$FileURL$", noticeFileURL)
65            //     .replace("$FileName$", "File " + (index + 1));
66            // finalNoticeFilesDivBody += noticeDivBody + "<br><br>";
67            let fileName = getFileNameFromPublicFileURL(noticeFileURL);
68            let isImageFile = noticeObj.filesInfo[fileName].contentType.startsWith("image/");
69            let noticeFilePreviewTagLocal = noticeFilePreviewTag.replace("$FileSRC$", noticeFileURL)
70                .replace("$FileSRC_2$", noticeFileURL)
71                .replace("$TAG_TYPE$", isImageFile ? "img" : "iframe")
72                .replace("$TAG_TYPE_2$", isImageFile ? "img" : "iframe")
73                .replace("$removeEle$", "")
74                .replace("$FileName$", noticeObj.filesInfo[fileName].file.name);
75            finalNoticeFilesPreviewDivBody += noticeFilePreviewTagLocal;
76        }
77        document.getElementById(nFilesDiv).innerHTML = finalNoticeFilesDivBody;
78        document.getElementById(nFilePreviewDiv).innerHTML = finalNoticeFilesPreviewDivBody;
79    }, function () {
80        history.back();
81    })
82}
83function getFileNameFromPublicFileURL(fileURL) {
84    return fileURL.substring(fileURL.indexOf("/o/") + 3, fileURL.indexOf("?alt"));
85}
86//------------------------------------------------------------
87const studentRowDivBody = `<tr>
88                                <td class="border px-4 py-2">
89                                    <a onclick="onViewStudentClicked('$studentIdView$')" class="bg-sky-800 cursor-pointer rounded p-1 mx-1 text-white">
90                                        <i class="fas fa-eye"></i></a>
91                                    <a onclick="onUpdateStudentClicked('$studentIdEdit$')" class="bg-sky-800 cursor-pointer rounded p-1 mx-1 text-white">
92                                        <i class="fas fa-edit"></i></a>
93                                    </a>
94                                </td>
95                                <td class="border px-4 py-2">$PartnerCode$</td>
96                                <td class="border px-4 py-2">$EnrollmentNumber$</td>
97                                <td class="border px-4 py-2">$SName$</td>
98                                <td class="border px-4 py-2">$EnrollmentProgram$</td>
99                                <td class="border px-4 py-2">$SCSession$</td>
100                                <td class="border px-4 py-2">$SCSpecialization$</td>
101
102                                <td class="border px-4 py-2">
103                                    <button onclick="onStudentStatusChangeClicked('$studentIdStatus$')" class="text-blue-700 border border-blue-700 hover:bg-blue-700 hover:text-white px-2 py-2 rounded-xl">$cStatus$</button>
104                                </td>
105                        </tr>`;
106
107let students = {};
108function loadStudents(htmlRowsDivId) {
109    getStudents(function (res) {
110        let studentsArray = res.data;
111        let finalStudentsDivBody = "";
112        for (let index = 0; index < studentsArray.length; index++) {
113            const student = studentsArray[index];
114            students[student.id] = student;
115            let studentDivBody = studentRowDivBody.replace("$PartnerCode$", student.centerCode)
116                .replace("$EnrollmentNumber$", student.enrollmentNumber)
117                .replace("$EnrollmentProgram$", student.enrollProgramName)
118                .replace("$RollNumber$", student.rollNumber)
119                .replace("$SName$", student.name)
120                .replace("$SCSession$", student.yearOfSession.replace("-", " to "))
121                .replace("$cStatus$", student.statusText)
122                .replace("$SCSpecialization$", student.specialization)
123                .replace("$studentIdStatus$", student.id)
124                .replace("$studentIdView$", student.id)
125                .replace("$studentIdEdit$", student.id)
126                .replace("$studentIdDelete$", student.id);
127            finalStudentsDivBody += studentDivBody;
128        }
129        document.getElementById(htmlRowsDivId).innerHTML = finalStudentsDivBody;
130    })
131}
132
133function onStudentStatusChangeClicked(studentId) {
134    selectedStudentId = studentId;
135    showStatusChangePopUp();
136}
137
138function onViewStudentClicked(studentId) {
139    selectedStudentId = studentId;
140    window.location.href = "/dev/admin-studentInner.html?id=" + selectedStudentId + "&action=view";
141}
142
143function onUpdateStudentClicked(studentId) {
144    selectedStudentId = studentId;
145    window.location.href = "/dev/admin-studentInner.html?id=" + selectedStudentId;
146}
147
148let selectedStudentId;
149function onDeleteStudentClicked(studentId) {
150    selectedStudentId = studentId;
151    showDeletePopUp();
152}
153//------------------------------------------------------
154//------------------------------------------------------------
155const centerRowDivBody = `<tr>
156                                <td class="border px-4 py-2">
157                                    <a onclick="onViewCenterClicked('$centerIdView$')" class="bg-sky-800 cursor-pointer rounded p-1 mx-1 text-white">
158                                        <i class="fas fa-eye"></i></a>
159                                    <a onclick="onUpdateCenterClicked('$centerIdEdit$')" class="bg-sky-800 cursor-pointer rounded p-1 mx-1 text-white">
160                                        <i class="fas fa-edit"></i></a>
161                                    </a>
162                                </td>
163                                <td class="border px-4 py-2">$CenterCode$</td>
164                                <td class="border px-4 py-2">$CName$</td>
165                                <td class="border px-4 py-2">$CType$</td>
166                                <td class="border px-4 py-2">$StateCountry$</td>
167
168                                <td class="border px-4 py-2">
169                                    <button onclick="onCenterStatusChangeClicked('$centerIdStatus$')" class="text-blue-700 border border-blue-700 hover:bg-blue-700 hover:text-white px-2 py-2 rounded-xl">$cStatus$</button>
170                                </td>
171                        </tr>`;
172
173let centers = {};
174function loadCenters(htmlRowsDivId) {
175    getCenters(function (res) {
176        let centerssArray = res.data;
177        let finalCentersDivBody = "";
178        for (let index = 0; index < centerssArray.length; index++) {
179            const center = centerssArray[index];
180            centers[center.id] = center;
181            let centerDivBody = centerRowDivBody.replace("$CenterCode$", center.code)
182                .replace("$CName$", center.name)
183                .replace("$CType$", center.type)
184                .replace("$StateCountry$", center.state + ", " + center.country)
185                .replace("$cStatus$", center.statusText)
186                .replace("$centerIdStatus$", center.id)
187                .replace("$centerIdView$", center.id)
188                .replace("$centerIdEdit$", center.id)
189                .replace("$centerIdDelete$", center.id);
190            finalCentersDivBody += centerDivBody;
191        }
192        document.getElementById(htmlRowsDivId).innerHTML = finalCentersDivBody;
193    })
194}
195
196function onCenterStatusChangeClicked(centerId) {
197    selectedCenterId = centerId;
198    showStatusChangePopUp();
199}
200
201function onViewCenterClicked(centerId) {
202    selectedCenterId = centerId;
203    window.location.href = "/dev/admin-centerInner.html?id=" + selectedCenterId + "&action=view";
204}
205
206function onUpdateCenterClicked(centerId) {
207    selectedCenterId = centerId;
208    window.location.href = "/dev/admin-centerInner.html?id=" + selectedCenterId;
209}
210
211let selectedCenterId;
212function onDeleteCenterClicked(centerId) {
213    selectedCenterId = centerId;
214    showDeletePopUp();
215}
216//------------------------------------------------------
217//------------------------------------------------------------
218const courseRowDivBody = `<tr>
219                            <td class="border px-4 py-2">
220                                <a onclick="onViewCourseClicked('$courseIdView$')" class="bg-sky-800 cursor-pointer rounded p-1 mx-1 text-white">
221                                    <i class="fas fa-eye"></i></a>
222                                <a onclick="onUpdateCourseClicked('$courseIdEdit$')" class="bg-sky-800 cursor-pointer rounded p-1 mx-1 text-white">
223                                    <i class="fas fa-edit"></i></a>
224                                </a>
225                            </td>
226                            <td class="border px-4 py-2">$cName$</td>
227                            <td class="border px-4 py-2">$Category$</td>
228                            <td class="border px-4 py-2">$cLevel$</td>
229                            <td class="border px-4 py-2">$cPattern$</td>
230
231                            <td class="border px-4 py-2">
232                                <button onclick="onCourseStatusChangeClicked('$courseIdStatus$')" class="text-blue-700 border border-blue-700 hover:bg-blue-700 hover:text-white px-2 py-2 rounded-xl">$cStatus$</button>
233                            </td>
234                        </tr>`;
235
236function resIsValid(res) {
237    try {
238        if (res || typeof res === 'string') {
239            res = JSON.parse(res);
240            return true;
241        }
242    } catch (e) {
243        console.error("error", e);
244    }
245    return false;
246}
247
248let courses = {};
249function loadCourses(htmlRowsDivId) {
250    getCourses(function (res) {
251        let coursesArray = res.data;
252        let finalCoursesDivBody = "";
253        for (let index = 0; index < coursesArray.length; index++) {
254            const course = coursesArray[index];
255            courses[course.id] = course;
256            let courseDivBody = courseRowDivBody.replace("$cName$", course.title)
257                .replace("$Category$", course.category)
258                .replace("$cLevel$", course.level)
259                .replace("$cPattern$", course.pattern)
260                .replace("$cStatus$", course.statusText)
261                .replace("$courseIdStatus$", course.id)
262                .replace("$courseIdView$", course.id)
263                .replace("$courseIdEdit$", course.id)
264                .replace("$courseIdDelete$", course.id);
265            finalCoursesDivBody += courseDivBody;
266        }
267        document.getElementById(htmlRowsDivId).innerHTML = finalCoursesDivBody;
268    })
269}
270
271function onCourseStatusChangeClicked(courseId) {
272    selectedCourseId = courseId;
273    showStatusChangePopUp();
274}
275
276function onViewCourseClicked(courseId) {
277    selectedCourseId = courseId;
278    window.location.href = "/dev/admin-coursesInner.html?id=" + selectedCourseId + "&action=view";
279}
280
281function onUpdateCourseClicked(courseId) {
282    selectedCourseId = courseId;
283    window.location.href = "/dev/admin-coursesInner.html?id=" + selectedCourseId;
284}
285
286let selectedCourseId;
287function onDeleteCourseClicked(courseId) {
288    selectedCourseId = courseId;
289    showDeletePopUp();
290}
291//------------------------------------------------------
292
293function createCourse(reqBody, onSuccess, onError) {
294    let url = getBaseURL() + "/course";
295    //let headers = getAdminHeaders("FormData");
296    let headers = getAdminHeaders();
297    callAPI(url, function (err, response) {
298        if (err) {
299            if (onError) {
300                onError();
301            }
302            if (response) {
303                console.error("error res", JSON.stringify(response));
304                alert(err);
305            } else {
306                alert(err);
307            }
308        } else {
309            //console.log("success res", JSON.stringify(response));
310            //localStorage["logRes"] = JSON.stringify(response);
311            onSuccess(response);
312        }
313    }, "POST", reqBody, headers)//, "FormData"
314}
315
316function createCenter(reqBody, onSuccess, onError) {
317    let url = getBaseURL() + "/center";
318    //let headers = getAdminHeaders("FormData");
319    let headers = getAdminHeaders();
320    callAPI(url, function (err, response) {
321        if (err) {
322            if (onError) {
323                onError();
324            }
325            if (response) {
326                console.error("error res", JSON.stringify(response));
327                alert(err);
328            } else {
329                alert(err);
330            }
331        } else {
332            //console.log("success res", JSON.stringify(response));
333            //localStorage["logRes"] = JSON.stringify(response);
334            onSuccess(response);
335        }
336    }, "POST", reqBody, headers)//, "FormData"
337}
338
339function createStudent(reqBody, onSuccess, onError) {
340    let url = getBaseURL() + "/student";
341    let headers = getAdminHeaders("FormData");
342    // let headers = getAdminHeaders();
343    callAPI(url, function (err, response) {
344        if (err) {
345            if (onError) {
346                onError();
347            }
348            if (response) {
349                console.error("error res", JSON.stringify(response));
350                alert(err);
351            } else {
352                alert(err);
353            }
354        } else {
355            //console.log("success res", JSON.stringify(response));
356            //localStorage["logRes"] = JSON.stringify(response);
357            onSuccess(response);
358        }
359    }, "POST", reqBody, headers, "FormData")
360}
360
361
362function getCourseById(courseId, onSuccess, onError) {
363    let url = getBaseURL() + "/course/" + courseId + "?fieldsAll=1";
364    let headers = getAdminHeaders();
365    callAPI(url, function (err, response) {
366        if (err) {
367            if (onError) {
368                onError();
369            }
370            if (response) {
371                console.error("error res", JSON.stringify(response));
372                alert(err);
373            } else {
374                alert(err);
375            }
376        } else {
377            //console.log("success res", JSON.stringify(response));
378            //localStorage["logRes"] = JSON.stringify(response);
379            onSuccess(response);
380        }
381    }, "GET", null, headers)
382}
383
384function getCenterById(centerId, onSuccess, onError) {
385    let url = getBaseURL() + "/center/" + centerId + "?fieldsAll=1";
386    let headers = getAdminHeaders();
387    callAPI(url, function (err, response) {
388        if (err) {
389            if (onError) {
390                onError();
391            }
392            if (response) {
393                console.error("error res", JSON.stringify(response));
394                alert(err);
395            } else {
396                alert(err);
397            }
398        } else {
399            //console.log("success res", JSON.stringify(response));
400            //localStorage["logRes"] = JSON.stringify(response);
401            onSuccess(response);
402        }
403    }, "GET", null, headers)
404}
405
406function getStudentById(studentId, onSuccess, onError) {
407    let url = getBaseURL() + "/student/" + studentId + "?fieldsAll=1";
408    let headers = getAdminHeaders();
409    callAPI(url, function (err, response) {
410        if (err) {
411            if (onError) {
412                onError();
413            }
414            if (response) {
415                console.error("error res", JSON.stringify(response));
416                alert(err);
417            } else {
418                alert(err);
419            }
420        } else {
421            //console.log("success res", JSON.stringify(response));
422            //localStorage["logRes"] = JSON.stringify(response);
423            onSuccess(response);
424        }
425    }, "GET", null, headers)
426}
427
428function deleteCourseById(courseId, onSuccess, onError) {
429    let url = getBaseURL() + "/course/" + courseId;
430    let headers = getAdminHeaders();
431    callAPI(url, function (err, response) {
432        if (err) {
433            if (onError) {
434                onError();
435            }
436            if (response) {
437                console.error("error res", JSON.stringify(response));
438                alert(err);
439            } else {
440                alert(err);
441            }
442        } else {
443            //console.log("success res", JSON.stringify(response));
444            //localStorage["logRes"] = JSON.stringify(response);
445            onSuccess(response);
446        }
447    }, "DELETE", null, headers)
448}
449
450function deleteCenterById(centerId, onSuccess, onError) {
451    let url = getBaseURL() + "/center/" + centerId;
452    let headers = getAdminHeaders();
453    callAPI(url, function (err, response) {
454        if (err) {
455            if (onError) {
456                onError();
457            }
458            if (response) {
459                console.error("error res", JSON.stringify(response));
460                alert(err);
461            } else {
462                alert(err);
463            }
464        } else {
465            //console.log("success res", JSON.stringify(response));
466            //localStorage["logRes"] = JSON.stringify(response);
467            onSuccess(response);
468        }
469    }, "DELETE", null, headers)
470}
471
472function deleteStudentById(studentId, onSuccess, onError) {
473    let url = getBaseURL() + "/student/" + studentId;
474    let headers = getAdminHeaders();
475    callAPI(url, function (err, response) {
476        if (err) {
477            if (onError) {
478                onError();
479            }
480            if (response) {
481                console.error("error res", JSON.stringify(response));
482                alert(err);
483            } else {
484                alert(err);
485            }
486        } else {
487            //console.log("success res", JSON.stringify(response));
488            //localStorage["logRes"] = JSON.stringify(response);
489            onSuccess(response);
490        }
491    }
491, "DELETE", null, headers)
492}
493
494function hideBtn(btnId) {
495    let button = document.getElementById(btnId);
496    button.style.display = "none";
497}
498
499function disableBtn(btnId, btnText) {
500    let button = document.getElementById(btnId);
501    button.disabled = true;
502    if (btnText) {
503        button.innerHTML = btnText;
504    }
505}
506
507function enableBtn(btnId, btnText) {
508    let button = document.getElementById(btnId);
509    button.disabled = false;
510    if (btnText) {
511        button.innerHTML = btnText;
512    }
513}
514
515function serialize(nodeType, dataObj) {
516    if (!nodeType || typeof nodeType !== "string") {
517        nodeType = 'input';
518    }
519    var elements = document.querySelectorAll('#paperSubmitForm ' + nodeType);
520    var data = {};
521    if (dataObj && isObject(dataObj)) {
522        data = dataObj;
523    }
524    for (var i = 0; i < elements.length; i++) {
525        var el = elements[i];
526        console.log("element", el.nodeName);
527        var val = el.value;
528        if (!val) val = "";
529        var fullName = el.getAttribute("name");
530        if (!fullName) continue;
531        var fullNameParts = fullName.split('.');
532        var prefix = '';
533        var stack = data;
534        for (var k = 0; k < fullNameParts.length - 1; k++) {
535            prefix = fullNameParts[k];
536            if (!stack[prefix]) {
537                stack[prefix] = {};
538            }
539            stack = stack[prefix];
540        }
541        prefix = fullNameParts[fullNameParts.length - 1];
542        if (stack[prefix]) {
543
544            var newVal = stack[prefix] + ',' + val;
545            stack[prefix] += newVal;
546        } else {
547            stack[prefix] = val;
548        }
549    }
550    // console.log(data);
551    return data;
552}
553
554function updateCourse(reqBody, onSuccess, onError) {
555    let url = getBaseURL() + "/course";
556    //let headers = getAdminHeaders("FormData");
557    let headers = getAdminHeaders();
558    callAPI(url, function (err, response) {
559        if (err) {
560            if (onError) {
561                onError();
562            }
563            if (response) {
564                console.error("error res", JSON.stringify(response));
565                alert(err);
566            } else {
567                alert(err);
568            }
569        } else {
570            //console.log("success res", JSON.stringify(response));
571            //localStorage["logRes"] = JSON.stringify(response);
572            onSuccess(response);
573        }
574    }, "PATCH", reqBody, headers)//, "FormData"
575}
576
577function updateCenter(reqBody, onSuccess, onError) {
578    let url = getBaseURL() + "/center";
579    //let headers = getAdminHeaders("FormData");
580    let headers = getAdminHeaders();
581    callAPI(url, function (err, response) {
582        if (err) {
583            if (onError) {
584                onError();
585            }
586            if (response) {
587                console.error("error res", JSON.stringify(response));
588                alert(err);
589            } else {
590                alert(err);
591            }
592        } else {
593            //console.log("success res", JSON.stringify(response));
594            //localStorage["logRes"] = JSON.stringify(response);
595            onSuccess(response);
596        }
597    }, "PATCH", reqBody, headers)//, "FormData"
598}
599
600function updateStudent(reqBody, onSuccess, onError) {
601    let url = getBaseURL() + "/student";
602    let headers = getAdminHeaders("FormData");
603    // let headers = getAdminHeaders();
604    callAPI(url, function (err, response) {
605        if (err) {
606            if (onError) {
607                onError();
608            }
609            if (response) {
610                console.error("error res", JSON.stringify(response));
611                alert(err);
612            } else {
613                alert(err);
614            }
615        } else {
616            //console.log("success res", JSON.stringify(response));
617            //localStorage["logRes"] = JSON.stringify(response);
618            onSuccess(response);
619        }
620    }, "PATCH", reqBody, headers, "FormData")
621}
621
622
623function updateCourseStatus(courseId, reqBody, onSuccess, onError) {
624    let url = getBaseURL() + "/course/status/" + courseId;
625    //let headers = getAdminHeaders("FormData");
626    let headers = getAdminHeaders();
627    callAPI(url, function (err, response) {
628        if (err) {
629            if (onError) {
630                onError();
631            }
632            if (response) {
633                console.error("error res", JSON.stringify(response));
634                alert(err);
635            } else {
636                alert(err);
637            }
638        } else {
639            //console.log("success res", JSON.stringify(response));
640            //localStorage["logRes"] = JSON.stringify(response);
641            onSuccess(response);
642        }
643    }, "PATCH", reqBody, headers)//, "FormData"
644}
645
646function updateCenterStatus(centerId, reqBody, onSuccess, onError) {
647    let url = getBaseURL() + "/center/status/" + centerId;
648    //let headers = getAdminHeaders("FormData");
649    let headers = getAdminHeaders();
650    callAPI(url, function (err, response) {
651        if (err) {
652            if (onError) {
653                onError();
654            }
655            if (response) {
656                console.error("error res", JSON.stringify(response));
657                alert(err);
658            } else {
659                alert(err);
660            }
661        } else {
662            //console.log("success res", JSON.stringify(response));
663            //localStorage["logRes"] = JSON.stringify(response);
664            onSuccess(response);
665        }
666    }, "PATCH", reqBody, headers)//, "FormData"
667}
668
669function updateStudentStatus(studentId, reqBody, onSuccess, onError) {
670    let url = getBaseURL() + "/student/status/" + studentId;
671    //let headers = getAdminHeaders("FormData");
672    let headers = getAdminHeaders();
673    callAPI(url, function (err, response) {
674        if (err) {
675            if (onError) {
676                onError();
677            }
678            if (response) {
679                console.error("error res", JSON.stringify(response));
680                alert(err);
681            } else {
682                alert(err);
683            }
684        } else {
685            //console.log("success res", JSON.stringify(response));
686            //localStorage["logRes"] = JSON.stringify(response);
687            onSuccess(response);
688        }
689    }, "PATCH", reqBody, headers)//, "FormData"
690}
691
692function asi(onSuccess, onError) {
693    let url = getBaseURL() + "/admin/signin";
694    let headers = getAdminHeaders(false, true);
695    callAPI(url, function (err, response) {
696        if (err) {
697            if (onError) {
698                onError();
699            }
700            if (response) {
701                console.error("error res", JSON.stringify(response));
702                alert(err);
703            } else {
704                alert(err);
705            }
706        } else {
707            // console.log("success res", JSON.stringify(response));
708            localStorage["aun"] = response.data.loginId;
709            localStorage["alt"] = response.data.loginSession;
710            localStorage["altime"] = new Date().getTime();
711            // console.log("aun", localStorage["aun"]);
712            // console.log("alt", localStorage["alt"]);
713            // console.log("altime", localStorage["altime"]);
714            onSuccess(response);
715        }
716    }, "PATCH", {}, headers)
717}
718
719function getCustomerHeaders(isFormData, isAdmin) {
720    let headers = [{
721        key: 'x-api-key',
722        value: 'DEV_hIo3cNcgvjjgvvjgvjjvhgghvhhjvjbvbvkbsuWxCupsADArl7Abx1gzpUxEL_DEV'
723    },
724    {
725        key: 'x-login-session-id',
726        value: 'hIo3cNd4Z17VTSJyHGDH5FNCQoIuYDdMhRQwoOdsuWxCupsADArl7Abx1gzpUxEL-JournalEasy@123'
727    }];
728    if (!isAdmin) {
729        headers.push({
730            key: 'x-client',
731            value: 'WEB_CHROME_CUSTOMER_DEV_1.0_installerPackageName_true'
732        });
733    }
734    if (!isFormData) {
735        headers.push({
736            key: 'Content-Type',
737            value: 'application/json'
738        });
739    }
740    return headers;
741}
742
743let ap;
744function getAdminHeaders(isFormData, isSignIn) {
745    let headers = getCustomerHeaders(isFormData, true);
746    headers.push({
747        key: 'x-admin-id',
748        value: localStorage.getItem("aun") + ''
749    });
750    headers.push({
751        key: 'x-client',
752        value: 'WEB_CHROME_ADMIN_DEV_1.0_installerPackageName_true'
753    });
754    if (isSignIn) {
755        headers.push({
756            key: 'x-admin-password',
757            value: ap + ''
758        });
759    } else {
760        let altMillis = localStorage.getItem("altime") || 0;
761        let diff = (new Date().getTime() - altMillis);
762        if (diff > 30 * 60 * 1000) {//30 minutes
763            localStorage["aun"] = "";
764            localStorage["alt"] = "";
765        }
766        headers.push({
767            key: 'x-admin-token',
768            value: localStorage.getItem("aun") + localStorage.getItem("alt") + '' + localStorage.getItem("aun")
769        });
770    }
771    return headers;
772}
773
774function getBaseURL() {
775    return "https://us-central1-kennedy-university-of-baptist.cloudfunctions.net/studentverify/api/v1"
776}
777
778function getCourses(onSuccess, onError, hideAlert) {
779    let url = getBaseURL() + "/courses";
780    let headers = getAdminHeaders();
781    callAPI(url, function (err, response) {
782        if (err) {
783            if (onError) {
784                onError();
785            }
786            if (response) {
787                console.error("error res", JSON.stringify(response));
788                if (!hideAlert) {
789                    alert(err);
790                }
791            } else {
792                if (!hideAlert) {
793                    alert(err);
794                }
795            }
796        } else {
797            //console.log("success res", JSON.stringify(response));
798            //localStorage["logRes"] = JSON.stringify(response);
799            onSuccess(response);
800        }
801    }, "GET", false, headers)
802}
803
804function getCenters(onSuccess, onError, hideAlert) {
805    let url = getBaseURL() + "/centers?limit=1000";
806    let headers = getAdminHeaders();
807    callAPI(url, function (err, response) {
808        if (err) {
809            if (onError) {
810                onError();
811            }
812            if (response) {
813                console.error("error res", JSON.stringify(response));
814                if (!hideAlert) {
815                    alert(err);
816                }
817            } else {
818                if (!hideAlert) {
819                    alert(err);
820                }
821            }
822        } else {
823            //console.log("success res", JSON.stringify(response));
824            //localStorage["logRes"] = JSON.stringify(response);
825            onSuccess(response);
826        }
827    }, "GET", false, headers)
828}
829
830function getCenterByCode(centerCode, onSuccess, onError, hideAlert) {
831    let url = getBaseURL() + "/centers?code=" + centerCode;
832    let headers = getCustomerHeaders();
833    callAPI(url, function (err, response) {
834        if (err) {
835            if (onError) {
836                onError();
837            }
838            if (response) {
839                console.error("error res", JSON.stringify(response));
840                if (!hideAlert) {
841                    alert(err);
842                }
843            } else {
844                if (!hideAlert) {
845                    alert(err);
846                }
847            }
848        } else {
849            //console.log("success res", JSON.stringify(response));
850            //localStorage["logRes"] = JSON.stringify(response);
851            onSuccess(response);
852        }
853    }, "GET", false, headers)
854}
855
856function getStudents(onSuccess, onError, hideAlert) {
857    let url = getBaseURL() + "/students?limit=1000";
858    let headers = getAdminHeaders();
859    callAPI(url, function (err, response) {
860        if (err) {
861            if (onError) {
862                onError();
863            }
864            if (response) {
865                console.error("error res", JSON.stringify(response));
866                if (!hideAlert) {
867                    alert(err);
868                }
869            } else {
870                if (!hideAlert) {
871                    alert(err);
872                }
873            }
874        } else {
875            //console.log("success res", JSON.stringify(response));
876            //localStorage["logRes"] = JSON.stringify(response);
877            onSuccess(response);
878        }
879    }, "GET", false, headers)
880}
881
882function getStudentByEnrollmentNumberAndCenterCode(enrollmentNumber, 
882centerCode, onSuccess, onError, hideAlert) {
883    let url = getBaseURL() + "/students?enrollmentNumber=" + enrollmentNumber + "&centerCode=" + centerCode + "&fieldsAll=1";
884    let headers = getCustomerHeaders();
885    callAPI(url, function (err, response) {
886        if (err) {
887            if (onError) {
888                onError();
889            }
890            if (response) {
891                console.error("error res", JSON.stringify(response));
892                if (!hideAlert) {
893                    alert(err);
894                }
895            } else {
896                if (!hideAlert) {
897                    alert(err);
898                }
899            }
900        } else {
901            //console.log("success res", JSON.stringify(response));
902            //localStorage["logRes"] = JSON.stringify(response);
903            onSuccess(response);
904        }
905    }, "GET", false, headers)
906}
907
908function callAPI(url, callback, requestMethod, requestBody, headers, isFormData) {
909    var xhr = new XMLHttpRequest();
910    xhr.open(requestMethod, url);
911    // console.log("xhr.status");
912    // console.log("headers", headers);
913    if (headers && headers.length > 0) {
914        for (let index = 0; index < headers.length; index++) {
915            const header = headers[index];
916            xhr.setRequestHeader(header.key, header.value);
917        }
918    } else {
919        xhr.setRequestHeader("Content-Type", "application/json");
920    }
921    xhr.onreadystatechange = function () {
922        let err = false;
923        if (xhr.readyState === 4) {
924            // console.log(xhr.status);
925            // console.log(xhr.responseText);
926            if (xhr.status >= 200 && xhr.status <= 299) {
927                /*try {
928                    console.log(xhr.status, JSON.stringify(xhr.response), JSON.stringify(xhr.responseText));
929                } catch (e) {
930                    console.log("e console", JSON.stringify(e));
931                }*/
932                var response = JSON.parse(xhr.responseText);
933                if ((response.code + '').startsWith('2')) {
934                    //Success
935                    callback(err, response);
936                } else {
937                    err = "Server error";
938                    //logic/validation failure
939                    if (response) {
940                        if (response.message) {
941                            err = response.message;
942                        }
943                        callback(err, response);
944                    } else {
945                        callback(err);
946                    }
947                }
948            } else {
949                var response = JSON.parse(xhr.responseText);
950                //Network/Server failure
951                err = "Network error";
952                if (response) {
953                    if (response.message) {
954                        err = response.message;
955                    }
956                    if (!(url + '').endsWith("/signin") && (response.code + '').startsWith("48")) {
957                        //Admin authentication error code
958                        alert("Invalid session, Please sign in.")
959                        window.location.href = "/dev/admin-login.html";
960                        return;
961                    }
962                    callback(err, response);
963                } else {
964                    callback(err);
965                }
966            }
967        }
968    };
969    if (requestBody) {
970        xhr.send(isFormData ? requestBody : JSON.stringify(requestBody));
971        // xhr.send(requestBody);
972    } else {
973        xhr.send();
974    }
975}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.