student update screen changes: kdk
This commit is contained in:
parent
cae1beaa2c
commit
43e679ef79
@ -553,6 +553,7 @@ $scope.studentListLength = 0;
|
||||
// add student
|
||||
$scope.studentFORM = {
|
||||
submit: function (form, myModel, myModelCourseAdd) {
|
||||
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
var field = null, firstError = null;
|
||||
@ -596,6 +597,7 @@ $scope.studentListLength = 0;
|
||||
} else {
|
||||
// $scope.ldloading1[loading.replace('-', '_')] = false;
|
||||
swal("Failed!", data.message, "error");
|
||||
// $scope.disableButton = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -618,7 +620,7 @@ $scope.studentListLength = 0;
|
||||
$scope.disableButton = false;
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
} else {
|
||||
$scope.disableButton = false;
|
||||
// $scope.disableButton = false;
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
@ -628,31 +630,35 @@ $scope.studentListLength = 0;
|
||||
reset: function (form) {
|
||||
// $scope.myModel = angular.copy($scope.master);
|
||||
form.$setPristine(true);
|
||||
$scope.myModel = {
|
||||
'employeeId': '',
|
||||
'firstname': '',
|
||||
'lastname': '',
|
||||
'fathername': '',
|
||||
'mothername': '',
|
||||
'emailId': '',
|
||||
'primaryPhone': '',
|
||||
'secondaryPhone': '',
|
||||
'dateofbirth': '',
|
||||
'gender': '',
|
||||
'qualificaion': '',
|
||||
'aadharNumber': '',
|
||||
'otherId': '',
|
||||
'otherIdDetails': '',
|
||||
'address1': '',
|
||||
'address2': '',
|
||||
'homeBranch': '',
|
||||
'dateofjoining': '',
|
||||
'dateofjoining': '',
|
||||
'role': '',
|
||||
'switchsetting': true,
|
||||
'DeactiveComments': '',
|
||||
'Comments': ''
|
||||
};
|
||||
$scope.myModel = {
|
||||
'primaryPhone': '',
|
||||
'firstname': '',
|
||||
'lastname': '',
|
||||
'fathername': '',
|
||||
'mothername': '',
|
||||
'emailId': '',
|
||||
'secondaryPhone': '',
|
||||
'dateofbirth': '',
|
||||
'gender': '',
|
||||
'aadharNumber': '',
|
||||
'otherId': '',
|
||||
'otherIdDetails': '',
|
||||
'address1': '',
|
||||
'address2': '',
|
||||
'caste': '',
|
||||
'category': '',
|
||||
'religion': '',
|
||||
'nationality': '',
|
||||
'prequalification': '',
|
||||
'occupation': '',
|
||||
'designation': '',
|
||||
'companyname': '',
|
||||
'referredby': '',
|
||||
'referredmobilenumber': '',
|
||||
'switchsetting': true,
|
||||
'DeactiveComments': '',
|
||||
'Comments': ''
|
||||
};
|
||||
}, resetCourse: function (form) {
|
||||
form.$setPristine(true);
|
||||
$scope.myModelCourse = {
|
||||
@ -1429,31 +1435,35 @@ $scope.myUnivSearch = "";
|
||||
|
||||
$scope.myActivateDiv = function() {
|
||||
$scope.viewStudentDetailsPage = false;
|
||||
$scope.myModel = {
|
||||
'employeeId': '',
|
||||
'firstname': '',
|
||||
'lastname': '',
|
||||
'fathername': '',
|
||||
'mothername': '',
|
||||
'emailId': '',
|
||||
'primaryPhone': '',
|
||||
'secondaryPhone': '',
|
||||
'dateofbirth': '',
|
||||
'gender': '',
|
||||
'qualificaion': '',
|
||||
'aadharNumber': '',
|
||||
'otherId': '',
|
||||
'otherIdDetails': '',
|
||||
'address1': '',
|
||||
'address2': '',
|
||||
'homeBranch': '',
|
||||
'dateofjoining': '',
|
||||
'dateofjoining': '',
|
||||
'role': '',
|
||||
'switchsetting': true,
|
||||
'DeactiveComments': '',
|
||||
'Comments': ''
|
||||
};
|
||||
$scope.myModel = {
|
||||
'primaryPhone': '',
|
||||
'firstname': '',
|
||||
'lastname': '',
|
||||
'fathername': '',
|
||||
'mothername': '',
|
||||
'emailId': '',
|
||||
'secondaryPhone': '',
|
||||
'dateofbirth': '',
|
||||
'gender': '',
|
||||
'aadharNumber': '',
|
||||
'otherId': '',
|
||||
'otherIdDetails': '',
|
||||
'address1': '',
|
||||
'address2': '',
|
||||
'caste': '',
|
||||
'category': '',
|
||||
'religion': '',
|
||||
'nationality': '',
|
||||
'prequalification': '',
|
||||
'occupation': '',
|
||||
'designation': '',
|
||||
'companyname': '',
|
||||
'referredby': '',
|
||||
'referredmobilenumber': '',
|
||||
'switchsetting': true,
|
||||
'DeactiveComments': '',
|
||||
'Comments': ''
|
||||
};
|
||||
$scope.myModelCourseAdd = {
|
||||
'university': '',
|
||||
'course': '',
|
||||
@ -1469,6 +1479,7 @@ $scope.myUnivSearch = "";
|
||||
// add student
|
||||
$scope.studentFORM = {
|
||||
submit: function (form, myModel, myModelCourseAdd) {
|
||||
alert(JSON.stringify(myModelCourseAdd));
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
var field = null, firstError = null;
|
||||
@ -1487,16 +1498,16 @@ $scope.myUnivSearch = "";
|
||||
} else {
|
||||
$scope.disableButton = true;
|
||||
var formate = "dd-MM-yyyy";
|
||||
$scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
|
||||
$scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate);
|
||||
myModel.switchsetting = myModel.switchsetting === true ? 1 : 0;
|
||||
myModelCourseAdd.dateofjoining = $filter('date')(new Date(myModelCourseAdd.dateofjoining), formate);
|
||||
var idStuProof = $scope.files[0];
|
||||
|
||||
if (idStuProof !== undefined) {
|
||||
var formData = new FormData();
|
||||
var idProof = $scope.files[0];
|
||||
// alert(idProof);
|
||||
formData.append("data", JSON.stringify($scope.myModel));
|
||||
formData.append("coursedata", JSON.stringify($scope.myModelCourseAdd));
|
||||
formData.append("data", JSON.stringify(myModel));
|
||||
formData.append("coursedata", JSON.stringify(myModelCourseAdd));
|
||||
formData.append("createdBy", localDetails.localUserID);
|
||||
formData.append("loginBranch", localDetails.localBranchID);
|
||||
formData.append('idStuProof', idStuProof);
|
||||
@ -1527,8 +1538,8 @@ $scope.myUnivSearch = "";
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
data: $scope.myModel,
|
||||
coursedata: $scope.myModelCourseAdd,
|
||||
data: myModel,
|
||||
coursedata: myModelCourseAdd,
|
||||
loginBranch: localDetails.localBranchID,
|
||||
createdBy: localDetails.localUserID,
|
||||
}
|
||||
@ -1545,7 +1556,7 @@ $scope.myUnivSearch = "";
|
||||
|
||||
// $scope.tabActive('tabactive1');
|
||||
} else {
|
||||
$scope.disableButton = false;
|
||||
// $scope.disableButton = false;
|
||||
swal("Failed!", response.data.message, "error");
|
||||
}
|
||||
});
|
||||
@ -1556,30 +1567,34 @@ $scope.myUnivSearch = "";
|
||||
// $scope.myModel = angular.copy($scope.master);
|
||||
form.$setPristine(true);
|
||||
$scope.myModel = {
|
||||
'employeeId': '',
|
||||
'firstname': '',
|
||||
'lastname': '',
|
||||
'fathername': '',
|
||||
'mothername': '',
|
||||
'emailId': '',
|
||||
'primaryPhone': '',
|
||||
'secondaryPhone': '',
|
||||
'dateofbirth': '',
|
||||
'gender': '',
|
||||
'qualificaion': '',
|
||||
'aadharNumber': '',
|
||||
'otherId': '',
|
||||
'otherIdDetails': '',
|
||||
'address1': '',
|
||||
'address2': '',
|
||||
'homeBranch': '',
|
||||
'dateofjoining': '',
|
||||
'dateofjoining': '',
|
||||
'role': '',
|
||||
'switchsetting': true,
|
||||
'DeactiveComments': '',
|
||||
'Comments': ''
|
||||
};
|
||||
'primaryPhone': '',
|
||||
'firstname': '',
|
||||
'lastname': '',
|
||||
'fathername': '',
|
||||
'mothername': '',
|
||||
'emailId': '',
|
||||
'secondaryPhone': '',
|
||||
'dateofbirth': '',
|
||||
'gender': '',
|
||||
'aadharNumber': '',
|
||||
'otherId': '',
|
||||
'otherIdDetails': '',
|
||||
'address1': '',
|
||||
'address2': '',
|
||||
'caste': '',
|
||||
'category': '',
|
||||
'religion': '',
|
||||
'nationality': '',
|
||||
'prequalification': '',
|
||||
'occupation': '',
|
||||
'designation': '',
|
||||
'companyname': '',
|
||||
'referredby': '',
|
||||
'referredmobilenumber': '',
|
||||
'switchsetting': true,
|
||||
'DeactiveComments': '',
|
||||
'Comments': ''
|
||||
};
|
||||
}, resetCourse: function (form) {
|
||||
form.$setPristine(true);
|
||||
$scope.myModelCourse = {
|
||||
|
||||
@ -245,7 +245,7 @@
|
||||
<!--<button ng-click="tabActive('0')" value="Tab1">Tab1</button>-->
|
||||
<div>
|
||||
<!--<button ng-click="myActivateDiv()">Click Me</button>-->
|
||||
<form name="Form" id="form" novalidate ng-submit="studentFORM.submit(Form, myModel)" method="post">
|
||||
<form name="Form" id="form" novalidate ng-submit="studentFORM.submit(Form, myModel, myModelCourseAdd)" method="post">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<fieldset style="background-color: #eaeaea;">
|
||||
@ -256,7 +256,7 @@
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<form name="Form" id="form1" novalidate ng-submit="form.submit(Form,myModel)" method="post">
|
||||
<form name="Form" id="form1" novalidate ng-submit="form.submit(Form,myModel, myModelCourseAdd)" method="post">
|
||||
<div class="file-upload">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user