739 lines
23 KiB
JavaScript
739 lines
23 KiB
JavaScript
'use strict';
|
|
/**
|
|
* controllers for ng-table
|
|
* Simple table with sorting and filtering on AngularJS
|
|
*/
|
|
app.controller('generateHallTicketCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$sessionStorage", "$http", "$state","$modal","$log", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $sessionStorage, $http, $state,$modal,$log) {
|
|
$scope.myModel = {
|
|
"universityName":"",
|
|
"courseName":"",
|
|
"batchName":"",
|
|
"centerName":""
|
|
};
|
|
|
|
$scope.pdfModel = {
|
|
"universityDetails":"",
|
|
"studentDetails":"",
|
|
"batchDetails":"",
|
|
"courseDetails":"",
|
|
"centerDetails":"",
|
|
"semDataType":""
|
|
};
|
|
|
|
$rootScope.userType = JSON.parse(sessionStorage.getItem('localObj')).localType;
|
|
|
|
|
|
$scope.isTblShow = false;
|
|
$scope.isLoader = false;
|
|
$scope.isLoaderShow = false;
|
|
$scope.isLoaderTxt = "Loading...";
|
|
$scope.generateButtonTxt = "GENERATE";
|
|
$scope.generateButtonStatus = false;
|
|
|
|
// sorting function for table params
|
|
$scope.sort = function(keyname){
|
|
$scope.sortKey = keyname; //set the sortKey to the param passed
|
|
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
|
|
}
|
|
|
|
|
|
/*
|
|
* init function
|
|
* created by kms
|
|
* */
|
|
$scope.init = function () {
|
|
|
|
|
|
|
|
// var logcheck = JSON.parse(sessionStorage.getItem('localObj'));
|
|
|
|
// const LOCALTYPE = logcheck.localType;
|
|
// if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' )) {
|
|
// console.log("if");
|
|
// }else {
|
|
// if(logcheck != null && LOCALTYPE !='R001') {
|
|
// console.log("else if");
|
|
// $state.go('app.dashboard');
|
|
// } else {
|
|
|
|
// console.log("else else");
|
|
// //ipCookie.remove('cookiechk');
|
|
// window.sessionStorage.clear();
|
|
// $state.go('login.signin');
|
|
// }
|
|
// }
|
|
|
|
|
|
var getUniv = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getUniversityCourseDetails/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
|
|
branchId:JSON.parse(sessionStorage.getItem('localObj')).localBranchID
|
|
}
|
|
};
|
|
$http(getUniv).then(function (response) {
|
|
if (response.data.status==200 && response.data.universityStatus) {
|
|
$scope.university = response.data.univerSityDetails;
|
|
$scope.centers = response.data.centerDetails;
|
|
//console.log( $scope.university);
|
|
|
|
} else {
|
|
$scope.university = "";
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
/*
|
|
* get student details
|
|
* created by kms
|
|
* */
|
|
$scope.studentInfo="";
|
|
$scope.getStudentDetails = function (form,myModel) {
|
|
|
|
if(myModel.universityName == null || myModel.universityName == '' || myModel.universityName == undefined){
|
|
swal('Select University','','warning');
|
|
return false;
|
|
}
|
|
|
|
// if(myModel.courseName == '' || myModel.courseName == null || myModel.courseName == undefined){
|
|
// swal('Select Course','','warning');
|
|
// return false;
|
|
// }
|
|
|
|
if(myModel.batchName == null || myModel.batchName == '' || myModel.batchName == undefined){
|
|
swal('Select Batch','','warning');
|
|
return false;
|
|
}
|
|
|
|
if(myModel.centerName == null || myModel.centerName == '' || myModel.centerName == undefined){
|
|
swal('Select Center','','warning');
|
|
return false;
|
|
}
|
|
|
|
|
|
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 {
|
|
$scope.selectedStudentsID = [];
|
|
$scope.isLoaderShow = true;
|
|
$scope.myModel.all = false;
|
|
$scope.isTblShow = false;
|
|
var university = myModel.universityName;
|
|
var course = myModel.courseName;
|
|
var batch = myModel.batchName;
|
|
var centerDetails = myModel.centerName;
|
|
var getStudents = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getStudentListForHallTicket/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
university: university,
|
|
course:course,
|
|
batch:batch,
|
|
requestedtBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
|
|
branchId: JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
|
|
requestedDept: JSON.parse(sessionStorage.getItem('localObj')).localType,
|
|
center:centerDetails
|
|
}
|
|
};
|
|
$http(getStudents).then(function (response) {
|
|
if (response.data.status == 200 && response.data.studentStatus) {
|
|
$scope.studentInfo = response.data.studentDetails;
|
|
$scope.isLoaderShow = false;
|
|
$scope.isTblShow = true;
|
|
|
|
//console.log($scope.studentInfo);
|
|
|
|
|
|
// angular.forEach(($scope.studentInfo),function(studentInfo,key)
|
|
// {
|
|
// //console.log($scope.studentInfo);
|
|
// if(studentInfo.balpayable != 0)
|
|
// {
|
|
// var mobileno = studentInfo.MobileNumber;
|
|
// var sendmsg =
|
|
// {
|
|
// method: 'POST',
|
|
// url: apiPoint.url + 'SendMessagetoFeeBalance/',
|
|
// headers:
|
|
// {
|
|
// 'Content-Type': 'application/json'
|
|
// },
|
|
// data:
|
|
// {
|
|
// mobileno:mobileno,
|
|
// branchId: JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
|
|
// }
|
|
// };
|
|
|
|
// $http(sendmsg).then(function (response)
|
|
// {
|
|
// console.log(response.data);
|
|
// });
|
|
|
|
|
|
// }
|
|
// //break;
|
|
// });
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
$scope.studentInfo="";
|
|
$scope.isLoaderShow = true;
|
|
$scope.isTblShow = false;
|
|
$scope.isLoaderTxt = "No Records Found";
|
|
}
|
|
},function(error){
|
|
$scope.isLoaderShow = true;
|
|
$scope.isTblShow = false;
|
|
$scope.isLoaderTxt = "No Records Found";
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
/*
|
|
* get student details
|
|
* created by kms
|
|
* */
|
|
// $scope.getstudent="";
|
|
$scope.StudentDetails = function (form,myModel) {
|
|
|
|
if(myModel.universityName == null || myModel.universityName == '' || myModel.universityName == undefined){
|
|
swal('Select University','','warning');
|
|
return false;
|
|
}
|
|
|
|
if(myModel.courseName == '' || myModel.courseName == null || myModel.courseName == undefined){
|
|
swal('Select Course','','warning');
|
|
return false;
|
|
}
|
|
|
|
if(myModel.batchName == null || myModel.batchName == '' || myModel.batchName == undefined){
|
|
swal('Select Batch','','warning');
|
|
return false;
|
|
}
|
|
|
|
if(myModel.centerName == null || myModel.centerName == '' || myModel.centerName == undefined){
|
|
swal('Select Center','','warning');
|
|
return false;
|
|
}
|
|
|
|
|
|
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 {
|
|
$scope.selectedStudentsID = [];
|
|
$scope.isLoaderShow = true;
|
|
$scope.myModel.all = false;
|
|
$scope.isTblShow = false;
|
|
var university = myModel.universityName;
|
|
var course = myModel.courseName;
|
|
var batch = myModel.batchName;
|
|
var centerDetails = myModel.centerName;
|
|
var getStudents = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getallStudentdetails/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
university: university,
|
|
course:course,
|
|
batch:batch,
|
|
requestedtBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
|
|
branchId: JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
|
|
requestedDept: JSON.parse(sessionStorage.getItem('localObj')).localType,
|
|
center:centerDetails
|
|
}
|
|
};
|
|
$http(getStudents).then(function (response) {
|
|
if (response.data.status == 200 && response.data.studentStatus) {
|
|
// $scope.studentInfo = response.data.studentDetails;
|
|
$scope.isLoaderShow = false;
|
|
$scope.isTblShow = true;
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
$scope.studentInfo="";
|
|
$scope.isLoaderShow = true;
|
|
$scope.isTblShow = false;
|
|
$scope.isLoaderTxt = "No Records Found";
|
|
}
|
|
},function(error){
|
|
$scope.isLoaderShow = true;
|
|
$scope.isTblShow = false;
|
|
$scope.isLoaderTxt = "No Records Found";
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$scope.selectedStudentsID = [];
|
|
$scope.Sem_id = '';
|
|
$scope.isClick = function(e)
|
|
{
|
|
// alert();
|
|
|
|
var ide = e.target;
|
|
var val = (ide.checked ? true : false);
|
|
var sid1 = e.target.id;
|
|
/* From Front End Checkbox ID Comes with StudentID and SemID Merged (78596) => here 7859 is student id and 6 is sem id
|
|
So have to split it using substr function
|
|
*/
|
|
var sid = sid1.substr(0,4);
|
|
var sem = sid1.substr(4,2);
|
|
$scope.Sem_id = sem;
|
|
|
|
|
|
|
|
console.log(sid);
|
|
console.log(sem);
|
|
|
|
|
|
angular.forEach($scope.studentInfo,function(value,key){
|
|
|
|
if(parseInt(sid) == value.StudentID)
|
|
{
|
|
//console.log(value);
|
|
// var invalue = value.FeeDetails.filter(fees=>fees.Sem_Year == sem);
|
|
// console.log(invalue);
|
|
|
|
sid = value;
|
|
|
|
// sid.FeeDetails = invalue;
|
|
}
|
|
});
|
|
|
|
var pos = $scope.selectedStudentsID.indexOf(sid);
|
|
|
|
if(val)
|
|
{
|
|
if( pos == -1)
|
|
{
|
|
|
|
$scope.selectedStudentsID.push(sid);
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
$scope.selectedStudentsID.splice(pos,1);
|
|
}
|
|
|
|
|
|
// console.log('check Box Click Funciton');
|
|
// console.log($scope.selectedStudentsID);
|
|
}
|
|
|
|
|
|
$scope.isCheckAll = function(e)
|
|
{
|
|
var val = (e.target.checked ? true : false);
|
|
|
|
if(val)
|
|
{
|
|
var len = $scope.studentInfo.length;
|
|
var i = 0;
|
|
for(i=0;i<len;i++)
|
|
{
|
|
if($scope.selectedStudentsID.indexOf($scope.studentInfo[i]) === -1)
|
|
{
|
|
$scope.selectedStudentsID.push($scope.studentInfo[i]);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$scope.selectedStudentsID = [];
|
|
}
|
|
|
|
}
|
|
|
|
$scope.generateHallTicket = function()
|
|
{
|
|
if($scope.studentInfo.length == 0)
|
|
|
|
{
|
|
swal('No Students Found','','warning');return false;
|
|
}
|
|
|
|
if($scope.myModel.centerName == "" || $scope.myModel.centerName == undefined || $scope.myModel.centerName == null)
|
|
{
|
|
swal('Select Center Name','','warning');return false;
|
|
}
|
|
|
|
if($scope.selectedStudentsID.length == 0)
|
|
{
|
|
swal('Select Student(s)','','warning');return false;
|
|
}
|
|
//console.log($scope.Sem_id);return false;
|
|
|
|
|
|
var university = $scope.myModel.universityName;
|
|
var course = $scope.myModel.courseName;
|
|
var batch = $scope.myModel.batchName;
|
|
$scope.generateButtonTxt = "Please Wait...";
|
|
$scope.generateButtonStatus = true;
|
|
var dataForHallTicket = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getHallTicket/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
universityID : university,
|
|
courseID :course,
|
|
batchName:batch,
|
|
StudentIDs:$scope.selectedStudentsID,
|
|
//SemID:$scope.Sem_id,
|
|
centerName:$scope.myModel.centerName,
|
|
branchId:JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
|
|
requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID
|
|
}
|
|
};
|
|
$http(dataForHallTicket).then(function (response) {
|
|
if (response.data.status==200 && response.data.hallTicketStatus) {
|
|
|
|
$scope.pdfModel.universityDetails = response.data.hallTicketData.UniversityDetails;
|
|
$scope.pdfModel.studentDetails = response.data.hallTicketData.studentDetails;
|
|
|
|
$scope.pdfModel.batchDetails = $scope.selectedBatchName;
|
|
$scope.pdfModel.courseDetails = $scope.selectedCourseName;
|
|
$scope.pdfModel.centerDetails = $scope.myModel.centerName;
|
|
$scope.pdfModel.semDataType =response.data.semDataType;
|
|
//alert('after API Response',$scope.Sem_id)
|
|
$scope.pdfModel.semidToGenarte = $scope.Sem_id; /* select the checkbox particluar semesterid */
|
|
|
|
$scope.open($scope.pdfModel);
|
|
$scope.generateButtonTxt = "GENERATE";
|
|
$scope.generateButtonStatus = false;
|
|
|
|
}
|
|
},function(error){
|
|
swal('No Records Found','',error);
|
|
$scope.generateButtonTxt = "No Records Found";
|
|
});
|
|
}
|
|
|
|
//Below Functions defined for Hall Ticket generation
|
|
|
|
|
|
$scope.FeesName="" ;
|
|
$scope.open = function (PDFdata) {
|
|
//console.log('while Open Fun Called....!')
|
|
//console.log(PDFdata);
|
|
|
|
//$rootScope.StudentsIDs = $scope.selectedStudentsID;
|
|
var modalInstance = $modal.open({
|
|
templateUrl: 'assets/views/hallticket/hallTicketPDF.html',
|
|
controller: 'HallTicketPDFCtrl',
|
|
// size: size,
|
|
resolve: {
|
|
pdfitems: function () {
|
|
//return $scope.FeesName;
|
|
return PDFdata;
|
|
}
|
|
}
|
|
});
|
|
|
|
modalInstance.result.then(function (selectedItem) {
|
|
$scope.selected = selectedItem;
|
|
}, function () {
|
|
$log.info('Modal dismissed at: ' + new Date());
|
|
});
|
|
};
|
|
// }
|
|
// generate pdf for student view
|
|
|
|
|
|
$scope.captureCourseName = function()
|
|
{
|
|
|
|
$scope.selectedCourseName = course.options[course.selectedIndex].text;
|
|
};
|
|
|
|
$scope.captureBatchName = function()
|
|
{
|
|
|
|
$scope.selectedBatchName = batch.options[batch.selectedIndex].text;
|
|
};
|
|
|
|
|
|
}]);
|
|
/*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) {
|
|
|
|
|
|
|
|
$scope.Currentdate = new Date();
|
|
|
|
// console.log($scope.Currentdate);
|
|
// get student view details
|
|
var getcourse = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getStudentBasicInfo/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
requestedBy :studentDetails.MobileNumber,
|
|
requestedFrom: 3,
|
|
branchCode:JSON.parse(sessionStorage.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());
|
|
});
|
|
};
|
|
|
|
|
|
}]);
|
|
|
|
// 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');
|
|
};
|
|
|
|
|
|
}]);
|
|
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;
|
|
};
|
|
});
|
|
|
|
// Controller for Hallticket Modal PDF
|
|
app.controller('HallTicketPDFCtrl', ["$scope", "$modalInstance", "pdfitems", function ($scope, $modalInstance, pdfitems) {
|
|
|
|
// console.log('child');
|
|
$scope.localPdfUniverityDetails = pdfitems.universityDetails;
|
|
$scope.universityNamePDF = $scope.localPdfUniverityDetails[0].UniversityName;
|
|
$scope.length_of_universityNamePDF = $scope.universityNamePDF.length/2;
|
|
// console.log('$scope.length_of_universityNamePDF'+$scope.length_of_universityNamePDF);
|
|
$scope.universityAddressPDF = $scope.localPdfUniverityDetails[0].Address;
|
|
$scope.universityEmailPDF = $scope.localPdfUniverityDetails[0].EmailID;
|
|
$scope.universityLogoPDF = $scope.localPdfUniverityDetails[0].ProfilePicPath;
|
|
$scope.batchNamePDF = pdfitems.batchDetails;//.BatchName;
|
|
$scope.courseNamePDF = pdfitems.courseDetails;//.CourseName;
|
|
$scope.centerNamePDF = pdfitems.centerDetails.CenterName+''+ pdfitems.centerDetails.CenterAddress;
|
|
$scope.semDataTypePDF = pdfitems.semDataType;
|
|
//console.log('AFter HallTicketPDFCtrl called');
|
|
// console.log(pdfitems.semDataTypePDF);
|
|
$scope.SemIDPDF = pdfitems.semidToGenarte;
|
|
$scope.localPdfStudentDetails = pdfitems.studentDetails;
|
|
|
|
angular.forEach($scope.localPdfStudentDetails,function(student,parent_key)
|
|
|
|
{
|
|
|
|
|
|
if(angular.isObject(student))
|
|
{
|
|
angular.forEach(student.FeeDetails,function(value,key)
|
|
{
|
|
|
|
if('0' in value)
|
|
|
|
{
|
|
|
|
var local_stu_details = value;
|
|
$scope.localPdfStudentDetails[parent_key].FeeDetails[key] = {};
|
|
$scope.localPdfStudentDetails[parent_key].FeeDetails[key]['sem'] = value[0].SemesterID;
|
|
$scope.localPdfStudentDetails[parent_key].FeeDetails[key]['sub'] = value;
|
|
}
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$scope.ok = function () {
|
|
$modalInstance.close($scope.selected.item);
|
|
};
|
|
|
|
$scope.cancel = function () {
|
|
$modalInstance.dismiss('cancel');
|
|
};
|
|
|
|
$scope.generatePDF = function(){
|
|
// console.log('hi'); return false;
|
|
|
|
var innerContents = document.getElementById("university_header").innerHTML;
|
|
|
|
var popupWinindow = window.open('', '_blank', 'width=1200,height=700,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no');
|
|
popupWinindow.document.open();
|
|
popupWinindow.document.write('<html>');
|
|
popupWinindow.document.write('<style type="text/css" media="print">');
|
|
popupWinindow.document.write('@page { size: portrait; }');
|
|
// popupWinindow.document.write('.title{border:3px solid black;}');
|
|
popupWinindow.document.write('</style>');
|
|
popupWinindow.document.write(innerContents);
|
|
popupWinindow.document.write('</br>');
|
|
popupWinindow.document.write('</br>');
|
|
popupWinindow.document.write('</br>');
|
|
popupWinindow.document.write('</br>');
|
|
//popupWinindow.document.write(innerContents);
|
|
popupWinindow.document.write('</html>');
|
|
popupWinindow.document.close();
|
|
popupWinindow.focus();
|
|
popupWinindow.print();
|
|
popupWinindow.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
}]); |