251 lines
8.4 KiB
JavaScript
Executable File
251 lines
8.4 KiB
JavaScript
Executable File
'use strict';
|
|
/*** controller***/
|
|
app.controller('report_balfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',
|
|
function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) {
|
|
|
|
// to generate serial number
|
|
$scope.currentPage=1;
|
|
$scope.itemsPerPage=10;
|
|
|
|
// $scope.serial = 1;
|
|
// $scope.itemPerPage=10
|
|
// $scope.indexCount = function(newPageNumber){
|
|
|
|
// $scope.serial = newPageNumber * $scope.itemPerPage - ($scope.itemPerPage-1);
|
|
// }
|
|
//to filter labels
|
|
$scope.filters = {
|
|
"branch": "",
|
|
"university": "",
|
|
"batch": "",
|
|
|
|
|
|
};
|
|
|
|
$scope.filters = function () {
|
|
var filterlist = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'report_filters/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
branch : JSON.parse(localStorage.getItem('localObj')).localBranchID
|
|
|
|
}
|
|
|
|
};
|
|
$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 {
|
|
}
|
|
});
|
|
}
|
|
// response data
|
|
$scope.onSubmit = function () {
|
|
|
|
$scope.balfee_data = '';
|
|
$scope.message = '';
|
|
var response_data = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'report_balfee/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
branch: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
|
university: $scope.filters.university,
|
|
batch: $scope.filters.batch
|
|
|
|
}
|
|
|
|
};
|
|
|
|
$http(response_data).then(function (response) {
|
|
if (response.data.balfeeList == true) {
|
|
$scope.balfee_data = response.data.balfee_data;
|
|
for(var i=0;i<$scope.balfee_data.length;i++)
|
|
$scope.balfee_data[i].SL_NO = i+1;
|
|
|
|
} else {
|
|
$scope.message = response.data.message;
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
//Export to excel
|
|
var mystyle = {
|
|
sheetid: 'BALANCE FEE STATUS REPORT',
|
|
headers: true,
|
|
caption: {
|
|
title:'BALANCE FEE STATUS REPORT',
|
|
width: '300px',
|
|
style:'font-size:50px;'
|
|
},
|
|
// style:'background:#00FF00',
|
|
column: {
|
|
style:'font-size:10px'
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.exportData = function () {
|
|
alasql('SELECT CAST(SL_NO AS NUMBER) as SLNO,eid as EnrollmentID,Student_name as StudentName,Father_name as FatherName,CAST(Phone_number AS NUMBER) as PhoneNumber,Course_name as CourseName,University as University,Sem_year as SemYear,CAST(Total AS NUMBER) as Total,CAST(Paid_fee AS NUMBER) as PaidFee,CAST(balance AS NUMBER) as Balance,billno1 as BillNO1,CAST(billamt1 AS NUMBER) as BillAmount1,billno2 as BillNO2,CAST(billamt2 AS NUMBER) as BillAmount2, billno3 as BillNO3, CAST(billamt3 AS NUMBER) as BillAmount3, billno4 as BillNO4, CAST(billamt4 AS NUMBER) as BillAmount4, billno5 as BillNO5,CAST(billamt5 AS NUMBER) as BillAmount5,billno6 as BillNO6,CAST(billamt6 AS NUMBER) as BillAmount6,billno7 as BillNo7,CAST(billamt7 AS NUMBER)as BillAmount7,billno8 as BillNO8,CAST(billamt8 AS NUMBER) as BillAmount8,billno9 as BillNO9,CAST(billamt9 AS NUMBER) as BillAmount9,billno10 as BillNO10,CAST(billamt10 AS NUMBER) as BillAmount10 INTO XLS("Balancefee_status.xls",?) FROM ?',[mystyle,$scope.balfee_data]);
|
|
};
|
|
|
|
|
|
|
|
/*modal controller
|
|
* */
|
|
app.controller('studentModalDemoCtrl', ["$scope","$rootScope", "$modal", "$log", "API_POINTS", "$http", function ($scope,$rootScope, $modal, $log, apiPoint, $http) {
|
|
//Tooltip for print button
|
|
$scope.dynamicTooltip = 'Student View';
|
|
|
|
|
|
|
|
// $scope.items = ['item1', 'item2', 'item3'];
|
|
|
|
$scope.open = function (studentDetails) {
|
|
|
|
|
|
// get student view details
|
|
var getcourse = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getStudentBasicInfo/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
requestedBy: studentDetails.Phone_number,
|
|
requestedFrom: 3,
|
|
branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID
|
|
}
|
|
};
|
|
$http(getcourse).then(function (response) {
|
|
|
|
if (response.data.status == 200 && response.data.studentStatus == true) {
|
|
$scope.courseEditLoading = false;
|
|
// $scope.studentDetails = response.data.studentDetails;
|
|
$scope.studentDetails = response.data;
|
|
// $scope.courseDetails = response.data.courseDetails;
|
|
var modalInstance = $modal.open({
|
|
templateUrl: 'assets/views/student/studentDetailsModal.html',
|
|
controller: 'ModalInstanceCtrl',
|
|
// size: size,
|
|
resolve: {
|
|
items: function () {
|
|
return $scope.studentDetails;
|
|
}
|
|
}
|
|
});
|
|
|
|
modalInstance.result.then(function (selectedItem) {
|
|
$scope.selected = selectedItem;
|
|
}, function () {
|
|
$log.info('Modal dismissed at: ' + new Date());
|
|
});
|
|
|
|
} else {
|
|
swal("Failed!", "This student is not registerd", "warning");
|
|
$scope.courseEditLoading = false;
|
|
$scope.studentDetails = "";
|
|
$scope.courseDetails = "";
|
|
|
|
}
|
|
});
|
|
|
|
|
|
};
|
|
$scope.open1 = function (values,type) {
|
|
|
|
var modalInstance1 = $modal.open({
|
|
templateUrl: 'assets/views/student/studentPaymentModal.html',
|
|
controller: 'ModalInstanceCtrl1',
|
|
// size: size,
|
|
resolve: {
|
|
items1: function () {
|
|
var myvalues =
|
|
{
|
|
"values":values,
|
|
"type":type
|
|
};
|
|
return myvalues;
|
|
}
|
|
}
|
|
});
|
|
|
|
modalInstance1.result.then(function (selectedItem) {
|
|
$scope.selected = selectedItem;
|
|
}, function () {
|
|
$log.info('Modal dismissed at: ' + new Date());
|
|
});
|
|
};
|
|
|
|
$scope.printStudentDetails = function (details) {
|
|
$rootScope.pdfItems = details;
|
|
|
|
var printInstance = $modal.open({
|
|
templateUrl: 'assets/views/student/studentPdf.html',
|
|
controller: 'studentModalDemoCtrl',
|
|
});
|
|
};
|
|
|
|
// generate pdf for student view
|
|
$scope.export = function(getName) {
|
|
kendo.drawing.drawDOM($("#exportthis")).then(function(group) {
|
|
kendo.drawing.pdf.saveAs(group, getName+".pdf");
|
|
});
|
|
}
|
|
|
|
|
|
}]);
|
|
|
|
// Please note that $modalInstance represents a modal window (instance) dependency.
|
|
// It is not the same as the $modal service used above.
|
|
|
|
app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items", "WordsService", function ($scope, $modalInstance, items, WordsService) {
|
|
|
|
$scope.items = items;
|
|
$scope.selected = {
|
|
item: $scope.items[0]
|
|
};
|
|
|
|
$scope.ok = function () {
|
|
$modalInstance.close($scope.selected.item);
|
|
};
|
|
|
|
$scope.cancel = function () {
|
|
$modalInstance.dismiss('cancel');
|
|
};
|
|
|
|
|
|
}]);
|
|
app.controller('ModalInstanceCtrl1', ["$scope", "$modalInstance", "items1", "WordsService", function ($scope, $modalInstance, items1, WordsService) {
|
|
|
|
$scope.items1 = items1.values;
|
|
$scope.selectedtype = items1.type;
|
|
|
|
$scope.ok = function () {
|
|
$modalInstance.close($scope.selected.item);
|
|
};
|
|
|
|
$scope.cancel = function () {
|
|
$modalInstance.dismiss('cancel');
|
|
};
|
|
|
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|