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
|
||||
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 month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID)";
|
||||
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
|
||||
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 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)";
|
||||
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
|
||||
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 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)";
|
||||
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 {
|
||||
@ -532,7 +612,7 @@ public function leadCountMonth(){
|
||||
$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';
|
||||
|
||||
@ -106,17 +106,20 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
};
|
||||
/*For dashboard tab*/
|
||||
//To filters
|
||||
//Fees outstanding
|
||||
|
||||
$scope.filters = {
|
||||
"year" : "",
|
||||
"month" : "",
|
||||
"batch" : "",
|
||||
"univ" : ""
|
||||
"year": "",
|
||||
"month": "",
|
||||
"batch": "",
|
||||
"univ": "",
|
||||
"fout_univ": "",
|
||||
"fout_year": ""
|
||||
}
|
||||
//to store filter data
|
||||
$scope.year = '';
|
||||
$scope.branch = '';
|
||||
$scope.univ = '';
|
||||
|
||||
$scope.fyr = '';
|
||||
var fYear = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'filterYear/',
|
||||
@ -135,6 +138,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$scope.year = response.data.year;
|
||||
$scope.branch = response.data.branch;
|
||||
$scope.univ = response.data.univ;
|
||||
$scope.fyr = response.data.fyr;
|
||||
|
||||
console.log($scope.branch);
|
||||
} else {
|
||||
@ -167,6 +171,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$scope.Dt_dataMonthClosed = '';
|
||||
$scope.Dt_ftoday = '';
|
||||
$scope.Dt_fpending = '';
|
||||
$scope.grid;
|
||||
$scope.initDashboardDetails = function () {
|
||||
//lead today
|
||||
var leadToday = {
|
||||
@ -186,21 +191,21 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(leadToday).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.l_dataToday = response.data.l_data;
|
||||
for(var i=0;i<$scope.l_dataToday.length;i++)
|
||||
$scope.l_dataToday[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.l_dataToday.length; i++)
|
||||
$scope.l_dataToday[i].Sl_No = i + 1;
|
||||
$scope.lt = false;
|
||||
//To staff
|
||||
$scope.sl_dataToday = response.data.sl_data;
|
||||
for(var i=0;i<$scope.sl_dataToday.length;i++)
|
||||
$scope.sl_dataToday[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.sl_dataToday.length; i++)
|
||||
$scope.sl_dataToday[i].Sl_No = i + 1;
|
||||
$scope.ltl = false;
|
||||
|
||||
if($scope.l_dataToday == ''){
|
||||
if ($scope.l_dataToday == '') {
|
||||
$scope.Dt_leadtoday = $scope.sl_dataToday;
|
||||
// console.log($scope.Dt_leadtoday);
|
||||
// console.log('if');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$scope.Dt_leadtoday = $scope.l_dataToday;
|
||||
// console.log($scope.Dt_leadtoday);
|
||||
// console.log('else');
|
||||
@ -258,20 +263,20 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(leadMonth).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.l_dataMonth = response.data.l_data;
|
||||
for(var i=0;i<$scope.l_dataMonth.length;i++)
|
||||
$scope.l_dataMonth[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.l_dataMonth.length; i++)
|
||||
$scope.l_dataMonth[i].Sl_No = i + 1;
|
||||
$scope.lm = false;
|
||||
//to staff
|
||||
$scope.sl_dataMonth = response.data.sl_data;
|
||||
for(var i=0;i<$scope.sl_dataMonth.length;i++)
|
||||
$scope.sl_dataMonth[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.sl_dataMonth.length; i++)
|
||||
$scope.sl_dataMonth[i].Sl_No = i + 1;
|
||||
$scope.lml = false;
|
||||
if($scope.l_dataMonth == ''){
|
||||
if ($scope.l_dataMonth == '') {
|
||||
$scope.Dt_leadmonth = $scope.sl_dataMonth;
|
||||
// console.log($scope.Dt_leadmonth);
|
||||
// console.log('if');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$scope.Dt_leadmonth = $scope.l_dataMonth;
|
||||
// console.log($scope.Dt_leadmonth);
|
||||
// console.log('else');
|
||||
@ -327,20 +332,20 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(leadTodayClosed).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.l_dataDayClosed = response.data.l_data;
|
||||
for(var i=0;i<$scope.l_dataDayClosed.length;i++)
|
||||
$scope.l_dataDayClosed[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.l_dataDayClosed.length; i++)
|
||||
$scope.l_dataDayClosed[i].Sl_No = i + 1;
|
||||
$scope.cd = false;
|
||||
//to staff
|
||||
$scope.sl_dataDayClosed = response.data.sl_data;
|
||||
for(var i=0;i<$scope.sl_dataDayClosed.length;i++)
|
||||
$scope.sl_dataDayClosed[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.sl_dataDayClosed.length; i++)
|
||||
$scope.sl_dataDayClosed[i].Sl_No = i + 1;
|
||||
$scope.cdl = false;
|
||||
if($scope.l_dataDayClosed == ''){
|
||||
if ($scope.l_dataDayClosed == '') {
|
||||
$scope.Dt_dataDayClosed = $scope.sl_dataDayClosed;
|
||||
// console.log($scope.Dt_dataDayClosed);
|
||||
// console.log('if');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$scope.Dt_dataDayClosed = $scope.l_dataDayClosed;
|
||||
// console.log($scope.Dt_dataDayClosed);
|
||||
// console.log('else');
|
||||
@ -397,20 +402,20 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(leadMonthClosed).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.l_dataMonthClosed = response.data.l_data;
|
||||
for(var i=0;i<$scope.l_dataMonthClosed.length;i++)
|
||||
$scope.l_dataMonthClosed[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.l_dataMonthClosed.length; i++)
|
||||
$scope.l_dataMonthClosed[i].Sl_No = i + 1;
|
||||
$scope.cm = false;
|
||||
//to Staff
|
||||
$scope.sl_dataMonthClosed = response.data.sl_data;
|
||||
for(var i=0;i<$scope.sl_dataMonthClosed.length;i++)
|
||||
$scope.sl_dataMonthClosed[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.sl_dataMonthClosed.length; i++)
|
||||
$scope.sl_dataMonthClosed[i].Sl_No = i + 1;
|
||||
$scope.cml = false;
|
||||
if($scope.l_dataMonthClosed == ''){
|
||||
if ($scope.l_dataMonthClosed == '') {
|
||||
$scope.Dt_dataMonthClosed = $scope.sl_dataMonthClosed;
|
||||
// console.log($scope.Dt_dataMonthClosed);
|
||||
// console.log('if');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$scope.Dt_dataMonthClosed = $scope.l_dataMonthClosed;
|
||||
// console.log($scope.Dt_dataMonthClosed);
|
||||
// console.log('else');
|
||||
@ -460,15 +465,18 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
data: {
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType
|
||||
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
|
||||
year: $scope.filters.year,
|
||||
month: $scope.filters.month
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$http(admissionMonth).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.adMonth = response.data.l_data;
|
||||
for(var i=0;i<$scope.adMonth.length;i++)
|
||||
$scope.adMonth[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.adMonth.length; i++)
|
||||
$scope.adMonth[i].Sl_No = i + 1;
|
||||
$scope.ad = false;
|
||||
// console.log($scope.adMonth);
|
||||
} else {
|
||||
@ -514,10 +522,13 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
}, {
|
||||
dataField: "week4",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "week5",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "total",
|
||||
dataType: "number"
|
||||
}, 'AdmissionTakenBy&Count']
|
||||
}, 'AdmissionTakenBy']
|
||||
};
|
||||
|
||||
//Admissions Year-wise
|
||||
@ -537,8 +548,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(admissionYear).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.adYear = response.data.l_data;
|
||||
for(var i=0;i<$scope.adYear.length;i++)
|
||||
$scope.adYear[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.adYear.length; i++)
|
||||
$scope.adYear[i].Sl_No = i + 1;
|
||||
$scope.ady = false;
|
||||
//console.log($scope.adYear);
|
||||
} else {
|
||||
@ -581,59 +592,59 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
rowAlternationEnabled: "rowAlternationEnabled",
|
||||
dataSource: 'adYear'
|
||||
},
|
||||
columns: [{ dataField: 'Sl_No', width:50 }, { dataField: 'university', width:200 }, {
|
||||
columns: [{ dataField: 'Sl_No', width: 50 }, { dataField: 'university', width: 200 }, {
|
||||
dataField: "June",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "July",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "August",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "September",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "October",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "November",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "December",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "January",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "February",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "March",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "April",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "May",
|
||||
dataType: "number",
|
||||
width:60
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "total",
|
||||
dataType: "number",
|
||||
width:60
|
||||
}, { dataField: 'AdmissionTakenBy', cssClass: 'WrappedColumnClass', width:300 }]
|
||||
width: 60
|
||||
}, { dataField: 'AdmissionTakenBy', cssClass: 'WrappedColumnClass', width: 300 }]
|
||||
};
|
||||
//Fees outstanding
|
||||
var fOut = {
|
||||
@ -652,8 +663,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(fOut).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.fout = response.data.l_data;
|
||||
for(var i=0;i<$scope.fout.length;i++)
|
||||
$scope.fout[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.fout.length; i++)
|
||||
$scope.fout[i].Sl_No = i + 1;
|
||||
$scope.fo = false;
|
||||
//console.log($scope.fo);
|
||||
} else {
|
||||
@ -687,7 +698,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
rowAlternationEnabled: "rowAlternationEnabled",
|
||||
dataSource: 'fout'
|
||||
},
|
||||
columns: [ {
|
||||
columns: [{
|
||||
dataField: "Sl_No",
|
||||
dataType: "number",
|
||||
//width:50
|
||||
@ -714,7 +725,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
}, {
|
||||
dataField: "BalancePercentageByStaff",
|
||||
cssClass: 'WrappedColumnClass',
|
||||
width:300
|
||||
width: 300
|
||||
}]
|
||||
};
|
||||
//Follow ups today
|
||||
@ -734,21 +745,21 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(ftoday).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.ftoday = response.data.l_data;
|
||||
for(var i=0;i<$scope.ftoday.length;i++)
|
||||
$scope.ftoday[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.ftoday.length; i++)
|
||||
$scope.ftoday[i].Sl_No = i + 1;
|
||||
$scope.fut = false;
|
||||
//to staff
|
||||
$scope.sftoday = response.data.sl_data;
|
||||
for(var i=0;i<$scope.sftoday.length;i++)
|
||||
$scope.sftoday[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.sftoday.length; i++)
|
||||
$scope.sftoday[i].Sl_No = i + 1;
|
||||
$scope.futl = false;
|
||||
// console.log($scope.ftoday);
|
||||
if($scope.ftoday == ''){
|
||||
if ($scope.ftoday == '') {
|
||||
$scope.Dt_ftoday = $scope.sftoday;
|
||||
// console.log($scope.Dt_dataMonthClosed);
|
||||
// console.log('if');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$scope.Dt_ftoday = $scope.ftoday;
|
||||
// console.log($scope.Dt_dataMonthClosed);
|
||||
// console.log('else');
|
||||
@ -804,21 +815,21 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$http(fpending).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.fpending = response.data.l_data;
|
||||
for(var i=0;i<$scope.fpending.length;i++)
|
||||
$scope.fpending[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.fpending.length; i++)
|
||||
$scope.fpending[i].Sl_No = i + 1;
|
||||
$scope.fp = false;
|
||||
//to staff
|
||||
$scope.fpl = false;
|
||||
$scope.sfpending = response.data.sl_data;
|
||||
for(var i=0;i<$scope.sfpending.length;i++)
|
||||
$scope.sfpending[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.sfpending.length; i++)
|
||||
$scope.sfpending[i].Sl_No = i + 1;
|
||||
//console.log($scope.fpending);
|
||||
if($scope.fpending == ''){
|
||||
if ($scope.fpending == '') {
|
||||
$scope.Dt_fpending = $scope.sfpending;
|
||||
// console.log($scope.Dt_dataMonthClosed);
|
||||
// console.log('if');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$scope.Dt_fpending = $scope.fpending;
|
||||
// console.log($scope.Dt_dataMonthClosed);
|
||||
// console.log('else');
|
||||
@ -865,6 +876,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
univ: $scope.filters.univ
|
||||
|
||||
}
|
||||
@ -874,8 +887,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
if (response.data.lList == true) {
|
||||
$scope.fbselect = false;
|
||||
$scope.adBatch = response.data.l_data;
|
||||
for(var i=0;i<$scope.adBatch.length;i++)
|
||||
$scope.adBatch[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.adBatch.length; i++)
|
||||
$scope.adBatch[i].Sl_No = i + 1;
|
||||
// var gridData = $scope.adBatch;
|
||||
$scope.adb = false;
|
||||
//console.log($scope.adBatch);
|
||||
@ -932,17 +945,9 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
};
|
||||
|
||||
//function for batch filter
|
||||
$scope.buttonOptions = {
|
||||
text: "Test",
|
||||
onClick: function(){
|
||||
$scope.adBatchfilter = $scope.adBatchfilter;
|
||||
|
||||
$scope.pivot.getDataSource().reload();
|
||||
$scope.batchFilter = function () {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
$scope.batchFilter = function(){
|
||||
$scope.adBatchgrid1 = '';
|
||||
//Admissions batch
|
||||
var AdmissionsBatch = {
|
||||
@ -952,6 +957,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
univ: $scope.filters.univ
|
||||
|
||||
}
|
||||
@ -965,8 +972,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
$scope.fbselect = true;
|
||||
$scope.adb = false;
|
||||
$scope.adBatchfilter = response.data.l_data;
|
||||
for(var i=0;i<$scope.adBatchfilter.length;i++)
|
||||
$scope.adBatchfilter[i].Sl_No = i+1;
|
||||
for (var i = 0; i < $scope.adBatchfilter.length; i++)
|
||||
$scope.adBatchfilter[i].Sl_No = i + 1;
|
||||
// var gridData = $scope.adBatch;
|
||||
|
||||
$scope.adb = false;
|
||||
@ -974,7 +981,9 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
|
||||
$scope.adBatchgrid1 = {
|
||||
|
||||
|
||||
onInitialized: function (e) {
|
||||
$scope.grid = e.component;
|
||||
},
|
||||
allowSortingBySummary: true,
|
||||
allowSorting: true,
|
||||
allowFiltering: true,
|
||||
@ -989,6 +998,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
enabled: true,
|
||||
fileName: "AdmissionsBatch"
|
||||
},
|
||||
|
||||
dataSource: {
|
||||
|
||||
fields: [{
|
||||
@ -1007,23 +1017,329 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
|
||||
summaryType: "sum",
|
||||
area: "data"
|
||||
}],
|
||||
store: new DevExpress.data.CustomStore({
|
||||
load: function(loadOptions) {
|
||||
var d = $.Deferred();
|
||||
setTimeout(function() {
|
||||
d.resolve($scope.adBatchfilter);
|
||||
}, 500);
|
||||
return d.promise();
|
||||
}
|
||||
})
|
||||
|
||||
store: $scope.adBatchfilter
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
$scope.batchFilterClick();
|
||||
} else {
|
||||
$scope.fbselect = false;
|
||||
$scope.message = response.data.message;
|
||||
}
|
||||
});
|
||||
}
|
||||
$scope.batchFilterClick = function () {
|
||||
$scope.grid.option('dataSource', {
|
||||
fields: [{
|
||||
caption: "Batches",
|
||||
width: 100,
|
||||
dataField: "Batches",
|
||||
area: "row"
|
||||
}, {
|
||||
caption: "staff",
|
||||
dataField: "Staff",
|
||||
dataType: "string",
|
||||
width: 200,
|
||||
area: "column"
|
||||
}, {
|
||||
caption: "TotalNoOfAdmissions",
|
||||
dataField: "TotalNoOfAdmissions",
|
||||
dataType: "number",
|
||||
summaryType: "sum",
|
||||
width: 100,
|
||||
area: "data"
|
||||
}],
|
||||
store: $scope.adBatchfilter
|
||||
});
|
||||
}
|
||||
|
||||
$scope.foutFilter = function(){
|
||||
$scope.fout = '';
|
||||
var fOut = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'feeOutstanding/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
univ: $scope.filters.fout_univ,
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType
|
||||
|
||||
}
|
||||
};
|
||||
console.log($scope.filters.fout_univ);
|
||||
console.log(JSON.parse(localStorage.getItem('localObj')).localBranchID);
|
||||
|
||||
$http(fOut).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.fout = response.data.l_data;
|
||||
for (var i = 0; i < $scope.fout.length; i++)
|
||||
$scope.fout[i].Sl_No = i + 1;
|
||||
$scope.fo = false;
|
||||
console.log($scope.fout);
|
||||
} else {
|
||||
$scope.fo = true;
|
||||
$scope.message = response.data.message;
|
||||
}
|
||||
});
|
||||
//Data grid
|
||||
$scope.showColumnLines = true;
|
||||
$scope.showRowLines = true;
|
||||
$scope.rowAlternationEnabled = true;
|
||||
$scope.FeeOut = {
|
||||
columnAutoWidth: true,
|
||||
showBorders: true,
|
||||
"export": {
|
||||
enabled: true,
|
||||
fileName: "FeesOutstanding",
|
||||
allowExportSelectedData: true
|
||||
},
|
||||
paging: {
|
||||
pageSize: 10
|
||||
},
|
||||
pager: {
|
||||
showPageSizeSelector: true,
|
||||
allowedPageSizes: [5, 10, 20],
|
||||
showInfo: true
|
||||
},
|
||||
bindingOptions: {
|
||||
showColumnLines: "showColumnLines",
|
||||
showRowLines: "showRowLines",
|
||||
rowAlternationEnabled: "rowAlternationEnabled",
|
||||
dataSource: 'fout'
|
||||
},
|
||||
columns: [{
|
||||
dataField: "Sl_No",
|
||||
dataType: "number",
|
||||
//width:50
|
||||
}, {
|
||||
dataField: "Batches",
|
||||
dataType: "number",
|
||||
// width:100
|
||||
}, {
|
||||
dataField: "TotalPayableFee",
|
||||
dataType: "number",
|
||||
// width:80
|
||||
}, {
|
||||
dataField: "TotalPaidFee",
|
||||
dataType: "number",
|
||||
// width:80
|
||||
}, {
|
||||
dataField: "TotalBalance",
|
||||
dataType: "number",
|
||||
// width:80
|
||||
}, {
|
||||
dataField: "BalancePercentage",
|
||||
dataType: "number",
|
||||
// width:80
|
||||
}, {
|
||||
dataField: "BalancePercentageByStaff",
|
||||
cssClass: 'WrappedColumnClass',
|
||||
width: 300
|
||||
}]
|
||||
};
|
||||
}
|
||||
$scope.fyearFilter = function(){
|
||||
var admissionYear = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'admissionYear/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
|
||||
fyear: $scope.filters.fout_year
|
||||
|
||||
}
|
||||
};
|
||||
console.log($scope.filters.fout_year);
|
||||
console.log(JSON.parse(localStorage.getItem('localObj')).localBranchID);
|
||||
$http(admissionYear).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.adYear = response.data.l_data;
|
||||
for (var i = 0; i < $scope.adYear.length; i++)
|
||||
$scope.adYear[i].Sl_No = i + 1;
|
||||
$scope.ady = false;
|
||||
//console.log($scope.adYear);
|
||||
} else {
|
||||
$scope.ady = true;
|
||||
$scope.message = response.data.message;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Data grid
|
||||
$scope.filterRow = {
|
||||
visible: true,
|
||||
applyFilter: "auto"
|
||||
};
|
||||
$scope.showColumnLines = true;
|
||||
$scope.showRowLines = true;
|
||||
$scope.rowAlternationEnabled = true;
|
||||
$scope.adYeargrid = {
|
||||
showBorders: true,
|
||||
columnAutoWidth: true,
|
||||
//columnWidth: 100,
|
||||
|
||||
"export": {
|
||||
enabled: true,
|
||||
fileName: "AdmissionsYear",
|
||||
allowExportSelectedData: true
|
||||
},
|
||||
paging: {
|
||||
pageSize: 10
|
||||
},
|
||||
pager: {
|
||||
showPageSizeSelector: true,
|
||||
allowedPageSizes: [5, 10, 20],
|
||||
showInfo: true
|
||||
},
|
||||
bindingOptions: {
|
||||
//filterRow: "filterRow",
|
||||
showColumnLines: "showColumnLines",
|
||||
showRowLines: "showRowLines",
|
||||
rowAlternationEnabled: "rowAlternationEnabled",
|
||||
dataSource: 'adYear'
|
||||
},
|
||||
columns: [{ dataField: 'Sl_No', width: 50 }, { dataField: 'university', width: 200 }, {
|
||||
dataField: "June",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "July",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "August",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "September",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "October",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "November",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "December",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "January",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "February",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "March",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "April",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "May",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, {
|
||||
dataField: "total",
|
||||
dataType: "number",
|
||||
width: 60
|
||||
}, { dataField: 'AdmissionTakenBy', cssClass: 'WrappedColumnClass', width: 300 }]
|
||||
};
|
||||
}
|
||||
$scope.fbwFilter = function(){
|
||||
var admissionMonth = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'admissionMonth/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
|
||||
year: $scope.filters.year,
|
||||
month: $scope.filters.month
|
||||
|
||||
}
|
||||
};
|
||||
console.log($scope.filters.year);
|
||||
console.log($scope.filters.month);
|
||||
$http(admissionMonth).then(function (response) {
|
||||
if (response.data.lList == true) {
|
||||
$scope.adMonth = response.data.l_data;
|
||||
for (var i = 0; i < $scope.adMonth.length; i++)
|
||||
$scope.adMonth[i].Sl_No = i + 1;
|
||||
$scope.ad = false;
|
||||
// console.log($scope.adMonth);
|
||||
} else {
|
||||
$scope.ad = true;
|
||||
$scope.message = response.data.message;
|
||||
}
|
||||
});
|
||||
//Data grid
|
||||
$scope.showColumnLines = true;
|
||||
$scope.showRowLines = true;
|
||||
$scope.rowAlternationEnabled = true;
|
||||
$scope.admgrid = {
|
||||
columnAutoWidth: true,
|
||||
showBorders: true,
|
||||
"export": {
|
||||
enabled: true,
|
||||
fileName: "AdmissionsMonth",
|
||||
allowExportSelectedData: true
|
||||
},
|
||||
paging: {
|
||||
pageSize: 10
|
||||
},
|
||||
pager: {
|
||||
showPageSizeSelector: true,
|
||||
allowedPageSizes: [5, 10, 20],
|
||||
showInfo: true
|
||||
},
|
||||
bindingOptions: {
|
||||
showColumnLines: "showColumnLines",
|
||||
showRowLines: "showRowLines",
|
||||
rowAlternationEnabled: "rowAlternationEnabled",
|
||||
dataSource: 'adMonth'
|
||||
},
|
||||
columns: ['Sl_No', 'university', {
|
||||
dataField: "week1",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "week2",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "week3",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "week4",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "week5",
|
||||
dataType: "number"
|
||||
}, {
|
||||
dataField: "total",
|
||||
dataType: "number"
|
||||
}, 'AdmissionTakenBy']
|
||||
};
|
||||
}
|
||||
/*end dashboard tab*/
|
||||
/*For dashboard tiles*/
|
||||
$scope.lead_dataToday = 0;
|
||||
|
||||
@ -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