105 lines
3.0 KiB
JavaScript
Executable File
105 lines
3.0 KiB
JavaScript
Executable File
'use strict';
|
|
/*** controller***/
|
|
app.controller('report_examfeeCtrl', ["$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.examfee_data = '';
|
|
$scope.message = '';
|
|
var response_data = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'report_examfee/',
|
|
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.examfeeList == true) {
|
|
$scope.examfee_data = response.data.examfee_data;
|
|
|
|
} else {
|
|
$scope.message = response.data.message;
|
|
}
|
|
|
|
});
|
|
$scope.getstf = function(){
|
|
var totalf = 0;
|
|
for(var i = 0; i < $scope.examfee_data.length; i++){
|
|
var item = $scope.examfee_data[i];
|
|
totalf += parseFloat(item.Amount);
|
|
}
|
|
return totalf; }
|
|
|
|
}
|
|
var mystyle = {
|
|
sheetid: 'EXAM WRITING FEE REPORT',
|
|
headers: true,
|
|
caption: {
|
|
title:'EXAM WRITING FEE REPORT',
|
|
|
|
|
|
},
|
|
// style:'background:#00FF00',
|
|
column: {
|
|
style:'font-size:12px'
|
|
},
|
|
|
|
// column: {style:{Font:{Bold:"1"}}},
|
|
// rows: {1:{style:{Font:{Color:"#FF0077"}}}},
|
|
// cells: {1:{1:{
|
|
// style: {Font:{Color:"#00FFFF"}}
|
|
// }}}
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.exportData = function () {
|
|
alasql('SELECT * INTO XLS("Exam_writing_fee_report.xls",?) FROM ?',[mystyle,$scope.examfee_data]);
|
|
};
|
|
}]);
|
|
|
|
|
|
|
|
|