PageSourceSearch

https://samarthinstitute.edu.in/web-assets/angular/angularjs/controllers/cms-header.js?version=1772287900

js samarthinstitute.edu.in collected 2026-10-09 23:59:57 UTC 5,076 bytes, 107 lines download raw bytes

1var csrflistHash = $('#csrflistHash').val();
2
3
4app.controller('headerServicesCtrl', function ($scope, $http, toastr) {
5    $scope.headerServicesCtrlInit = function () {
6
7        $scope.fullName = '';
8        $scope.email = '';
9        $scope.contact = '';
10        $scope.course = '';
11        $scope.comment = '';
12        $scope.whatsappGroupLink = '';
13        $scope.isDisplayProgrss = false;
14
15    }
16    $scope.createHtmlErrorDiv = function (message) {
17        return '<div id="name" ><p class"enqury-msg" style="color: red; font-size: small">' + message + '</p></div>'
18    }
19
20    $scope.admissionFormClear = function () {
21        $scope.fullName = '';
22        $scope.email = '';
23        $scope.contact = '';
24        $scope.course = '';
25        $scope.comment = '';
26        $scope.whatsappGroupLink = '';
27        $scope.isDisplayProgrss = false;
28    }
29
30      $scope.admissionEnquiryFormSubmitButton = function () {
31        // Clear previous error messages
32        $(".error-message").remove();
33
34        if ($scope.fullName) {
35            if ($scope.contact) {
36                // Contact validation: Check if it's a valid phone number (e.g., 10 digits)
37                var contactPattern = /^[0-9]{10}$/; // Regex for 10-digit phone number
38                if (contactPattern.test($scope.contact)) {
39                    if ($scope.email) {
40                        // Optional: Add email format validation
41                        var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
42                        if (emailPattern.test($scope.email)) {
43                            if ($scope.comment) {
44                                $scope.isDisplayProgrss = true;
45                                var transform = function (data) {
46                                    return $.param(data);
47                                };
48                                $http.post(window.site_url + 'Website/sendAdmissionEnquiryForm', {
49                                    fullName: $scope.fullName,
50                                    email: $scope.email,
51                                    contact: $scope.contact,
52                                    course: $scope.course,
53                                    comment: $scope.comment,
54                                }, {
55                                    headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
56                                    transformRequest: transform
57                                }).then(function (response) {
58                                    if (response.data.status.status == "200") {
59                                        toastr.success(response.data.status.message);
60                                        $scope.headerServicesCtrlInit();
61                                        $('#admission').modal('hide');
62                                    } else {
63                                        toastr.error(response.data.status.message);
64                                    }
65                                    $scope.isDisplayProgrss = false;
66                                });
67                            } else {
68                                document.getElementById("comment").focus();
69                                var getnameParent = $("#comment").parent();
70                                getnameParent.append($scope.createHtmlErrorDiv("Please enter comment"));
71                            }
72                        } else {
73                            document.getElementById("email").focus();
74                            var getnameParent = $("#email").parent();
75                            getnameParent.append($scope.createHtmlErrorDiv("Please enter a valid email address"));
76                        }
77                    } else {
78                        document.getElementById("email").focus();
79                        var getnameParent = $("#email").parent();
80                        getnameParent.append($scope.createHtmlErrorDiv("Please enter email address"));
81                    }
82                } else {
83                    document.getElementById("contact").focus();
84                    var getnameParent = $("#contact").parent();
85                    getnameParent.append($scope.createHtmlErrorDiv("Please enter a valid 10-digit contact number"));
86                }
87            } else {
88                document.getElementById("contact").focus();
89                var getnameParent = $("#contact").parent();
90                getnameParent.append($scope.createHtmlErrorDiv("Please enter contact"));
91            }
92        } else {
93            document.getElementById("fullName").focus();
94            var getnameParent = $("#fullName").parent();
95            getnameParent.append($scope.createHtmlErrorDiv("Please enter name"));
96        }
97    };
98});
99function onHtmlElementChnage(event) {
100    var getThis = event
101    if ($(getThis).parent().find("#name").length == 1) {
102        $(getThis).parent().find("#name").remove();
103    }
104    if ($(getThis).parent().parent().find("#name").length == 1) {
105        $(getThis).parent().parent().find("#name").remove();
106    }
107}

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.