74 lines
2.1 KiB
JavaScript
Executable File
74 lines
2.1 KiB
JavaScript
Executable File
'use strict';
|
|
/*** controller***/
|
|
app.controller('report_waiver_referalCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',
|
|
function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) {
|
|
|
|
// DataTables configurable options
|
|
|
|
|
|
$scope.filters = {
|
|
"branch": "",
|
|
"university": "",
|
|
"batch": "",
|
|
|
|
|
|
};
|
|
|
|
$scope.filters = function () {
|
|
var filterlist = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'report_filters/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
|
|
};
|
|
$http(filterlist).then(function (response) {
|
|
if (response.data) {
|
|
$scope.batch = response.data.batch;
|
|
$scope.branch = response.data.branch;
|
|
$scope.university = response.data.university;
|
|
//console.log($scope.branch);
|
|
} else {
|
|
}
|
|
});
|
|
}
|
|
|
|
$scope.onSubmit = function () {
|
|
//alert($scope.batch.name);
|
|
$scope.waiver_referal_data = '';
|
|
$scope.message = '';
|
|
console.log($scope.waiver_referal_data);
|
|
var response_data = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'report_wav_ref/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
branch: $scope.filters.branch,
|
|
university: $scope.filters.university,
|
|
batch: $scope.filters.batch
|
|
|
|
}
|
|
|
|
};
|
|
|
|
$http(response_data).then(function (response) {
|
|
if (response.data.wav_refList == true) {
|
|
$scope.waiver_referal_data = response.data.wav_ref_data;
|
|
|
|
} else {
|
|
$scope.message = response.data.message;
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|