hallticket

This commit is contained in:
sriramv 2019-02-06 17:14:32 +05:30
parent 745add04c4
commit b6883083a3
4 changed files with 112 additions and 741 deletions

View File

@ -855,8 +855,13 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId)
{
$this->db->distinct();
$this->db->select('T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,T_StudentDetails.ProfilePicPath,T_Student_CourseDetails.EnrollmentID,T_Hallticket_Master.HallTicket_ID,T_Hallticket_Student_Details.HallTicket_ID as isFlag,BalFees.balpayable,BalFees.semyr,T_Student_CourseDetails.CourseID as CourseID,T_CourseMaster.CourseName');
$this->db->from('T_Students_Fees_Status');
$this->db->select('T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,T_StudentDetails.ProfilePicPath,T_Student_CourseDetails.EnrollmentID,T_Hallticket_Master.HallTicket_ID,T_Hallticket_Student_Details.HallTicket_ID as isFlag,BalFees.balpayable,BalFees.semyr,T_Student_CourseDetails.CourseID as CourseID,T_CourseMaster.CourseName,
if(substr(substr(BalFees.semyr, -4), 1, 3) = "sem", substr(BalFees.semyr, -1),
if(substr(substr(BalFees.semyr, -5), 1, 4) = "year", substr(BalFees.semyr, -1), false)) as SemID,
if(substr(substr(BalFees.semyr, -4), 1, 3) = "sem", "SEM",
if(substr(substr(BalFees.semyr, -5), 1, 4) = "year","YEAR", false)) as SubType,
BalFees.semyr');
$this->db->from('T_Students_Fees_Status');
$this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID and T_StudentDetails.IsActive = 1');
$this->db->join('BalFees','BalFees.student =T_Students_Fees_Status.StudentID and BalFees.course = T_Students_Fees_Status. CourseID and BalFees.branchCode = T_Students_Fees_Status.BranchCode and BalFees.bcode=T_Students_Fees_Status.BatchCode');
@ -899,9 +904,10 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId)
$course = $r->CourseID;
$studetdetails['FeeDetails'] = $this->getFeeSemesterDetails($r->StudentID,$batch,$branchId,$course);
$studetdetails['CourseID'] = $r->CourseID;
$studetdetails['CourseName'] = $r->CourseName;
$studetdetails['CourseName'] = $r->CourseName;
$studetdetails['balpayable'] =$r->balpayable;
$studetdetails['semyr'] =$r->semyr;
$studetdetails['SemID'] =$r->SemID;
$result_array[] = $studetdetails;
$prestu = $r->StudentID;
@ -921,12 +927,12 @@ $studetdetails['CourseName'] = $r->CourseName;
}
function getFeeSemesterDetails($stuid,$bcode,$branchId,$courseID)
{
$this->db->select("T_Course_Fees_Details.ID as FeesID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem',substr(sem_Year,-1),if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year',substr(T_Course_Fees_Details.sem_Year,-1),false)) as SemID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem','SEM',if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year','YEAR',false)) as SubType,T_Course_Fees_Details.Sem_Year,if(T_Course_Fees_Details.ProgramType = 'Y001','SEM',if(ProgramType = 'P001','REG',if(ProgramType = 'P002','LAT','FALSE'))) as Type");
{ $this->db->distinct();
$this->db->select("T_Course_Fees_Details.ID as FeesID,BalFees.balpayable,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem',substr(sem_Year,-1),if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year',substr(T_Course_Fees_Details.sem_Year,-1),false)) as SemID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem','SEM',if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year','YEAR',false)) as SubType,T_Course_Fees_Details.Sem_Year,if(T_Course_Fees_Details.ProgramType = 'Y001','SEM',if(ProgramType = 'P001','REG',if(ProgramType = 'P002','LAT','FALSE'))) as Type");
$this->db->from('T_Students_Fees_Status');
//$this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID');
$this->db->join('T_Course_Fees_Details','T_Students_Fees_Status.FeesType=T_Course_Fees_Details.ID');
$this->db->where('T_Students_Fees_Status.BatchCode',$bcode);
$this->db->join('BalFees','BalFees.feestype = T_Course_Fees_Details.ID and BalFees.student = T_Students_Fees_Status.StudentID'); $this->db->where('T_Students_Fees_Status.BatchCode',$bcode);
$this->db->where('T_Students_Fees_Status.BranchCode',$branchId);
$this->db->where('T_Students_Fees_Status.CourseID',$courseID);
$this->db->where('T_Students_Fees_Status.StudentID',$stuid);
@ -954,6 +960,7 @@ $studetdetails['CourseName'] = $r->CourseName;
//echo $courseID.'course';die();
$a=array();
$feeArray = array();
foreach($studentIDs as $key1 => $id)
{
@ -965,6 +972,7 @@ $studetdetails['CourseName'] = $r->CourseName;
// echo $courseID;
foreach($id['FeeDetails'] as $key2 => $ind)
{
array_push($feeArray,$ind);
// Get Normel Semester
if(strcasecmp($ind['Type'],'sem') == 0 && strcasecmp($ind['SubType'],'sem') == 0 )
{

View File

@ -219,6 +219,7 @@ $scope.generateButtonStatus = false;
$scope.selectedStudentsID = [];
$scope.Sem_id = '';
$scope.isClick = function(e)
{
// alert();
@ -226,23 +227,30 @@ $scope.generateButtonStatus = false;
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,17);
var sem = sid1.substr(4,2);
$scope.Sem_id = sem;
console.log(sid);
console.log(sem);
angular.forEach($scope.studentInfo,function(value,key){
console.log(sem);
if(parseInt(sid) == value.StudentID)
{
console.log(value);
var invalue = value.FeeDetails.filter(fees=>fees.Sem_Year == sem);
//console.log(value);
// var invalue = value.FeeDetails.filter(fees=>fees.Sem_Year == sem);
// console.log(invalue);
sid = value;
sid.FeeDetails = invalue;
// sid.FeeDetails = invalue;
}
});
@ -264,7 +272,8 @@ $scope.generateButtonStatus = false;
}
// console.log('check Box Click Funciton');
// console.log($scope.selectedStudentsID);
}
@ -308,8 +317,9 @@ $scope.generateButtonStatus = false;
{
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;
@ -326,6 +336,7 @@ $scope.generateButtonStatus = false;
courseID :course,
batchName:batch,
StudentIDs:$scope.selectedStudentsID,
//SemID:$scope.Sem_id,
centerName:$scope.myModel.centerName,
branchId:JSON.parse(localStorage.getItem('localObj')).localBranchID,
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
@ -341,6 +352,8 @@ $scope.generateButtonStatus = false;
$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";
@ -358,8 +371,10 @@ $scope.generateButtonStatus = false;
$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',
@ -412,7 +427,7 @@ app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS"
$scope.Currentdate = new Date();
console.log($scope.Currentdate);
// console.log($scope.Currentdate);
// get student view details
var getcourse = {
method: 'POST',
@ -546,11 +561,11 @@ app.filter('unique', function() {
// Controller for Hallticket Modal PDF
app.controller('HallTicketPDFCtrl', ["$scope", "$modalInstance", "pdfitems", function ($scope, $modalInstance, pdfitems) {
console.log('child');
// 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);
// 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;
@ -558,654 +573,38 @@ app.controller('HallTicketPDFCtrl', ["$scope", "$modalInstance", "pdfitems", fun
$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;
$scope.printStudentDetails = function(hallticket_type) {
angular.forEach($scope.localPdfStudentDetails,function(value,key){
if(value.StudentID)
{
if(hallticket_type == 'REG' || hallticket_type == 'LAT'){
console.log('REGLAT');
var semlength = value.FeeDetails.length;
if(hallticket_type == 'REG' || hallticket_type == 'LAT')
{
semlength = 7;
}
var i = 0;
for(i = 0; i <= semlength;i=i+2)
{
var fileName = "DEFAULT.pdf";
var margins = {
top: 70,
bottom: 40,
left: 30,
width: 550
};
var doc = new jsPDF('p', 'pt');
//convert img to base 64
var img = document.getElementById("logo")
var canvas = document.createElement("canvas");
canvas.width = 100;
canvas.height = 100;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0,100,100);
var dataURL = canvas.toDataURL("image/png");
//console.log('***'+dataURL);
//convert img to base 64
//convert img to base 64
var profile = document.getElementById("sprofile")
var canvas2 = document.createElement("canvas");
canvas2.width = 100;
canvas2.height = 100;
var ctx2 = canvas2.getContext("2d");
ctx2.drawImage(profile, 0, 0,100,100);
var profiledataURL = canvas2.toDataURL("image/png",1.0);
//convert img to base 64
var sem1 = "";
var sem2 = "";
var tableid = value.StudentID;
doc.autoTableSetDefaults({
styles: {cellPadding: 3.0, fontSize: 8},
headerStyles: {fillColor: [245, 245, 240], textColor: 0}
});
var firstTableID = tableid+i;
var SecTableID = (tableid+(i+1));
if(document.getElementById(firstTableID))
{
var sem1 = doc.autoTableHtmlToJson(document.getElementById(firstTableID));
}
if(document.getElementById(SecTableID))
{
var sem2 = doc.autoTableHtmlToJson(document.getElementById(SecTableID));
}
var header = function(data) {
var examName = 'ADMIT CARD : '+$scope.courseNamePDF+' EXAMINATION ' +$scope.batchNamePDF;
var rollNo = 'Reg No : '+value.EnrollmentID;
var stuName = 'Name : '+value.Firstname+' '+value.Lastname;
var centerName = 'Centre : '+$scope.centerNamePDF;
if(hallticket_type == 'SEM' || hallticket_type == 'REG')
{
var semName = 'SEM'+(i+1)+'&'+(i+2);
}
else if(hallticket_type == 'LAT')
{
var semName = 'SEM'+(i+3)+'&'+(i+4);
}
fileName = value.EnrollmentID+'-'+value.Firstname+value.Lastname+$scope.courseNamePDF+semName+'.pdf';
doc.setDrawColor(0);
doc.setFillColor(245, 245, 240);
doc.rect(120, 30, 425, 67,'FD');
doc.setFontSize(12);
doc.setTextColor(40);
doc.setFontStyle('normal');
doc.addImage(dataURL, 'jpeg', 50, 35, 50, 50);//university logo location
doc.addImage(profiledataURL, 'jpeg', 470, 100, 60, 60);//student profile location
var uni_add_position = 0;
// if($scope.length_of_universityNamePDF >= 20 ){
// uni_add_position = 110;console.log(uni_add_position);
// }
// else{
// uni_add_position = 10;console.log(uni_add_position);
// }
doc.setFontSize(14);
doc.setFontType("bold");
doc.text(130,50,$scope.universityNamePDF);
doc.setFontSize(10);
doc.text(130,70,$scope.universityAddressPDF);
doc.setFontSize(8);
doc.text(130,90,$scope.universityEmailPDF);
doc.rect(45, 100, 400, 60);
doc.rect(445, 100, 100, 60);
doc.line(45, 125, 445, 125);
doc.setFontSize(8);
doc.setFontType("bold");
doc.text(50,115,examName);
doc.setFontSize(10);
doc.setFontType("normal");
doc.text(50,140,rollNo);
doc.text(230,140,stuName);
doc.text(50,155,centerName);
//footer content
var footerNote1 ="Note : 1. Without Identification Card Candidates shallnot Allowed to write for examination.";
var footerNote2 ="2. For further instructions refer to the facing sheet of the Answer book before writting examination.";
var footerNote3 ="3. Carrying Mobile phone to the examination hall is strictly prohibited.";
var footerNote4 ="4. Attend the examintaion as per mentioned above.";
var footerNote_student_sign ="Signature of the Student";
var footerNote_controller_sign ="Controller of Examination";
doc.setFontSize(8);
doc.text(40,doc.internal.pageSize.height - 150,footerNote1);
doc.text(70,doc.internal.pageSize.height - 140,footerNote2);
doc.text(70,doc.internal.pageSize.height - 130,footerNote3);
doc.text(70,doc.internal.pageSize.height - 120,footerNote4);
doc.text(40,doc.internal.pageSize.height - 50,footerNote_student_sign);
doc.text(450,doc.internal.pageSize.height - 50,footerNote_controller_sign);
};
var autoTableEndPosYvalue = 0;
if(sem1 == "")
{
autoTableEndPosYvalue = 200;
}
else
{
autoTableEndPosYvalue = 300;
}
var options2 = {
addPageContent: header,
margin: {
top: 100
},
startY: doc.autoTableEndPosY() + autoTableEndPosYvalue,
theme :'grid'
};
var options1 = {
addPageContent: header,
margin: {
top: 200
},
theme :'grid'
};
if(sem1 != "")
{
doc.autoTable(sem1.columns, sem1.data, options1);
}
if(sem2 != "")
{
doc.autoTable(sem2.columns, sem2.data, options2);
}
if(sem2 != "" || sem1 != "")
{
doc.save(fileName);
}
}//End of semlength for loop
}//END OF SEM HALL TICKET TYPE
else if(hallticket_type == 'YEAR')
{
console.log('YEAR');
var semlength = value.FeeDetails.length;
var i = 0;
for(i = 0; i <= semlength;i++)
{
// console.log('FOR'+i);
var fileName = "DEFAULT.pdf";
var semName = 'DEFAULT_SEM';
var margins = {
top: 70,
bottom: 40,
left: 30,
width: 550
};
var doc = new jsPDF('p', 'pt');
//convert img to base 64
var img = document.getElementById("logo")
var canvas = document.createElement("canvas");
canvas.width = 100;
canvas.height = 100;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0,100,100);
var dataURL = canvas.toDataURL("image/png");
//console.log('***'+dataURL);
//convert img to base 64
//convert img to base 64
var profile = document.getElementById("sprofile")
var canvas2 = document.createElement("canvas");
canvas2.width = 100;
canvas2.height = 100;
var ctx2 = canvas2.getContext("2d");
ctx2.drawImage(profile, 0, 0,100,100);
var profiledataURL = canvas2.toDataURL("image/png",1.0);
//convert img to base 64
var sem1 = "";
// var sem2 = "";
var tableid = value.StudentID;
doc.autoTableSetDefaults({
styles: {cellPadding: 3.0, fontSize: 8},
headerStyles: {fillColor: [245, 245, 240], textColor: 0},
});
var firstTableID = "0";
//var SecTableID = "1";
switch(i)
{
case 0:
var firstTableID = tableid+'year1'+key;
//var SecTableID = tableid+'year11';
semName = 'YEAR1';
break;
case 1:
var firstTableID = tableid+'year2'+key;
//var SecTableID = tableid+'year21';
semName = 'YEAR2';
break;
case 2:
var firstTableID = tableid+'year3'+key;
//var SecTableID = tableid+'year31';
semName = 'YEAR3';
break;
case 4:
var firstTableID = tableid+'year4'+key;
//var SecTableID = tableid+'year41';
semName = 'YEAR4';
break;
}
if(document.getElementById(firstTableID))
{
var sem1 = doc.autoTableHtmlToJson(document.getElementById(firstTableID));
}
// if(document.getElementById(SecTableID))
// {
// var sem2 = doc.autoTableHtmlToJson(document.getElementById(SecTableID));
// }
var header = function(data) {
var examName = 'ADMIT CARD : '+$scope.courseNamePDF+' EXAMINATION ' +$scope.batchNamePDF;
var rollNo = 'Reg No : '+value.EnrollmentID;
var stuName = 'Name : '+value.Firstname+' '+value.Lastname;
var centerName = 'Centre : '+$scope.centerNamePDF;
fileName = value.EnrollmentID+'-'+value.Firstname+value.Lastname+$scope.courseNamePDF+semName+'.pdf';
doc.setDrawColor(0);
doc.setFillColor(245, 245, 240);
doc.rect(120, 30, 425, 67,'FD');
doc.setFontSize(12);
doc.setTextColor(40);
doc.setFontStyle('normal');
doc.addImage(dataURL, 'jpeg', 50, 35, 50, 50);//university logo location
doc.addImage(profiledataURL, 'jpeg', 470, 100, 60, 60);//student profile location
var uni_add_position = 0;
// if($scope.length_of_universityNamePDF >= 20 ){
// uni_add_position = 110;console.log(uni_add_position);
// }
// else{
// uni_add_position = 10;console.log(uni_add_position);
// }
doc.setFontSize(14);
doc.setFontType("bold");
doc.text(130,50,$scope.universityNamePDF);
doc.setFontSize(10);
doc.text(130,70,$scope.universityAddressPDF);
doc.setFontSize(8);
doc.text(130,90,$scope.universityEmailPDF);
doc.rect(45, 100, 400, 60);
doc.rect(445, 100, 100, 60);
doc.line(45, 125, 445, 125);
doc.setFontSize(8);
doc.setFontType("bold");
doc.text(50,115,examName);
doc.setFontSize(10);
doc.setFontType("normal");
doc.text(50,140,rollNo);
doc.text(230,140,stuName);
doc.text(50,155,centerName);
//footer content
var footerNote1 ="Note : 1. Without Identification Card Candidates shallnot Allowed to write for examination.";
var footerNote2 ="2. For further instructions refer to the facing sheet of the Answer book before writting examination.";
var footerNote3 ="3. Carrying Mobile phone to the examination hall is strictly prohibited.";
var footerNote4 ="4. Attend the examintaion as per mentioned above.";
var footerNote_student_sign ="Signature of the Student";
var footerNote_controller_sign ="Controller of Examination";
doc.setFontSize(8);
doc.text(40,doc.internal.pageSize.height - 150,footerNote1);
doc.text(70,doc.internal.pageSize.height - 140,footerNote2);
doc.text(70,doc.internal.pageSize.height - 130,footerNote3);
doc.text(70,doc.internal.pageSize.height - 120,footerNote4);
doc.text(40,doc.internal.pageSize.height - 50,footerNote_student_sign);
doc.text(450,doc.internal.pageSize.height - 50,footerNote_controller_sign);
};
var options = {
addPageContent: header,
margin: {
top: 170
},
//startY: doc.autoTableEndPosY() + 20,
theme :'grid'
};
if(sem1 != "")
{
doc.autoTable(sem1.columns, sem1.data, options);
}
angular.forEach($scope.localPdfStudentDetails,function(student,parent_key)
{
// if(sem2 != "")
// {
// doc.autoTable(sem2.columns, sem2.data, options);
// }
if(angular.isObject(student))
{
angular.forEach(student.FeeDetails,function(value,key)
{
if(sem1 != "")
{
doc.save(fileName);
}
}//End of semlength for loop
}//END OF YEAR HALL TICKET TYPE
else if(hallticket_type == 'SEM' ){
console.log('SEM*********df;lsjfo');
var semlength = value.FeeDetails.length;
var i = 0;
for(i = 0; i < semlength;i++)
{
var fileName = "DEFAULT.pdf";
var margins = {
top: 70,
bottom: 40,
left: 30,
width: 550
};
var doc = new jsPDF('p', 'pt');
//convert img to base 64
var img = document.getElementById("logo")
var canvas = document.createElement("canvas");
canvas.width = 100;
canvas.height = 100;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0,100,100);
var dataURL = canvas.toDataURL("image/png");
//console.log('***'+dataURL);
//convert img to base 64
//convert img to base 64
var profile = document.getElementById("sprofile")
var canvas2 = document.createElement("canvas");
canvas2.width = 100;
canvas2.height = 100;
var ctx2 = canvas2.getContext("2d");
ctx2.drawImage(profile, 0, 0,100,100);
var profiledataURL = canvas2.toDataURL("image/png",1.0);
//convert img to base 64
var sem1 = "";
//var sem2 = "";
var tableid = value.StudentID;
doc.autoTableSetDefaults({
styles: {cellPadding: 3.0, fontSize: 8},
headerStyles: {fillColor: [245, 245, 240], textColor: 0}
});
var firstTableID = tableid+i;
// var SecTableID = (tableid+(i+1));
if(document.getElementById(firstTableID))
{
var sem1 = doc.autoTableHtmlToJson(document.getElementById(firstTableID));
}
// if(document.getElementById(SecTableID))
// {
if('0' in value)
{
// var sem2 = doc.autoTableHtmlToJson(document.getElementById(SecTableID));
// }
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;
}
var header = function(data) {
var examName = 'ADMIT CARD : '+$scope.courseNamePDF+' EXAMINATION ' +$scope.batchNamePDF;
var rollNo = 'Reg No : '+value.EnrollmentID;
var stuName = 'Name : '+value.Firstname+' '+value.Lastname;
var centerName = 'Centre : '+$scope.centerNamePDF;
// if(hallticket_type == 'SEM' || hallticket_type == 'REG')
// {
// var semName = 'SEM'+(i+1)+'&'+(i+2);
// }
// else if(hallticket_type == 'LAT')
// {
// var semName = 'SEM'+(i+3)+'&'+(i+4);
// }
var semName = 'SEM'+(i+1);
fileName = value.EnrollmentID+'-'+value.Firstname+value.Lastname+$scope.courseNamePDF+semName+'.pdf';
doc.setDrawColor(0);
doc.setFillColor(245, 245, 240);
doc.rect(120, 30, 425, 67,'FD');
doc.setFontSize(12);
doc.setTextColor(40);
doc.setFontStyle('normal');
doc.addImage(dataURL, 'jpeg', 50, 35, 50, 50);//university logo location
doc.addImage(profiledataURL, 'jpeg', 470, 100, 60, 60);//student profile location
var uni_add_position = 0;
// if($scope.length_of_universityNamePDF >= 20 ){
// uni_add_position = 110;console.log(uni_add_position);
// }
// else{
// uni_add_position = 10;console.log(uni_add_position);
// }
doc.setFontSize(14);
doc.setFontType("bold");
doc.text(130,50,$scope.universityNamePDF);
doc.setFontSize(10);
doc.text(130,70,$scope.universityAddressPDF);
doc.setFontSize(8);
doc.text(130,90,$scope.universityEmailPDF);
doc.rect(45, 100, 400, 60);
doc.rect(445, 100, 100, 60);
doc.line(45, 125, 445, 125);
doc.setFontSize(8);
doc.setFontType("bold");
doc.text(50,115,examName);
doc.setFontType("normal");
doc.setFontSize(10);
doc.text(50,140,rollNo);
doc.text(230,140,stuName);
doc.text(50,155,centerName);
//footer content
var footerNote1 ="Note : 1. Without Identification Card Candidates shallnot Allowed to write for examination.";
var footerNote2 ="2. For further instructions refer to the facing sheet of the Answer book before writting examination.";
var footerNote3 ="3. Carrying Mobile phone to the examination hall is strictly prohibited.";
var footerNote4 ="4. Attend the examintaion as per mentioned above.";
var footerNote_student_sign ="Signature of the Student";
var footerNote_controller_sign ="Controller of Examination";
doc.setFontSize(8);
doc.text(40,doc.internal.pageSize.height - 150,footerNote1);
doc.text(70,doc.internal.pageSize.height - 140,footerNote2);
doc.text(70,doc.internal.pageSize.height - 130,footerNote3);
doc.text(70,doc.internal.pageSize.height - 120,footerNote4);
doc.text(40,doc.internal.pageSize.height - 50,footerNote_student_sign);
doc.text(450,doc.internal.pageSize.height - 50,footerNote_controller_sign);
};
// var autoTableEndPosYvalue = 0;
// if(sem1 == "")
// {
// autoTableEndPosYvalue = 200;
// }
// else
// {
// autoTableEndPosYvalue = 300;
// }
// var options2 = {
// addPageContent: header,
// margin: {
// top: 100
// },
// startY: doc.autoTableEndPosY() + autoTableEndPosYvalue,
// theme :'grid'
// };
var options1 = {
addPageContent: header,
margin: {
top: 200
},
theme :'grid'
};
if(sem1 != "")
{
doc.autoTable(sem1.columns, sem1.data, options1);
}
// if(sem2 != "")
// {
// doc.autoTable(sem2.columns, sem2.data, options2);
// }
if(sem2 != "" || sem1 != "")
{
doc.save(fileName);
}
}//End of semlength for loop
}
}// END of studentID Check
});//END of For Each
}
});
}
});
$scope.ok = function () {
@ -1217,6 +616,8 @@ app.controller('HallTicketPDFCtrl', ["$scope", "$modalInstance", "pdfitems", fun
};
$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');
@ -1238,16 +639,8 @@ app.controller('HallTicketPDFCtrl', ["$scope", "$modalInstance", "pdfitems", fun
popupWinindow.print();
popupWinindow.close();
}
}]);

View File

@ -176,7 +176,8 @@
<!-- <input type="checkbox" ng-checked="myModel.all" id="{{p.StudentID}}" name="{{p.StudentID}}" class="form-control" ng-click="isClick($event)"/></span> -->
<td style="width:3%">
<div ng-if="p.balpayable <=0" >
<input type="checkbox" ng-checked="myModel.all" id="{{p.StudentID}}{{p.semyr}}" name="{{p.StudentID}}" class="form-control" ng-click="isClick($event)"/></div>
<input type="checkbox" ng-checked="myModel.all" id="{{p.StudentID}}{{p.SemID}}" name="{{p.StudentID}}" class="form-control" ng-click="isClick($event)"/>
</div>
</td>
<td>

View File

@ -60,17 +60,17 @@
<!-- FOR SEMESTER TYPE STUDENTS-->
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-repeat ="subjects in studentObj.FeeDetails" and ng-if="semDataTypePDF == 'SEM'" id = "{{studentObj.StudentID}}{{$index}}">
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-repeat ="subjects in studentObj.FeeDetails" and ng-if="semDataTypePDF == 'SEM' && subjects.sem == SemIDPDF" id = "{{studentObj.StudentID}}{{$index}}">
<thead>
<!-- <tr> -->
<!-- <th colspan="6">SEMESTER</th> -->
<!-- </tr> -->
<tr>
<tr >
<th width="5%"><center>Sem/Year</center></th><th width="15%"><center>Paper Code</center></th><th><center>Subject Name</center></th><th width="15%"><center>Date</center></th><th width="20%"><center>Time</center></th><th width="5%"><center>Inv.sign</center></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in subjects">
<tr ng-repeat="sub in subjects.sub" >
<td>0{{sub.SemesterID}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime}} - {{sub.ToTime }}</td><td >&nbsp;</td>
</tr>
</tbody>
@ -80,7 +80,8 @@
<!-- END OF SEMESTER TYPE STUDENTS-->
<!-- FOR YEAR TYPE STUDENTS-->
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-if="studentObj.FeeDetails[0] && semDataTypePDF == 'YEAR'" id = "{{studentObj.StudentID}}year1{{$index}}">
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-repeat ="subjects in studentObj.FeeDetails" and ng-if="semDataTypePDF == 'YEAR' && subjects.sem == SemIDPDF" id = "{{studentObj.StudentID}}{{$index}}">
<thead>
<tr>
@ -88,84 +89,52 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in studentObj.FeeDetails[0]">
<tr ng-repeat="sub in subjects.sub" >
<td>0{{sub.SemesterID}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime}} - {{sub.ToTime}}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-if = "studentObj.FeeDetails[1] && semDataTypePDF == 'YEAR'" id = "{{studentObj.StudentID}}year2{{$index}}">
<thead>
<tr>
<th width="5%"><center>Sem/Year</center></th><th width="10%"><center>Paper Code</center></th><th><center>Subject Name</center></th><th width="15%"><center>Date</center></th><th width="20%"><center>Time</center></th><th width="5%"><center>Inv.sign</center></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in studentObj.FeeDetails[1]">
<td>0{{sub.SemesterID-1}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime }} - {{sub.ToTime }}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-if ="studentObj.FeeDetails[2] && semDataTypePDF == 'YEAR'" id = "{{studentObj.StudentID}}year3{{$index}}">
<thead>
<tr>
<th width="5%"><center>Sem/Year</center></th><th width="10%"><center>Paper Code</center></th><th><center>Subject Name</center></th><th width="15%"><center>Date</center></th><th width="20%"><center>Time</center></th><th width="5%"><center>Inv.sign</center></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in studentObj.FeeDetails[2]">
<td>0{{sub.SemesterID-2}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime}} - {{sub.ToTime | date :"hh:mm: a"}}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-if = "studentObj.FeeDetails[3] && semDataTypePDF == 'YEAR'" id = "{{studentObj.StudentID}}year4{{$index}}">
<thead>
<tr>
<th width="5%"><center>Sem/Year</center></th><th width="10%"><center>Paper Code</center></th><th><center>Subject Name</center></th><th width="15%"><center>Date</center></th><th width="20%"><center>Time</center></th><th width="5%"><center>Inv.sign</center></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in studentObj.FeeDetails[3]">
<td>0{{sub.SemesterID-3}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime }} - {{sub.ToTime}}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
<!-- END OF YEAR TYPE STUDENTS-->
<!-- END OF YEAR TYPE STUDENTS-->
<!-- FOR OF REG AND LAT TYPE STUDENTS-->
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-repeat = "subjects in studentObj.FeeDetails[0]" ng-if="semDataTypePDF == 'REG' || semDataTypePDF == 'LAT' && subjects.length != 0" id = "{{studentObj.StudentID}}{{$index}}">
<thead>
<tr>
<th width="5%">Sem/Year</th><th width="10%">Paper Code</th><th>Subject Name</th><th width="5%">Date</th><th width="15%">Time</th><th width="5%">Invigi.sign</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in subjects">
<td>0{{sub.SemesterID}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime}} - {{sub.ToTime }}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-repeat ="subjects in studentObj.FeeDetails" and ng-if=" semDataTypePDF == 'LAT' && subjects.sem == SemIDPDF && subjects.length != 0" id = "{{studentObj.StudentID}}{{$index}}">
<thead>
<tr>
<th width="5%">Sem/Year</th><th width="10%">Paper Code</th><th>Subject Name</th><th width="5%">Date</th><th width="15%">Time</th><th width="5%">Invigi.sign</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="sub in subjects.sub">
<td>0{{sub.SemesterID}}</td><td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime}} - {{sub.ToTime }}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" ng-repeat ="subjects in studentObj.FeeDetails" and ng-if="semDataTypePDF == 'REG' && subjects.sem == undefined " id = "{{studentObj.StudentID}}{{$index}}">
<thead>
<tr>
<!-- <th width="5%">Sem/Year</th> -->
<th width="10%">Paper Code</th><th>Subject Name</th><th width="10%">Date</th><th width="15%">Time</th><th width="5%">Invigi.sign</th>
</tr>
</thead>
<tbody ng-repeat="subject in subjects.sub">
<tr ng-repeat="sub in subject">
<!-- <td>0{{sub.SemesterID}}</td> -->
<td style="padding-left:3px;">{{sub.SubjectCode}}</td><td style="padding-left:3px;">{{sub.SubjectName}}</td><td >{{sub.ScheduleDate | date: "dd-MM-y" }}</td><td>{{sub.FromTime}} - {{sub.ToTime }}</td><td >&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>