course details changes done
This commit is contained in:
parent
c294ed3aeb
commit
d4850bce13
@ -429,3 +429,138 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
/*modal controller
|
||||||
|
* */
|
||||||
|
app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS", "$http", function ($scope, $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.MobileNumber,
|
||||||
|
requestedFrom: 3
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$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) {
|
||||||
|
|
||||||
|
var modalInstance1 = $modal.open({
|
||||||
|
templateUrl: 'assets/views/student/studentPaymentModal.html',
|
||||||
|
controller: 'ModalInstanceCtrl1',
|
||||||
|
// size: size,
|
||||||
|
resolve: {
|
||||||
|
items1: function () {
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
modalInstance1.result.then(function (selectedItem) {
|
||||||
|
$scope.selected = selectedItem;
|
||||||
|
}, function () {
|
||||||
|
$log.info('Modal dismissed at: ' + new Date());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}]);
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
$scope.ok = function () {
|
||||||
|
$modalInstance.close($scope.selected.item);
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.cancel = function () {
|
||||||
|
$modalInstance.dismiss('cancel');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}]);
|
||||||
|
app.filter('unique', function() {
|
||||||
|
return function(collection, primaryKey, secondaryKey) { //optional secondary key
|
||||||
|
var output = [],
|
||||||
|
keys = [];
|
||||||
|
|
||||||
|
angular.forEach(collection, function(item) {
|
||||||
|
var key;
|
||||||
|
secondaryKey === undefined ? key = item[primaryKey] : key = item[primaryKey][secondaryKey];
|
||||||
|
|
||||||
|
if(keys.indexOf(key) === -1) {
|
||||||
|
keys.push(key);
|
||||||
|
output.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user