student pending doc details updations : kdk
This commit is contained in:
parent
0abb2a3dfe
commit
a4c18823b0
@ -1177,7 +1177,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams",
|
|||||||
if (response.data.deleteStatus == true) {
|
if (response.data.deleteStatus == true) {
|
||||||
// swal("Success!", response.data.message, "success");
|
// swal("Success!", response.data.message, "success");
|
||||||
$scope.documentTrackAddDetailsLoading = false;
|
$scope.documentTrackAddDetailsLoading = false;
|
||||||
$scope.studentDocumentsList = '';
|
// $scope.studentDocumentsList = '';
|
||||||
$scope.getStudentPendingEntrolDocDetails(StuID);
|
$scope.getStudentPendingEntrolDocDetails(StuID);
|
||||||
} else {
|
} else {
|
||||||
swal(" ", res.data.message, "error");
|
swal(" ", res.data.message, "error");
|
||||||
@ -2457,6 +2457,139 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// $scope.PendingDocNotFound = false;
|
||||||
|
// student pending document details
|
||||||
|
$scope.getStudentPendingEntrolDocDetails = function(stuId) {
|
||||||
|
// $scope.studentDocumentsList = '';
|
||||||
|
|
||||||
|
var getStudentPendingDocDetails = {
|
||||||
|
method: 'POST',
|
||||||
|
url: apiPoint.url + 'getListofStuPendingDocDetails/',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
exceptId: stuId,
|
||||||
|
localData: localDetail
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$http(getStudentPendingDocDetails).then(function (response) {
|
||||||
|
if (response.data.PendingDocListStatus == true) {
|
||||||
|
// $scope.PendingDocNotFound = false;
|
||||||
|
$scope.studentPendingDocumentsDetails = response.data.student_pending_doc_details;
|
||||||
|
} else {
|
||||||
|
// $scope.PendingDocNotFound = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$scope.myModelAddPendingDocDetails = {
|
||||||
|
"documentDetails": "",
|
||||||
|
"checkTracking": false
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.documentTrackAddDetailsLoading = false;
|
||||||
|
|
||||||
|
$scope.studentEntrollPendingDocFORM = {
|
||||||
|
submit: function (form, myModelAddPendingDocDetails, stuID) {
|
||||||
|
$scope.documentTrackAddDetailsLoading = true;
|
||||||
|
var firstError = null;
|
||||||
|
if (form.$invalid) {
|
||||||
|
var field = null, firstError = null;
|
||||||
|
for (field in form) {
|
||||||
|
if (field[0] != '$') {
|
||||||
|
if (firstError === null && !form[field].$valid) {
|
||||||
|
firstError = form[field].$name;
|
||||||
|
}
|
||||||
|
if (form[field].$pristine) {
|
||||||
|
form[field].$dirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||||
|
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||||
|
} else {
|
||||||
|
var ModelDetails = {
|
||||||
|
"student" : stuID,
|
||||||
|
"doc_Details": myModelAddPendingDocDetails.documentDetails,
|
||||||
|
"checkTracking": myModelAddPendingDocDetails.checkTracking
|
||||||
|
};
|
||||||
|
var updateStudentPendingDocDetails = {
|
||||||
|
method: 'POST',
|
||||||
|
url: apiPoint.url + 'addStudentEnrollPendingDocDetails/',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
updateDetails: ModelDetails,
|
||||||
|
localData: localDetail
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$http(updateStudentPendingDocDetails).then(function (response) {
|
||||||
|
if (response.data.AddStuPendingDocStatus == true) {
|
||||||
|
$scope.getStudentPendingEntrolDocDetails(stuID);
|
||||||
|
$scope.documentTrackAddDetailsLoading = false;
|
||||||
|
$scope.myModelAddPendingDocDetails = {
|
||||||
|
"documentDetails": "",
|
||||||
|
"checkTracking": false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
swal(" ", res.data.message, "error");
|
||||||
|
$scope.documentTrackAddDetailsLoading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reset: function (form) {
|
||||||
|
$scope.myModelAddPendingDocDetails = {
|
||||||
|
"documentDetails": "",
|
||||||
|
"checkTracking": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.deletePendingDocDetails = function(details, StuID, Url) {
|
||||||
|
// alert(JSON.stringify(details));
|
||||||
|
|
||||||
|
SweetAlert.swal({
|
||||||
|
title: "Warning!",
|
||||||
|
text: "Want to Delete this Entry ?",
|
||||||
|
type: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#007aff",
|
||||||
|
confirmButtonText: "Yes!"
|
||||||
|
}, function (res) {
|
||||||
|
if (res === true) {
|
||||||
|
$scope.documentTrackAddDetailsLoading = true;
|
||||||
|
var deleteDocEntry = {
|
||||||
|
method: 'POST',
|
||||||
|
url: apiPoint.url + 'deleteDocPendingDetails/',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
exceptId: details.ID,
|
||||||
|
localData: localDetail
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$http(deleteDocEntry).then(function (response) {
|
||||||
|
if (response.data.deleteStatus == true) {
|
||||||
|
// swal("Success!", response.data.message, "success");
|
||||||
|
$scope.documentTrackAddDetailsLoading = false;
|
||||||
|
// $scope.studentDocumentsList = '';
|
||||||
|
$scope.getStudentPendingEntrolDocDetails(StuID);
|
||||||
|
} else {
|
||||||
|
swal(" ", res.data.message, "error");
|
||||||
|
$scope.documentTrackAddDetailsLoading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// end : entrollment document upload ====================================
|
// end : entrollment document upload ====================================
|
||||||
|
|
||||||
|
|
||||||
@ -2772,14 +2905,19 @@ app.controller('ModalInstanceCtrl1', ["$scope", "$modalInstance", "items1", "Wor
|
|||||||
|
|
||||||
|
|
||||||
// Hook in a directive
|
// Hook in a directive
|
||||||
app.directive('fileDownload', function(){
|
app.directive('fileDownload', function($window){
|
||||||
|
|
||||||
|
// alert(path);
|
||||||
return {
|
return {
|
||||||
restrict: 'E', // applied on 'element'
|
restrict: 'E', // applied on 'element'
|
||||||
scope: {
|
scope: {
|
||||||
fileurl: '@fileurl',
|
fileurl: '@fileurl',
|
||||||
linktext: '@linktext'
|
linktext: '@linktext'
|
||||||
},
|
},
|
||||||
template: '<a href="{{ fileurl }}" download><button tooltip="Download" class="btn btn-xs btn-primary"><i class="ti-download"> </i></button></a>', // need this so that the inner HTML can be re-used
|
controller: function($scope) {
|
||||||
|
$scope.path = $window.location.origin + $window.location.pathname + 'images/';
|
||||||
|
},
|
||||||
|
template: '<a href="{{ path }}{{ fileurl }}" download><button tooltip="Download" class="btn btn-xs btn-primary"><i class="ti-download"> </i></button></a>', // need this so that the inner HTML can be re-used
|
||||||
link: function(scope, elem, attrs) {
|
link: function(scope, elem, attrs) {
|
||||||
/* Ref: https://thinkster.io/egghead/isolate-scope-at
|
/* Ref: https://thinkster.io/egghead/isolate-scope-at
|
||||||
* This block is used when we have
|
* This block is used when we have
|
||||||
|
|||||||
@ -467,7 +467,7 @@
|
|||||||
<td class="center">
|
<td class="center">
|
||||||
<!--<td class="center"><button tooltip="Download" class="btn btn-xs btn-primary" ng-click="printPdf(doc.DocumentStorePath)"><i class="ti-download">
|
<!--<td class="center"><button tooltip="Download" class="btn btn-xs btn-primary" ng-click="printPdf(doc.DocumentStorePath)"><i class="ti-download">
|
||||||
<a ng-href="http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/images/{{doc.DocumentStorePath}}" target="_blank"></a> </i></button>-->
|
<a ng-href="http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/images/{{doc.DocumentStorePath}}" target="_blank"></a> </i></button>-->
|
||||||
<file-download fileurl="http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/images/{{doc.DocumentStorePath}}" linktext="Click here!"></file-download>
|
<file-download fileurl="{{doc.DocumentStorePath}}" linktext="Click here!"></file-download>
|
||||||
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deleteDocDetails(doc.ID, p.StudentID)"><i class="ti-trash">
|
<button tooltip="Delete" class="btn btn-xs btn-danger" ng-click="deleteDocDetails(doc.ID, p.StudentID)"><i class="ti-trash">
|
||||||
</i></button>
|
</i></button>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user