Dashboard changes
This commit is contained in:
parent
a7129dfdde
commit
485ddbdf1a
@ -132,8 +132,8 @@ class Dashboard_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
public function getleadCountMonth_post(){
|
||||
$data = $this->post('data');
|
||||
$getleadCountMonth = $this->dashboard_model->leadCountMonth();
|
||||
$branchId = $this->post('branchId');
|
||||
$getleadCountMonth = $this->dashboard_model->leadCountMonth( $branchId);
|
||||
if ($getleadCountMonth) {
|
||||
$getleadCountMonth['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
@ -149,8 +149,8 @@ class Dashboard_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
public function getleadCountDayClosed_post(){
|
||||
$data = $this->post('data');
|
||||
$getleadCountDayClosed = $this->dashboard_model->leadCountDayClosed();
|
||||
$branchId = $this->post('branchId');
|
||||
$getleadCountDayClosed = $this->dashboard_model->leadCountDayClosed($branchId);
|
||||
if ($getleadCountDayClosed) {
|
||||
$getleadCountDayClosed['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
@ -166,8 +166,8 @@ class Dashboard_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
public function getleadCountMonthClosed_post(){
|
||||
$data = $this->post('data');
|
||||
$getleadCountMonthClosed = $this->dashboard_model->leadCountMonthClosed();
|
||||
$branchId = $this->post('branchId');
|
||||
$getleadCountMonthClosed = $this->dashboard_model->leadCountMonthClosed( $branchId);
|
||||
if ($getleadCountMonthClosed) {
|
||||
$getleadCountMonthClosed['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
@ -341,8 +341,10 @@ class Dashboard_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
public function admissionYear_post(){
|
||||
$data = $this->post('data');
|
||||
$admissionYear = $this->dashboard_model->admissionYear();
|
||||
$fyear = $this->post('fyear');
|
||||
$univ = $this->post('univ');
|
||||
$branchId = $this->post('branchId');
|
||||
$admissionYear = $this->dashboard_model->admissionYear( $fyear, $univ, $branchId);
|
||||
if ($admissionYear) {
|
||||
$admissionYear['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
@ -358,8 +360,9 @@ class Dashboard_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
public function feeOutstanding_post(){
|
||||
$data = $this->post('data');
|
||||
$feeOutstanding = $this->dashboard_model->feeOutstanding();
|
||||
$branchId = $this->post('branchId');
|
||||
$univ = $this->post('univ');
|
||||
$feeOutstanding = $this->dashboard_model->feeOutstanding($branchId, $univ);
|
||||
if ($feeOutstanding) {
|
||||
$feeOutstanding['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
@ -411,8 +414,9 @@ class Dashboard_Controller extends REST_Controller {
|
||||
}
|
||||
}
|
||||
public function admissionBatch_post(){
|
||||
$branchId = $this->post('branchId');
|
||||
$univ = $this->post('univ');
|
||||
$admissionBatch = $this->dashboard_model->admissionBatch($univ);
|
||||
$admissionBatch = $this->dashboard_model->admissionBatch($univ,$branchId);
|
||||
if ($admissionBatch) {
|
||||
$admissionBatch['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
|
||||
@ -213,9 +213,16 @@ class Dashboard_model extends CI_Model
|
||||
|
||||
}
|
||||
public function leadCountDay($branchId){
|
||||
$ltsql = "select count(distinct TrackingID) as count from T_Lead_Tracking_Followup ltf
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) ";
|
||||
$ltsql = "select count(InteractionID) as count
|
||||
from T_Lead_Tracking_Followup as ltf
|
||||
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
|
||||
join T_Login l on l.ID=lt.AssignedTo
|
||||
join T_StaffDetails sd on sd.StaffID=l.StaffID
|
||||
left join T_Lead_Details ld on ld.LeadID=lt.LeadID
|
||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)
|
||||
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and sd.BranchCode = '".$branchId."' ";
|
||||
$ltCount=$this->db->query($ltsql);
|
||||
$lcount = $ltCount->result();
|
||||
|
||||
@ -230,10 +237,17 @@ if (count($lcount) > 0) {
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function leadCountMonth(){
|
||||
$ltsql = "select count(distinct TrackingID) as count from T_Lead_Tracking_Followup ltf
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)";
|
||||
public function leadCountMonth($branchId){
|
||||
$ltsql = "select count(InteractionID) as count
|
||||
from T_Lead_Tracking_Followup as ltf
|
||||
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
|
||||
join T_Login l on l.ID=lt.AssignedTo
|
||||
join T_StaffDetails sd on sd.StaffID=l.StaffID
|
||||
left join T_Lead_Details ld on ld.LeadID=lt.LeadID
|
||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)
|
||||
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and sd.BranchCode = '".$branchId."' ";
|
||||
$ltCount=$this->db->query($ltsql);
|
||||
$lcount = $ltCount->result();
|
||||
|
||||
@ -247,10 +261,17 @@ public function leadCountMonth(){
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function leadCountDayClosed(){
|
||||
$ltsql = "select count(distinct TrackingID) as count from T_Lead_Tracking_Followup ltf
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and list.ListName like 'CLOSE' and InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)";
|
||||
public function leadCountDayClosed($branchId){
|
||||
$ltsql = "select count(InteractionID) as count
|
||||
from T_Lead_Tracking_Followup as ltf
|
||||
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
|
||||
join T_Login l on l.ID=lt.AssignedTo
|
||||
join T_StaffDetails sd on sd.StaffID=l.StaffID
|
||||
left join T_Lead_Details ld on ld.LeadID=lt.LeadID
|
||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)
|
||||
and date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and sd.BranchCode = '".$branchId."' ";
|
||||
$ltCount=$this->db->query($ltsql);
|
||||
$lcount = $ltCount->result();
|
||||
|
||||
@ -265,10 +286,17 @@ public function leadCountMonth(){
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function leadCountMonthClosed(){
|
||||
$ltsql = "select count(distinct TrackingID) as count from T_Lead_Tracking_Followup ltf
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and list.ListName like 'CLOSE' and InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)";
|
||||
public function leadCountMonthClosed($branchId){
|
||||
$ltsql = "select count(InteractionID) as count
|
||||
from T_Lead_Tracking_Followup as ltf
|
||||
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
|
||||
join T_Login l on l.ID=lt.AssignedTo
|
||||
join T_StaffDetails sd on sd.StaffID=l.StaffID
|
||||
left join T_Lead_Details ld on ld.LeadID=lt.LeadID
|
||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||
where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)
|
||||
and month(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and sd.BranchCode = '".$branchId."' ";
|
||||
$ltCount=$this->db->query($ltsql);
|
||||
$lcount = $ltCount->result();
|
||||
|
||||
@ -508,8 +536,60 @@ public function leadCountMonth(){
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function admissionMonth(){
|
||||
$sql = "SELECT * FROM admission_month ";
|
||||
public function admissionMonth($year = null,$month = null){
|
||||
$sql = "select UniversityID as uid,university,
|
||||
SUM(IF((wc.week_of_month = 1), wc.tot_cnt,0)) AS week1,
|
||||
SUM(IF((wc.week_of_month = 2), wc.tot_cnt,0)) AS week2,
|
||||
SUM(IF((wc.week_of_month = 3), wc.tot_cnt,0)) AS week3,
|
||||
SUM(IF((wc.week_of_month = 4), wc.tot_cnt,0)) AS week4,
|
||||
SUM(IF((wc.week_of_month = 5), wc.tot_cnt,0)) AS week5,
|
||||
sum(tot_cnt) as total,
|
||||
group_concat(AdmittedBy,'-',tot_cnt separator ',') as AdmissionTakenBy
|
||||
from (SELECT
|
||||
scd.UniversityID AS UniversityID,
|
||||
um.UniversityName as university,
|
||||
std.CreatedOn AS cdate,
|
||||
std.AdmittedBy AS AdmittedBy,
|
||||
(FLOOR(((DAYOFMONTH(std.CreatedOn) - 1) / 7)) + 1) AS week_of_month,
|
||||
COUNT(scd.StudentID) AS tot_cnt
|
||||
FROM
|
||||
T_StudentDetails std
|
||||
JOIN getUniv scd ON scd.StudentID = std.StudentID
|
||||
left join T_UniversityMaster um on um.UniversityID = scd.UniversityID
|
||||
WHERE
|
||||
std.AdmittedBy IS NOT NULL
|
||||
AND YEAR(std.CreatedOn) = YEAR(NOW())
|
||||
AND MONTH(std.CreatedOn) = MONTH(NOW())
|
||||
GROUP BY scd.UniversityID , std.AdmittedBy) wc
|
||||
group by uid ";
|
||||
|
||||
if ($year != '' and $month != '') {
|
||||
$sql = "select UniversityID as uid,university,
|
||||
SUM(IF((wc.week_of_month = 1), wc.tot_cnt,0)) AS week1,
|
||||
SUM(IF((wc.week_of_month = 2), wc.tot_cnt,0)) AS week2,
|
||||
SUM(IF((wc.week_of_month = 3), wc.tot_cnt,0)) AS week3,
|
||||
SUM(IF((wc.week_of_month = 4), wc.tot_cnt,0)) AS week4,
|
||||
SUM(IF((wc.week_of_month = 5), wc.tot_cnt,0)) AS week5,
|
||||
sum(tot_cnt) as total,
|
||||
group_concat(AdmittedBy,'-',tot_cnt separator ',') as AdmissionTakenBy
|
||||
from (SELECT
|
||||
scd.UniversityID AS UniversityID,
|
||||
um.UniversityName as university,
|
||||
std.CreatedOn AS cdate,
|
||||
std.AdmittedBy AS AdmittedBy,
|
||||
(FLOOR(((DAYOFMONTH(std.CreatedOn) - 1) / 7)) + 1) AS week_of_month,
|
||||
COUNT(scd.StudentID) AS tot_cnt
|
||||
FROM
|
||||
T_StudentDetails std
|
||||
JOIN getUniv scd ON scd.StudentID = std.StudentID
|
||||
left join T_UniversityMaster um on um.UniversityID = scd.UniversityID
|
||||
WHERE
|
||||
std.AdmittedBy IS NOT NULL
|
||||
AND YEAR(std.CreatedOn) = '".$year."'
|
||||
AND MONTH(std.CreatedOn) = '".$month."'
|
||||
GROUP BY scd.UniversityID , std.AdmittedBy) wc
|
||||
group by uid ";
|
||||
}
|
||||
$ltd=$this->db->query($sql);
|
||||
$tlead = $ltd->result();
|
||||
if (count($tlead) > 0) {
|
||||
@ -522,7 +602,7 @@ public function leadCountMonth(){
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function admissionYear(){
|
||||
public function admissionYear( $fyear = null, $univ = null, $branchId = null){
|
||||
if (date('m') >= 4) {
|
||||
$yearl = date('Y').'-'.(date('Y')+1);
|
||||
} else {
|
||||
@ -531,8 +611,8 @@ public function leadCountMonth(){
|
||||
$ab=$yearl;
|
||||
$fa=substr($ab,0,-5);
|
||||
$aa=substr($ab,5,5);
|
||||
|
||||
$sql = "SELECT month(std.CreatedOn),
|
||||
|
||||
$sql = " SELECT month(std.CreatedOn),
|
||||
std.AdmittedBy AS AdmittedBy,
|
||||
um.UniversityName AS university,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 6), 1, 0)) AS June,
|
||||
@ -552,13 +632,76 @@ public function leadCountMonth(){
|
||||
FROM
|
||||
T_StudentDetails std
|
||||
JOIN getUniYear scd ON scd.StudentID = std.StudentID
|
||||
JOIN staff_count sc ON sc.UniversityID = scd.UniversityID
|
||||
JOIN (select UniversityID,AdmittedBy,cnt,sname,group_concat(sname,'-',cnt) as staf from (SELECT scd.UniversityID AS UniversityID,
|
||||
std.BranchCode,
|
||||
std.CreatedOn,
|
||||
COUNT(std.StudentID) AS cnt,
|
||||
IFNULL(std.AdmittedBy, '-') AS AdmittedBy,
|
||||
CONCAT(sd.Firstname, sd.Lastname) AS sname
|
||||
FROM
|
||||
T_StudentDetails std
|
||||
left JOIN T_Student_CourseDetails scd ON scd.StudentID = std.StudentID
|
||||
JOIN T_StaffDetails sd ON sd.StaffID = std.AdmittedBy
|
||||
WHERE
|
||||
std.AdmittedBy IS NOT NULL and std.BranchCode = '".$branchId."' and (date(std.CreatedOn) >= '".$fa."-06-01' and date(std.CreatedOn) <= '".$aa."-05-31')
|
||||
GROUP BY std.AdmittedBy , scd.UniversityID) a group by UniversityID,AdmittedBy ) sc ON sc.UniversityID = scd.UniversityID
|
||||
AND sc.AdmittedBy = std.AdmittedBy
|
||||
LEFT JOIN T_UniversityMaster um ON um.UniversityID = scd.UniversityID
|
||||
WHERE
|
||||
std.AdmittedBy IS NOT NULL and (date(std.CreatedOn) >= '".$fa."-06-01' and date(std.CreatedOn) <= '".$aa."-05-31')";
|
||||
std.AdmittedBy IS NOT NULL and std.BranchCode = '".$branchId."' and (date(std.CreatedOn) >= '".$fa."-06-01' and date(std.CreatedOn) <= '".$aa."-05-31')
|
||||
GROUP BY scd.UniversityID ";
|
||||
|
||||
$sql.=" GROUP BY scd.UniversityID";
|
||||
if($fyear != ''){
|
||||
// print_r($fyear);
|
||||
$ab=$fyear;
|
||||
$fa1 = substr($ab,0,-5);
|
||||
$aa1 = substr($ab,5,5);
|
||||
|
||||
$sql =" SELECT month(std.CreatedOn),
|
||||
std.AdmittedBy AS AdmittedBy,
|
||||
um.UniversityName AS university,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 6), 1, 0)) AS June,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 7), 1, 0)) AS July,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 8), 1, 0)) AS August,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 9), 1, 0)) AS September,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 10), 1, 0)) AS October,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 11), 1, 0)) AS November,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 12), 1, 0)) AS December,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 1), 1, 0)) AS January,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 2), 1, 0)) AS February,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 3), 1, 0)) AS March,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 4), 1, 0)) AS April,
|
||||
SUM(IF((MONTH(std.CreatedOn) = 5), 1, 0)) AS May,
|
||||
COUNT(DISTINCT std.StudentID) AS total,
|
||||
GROUP_CONCAT(DISTINCT sc.sname, '-', sc.cnt SEPARATOR ';') AS AdmissionTakenBy
|
||||
FROM
|
||||
T_StudentDetails std
|
||||
JOIN getUniYear scd ON scd.StudentID = std.StudentID
|
||||
JOIN (select UniversityID,AdmittedBy,cnt,sname,group_concat(sname,'-',cnt) as staf from (SELECT scd.UniversityID AS UniversityID,
|
||||
std.BranchCode,
|
||||
std.CreatedOn,
|
||||
COUNT( distinct std.StudentID) AS cnt,
|
||||
IFNULL(std.AdmittedBy, '-') AS AdmittedBy,
|
||||
CONCAT(sd.Firstname, sd.Lastname) AS sname
|
||||
FROM
|
||||
T_StudentDetails std
|
||||
left JOIN T_Student_CourseDetails scd ON scd.StudentID = std.StudentID
|
||||
JOIN T_StaffDetails sd ON sd.StaffID = std.AdmittedBy
|
||||
WHERE
|
||||
std.AdmittedBy IS NOT NULL and std.BranchCode = '".$branchId."' and (date(std.CreatedOn) >= '".$fa1."-06-01' and date(std.CreatedOn) <= '".$aa1."-05-31')
|
||||
GROUP BY std.AdmittedBy , scd.UniversityID) a group by UniversityID,AdmittedBy ) sc ON sc.UniversityID = scd.UniversityID
|
||||
AND sc.AdmittedBy = std.AdmittedBy
|
||||
LEFT JOIN T_UniversityMaster um ON um.UniversityID = scd.UniversityID
|
||||
WHERE
|
||||
std.AdmittedBy IS NOT NULL and std.BranchCode = '".$branchId."' and (date(std.CreatedOn) >= '".$fa1."-06-01' and date(std.CreatedOn) <= '".$aa1."-05-31')
|
||||
GROUP BY scd.UniversityID ";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// print_r($fa);
|
||||
// print_r($aa);
|
||||
//print_r($sql);
|
||||
$ltd=$this->db->query($sql);
|
||||
$tlead = $ltd->result();
|
||||
if (count($tlead) > 0) {
|
||||
@ -571,13 +714,45 @@ public function leadCountMonth(){
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function feeOutstanding(){
|
||||
$sql = "select b.bcode,b.Batches,sum(b.totalpayable) as TotalPayableFee,sum(b.totalpaid) as TotalPaidFee,sum(b.balpayable) as TotalBalance,round(ifnull(((sum(b.balpayable)/sum(b.totalpayable))*100),0),2) as BalancePercentage,
|
||||
scb.staff as BalancePercentageByStaff
|
||||
from BalFees b
|
||||
left join (select bcode,sum(totalpayable) as tot,sum(totalpaid) as paid,sum(balpayable) as balance,((sum(balpayable)/sum(totalpayable)) * 100) as balPercentage,group_concat(staff,'-',bal_percentage) as staff from staff_count_batch
|
||||
group by bcode) scb on scb.bcode = b.bcode
|
||||
group by b.bcode ";
|
||||
|
||||
|
||||
|
||||
public function feeOutstanding($branchId = null, $univ = null){
|
||||
$sql = "select bcode,Batches,uid,staff,admittedby,sum(totalpayable) as TotalPayableFee,sum(totalpaid) as TotalPaidFee,(sum(totalpayable) - sum(totalpaid)) as TotalBalance,
|
||||
round((((sum(totalpayable) - sum(totalpaid)) / sum(totalpayable)) * 100),0) as BalancePercentage,
|
||||
group_concat(staff,'-',bal_percentage separator ',') as BalancePercentageByStaff
|
||||
from
|
||||
(SELECT
|
||||
a.BatchCode AS bcode,
|
||||
bm.UniversityID AS uid,
|
||||
bm.BatchName as Batches,
|
||||
IFNULL(std.AdmittedBy, '-') AS admittedby,
|
||||
IFNULL(CONCAT(sd.Firstname, sd.Lastname),
|
||||
'-') AS staff,
|
||||
SUM((((a.CourseFees + a.STFOrWR) + a.Waiver) + a.Others)) AS totalpayable,
|
||||
IFNULL(SUM(bb.BillAmount), 0) AS totalpaid,
|
||||
(SUM((((a.CourseFees + a.STFOrWR) + a.Waiver) + a.Others)) - IFNULL(SUM(bb.BillAmount), 0)) AS balpayable,
|
||||
ROUND((((SUM((((a.CourseFees + a.STFOrWR) + a.Waiver) + a.Others)) - IFNULL(SUM(bb.BillAmount), 0)) / SUM((((a.CourseFees + a.STFOrWR) + a.Waiver) + a.Others))) * 100),
|
||||
0) AS bal_percentage
|
||||
FROM
|
||||
T_Students_Fees_Status a
|
||||
LEFT JOIN BalFeesChild bb ON a.FeesID = bb.FeesId
|
||||
LEFT JOIN T_Course_Fees_Details c ON c.ID = a.FeesType
|
||||
LEFT JOIN T_StudentDetails std ON std.StudentID = a.StudentID
|
||||
LEFT JOIN T_StaffDetails sd ON sd.StaffID = std.AdmittedBy
|
||||
LEFT JOIN T_BatchMaster bm ON bm.BatchCode = a.BatchCode
|
||||
where a.BranchCode = '".$branchId."'
|
||||
GROUP BY std.AdmittedBy , bcode) b
|
||||
|
||||
|
||||
";
|
||||
|
||||
if($univ != ''){
|
||||
$sql.= " where uid = '".$univ."' ";
|
||||
}
|
||||
|
||||
$sql.= " group by bcode ";
|
||||
//print_r($sql);
|
||||
$ltd=$this->db->query($sql);
|
||||
$tlead = $ltd->result();
|
||||
if (count($tlead) > 0) {
|
||||
@ -666,14 +841,14 @@ group by bcode) scb on scb.bcode = b.bcode
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function admissionBatch($univ = null){
|
||||
public function admissionBatch($univ = null, $branchId = null){
|
||||
$sql = "SELECT sfs.BatchCode as bcode,scd.UniversityID as uid,ifnull(bm.BatchName,'-') as Batches,month(std.CreatedOn),ifnull(concat(sd.Firstname,' ',sd.Lastname),'-') as Staff,ifnull(std.AdmittedBy,'-') as admittedby,count(distinct std.StudentID) as TotalNoOfAdmissions
|
||||
FROM T_StudentDetails std
|
||||
join T_Student_CourseDetails scd on scd.StudentID = std.StudentID
|
||||
left join T_Students_Fees_Status sfs on sfs.StudentID =scd.StudentID and sfs.CourseID = scd.CourseID
|
||||
left join T_BatchMaster bm on bm.BatchCode = sfs.BatchCode
|
||||
left join T_StaffDetails sd on sd.StaffID = std.AdmittedBy
|
||||
where year(std.CreatedOn) = year(now())
|
||||
where year(std.CreatedOn) = year(now()) and std.BranchCode = '".$branchId."'
|
||||
";
|
||||
|
||||
if($univ != ''){
|
||||
@ -707,12 +882,21 @@ group by bcode) scb on scb.bcode = b.bcode
|
||||
$usql = "select UniversityID,UniversityName from T_UniversityMaster ";
|
||||
$uf=$this->db->query($usql);
|
||||
$univf = $uf->result();
|
||||
//get fiscal
|
||||
$ysql = "SELECT CASE WHEN MONTH(CreatedOn)>=6 THEN
|
||||
concat(YEAR(CreatedOn), '-',YEAR(CreatedOn)+1)
|
||||
ELSE concat(YEAR(CreatedOn)-1,'-', YEAR(CreatedOn)) END AS fy
|
||||
FROM T_StudentDetails
|
||||
GROUP BY fy ";
|
||||
$yf=$this->db->query($ysql);
|
||||
$univyf = $yf->result();
|
||||
|
||||
if (count($year) > 0) {
|
||||
$results['yearList'] = true;
|
||||
$results['year'] = $year;
|
||||
$results['branch'] = $branchf;
|
||||
$results['univ'] = $univf;
|
||||
$results['fyr'] = $univyf;
|
||||
} else {
|
||||
$results['yearList'] = false;
|
||||
$results['message'] = 'No record found';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -34,11 +34,7 @@
|
||||
<h5 class="text-dark">No Leads!</h5>
|
||||
</center>
|
||||
</div>
|
||||
<!-- <div class="cl-effect-13" style="float: right" ng-if="lt==false">
|
||||
<a ui-sref="app.call.tracking">
|
||||
view more
|
||||
</a>
|
||||
</div><br> -->
|
||||
|
||||
<div dx-data-grid="todayLead" ng-if="lt==false"></div>
|
||||
|
||||
<!-- <table class="table table-hover no-margin" ng-if="lt==false">
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<tab heading="Admissions-Month : {{adMonth.length}}" class="padding-top-5 padding-left-5">
|
||||
<div ng-if="getLoginType=='R004' || getLoginType=='R003'" class="panel-scroll height-500" perfect-scrollbar wheel-propagation="false"
|
||||
suppress-scroll-x="true">
|
||||
<!-- <div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>
|
||||
Year
|
||||
@ -76,13 +76,13 @@
|
||||
<div class="col-md-2" style="padding-top: 2.3%;">
|
||||
<div >
|
||||
|
||||
<button type="submit" class="btn btn-success btn-o" ng-click = "getFilteredData()" tabindex="8">
|
||||
<button type="submit" class="btn btn-success btn-o" ng-click = "fbwFilter()" tabindex="8">
|
||||
Submit
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div ng-if="ad==true">
|
||||
<center>
|
||||
<h5 class="text-dark">No Admissions!</h5>
|
||||
@ -94,36 +94,7 @@
|
||||
</a>
|
||||
</div> -->
|
||||
<div dx-data-grid="admgrid" ng-if="ad==false"></div>
|
||||
<!-- <table class="table table-hover no-margin" ng-if="ad==false">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<tr>
|
||||
<th> University</th>
|
||||
<th>1st Week</th>
|
||||
<th>2nd Week </th>
|
||||
<th>3rd Week</th>
|
||||
<th>4th Week</th>
|
||||
<th>Total </th>
|
||||
<th>Admissions Taken By & Count</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr ng-repeat="today in adMonth">
|
||||
<td>{{today.university}}</td>
|
||||
<td>{{today.w1}}</td>
|
||||
<td>{{today.w2}}</td>
|
||||
<td>{{today.w3}}</td>
|
||||
<td>{{today.w4}}</td>
|
||||
<td>{{today.total}}</td>
|
||||
<td>{{today.gad}}</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table> -->
|
||||
|
||||
</div>
|
||||
|
||||
</tab>
|
||||
@ -133,7 +104,7 @@
|
||||
|
||||
<div ng-if="getLoginType=='R004' || getLoginType=='R003'" class="panel-scroll height-500" perfect-scrollbar wheel-propagation="false"
|
||||
suppress-scroll-x="true">
|
||||
<!-- <div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>
|
||||
University
|
||||
@ -158,15 +129,15 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><br> -->
|
||||
</div><br>
|
||||
<div ng-if="adb==true">
|
||||
<center>
|
||||
<h5 class="text-dark">No Admissions!</h5>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<div dx-pivot-grid="adBatchgrid" ng-if="adb==false && fbselect==false"></div>
|
||||
<div style="width:600px;display:block;overflow: auto" dx-pivot-grid="adBatchgrid1" ng-if="fbselect==true"></div>
|
||||
<!-- <div id="dxPivotGrid" dx-pivot-grid="adBatchgrid" ng-if="adb==false"></div> -->
|
||||
<div id="dxPivotGrid" dx-pivot-grid="adBatchgrid" ng-if="adb==false && fbselect==false"></div>
|
||||
<div dx-pivot-grid="adBatchgrid1" ng-if="fbselect==true"></div>
|
||||
|
||||
|
||||
</div>
|
||||
@ -177,6 +148,34 @@
|
||||
<tab heading="Admissions-Yearly : {{adYear.length}}" class="padding-top-5">
|
||||
<div ng-if="getLoginType=='R004' || getLoginType=='R003'" class="panel-scroll height-500" perfect-scrollbar wheel-propagation="false"
|
||||
suppress-scroll-x="true">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>
|
||||
Year
|
||||
</label><br>
|
||||
|
||||
<select style="width: 250px;" ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="univ" ng-model="filters.fout_year" required>
|
||||
<option value="" selected>Select Year</option>
|
||||
|
||||
<option ng-repeat="b in fyr" value="{{b.fy}}">{{b.fy}}</option>
|
||||
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2" style="padding-top: 2.3%;">
|
||||
<div >
|
||||
|
||||
<button type="submit" class="btn btn-success btn-o" ng-click = "fyearFilter()" tabindex="8">
|
||||
Submit
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
|
||||
<div ng-if="ady==true">
|
||||
<center>
|
||||
<h5 class="text-dark">No Admissions!</h5>
|
||||
@ -197,6 +196,32 @@
|
||||
<tab heading="Fees Outstanding : {{fout.length}}" class="padding-top-5">
|
||||
<div ng-if="getLoginType=='R004' || getLoginType=='R003'" class="panel-scroll height-500" perfect-scrollbar wheel-propagation="false"
|
||||
suppress-scroll-x="true">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>
|
||||
University
|
||||
</label><br>
|
||||
|
||||
<select style="width: 250px;" ui-select2 class="form-control" tabindex="1" class="cs-select cs-skin-elastic" name="univ" ng-model="filters.fout_univ" required>
|
||||
<option value="" selected>Select University</option>
|
||||
|
||||
<option ng-repeat="b in univ" value="{{b.UniversityID}}">{{b.UniversityName}}</option>
|
||||
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2" style="padding-top: 2.3%;">
|
||||
<div >
|
||||
|
||||
<button type="submit" class="btn btn-success btn-o" ng-click = "foutFilter()" tabindex="8">
|
||||
Submit
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
<div ng-if="fo==true">
|
||||
<center>
|
||||
<h5 class="text-dark">No Outstanding Fee!</h5>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user