1375,1376 report issue

This commit is contained in:
rajasekar 2019-03-21 10:27:30 +05:30
parent 5ccd25cabd
commit c3c3381e23
4 changed files with 216 additions and 104 deletions

View File

@ -59,7 +59,7 @@ class Reregister_Controller extends REST_Controller {
$branchId = $this->post('branchId'); $branchId = $this->post('branchId');
$res = $this->Reregister_model->getStudentListForPromoteBatchmodal($UID,$batchCode,$branchId,$batchDate); $res = $this->Reregister_model->getStudentListForPromoteBatchmodal($UID,$batchCode,$branchId,$batchDate);
//print_r($res['studentList']);die(); // print_r($res['studentList']);die();
if(count($res['finalStudentList']) > 0) if(count($res['finalStudentList']) > 0)
{ {
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;

View File

@ -195,51 +195,83 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se
} }
public function certificate_status($bat=null,$br=null,$u=null,$from=null,$to=null){ public function certificate_status($bat=null,$br=null,$u=null,$from=null,$to=null){
$sql = "select sms.sid as Student_id,sms.cid,ifnull(sms.status,'-') as status,ifnull(sms.adate,'-') as adate,ifnull(sms.acmts,'-') as acmts,ifnull(sms.ctype,'-') as ctype,ifnull(sms.certname,'-') as certname,ifnull(balance,'-') as balance,ifnull(sfp.BillDate,'-') as initialPaid,ifnull(scd.eid,'-') as Enrollment_id,ifnull(std.name,'-') as Student_name,ifnull(std.father,'-') as Father_name,ifnull(std.phone,'-') as Phone_number,ifnull(cm.course,'-') as Course_name,ifnull(cm.uname,'-') as University,cm.uid as univID,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber // $sql = "select sms.sid as Student_id,sms.cid,ifnull(sms.status,'-') as status,ifnull(sms.adate,'-') as adate,ifnull(sms.acmts,'-') as acmts,ifnull(sms.ctype,'-') as ctype,ifnull(sms.certname,'-') as certname,ifnull(balance,'-') as balance,ifnull(sfp.BillDate,'-') as initialPaid,ifnull(scd.eid,'-') as Enrollment_id,ifnull(std.name,'-') as Student_name,ifnull(std.father,'-') as Father_name,ifnull(std.phone,'-') as Phone_number,ifnull(cm.course,'-') as Course_name,ifnull(cm.uname,'-') as University,cm.uid as univID,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber
from // from
(SELECT app.ID,app.StudentID as sid,app.CourseID as cid,app.BranchCode as branch,app.ListCode as lcode,p.ListName as status,AppDate as adate,app.Comments as acmts,CertificationType as ctype,CertificateName as certname,sum(bal.balpayable) as balance // (SELECT app.ID,app.StudentID as sid,app.CourseID as cid,app.BranchCode as branch,app.ListCode as lcode,p.ListName as status,AppDate as adate,app.Comments as acmts,CertificationType as ctype,CertificateName as certname,sum(bal.balpayable) as balance
FROM T_ApplicationStatus as app // FROM T_ApplicationStatus as app
left join T_CertificationMaster cm on cm.CertificationID=app.CertificationType // left join T_CertificationMaster cm on cm.CertificationID=app.CertificationType
left join T_PickListDetails p on p.ListCode = app.ListCode // left join T_PickListDetails p on p.ListCode = app.ListCode
left join BalFees bal on bal.student=app.StudentID and bal.course=app.CourseID // left join BalFees bal on bal.student=app.StudentID and bal.course=app.CourseID
where CertificateName not like 'APPLICATION%' and app.ID IN (SELECT max(ID) FROM T_ApplicationStatus group by StudentID,CourseID,BranchCode,CertificationType) // where CertificateName not like 'APPLICATION%' and app.ID IN (SELECT max(ID) FROM T_ApplicationStatus group by StudentID,CourseID,BranchCode,CertificationType)
group by app.ID // group by app.ID
union // union
SELECT app.ID,app.StudentID as sid,app.CourseID as cid,app.BranchCode as branch,app.ListCode as lcode,p.ListName as status,AppDate as adate,app.Comments as acmts,CertificationType as ctype,app.CertificationType as certname,sum(bal.balpayable) as balance // SELECT app.ID,app.StudentID as sid,app.CourseID as cid,app.BranchCode as branch,app.ListCode as lcode,p.ListName as status,AppDate as adate,app.Comments as acmts,CertificationType as ctype,app.CertificationType as certname,sum(bal.balpayable) as balance
FROM T_ApplicationStatus as app // FROM T_ApplicationStatus as app
left join T_PickListDetails p on p.ListCode = app.ListCode // left join T_PickListDetails p on p.ListCode = app.ListCode
left join BalFees bal on bal.student=app.StudentID and bal.course=app.CourseID and bal.feestype = app.CertificationType // left join BalFees bal on bal.student=app.StudentID and bal.course=app.CourseID and bal.feestype = app.CertificationType
where app.CertificationType not like 'CERT%' and app.ID IN (SELECT max(ID) FROM T_ApplicationStatus group by StudentID,CourseID,BranchCode,CertificationType) // where app.CertificationType not like 'CERT%' and app.ID IN (SELECT max(ID) FROM T_ApplicationStatus group by StudentID,CourseID,BranchCode,CertificationType)
group by app.ID) as sms // group by app.ID) as sms
left join // left join
(SELECT FeesID as fid,BatchCode as batch,StudentID as sid,CourseID as cid,FeesType as ftype,sum(CourseFees) as cf,Sum(STFOrWR) as stf,sum(Others) as others // (SELECT FeesID as fid,BatchCode as batch,StudentID as sid,CourseID as cid,FeesType as ftype,sum(CourseFees) as cf,Sum(STFOrWR) as stf,sum(Others) as others
// FROM T_Students_Fees_Status
// group by sid,cid)
// as sfs on sfs.sid=sms.sid and sfs.cid=sms.cid
// left join
// (SELECT sfp.StudentID as sid,sfp.FeesId as fid,sfs.CourseID as cid,BillDate as bdate,sum(BillAmount) as bamount,BillNO as billno FROM T_Students_Fees_PaidDetails sfp
// left join T_Students_Fees_Status sfs on sfs.FeesId=sfp.FeesId
// where IsActive = 1
// group by sid,cid)
// as sfb on sfb.sid=sms.sid
// left join
// (select ID,StudentId,FeesID,BillDate from T_Students_Fees_PaidDetails where ID in
// (select min(ID) from T_Students_Fees_PaidDetails group by FeesID)
// group by FeesID) as sfp on sfp.FeesID=sfb.fid
// left join
// (SELECT CourseID as cid,cm.UniversityID as cuid,u.UniversityID as uid,CourseName as course,
// UniversityName as uname,cm.BranchCode as branch FROM T_CourseMaster as cm
// left join T_UniversityMaster as u on u.UniversityID=cm.UniversityID
// group by cid
// order by CourseID)
// as cm on cm.cid=sms.cid
// left join
// (SELECT StudentID as sid,MobileNumber as phone,IsActive as active,concat(FirstName,' ',Lastname) as name,Fathername as father,PermanentAddress as address,AlternateNumber FROM T_StudentDetails) as std on std.sid=sms.sid
// left join
// (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid
$sql ="SELECT sms.sid AS Student_id,sms.cid,ifnull(sms.status,'-') AS STATUS,ifnull(sms.adate,'-') AS adate,ifnull(sms.acmts,'-') AS acmts,ifnull(sms.ctype,'-') AS ctype,ifnull(sms.certname,'-') AS certname,ifnull(balance,'-') AS balance,ifnull(sfb.bdate,'-') AS initialPaid,ifnull(scd.eid,'-') AS Enrollment_id,ifnull(std.name,'-') AS Student_name,ifnull(std.father,'-') AS Father_name,ifnull(std.phone,'-') AS Phone_number,ifnull(cm.course,'-') AS Course_name,ifnull(cm.uname,'-') AS University,cm.uid AS univID,ifnull(std.address,'-') AS address,ifnull(std.AlternateNumber,'') AS AlternateNumber
FROM
(
SELECT app.ID,app.StudentID AS sid,app.CourseID AS cid,app.BranchCode AS branch,app.ListCode AS lcode,p.ListName AS STATUS,AppDate AS adate,app.Comments AS acmts,CertificationType AS ctype,app.CertificationType AS certname,sum(bal.balpayable) AS balance
FROM T_ApplicationStatus AS app
LEFT JOIN T_PickListDetails p ON p.ListCode = app.ListCode
LEFT JOIN BalFees bal ON bal.student=app.StudentID AND bal.course=app.CourseID AND bal.feestype = app.CertificationType
WHERE app.CertificationType NOT LIKE 'CERT%' AND app.ID IN (SELECT max(ID) FROM T_ApplicationStatus GROUP BY StudentID,CourseID,BranchCode,CertificationType)
GROUP BY app.ID) AS sms
LEFT JOIN
(SELECT FeesID AS fid,BatchCode AS batch,StudentID AS sid,CourseID AS cid,FeesType AS ftype,sum(CourseFees) AS cf,Sum(STFOrWR) AS stf,sum(Others) AS others
FROM T_Students_Fees_Status FROM T_Students_Fees_Status
group by sid,cid) GROUP BY sid,cid,fid)
as sfs on sfs.sid=sms.sid and sfs.cid=sms.cid AS sfs ON sfs.sid=sms.sid AND sfs.cid=sms.cid AND sfs.ftype=sms.ctype
left join LEFT JOIN
(SELECT sfp.StudentID as sid,sfp.FeesId as fid,sfs.CourseID as cid,BillDate as bdate,sum(BillAmount) as bamount,BillNO as billno FROM T_Students_Fees_PaidDetails sfp (SELECT sfp.StudentID AS sid,sfp.FeesId AS fid,sfs.CourseID AS cid,BillDate AS bdate,sum(BillAmount) AS bamount,BillNO AS billno FROM T_Students_Fees_PaidDetails sfp
left join T_Students_Fees_Status sfs on sfs.FeesId=sfp.FeesId LEFT JOIN T_Students_Fees_Status sfs ON sfs.FeesId=sfp.FeesId
where IsActive = 1 WHERE IsActive = 1
group by sid,cid) GROUP BY sid,cid,fid)
as sfb on sfb.sid=sms.sid AS sfb ON sfb.sid=sms.sid AND sfb.fid=sfs.fid
left join
(select ID,StudentId,FeesID,BillDate from T_Students_Fees_PaidDetails where ID in LEFT JOIN
(select min(ID) from T_Students_Fees_PaidDetails group by FeesID) (SELECT CourseID AS cid,cm.UniversityID AS cuid,u.UniversityID AS uid,CourseName AS course,
group by FeesID) as sfp on sfp.FeesID=sfb.fid UniversityName AS uname,cm.BranchCode AS branch FROM T_CourseMaster AS cm
left join LEFT JOIN T_UniversityMaster AS u ON u.UniversityID=cm.UniversityID
(SELECT CourseID as cid,cm.UniversityID as cuid,u.UniversityID as uid,CourseName as course, GROUP BY cid
UniversityName as uname,cm.BranchCode as branch FROM T_CourseMaster as cm ORDER BY CourseID)
left join T_UniversityMaster as u on u.UniversityID=cm.UniversityID AS cm ON cm.cid=sms.cid
group by cid LEFT JOIN
order by CourseID) (SELECT StudentID AS sid,MobileNumber AS phone,IsActive AS active,concat(FirstName,' ',Lastname) AS NAME,Fathername AS father,PermanentAddress AS address,AlternateNumber FROM T_StudentDetails) AS std ON std.sid=sms.sid
as cm on cm.cid=sms.cid LEFT JOIN
left join (SELECT StudentID AS sid,UniversityID AS uid,CourseID AS cid,EnrollmentID AS eid,BranchID AS branch FROM T_Student_CourseDetails) AS scd ON scd.sid=sms.sid AND scd.cid=sms.cid
(SELECT StudentID as sid,MobileNumber as phone,IsActive as active,concat(FirstName,' ',Lastname) as name,Fathername as father,PermanentAddress as address,AlternateNumber FROM T_StudentDetails) as std on std.sid=sms.sid
left join where sms.branch = '".$br."'";
(SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid
where sms.branch = '".$br."'
";
if ($bat!= ''){ if ($bat!= ''){
@ -255,18 +287,18 @@ left join
$fromd= date("Y-m-d",strtotime($from)); $fromd= date("Y-m-d",strtotime($from));
$sql.="and STR_TO_DATE(sms.adate,'%d-%m-%Y') >= '".$fromd."' $sql.="and STR_TO_DATE(sfb.bdate,'%d-%m-%Y') >= '".$fromd."'
"; ";
} }
if ($to != ''){ if ($to != ''){
$tod=date("Y-m-d",strtotime($to)); $tod=date("Y-m-d",strtotime($to));
$sql.=" and STR_TO_DATE(sms.adate,'%d-%m-%Y') <= '".$tod."'"; $sql.=" and STR_TO_DATE(sfb.bdate,'%d-%m-%Y') <= '".$tod."'";
} }
$sql.=" group by Student_id,cid,ctype"; $sql.=" group by Student_id,cid,ctype";
// echo $sql; //echo $sql;
//print_r($sql); //print_r($sql);
@ -285,47 +317,119 @@ left join
} }
public function mark_cert_status($bat=null,$br=null,$u=null,$from=null,$to=null){ public function mark_cert_status($bat=null,$br=null,$u=null,$from=null,$to=null){
$sql = "select sms.ID,sms.sid,sms.cid,sms.fid,sms.sem as Sem_year,ifnull(sms.certname,'-') as Certificate_name,sms.ctype, // $sql = "select sms.ID,sms.sid,sms.cid,sms.fid,sms.sem as Sem_year,ifnull(sms.certname,'-') as Certificate_name,sms.ctype,
ifnull(sms.issuedate,'') as issuedate,sms.istatus, // ifnull(sms.issuedate,'') as issuedate,sms.istatus,
ifnull(sms.rcvedate,'-') as rdate,ifnull(sms.rstatus,'-') as rstatus,sms.acmts,ifnull(sms.balance,0) as Balance_fee,std.name as Student_name,std.father as Father_name,std.phone as Phone_number,cm.course as Course_name,cm.uname as University,mdate,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber // ifnull(sms.rcvedate,'-') as rdate,ifnull(sms.rstatus,'-') as rstatus,sms.acmts,ifnull(sms.balance,0) as Balance_fee,std.name as Student_name,std.father as Father_name,std.phone as Phone_number,cm.course as Course_name,cm.uname as University,mdate,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber
// from
// (select c.ID,c.StudentID as sid,sfs.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,Sem as sem,c.CertificationType as certname,c.CertificationType as ctype,CDate as mdate,balpayable as balance,
// if(ListName = 'ISSUED TO STUDENT', CDate,'-') as issuedate,if(ListName = 'ISSUED TO STUDENT', ListName,'-') as istatus,
// if(ListName = 'RECEIVED', CDate,'-') as rcvedate,if(ListName = 'RECEIVED', ListName,'-') as rstatus,c.Comments as acmts
// from T_CertificationStatus c
// left join T_Students_Fees_Status sfs on sfs.FeesType=c.CourseID and sfs.StudentID=c.StudentID
// left join T_PickListDetails list on list.ListCode=c.ListCode
// left join BalFees bal on bal.student=c.StudentID and bal.course=sfs.CourseID and bal.semyr=c.Sem
// where CDate is not null and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
// group by sid,cid,sem,ctype
// union
// select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance,
// if(ListName = 'ISSUED TO STUDENT', AppDate,'-') as issuedate,if(ListName = 'ISSUED TO STUDENT', ListName,'-') as istatus,
// if(ListName = 'RECEIVED', AppDate,'-') as rcvedate,if(ListName = 'RECEIVED', ListName,'-') as rstatus,a.Comments as acmts
// from T_ApplicationStatus a
// left join
// T_Students_Fees_Status sfs on sfs.StudentID=a.StudentID and sfs.CourseID=a.CourseID
// left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
// left join T_PickListDetails list on list.ListCode=a.ListCode
// left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID
// where cm.CertificateName not like 'APPLICATION%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a
// left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
// group by a.StudentID,a.CourseID,a.CertificationType,cm.CertificateName) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
// group by sid,cid,ctype
// union
// select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance,
// if(ListName = 'ISSUED TO STUDENT', AppDate,'-') as issuedate,if(ListName = 'ISSUED TO STUDENT', ListName,'-') as istatus,
// if(ListName = 'RECEIVED', AppDate,'-') as rcvedate,if(ListName = 'RECEIVED', ListName,'-') as rstatus,a.Comments as acmts
// from T_ApplicationStatus a
// left join
// T_Students_Fees_Status sfs on sfs.StudentID=a.StudentID and sfs.CourseID=a.CourseID
// left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
// left join T_PickListDetails list on list.ListCode=a.ListCode
// left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID
// where a.CertificationType not like 'CERT%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a
// left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
// group by a.StudentID,a.CourseID,a.CertificationType,cm.CertificateName,a.ListCode) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
// group by sid,cid,ctype
// ) as sms
// left join
// (SELECT FeesID as fid,BatchCode as batch,StudentID as sid,CourseID as cid,FeesType as ftype,sum(CourseFees) as cf,Sum(STFOrWR) as stf,sum(Others) as others
// FROM T_Students_Fees_Status
// group by sid,cid)
// as sfs on sfs.sid=sms.sid and sfs.cid=sms.cid
// left join
// (SELECT sfp.StudentID as sid,sfp.FeesId as fid,sfs.FeesType as ftype,sfs.CourseID as cid,BillDate as bdate,sum(BillAmount) as bamount,BillNO as billno FROM T_Students_Fees_PaidDetails sfp
// left join T_Students_Fees_Status sfs on sfs.FeesId=sfp.FeesId
// where IsActive = 1
// group by sid,cid)
// as sfb on sfb.sid=sms.sid and sfb.fid=sms.fid and (sfb.ftype=sms.cid or sfb.cid=sms.cid)
// left join
// (SELECT CourseID as cid,cm.UniversityID as cuid,u.UniversityID as uid,CourseName as course,
// UniversityName as uname,cm.BranchCode as branch FROM T_CourseMaster as cm
// left join T_UniversityMaster as u on u.UniversityID=cm.UniversityID
// group by cid
// order by CourseID)
// as cm on cm.cid=sms.cid
// left join
// (SELECT StudentID as sid,MobileNumber as phone,IsActive as active,concat(FirstName,' ',Lastname) as name,Fathername as father,PermanentAddress as address,AlternateNumber FROM T_StudentDetails) as std on std.sid=sms.sid
// left join
// (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid
$sql="select sms.ID,sms.sid,sms.cid,sms.fid,sms.sem as Sem_year,ifnull(sms.certname,'-') as Certificate_name,sms.ctype,
ifnull(sms.issuedate,'') as issuedate,
ifnull(sms.rcvedate,'-') as rdate,sms.acmts,ifnull(sms.balance,0) as Balance_fee,std.name as Student_name,std.father as Father_name,std.phone as Phone_number,cm.course as Course_name,cm.uname as University,mdate,ifnull(std.address,'-') as address,ifnull(std.AlternateNumber,'') as AlternateNumber
from from
(select c.ID,c.StudentID as sid,sfs.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,Sem as sem,c.CertificationType as certname,c.CertificationType as ctype,CDate as mdate,balpayable as balance, (
if(ListName = 'ISSUED TO STUDENT', CDate,'-') as issuedate,if(ListName = 'ISSUED TO STUDENT', ListName,'-') as istatus, SELECT g.ID, g.sid,g.cid,g.sem,g.branch, g.fid, g.certname, g.ctype, g.issuedate, h.rcvedate, concat(g.acmts,' ; ',h.acmts)as acmts,h.balance,g.mdate FROM
if(ListName = 'RECEIVED', CDate,'-') as rcvedate,if(ListName = 'RECEIVED', ListName,'-') as rstatus,c.Comments as acmts (SELECT c.ID,c.StudentID AS sid,sfs.CourseID AS cid,sfs.BranchCode AS branch,sfs.FeesID AS fid,Sem AS sem,c.CertificationType AS certname,c.CertificationType AS ctype,CDate AS mdate,balpayable AS balance,
from T_CertificationStatus c IF(ListName = 'ISSUED TO STUDENT', CDate,'-') AS issuedate,IF(ListName = 'ISSUED TO STUDENT', ListName,'-') AS istatus,
left join T_Students_Fees_Status sfs on sfs.FeesType=c.CourseID and sfs.StudentID=c.StudentID IF(ListName = 'RECEIVED', CDate,'-') AS rcvedate,IF(ListName = 'RECEIVED', ListName,'-') AS rstatus,c.Comments AS acmts
left join T_PickListDetails list on list.ListCode=c.ListCode FROM T_CertificationStatus c
left join BalFees bal on bal.student=c.StudentID and bal.course=sfs.CourseID and bal.semyr=c.Sem LEFT JOIN T_Students_Fees_Status sfs ON sfs.FeesType=c.CourseID AND sfs.StudentID=c.StudentID
where CDate is not null and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' ) LEFT JOIN T_PickListDetails `list` ON list.ListCode=c.ListCode
group by sid,cid,sem,ctype LEFT JOIN BalFees bal ON bal.student=c.StudentID AND bal.course=sfs.CourseID AND bal.semyr=c.Sem
WHERE CDate IS NOT NULL AND (list.ListName LIKE 'ISSUED TO STUDENT' )) g
JOIN
(SELECT c.ID,c.StudentID AS sid,sfs.CourseID AS cid,sfs.BranchCode AS branch,sfs.FeesID AS fid,Sem AS sem,c.CertificationType AS certname,c.CertificationType AS ctype,CDate AS mdate,balpayable AS balance,
IF(ListName = 'ISSUED TO STUDENT', CDate,'-') AS issuedate,IF(ListName = 'ISSUED TO STUDENT', ListName,'-') AS istatus,
IF(ListName = 'RECEIVED', CDate,'-') AS rcvedate,IF(ListName = 'RECEIVED', ListName,'-') AS rstatus,c.Comments AS acmts
FROM T_CertificationStatus c
LEFT JOIN T_Students_Fees_Status sfs ON sfs.FeesType=c.CourseID AND sfs.StudentID=c.StudentID
LEFT JOIN T_PickListDetails `list` ON list.ListCode=c.ListCode
LEFT JOIN BalFees bal ON bal.student=c.StudentID AND bal.course=sfs.CourseID AND bal.semyr=c.Sem
WHERE CDate IS NOT NULL AND ( list.ListName LIKE 'RECEIVED%' ))h
ON g.sid = h.sid AND g.cid = h.cid AND g.sem = h.sem AND g.ctype = h.ctype
GROUP BY sid,cid,sem,ctype
union union
select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance, SELECT g.ID, g.sid,g.cid,g.sem,g.branch, g.fid, g.ctype, g.ctype, g.issuedate, h.rcvedate, concat(g.acmts,' ; ',h.acmts)as acmts,h.balance,g.mdate FROM
if(ListName = 'ISSUED TO STUDENT', AppDate,'-') as issuedate,if(ListName = 'ISSUED TO STUDENT', ListName,'-') as istatus, (SELECT a.ID,a.StudentID AS sid,a.CourseID AS cid,sfs.BranchCode AS branch,sfs.FeesID AS fid,'-' AS sem, a.CertificationType AS ctype,AppDate AS mdate,bal.balpayable AS balance,
if(ListName = 'RECEIVED', AppDate,'-') as rcvedate,if(ListName = 'RECEIVED', ListName,'-') as rstatus,a.Comments as acmts AppDate AS issuedate, ListName AS istatus, a.Comments AS acmts
from T_ApplicationStatus a FROM T_ApplicationStatus a
left join LEFT JOIN
T_Students_Fees_Status sfs on sfs.StudentID=a.StudentID and sfs.CourseID=a.CourseID T_Students_Fees_Status sfs ON sfs.StudentID=a.StudentID AND sfs.CourseID=a.CourseID
left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType LEFT JOIN T_PickListDetails `list` ON list.ListCode=a.ListCode
left join T_PickListDetails list on list.ListCode=a.ListCode LEFT JOIN (SELECT student, course, feestype, sum(balpayable) balpayable FROM BalFees GROUP BY student, course, feestype) bal ON bal.student=a.StudentID AND bal.course=a.CourseID AND bal.feestype = a.CertificationType
left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID WHERE a.CertificationType NOT LIKE 'CERT%'
where cm.CertificateName not like 'APPLICATION%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a AND list.ListName LIKE 'ISSUED TO STUDENT') g
left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType LEFT JOIN
group by a.StudentID,a.CourseID,a.CertificationType,cm.CertificateName) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' ) (SELECT a.ID,a.StudentID AS sid,a.CourseID AS cid,sfs.BranchCode AS branch,sfs.FeesID AS fid,'-' AS sem, a.CertificationType AS ctype,AppDate AS mdate,bal.balpayable AS balance,
group by sid,cid,ctype AppDate AS rcvedate, ListName AS rstatus,a.Comments AS acmts
union FROM T_ApplicationStatus a
select a.ID,a.StudentID as sid,a.CourseID as cid,sfs.BranchCode as branch,sfs.FeesID as fid,'-' as sem,ifnull(cm.CertificateName,a.CertificationType) as certname,a.CertificationType as ctype,AppDate as mdate,bal.balpayable as balance, LEFT JOIN
if(ListName = 'ISSUED TO STUDENT', AppDate,'-') as issuedate,if(ListName = 'ISSUED TO STUDENT', ListName,'-') as istatus, T_Students_Fees_Status sfs ON sfs.StudentID=a.StudentID AND sfs.CourseID=a.CourseID
if(ListName = 'RECEIVED', AppDate,'-') as rcvedate,if(ListName = 'RECEIVED', ListName,'-') as rstatus,a.Comments as acmts LEFT JOIN T_PickListDetails `list` ON list.ListCode=a.ListCode
from T_ApplicationStatus a LEFT JOIN (SELECT student, course, feestype, sum(balpayable) balpayable FROM BalFees GROUP BY student, course, feestype) bal ON bal.student=a.StudentID AND bal.course=a.CourseID AND bal.feestype = a.CertificationType
left join WHERE a.CertificationType NOT LIKE 'CERT%'
T_Students_Fees_Status sfs on sfs.StudentID=a.StudentID and sfs.CourseID=a.CourseID AND list.ListName LIKE 'RECEIVED%')h
left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType ON g.sid = h.sid AND g.cid = h.cid AND g.sem = h.sem AND g.ctype = h.ctype
left join T_PickListDetails list on list.ListCode=a.ListCode GROUP BY sid,cid,sem,ctype
left join (select student, course, sum(balpayable) balpayable from BalFees group by student, course) bal on bal.student=a.StudentID and bal.course=a.CourseID
where a.CertificationType not like 'CERT%' and a.ID in (select Max(a.ID) from T_ApplicationStatus a
left join T_CertificationMaster cm on cm.CertificationID=a.CertificationType
group by a.StudentID,a.CourseID,a.CertificationType,cm.CertificateName,a.ListCode) and (list.ListName like 'ISSUED TO STUDENT' or list.ListName like 'RECEIVED%' )
group by sid,cid,ctype
) as sms ) as sms
left join left join
(SELECT FeesID as fid,BatchCode as batch,StudentID as sid,CourseID as cid,FeesType as ftype,sum(CourseFees) as cf,Sum(STFOrWR) as stf,sum(Others) as others (SELECT FeesID as fid,BatchCode as batch,StudentID as sid,CourseID as cid,FeesType as ftype,sum(CourseFees) as cf,Sum(STFOrWR) as stf,sum(Others) as others
@ -349,8 +453,8 @@ left join
(SELECT StudentID as sid,MobileNumber as phone,IsActive as active,concat(FirstName,' ',Lastname) as name,Fathername as father,PermanentAddress as address,AlternateNumber FROM T_StudentDetails) as std on std.sid=sms.sid (SELECT StudentID as sid,MobileNumber as phone,IsActive as active,concat(FirstName,' ',Lastname) as name,Fathername as father,PermanentAddress as address,AlternateNumber FROM T_StudentDetails) as std on std.sid=sms.sid
left join left join
(SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,EnrollmentID as eid,BranchID as branch FROM T_Student_CourseDetails) as scd on scd.sid=sms.sid and scd.cid=sms.cid
where sms.branch = '".$br."' where sms.branch = '".$br."' ";
";
if ($bat!= ''){ if ($bat!= ''){
@ -379,7 +483,7 @@ left join
} }
//echo $sql; // echo $sql;
$leadDet=$this->db->query($sql); $leadDet=$this->db->query($sql);
$mcert_statusDetails = $leadDet->result(); $mcert_statusDetails = $leadDet->result();

View File

@ -69,7 +69,7 @@ class Reregister_model extends CI_Model
$tempUniversityID = $UID['universityID']; $tempUniversityID = $UID['universityID'];
// Find Nxt Available Batch
$sql = "SELECT * FROM T_BatchMaster where isActive = 1 and UniversityID = ? and BranchCode = ? and str_to_date(BatchDate,'%d-%m-%Y') > str_to_date(?,'%d-%m-%Y') order by str_to_date(BatchDate,'%d-%m-%Y') asc limit 1"; $sql = "SELECT * FROM T_BatchMaster where isActive = 1 and UniversityID = ? and BranchCode = ? and str_to_date(BatchDate,'%d-%m-%Y') > str_to_date(?,'%d-%m-%Y') order by str_to_date(BatchDate,'%d-%m-%Y') asc limit 1";
$res2 = $this->db->query($sql,array($UID['universityID'],$branchId,date_format(date_create($batchDate),'d-m-Y'))); $res2 = $this->db->query($sql,array($UID['universityID'],$branchId,date_format(date_create($batchDate),'d-m-Y')));
@ -78,6 +78,7 @@ class Reregister_model extends CI_Model
//echo $data['nextBatch'][0]->BatchCode; //echo $data['nextBatch'][0]->BatchCode;
// Get STudnet List
$this->db->select("T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,max(T_Course_Fees_Details.Sem_Year) as current_sem,T_CourseMaster.CourseID,T_CourseMaster.CourseCode,T_CourseMaster.CourseName,max(T_Session_Master.SessionID) as SessionID,T_Students_Fees_Status.FeesType"); $this->db->select("T_StudentDetails.StudentID,T_StudentDetails.MobileNumber,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_StudentDetails.EmailID,max(T_Course_Fees_Details.Sem_Year) as current_sem,T_CourseMaster.CourseID,T_CourseMaster.CourseCode,T_CourseMaster.CourseName,max(T_Session_Master.SessionID) as SessionID,T_Students_Fees_Status.FeesType");
$this->db->from("T_Students_Fees_Status"); $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("T_StudentDetails","T_Students_Fees_Status.StudentID = T_StudentDetails.StudentID and T_StudentDetails.IsActive = 1");
@ -92,11 +93,14 @@ class Reregister_model extends CI_Model
$this->db->group_by("T_StudentDetails.StudentID"); $this->db->group_by("T_StudentDetails.StudentID");
$res = $this->db->get(); $res = $this->db->get();
$data['studentListOne'] = $res->result(); $data['studentListOne'] = $res->result();
//print_r($data['studentListOne']); // print_r($data['studentListOne']);
$data['finalStudentList'] = array(); $data['finalStudentList'] = array();
// print_r($data['studentListOne']);die(); print_r($data['studentListOne']);die();
//print_r($this->db->last_query());die(); print_r($this->db->last_query());die();
// Find current sem or Year and it's feesAmount
foreach($data['studentListOne'] as $student) foreach($data['studentListOne'] as $student)
{ {
@ -113,10 +117,13 @@ class Reregister_model extends CI_Model
$this->db->trans_complete(); $this->db->trans_complete();
$sesstionDetails = $sesstionDetails ->result_array(); $sesstionDetails = $sesstionDetails ->result_array();
//print_r($sesstionDetails);die(); //print_r($sesstionDetails);die();
//FIND OUT NEXT SEM NUMBER OR YEAR NUMBER
//FIND OUT NEXT SEM NUMBER OR YEAR NUMBER
$string = $student->current_sem; $string = $student->current_sem;
$string = str_replace(' ','',$string); $string = str_replace(' ','',$string);
$string = strtoupper($string); $string = strtoupper($string);
$next_sem = ""; $next_sem = "";
$sempos = strpos($string,"SEM"); $sempos = strpos($string,"SEM");
@ -137,9 +144,8 @@ class Reregister_model extends CI_Model
} }
//print_r($this->db->last_query());die(); //print_r($this->db->last_query());die();
//FIND OUT FEESTYPE ID //FIND OUT FEESTYPE ID
$sem = $next_sem; $sem = $next_sem;
$sem = '%'.(substr_replace($sem, '%', -1, 0)).'%'; $sem = '%'.(substr_replace($sem, '%', -1, 0)).'%';
$sql = "SELECT ID,FeesAmount FROM T_Course_Fees_Details where CourseID = ? and ProgramType = 'Y001' and FeesType = 'F002' and Sem_Year like ?"; $sql = "SELECT ID,FeesAmount FROM T_Course_Fees_Details where CourseID = ? and ProgramType = 'Y001' and FeesType = 'F002' and Sem_Year like ?";
@ -162,7 +168,7 @@ class Reregister_model extends CI_Model
$this->db->where('T_Students_Fees_Status.FeesType',$feesID); $this->db->where('T_Students_Fees_Status.FeesType',$feesID);
$res = $this->db->get(); $res = $this->db->get();
$res = $res->result_array(); $res = $res->result_array();
// print_r($this->db->last_query());die(); // print_r($this->db->last_query());die();
// print_r($res); // print_r($res);
if($res[0]['feescount'] == 0) if($res[0]['feescount'] == 0)
{ {
@ -183,11 +189,13 @@ class Reregister_model extends CI_Model
$tempArray['SessionName'] = $sesstionDetails[0]['SessionName']; $tempArray['SessionName'] = $sesstionDetails[0]['SessionName'];
$tempArray['SessionDate'] = $sesstionDetails[0]['SessionDate']; $tempArray['SessionDate'] = $sesstionDetails[0]['SessionDate'];
// Find nxt session
$sqlquery ="SELECT SessionID,SessionName FROM T_Session_Master where BranchCode = ? $sqlquery ="SELECT SessionID,SessionName FROM T_Session_Master where BranchCode = ?
and str_to_date(SessionDate,'%d-%m-%Y') > str_to_date(?,'%d-%m-%Y') order by str_to_date(SessionDate,'%d-%m-%Y') asc limit 1"; and str_to_date(SessionDate,'%d-%m-%Y') > str_to_date(?,'%d-%m-%Y') order by str_to_date(SessionDate,'%d-%m-%Y') asc limit 1";
$tempResult = $this->db->query($sqlquery,array($branchId,$tempArray['SessionDate'])); $tempResult = $this->db->query($sqlquery,array($branchId,$tempArray['SessionDate']));
$tempResult = $tempResult->result(); $tempResult = $tempResult->result();
//echo $this->db->last_query(); // echo $this->db->last_query();
// print_r($tempResult[0]);die(); // print_r($tempResult[0]);die();
// if($tempResult[0]){ // if($tempResult[0]){
// $tempArray['nextSessionName'] = $tempResult[0]->SessionName; // $tempArray['nextSessionName'] = $tempResult[0]->SessionName;

View File

@ -141,7 +141,7 @@
<thead> <thead>
<tr> <tr>
<th><input type="checkbox" ng-model="myModel.all" id="all" name="all" ng-click="isCheckAll($event);"></th> <th><input type="checkbox" style="margin-right: 20px;" ng-model="myModel.all" id="all" name="all" ng-click="isCheckAll($event);"></th>
<th>SL.No</th> <th>SL.No</th>
<th>Student Name</th> <th>Student Name</th>
<th>Father Name</th> <th>Father Name</th>
@ -149,9 +149,9 @@
<th>Course</th> <th>Course</th>
<th>Sem/Year</th> <th>Sem/Year</th>
<th>Certificates Name</th> <th>Certificates Name</th>
<th>Received Status</th> <!-- <th>Received Status</th> -->
<th>Received Date</th> <th>Received Date</th>
<th>Issued Status</th> <!-- <th>Issued Status</th> -->
<th>Issued Date</th> <th>Issued Date</th>
<th>Certificate Issued Comments</th> <th>Certificate Issued Comments</th>
<th>Balance Fee</th> <th>Balance Fee</th>
@ -160,7 +160,7 @@
</thead> </thead>
<tbody> <tbody>
<tr dir-paginate="p in mark_cert_data|filter:search:strict|itemsPerPage:10" current-page="currentPage"> <tr dir-paginate="p in mark_cert_data|filter:search:strict|itemsPerPage:10" current-page="currentPage">
<td><input type="checkbox" ng-checked="myModel.all" id="{{p.sid}}" name="{{p.sid}}" class="form-control" ng-click="isClick($event);" /></td> <td><input type="checkbox" style = "height:15px;" ng-checked="myModel.all" id="{{p.sid}}" name="{{p.sid}}" class="form-control" ng-click="isClick($event);" /></td>
<td>{{10 * (currentPage-1)+$index+1}}</td> <td>{{10 * (currentPage-1)+$index+1}}</td>
<td><a tooltip="View Student" class="text-dark" ng-click="open(p);">{{p.Student_name}}</a></td> <td><a tooltip="View Student" class="text-dark" ng-click="open(p);">{{p.Student_name}}</a></td>
<td>{{p.Father_name}}</td> <td>{{p.Father_name}}</td>
@ -168,9 +168,9 @@
<td>{{p.Course_name}}</td> <td>{{p.Course_name}}</td>
<td>{{p.Sem_year}}</td> <td>{{p.Sem_year}}</td>
<td>{{p.Certificate_name}}</td> <td>{{p.Certificate_name}}</td>
<td>{{p.rstatus}}</td> <!-- <td>{{p.rstatus}}</td> -->
<td>{{p.rdate}}</td> <td>{{p.rdate}}</td>
<td>{{p.istatus}}</td> <!-- <td>{{p.istatus}}</td> -->
<td>{{p.issuedate}}</td> <td>{{p.issuedate}}</td>
<td>{{p.acmts}}</td> <td>{{p.acmts}}</td>
<td style="text-align:right;">{{p.Balance_fee}}</td> <td style="text-align:right;">{{p.Balance_fee}}</td>