PageSourceSearch

https://tempwork247.com/AppModules/module/job-board/job-board.ctrl.js

js tempwork247.com collected 2026-10-01 15:00:32 UTC 4,023 bytes, 99 lines download raw bytes

1app.controller('JobBoardCtrl', ["$scope", "JobBoardSrv", function ($scope, JobBoardSrv) {
2
3    var _this = this;
4
5    _this.IsRequesting = true;
6    _this.IsRequested = false;
7
8    _this.Filter = {
9        SearchText: "",
10        Location: "",
11    };
12    _this.JobBoards = [];
13    _this.Shifts = [];
14    _this.JobTypes = [];
15
16
17    _this.Inititlize = function () {
18
19        _this.GetJobBoards({ SearchText: _this.SearchText, Location: _this.Location, Shifts: [], JobTypes: [] });
20
21        //_this.JobBoards = [
22        //    { Title: "Food Manufacturing", Img: "/Assets/images/job_board/TempWork_Staffing_Solution_Food_Manufacturing.png", QP: "job-board-food-manufacturing" },
23        //    { Title: "Distribution and Logistics", Img: "/Assets/images/job_board/TempWork_Staffing_Solution_Distribution_and_Logistics.png", QP: "job-board-distribution-logistics" },
24        //    { Title: "Administrative and Clerical", Img: "/Assets/images/job_board/TempWork_Staffing_Solution_Administrative_and_Clerical.png", QP: "administrative" },
25        //    { Title: "Refurbishing and Repair", Img: "/Assets/images/job_board/TempWork_Staffing_Solution_Refurbishing_and_Repair.png", QP: "job-board-phone-refurbishing" },
26        //    { Title: "Hospitality and Events", Img: "/Assets/images/job_board/TempWork_Staffing_Solution_Hospitality_and_Events.png", QP: "job-board-hospitality" },
27        //    { Title: "Others", Img: "/Assets/images/job_board/TempWork_Staffing_Solution_Others.png", QP: "job-board-warehouse" }
28        //];
29
30        _this.Shifts = [
31            { Title: "1st Shift - Morning", Value: "Shift1", IsSelected: false },
32            { Title: "2nd Shift - Afternoon", Value: "Shift2", IsSelected: false },
33            { Title: "3rd Shift - Overnight", Value: "Shift3", IsSelected: false },
34            { Title: "Day Shift", Value: "DayShift", IsSelected: false },
35            { Title: "Night Shift", Value: "NightShift", IsSelected: false }
36        ];
37
38        _this.JobTypes = [
39            { Title: "Full-Time", Value: "Full-Time", IsSelected: false },
40            { Title: "Part-Time", Value: "Part-Time", IsSelected: false },
41            { Title: "Contractual", Value: "Contractual", IsSelected: false }
42        ];
43    }
44
45    _this.ApplySearch = function ($event, callBy) {
46
47        var CallAPI = false;
48
49        if (callBy == "BTNCLICK" || (callBy == "ONHITENTER" && $event.which == 13)) {
50            CallAPI = true;
51        }
52        if (callBy == "SHIFTCLICK" || callBy == "JOBTYPECLICK") {
53            CallAPI = true;
54        }
55
56        if (CallAPI) {
57
58            setTimeout(function () {
59                var _sft = [];
60                var _jbt = [];
61                angular.forEach(_this.Shifts, function (sh) {
62                    if (sh.IsSelected) { _sft.push({ Key: sh.Title, Value: sh.Value }); }
63                });
64                angular.forEach(_this.JobTypes, function (jt) {
65                    if (jt.IsSelected) { _jbt.push({ Key: jt.Title, Value: jt.Value }); }
66                });
67
68                var _fltrs = angular.copy(_this.Filter);
69                _fltrs.Shifts = _sft;
70                _fltrs.JobTypes = _jbt;
71
72                _this.GetJobBoards(_fltrs);
73            }, 0);
74        }
75    };
76
77    _this.GetJobBoards = function (fltrs) {
78
79        JobBoardSrv.getJobBoards(fltrs,
80            function (resp) {
81                var _res = resp.data;
82                if (_res) {
83                    _this.JobBoards = _res.JobBoards;
84                }
85                else {
86                    _this.JobBoards = [];
87                    //window.location.href = '/job-board';
88                }
89
90                _this.IsRequesting = false;
91                _this.IsRequested = true;
92            },
93            function (resp) {
94                _this.IsRequesting = false;
95                _this.IsRequested = true;
96                //window.location.href = '/job-board';
97            });
98    }
99}]);

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.