course details changes done

This commit is contained in:
gandhimathi 2017-12-05 16:55:12 +05:30
parent d1003bf5f7
commit 2a010fa0fd

View File

@ -46,12 +46,12 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
};
$scope.myModelCourseAdd = {
'university': '',
'course': '',
'batch': '',
'dateofjoining': '',
'enrollmentid': ''
};
'university': '',
'course': '',
'batch': '',
'dateofjoining': '',
'enrollmentid': ''
};
$scope.addStudentView = function () {
// $scope.myModelCourseAdd = {
@ -80,16 +80,20 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
// load when html page load
$scope.init = function () {
var nowInMS = new Date().getTime(),
sixteenYearsInMS = 1000 * 60 * 60 * 24 * 365 * 16,
sixteenYearsBeforeNow = new Date(nowInMS - sixteenYearsInMS);
if (localDetail != null) {
$scope.currentDate = new Date();
$scope.currentDate = new Date(sixteenYearsBeforeNow);
$scope.getStudentList();
$scope.getUniversityList();
// $scope.currentPage = 1;
} else {
}
}
$scope.getStudentList = function () {
$scope.loader = true;
var empListreq = {
@ -262,7 +266,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
// update sutdent course details
$scope.updateStudentCourseDetails = function (form, datas, hidedoj) {
$scope.updateStudentCourseDetails = function (form, datas) {
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
@ -280,9 +284,9 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
} else {
// alert(datas.DOJ);
var formate = "dd-MM-yyyy";
// var checkDOJ = $filter('date')(new Date(datas.DOJ), formate);
var checkDOJ = $filter('date')(new Date(datas.DOJ), formate);
datas.IsActive = datas.IsActive === true ? 1 : 0;
datas.DOJ = datas.DOJ == hidedoj ? datas.DOJ : $filter('date')(new Date(datas.DOJ), formate);
datas.DOJ = checkDOJ == "NaN-NaN-0NaN" ? datas.DOJ : $filter('date')(new Date(datas.DOJ), formate);
// alert(datas.DOJ);
var req = {
method: 'POST',
@ -576,7 +580,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}
// update student details
$scope.updateStuDetails = function (form, p ,hidedob) {
$scope.updateStuDetails = function (form, p) {
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
@ -595,9 +599,9 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
} else {
// alert(p.DOB);
var formate = "dd-MM-yyyy";
// var checkDOB = $filter('date')(new Date(p.DOB), formate);
var checkDOB = $filter('date')(new Date(p.DOB), formate);
p.IsActive = p.IsActive === true ? 1 : 0;
p.DOB = p.DOB == hidedob ? p.DOB : $filter('date')(new Date(p.DOB), formate);
p.DOB = checkDOB == "NaN-NaN-0NaN" ? p.DOB : $filter('date')(new Date(p.DOB), formate);
var req = {
method: 'POST',
url: apiPoint.url + 'updateStudentExistDetail/',
@ -624,4 +628,4 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
}]);
}]);