From 485ddbdf1a1ff5840df6f03e7dd09b04e980bc9a Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Sun, 21 Oct 2018 22:01:07 +0530 Subject: [PATCH] Dashboard changes --- .../controllers/Dashboard_Controller.php | 26 +- .../application/models/Dashboard_model.php | 248 +++- Apollo/assets/js/controllers/dashboardCtrl.js | 1060 +++++++++++------ Apollo/assets/views/dashboard_tile1.html | 6 +- Apollo/assets/views/dashboard_tile3.html | 101 +- 5 files changed, 983 insertions(+), 458 deletions(-) diff --git a/Apollo/api/application/controllers/Dashboard_Controller.php b/Apollo/api/application/controllers/Dashboard_Controller.php index 4dbb77c7..1afff7ba 100755 --- a/Apollo/api/application/controllers/Dashboard_Controller.php +++ b/Apollo/api/application/controllers/Dashboard_Controller.php @@ -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 diff --git a/Apollo/api/application/models/Dashboard_model.php b/Apollo/api/application/models/Dashboard_model.php index 4708ac19..619082aa 100755 --- a/Apollo/api/application/models/Dashboard_model.php +++ b/Apollo/api/application/models/Dashboard_model.php @@ -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'; diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index e3e90606..d226e593 100755 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -106,18 +106,21 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " }; /*For dashboard tab*/ //To filters - //Fees outstanding - $scope.filters = { - "year" : "", - "month" : "", - "batch" : "", - "univ" : "" - } - $scope.year = ''; - $scope.branch = ''; - $scope.univ = ''; - - var fYear = { + + $scope.filters = { + "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/', headers: { @@ -135,14 +138,15 @@ 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 { - + $scope.message = response.data.message; } }); - + //End of filters $scope.l_dataToday = ''; $scope.sl_dataToday = ''; @@ -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 = { @@ -182,25 +187,25 @@ 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'); @@ -211,7 +216,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " $scope.message = response.data.message; } }); - + //Data grid $scope.showColumnLines = true; $scope.showRowLines = true; @@ -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,17 +465,20 @@ 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); + // console.log($scope.adMonth); } else { $scope.ad = true; $scope.message = response.data.message; @@ -505,21 +513,24 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " columns: ['Sl_No', 'university', { dataField: "week1", dataType: "number" - }, { - dataField: "week2", - dataType: "number" - }, { - dataField: "week3", - dataType: "number" - }, { - dataField: "week4", - dataType: "number" - }, { - dataField: "total", - dataType: "number" - }, 'AdmissionTakenBy&Count'] + }, { + dataField: "week2", + dataType: "number" + }, { + dataField: "week3", + dataType: "number" + }, { + dataField: "week4", + dataType: "number" + }, { + dataField: "week5", + dataType: "number" + }, { + dataField: "total", + dataType: "number" + }, 'AdmissionTakenBy'] }; - + //Admissions Year-wise var admissionYear = { method: 'POST', @@ -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 { @@ -546,95 +557,95 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " $scope.message = response.data.message; } }); - - - //Data grid - $scope.filterRow = { + + + //Data grid + $scope.filterRow = { visible: true, applyFilter: "auto" }; - $scope.showColumnLines = true; - $scope.showRowLines = true; - $scope.rowAlternationEnabled = true; - $scope.adYeargrid = { + $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: { + 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", + 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 }] - }; + 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 }] + }; //Fees outstanding var fOut = { method: 'POST', @@ -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 { @@ -661,62 +672,62 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " $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: [ { + //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 + // width:100 }, { dataField: "TotalPayableFee", dataType: "number", - // width:80 + // width:80 }, { dataField: "TotalPaidFee", dataType: "number", - // width:80 + // width:80 }, { dataField: "TotalBalance", dataType: "number", - // width:80 + // width:80 }, { dataField: "BalancePercentage", dataType: "number", - // width:80 - }, { + // width:80 + }, { dataField: "BalancePercentageByStaff", cssClass: 'WrappedColumnClass', - width:300 + width: 300 }] - }; + }; //Follow ups today var ftoday = { method: 'POST', @@ -734,59 +745,59 @@ 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 == ''){ - $scope.Dt_ftoday = $scope.sftoday; - // console.log($scope.Dt_dataMonthClosed); - // console.log('if'); - } - else{ - $scope.Dt_ftoday = $scope.ftoday; - // console.log($scope.Dt_dataMonthClosed); - // console.log('else'); - } + // console.log($scope.ftoday); + if ($scope.ftoday == '') { + $scope.Dt_ftoday = $scope.sftoday; + // console.log($scope.Dt_dataMonthClosed); + // console.log('if'); + } + else { + $scope.Dt_ftoday = $scope.ftoday; + // console.log($scope.Dt_dataMonthClosed); + // console.log('else'); + } } else { $scope.fut = true; $scope.futl = true; $scope.message = response.data.message; } }); - //Data grid - $scope.showColumnLines = true; - $scope.showRowLines = true; - $scope.rowAlternationEnabled = true; - $scope.FollowToday = { - columnAutoWidth: true, - showBorders: true, - "export": { - enabled: true, - fileName: "FollowUpToday", - allowExportSelectedData: true - }, - paging: { - pageSize: 10 - }, - pager: { - showPageSizeSelector: true, - allowedPageSizes: [5, 10, 20], - showInfo: true - }, - bindingOptions: { - showColumnLines: "showColumnLines", - showRowLines: "showRowLines", - rowAlternationEnabled: "rowAlternationEnabled", - dataSource: 'Dt_ftoday' - }, - columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'FollowUpDate', 'status'] - }; + //Data grid + $scope.showColumnLines = true; + $scope.showRowLines = true; + $scope.rowAlternationEnabled = true; + $scope.FollowToday = { + columnAutoWidth: true, + showBorders: true, + "export": { + enabled: true, + fileName: "FollowUpToday", + allowExportSelectedData: true + }, + paging: { + pageSize: 10 + }, + pager: { + showPageSizeSelector: true, + allowedPageSizes: [5, 10, 20], + showInfo: true + }, + bindingOptions: { + showColumnLines: "showColumnLines", + showRowLines: "showRowLines", + rowAlternationEnabled: "rowAlternationEnabled", + dataSource: 'Dt_ftoday' + }, + columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'FollowUpDate', 'status'] + }; //Follow ups pending var fpending = { method: 'POST', @@ -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'); @@ -829,35 +840,35 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " $scope.message = response.data.message; } }); - //Data grid - $scope.showColumnLines = true; - $scope.showRowLines = true; - $scope.rowAlternationEnabled = true; - $scope.FollowPending = { - columnAutoWidth: true, - showBorders: true, - "export": { - enabled: true, - fileName: "PendingFollowup", - allowExportSelectedData: true - }, - paging: { - pageSize: 10 - }, - pager: { - showPageSizeSelector: true, - allowedPageSizes: [5, 10, 20], - showInfo: true - }, - bindingOptions: { - showColumnLines: "showColumnLines", - showRowLines: "showRowLines", - rowAlternationEnabled: "rowAlternationEnabled", - dataSource: 'Dt_fpending' - }, - columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'FollowUpDate', 'status'] - }; - //Admissions batch + //Data grid + $scope.showColumnLines = true; + $scope.showRowLines = true; + $scope.rowAlternationEnabled = true; + $scope.FollowPending = { + columnAutoWidth: true, + showBorders: true, + "export": { + enabled: true, + fileName: "PendingFollowup", + allowExportSelectedData: true + }, + paging: { + pageSize: 10 + }, + pager: { + showPageSizeSelector: true, + allowedPageSizes: [5, 10, 20], + showInfo: true + }, + bindingOptions: { + showColumnLines: "showColumnLines", + showRowLines: "showRowLines", + rowAlternationEnabled: "rowAlternationEnabled", + dataSource: 'Dt_fpending' + }, + columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'FollowUpDate', 'status'] + }; + //Admissions batch var AdmissionsBatch = { method: 'POST', url: apiPoint.url + 'admissionBatch/', @@ -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,84 +887,78 @@ 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; - // var gridData = $scope.adBatch; + 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); - $scope.adBatchgrid = { - - allowSortingBySummary: true, - allowSorting: true, - allowFiltering: true, - allowExpandAll: true, - wordWrapEnabled: true, - height: 440, - showBorders: true, - fieldChooser: { - enabled: false - }, - // scrolling: { - // mode: "virtual" - // }, - "export": { - enabled: true, - fileName: "AdmissionsBatch" - }, - 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.adBatch - } - }; + $scope.adBatchgrid = { + + allowSortingBySummary: true, + allowSorting: true, + allowFiltering: true, + allowExpandAll: true, + wordWrapEnabled: true, + height: 440, + showBorders: true, + fieldChooser: { + enabled: false + }, + // scrolling: { + // mode: "virtual" + // }, + "export": { + enabled: true, + fileName: "AdmissionsBatch" + }, + 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.adBatch + } + }; } else { $scope.adb = true; $scope.message = response.data.message; } }); - + }; //function for batch filter - $scope.buttonOptions = { - text: "Test", - onClick: function(){ - $scope.adBatchfilter = $scope.adBatchfilter; - - $scope.pivot.getDataSource().reload(); - - } - - }; - $scope.batchFilter = function(){ - $scope.adBatchgrid1 = ''; - //Admissions batch - var AdmissionsBatch = { + + $scope.batchFilter = function () { + + $scope.adBatchgrid1 = ''; + //Admissions batch + var AdmissionsBatch = { method: 'POST', url: apiPoint.url + 'admissionBatch/', headers: { 'Content-Type': 'application/json' }, data: { + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, univ: $scope.filters.univ } @@ -960,70 +967,379 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " $http(AdmissionsBatch).then(function (response) { if (response.data.lList == true) { $scope.adBatch = ''; - + $scope.adBatchfilter = ''; $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; - // var gridData = $scope.adBatch; - + for (var i = 0; i < $scope.adBatchfilter.length; i++) + $scope.adBatchfilter[i].Sl_No = i + 1; + // var gridData = $scope.adBatch; + $scope.adb = false; console.log($scope.adBatchfilter); - - $scope.adBatchgrid1 = { - - - allowSortingBySummary: true, - allowSorting: true, - allowFiltering: true, - allowExpandAll: true, - height: 440, - showBorders: true, - fieldChooser: { - enabled: false - }, - - "export": { - enabled: true, - fileName: "AdmissionsBatch" - }, - dataSource: { - - fields: [{ - caption: "Batches", - width: 100, - dataField: "Batches", - area: "row" - }, { - caption: "Staff", - dataField: "Staff", - area: "column" - }, { - caption: "TotalNoOfAdmissions", - dataField: "TotalNoOfAdmissions", - dataType: "number", - 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(); - } - }) - } - }; + + $scope.adBatchgrid1 = { + + onInitialized: function (e) { + $scope.grid = e.component; + }, + allowSortingBySummary: true, + allowSorting: true, + allowFiltering: true, + allowExpandAll: true, + height: 440, + showBorders: true, + fieldChooser: { + enabled: false + }, + + "export": { + enabled: true, + fileName: "AdmissionsBatch" + }, + + dataSource: { + + fields: [{ + caption: "Batches", + width: 100, + dataField: "Batches", + area: "row" + }, { + caption: "Staff", + dataField: "Staff", + area: "column" + }, { + caption: "TotalNoOfAdmissions", + dataField: "TotalNoOfAdmissions", + dataType: "number", + summaryType: "sum", + area: "data" + }], + + 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; diff --git a/Apollo/assets/views/dashboard_tile1.html b/Apollo/assets/views/dashboard_tile1.html index ac403184..4babce04 100644 --- a/Apollo/assets/views/dashboard_tile1.html +++ b/Apollo/assets/views/dashboard_tile1.html @@ -34,11 +34,7 @@
No Leads!
- +
+
No Admissions!
@@ -94,36 +94,7 @@
-->
- + @@ -133,7 +104,7 @@
- +

No Admissions!
- -
-
+ +
+
@@ -177,6 +148,34 @@
+
+
+
+ + + +
+ + +
+
+ + + +
+
+

+ +
No Admissions!
@@ -197,6 +196,32 @@
+
+
+
+ + + +
+ + +
+
+ + + +
+
+

No Outstanding Fee!