apollodec/Apollo/assets/js/controllers/report_study_material_statusCtrl.js
venbatechnologies@gmail.com f35dc058e4 table fixed
2018-05-14 11:32:24 +05:30

71 lines
1.9 KiB
JavaScript
Executable File

'use strict';
/*** controller***/
app.controller('report_study_material_statusCtrl', ["$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.study_mat_data = '';
$scope.message = '';
var response_data = {
method: 'POST',
url: apiPoint.url + 'report_status/',
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.statusList == true) {
$scope.study_mat_data = response.data.statusr;
} else {
$scope.message = response.data.message;
}
});
}
}]);