diff --git a/Apollo/api/application/controllers/Dashboard_Controller.php b/Apollo/api/application/controllers/Dashboard_Controller.php
index 0ccbc312..4dbb77c7 100755
--- a/Apollo/api/application/controllers/Dashboard_Controller.php
+++ b/Apollo/api/application/controllers/Dashboard_Controller.php
@@ -251,8 +251,9 @@ class Dashboard_Controller extends REST_Controller {
}
}
public function leadToday_post(){
- $data = $this->post('data');
- $leadToday = $this->dashboard_model->leadToday();
+ $branchId = $this->post('branchId');
+ $requestedBy = $this->post('requestedBy');
+ $leadToday = $this->dashboard_model->leadToday($branchId,$requestedBy);
if ($leadToday) {
$leadToday['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
@@ -268,8 +269,9 @@ class Dashboard_Controller extends REST_Controller {
}
}
public function leadMonth_post(){
- $data = $this->post('data');
- $leadMonth = $this->dashboard_model->leadMonth();
+ $branchId = $this->post('branchId');
+ $requestedBy = $this->post('requestedBy');
+ $leadMonth = $this->dashboard_model->leadMonth($branchId,$requestedBy);
if ($leadMonth) {
$leadMonth['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
@@ -285,8 +287,9 @@ class Dashboard_Controller extends REST_Controller {
}
}
public function leadTodayClosed_post(){
- $data = $this->post('data');
- $leadTodayClosed = $this->dashboard_model->leadTodayClosed();
+ $branchId = $this->post('branchId');
+ $requestedBy = $this->post('requestedBy');
+ $leadTodayClosed = $this->dashboard_model->leadTodayClosed($branchId,$requestedBy);
if ($leadTodayClosed) {
$leadTodayClosed['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
@@ -302,8 +305,9 @@ class Dashboard_Controller extends REST_Controller {
}
}
public function leadMonthClosed_post(){
- $data = $this->post('data');
- $leadMonthClosed = $this->dashboard_model->leadMonthClosed();
+ $branchId = $this->post('branchId');
+ $requestedBy = $this->post('requestedBy');
+ $leadMonthClosed = $this->dashboard_model->leadMonthClosed($branchId,$requestedBy);
if ($leadMonthClosed) {
$leadMonthClosed['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
@@ -371,8 +375,9 @@ class Dashboard_Controller extends REST_Controller {
}
}
public function followupsToday_post(){
- $data = $this->post('data');
- $followupsToday = $this->dashboard_model->followupsToday();
+ $branchId = $this->post('branchId');
+ $requestedBy = $this->post('requestedBy');
+ $followupsToday = $this->dashboard_model->followupsToday( $branchId, $requestedBy);
if ($followupsToday) {
$followupsToday['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
@@ -388,8 +393,9 @@ class Dashboard_Controller extends REST_Controller {
}
}
public function followupsPending_post(){
- $data = $this->post('data');
- $followupsPending = $this->dashboard_model->followupsPending();
+ $branchId = $this->post('branchId');
+ $requestedBy = $this->post('requestedBy');
+ $followupsPending = $this->dashboard_model->followupsPending( $branchId, $requestedBy);
if ($followupsPending) {
$followupsPending['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 bb6bbc12..4708ac19 100755
--- a/Apollo/api/application/models/Dashboard_model.php
+++ b/Apollo/api/application/models/Dashboard_model.php
@@ -357,7 +357,7 @@ public function leadCountMonth(){
return $results;
}
- public function leadToday(){
+ public function leadToday($branchId = null,$requestedBy = null){
$sql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
@@ -367,12 +367,28 @@ public function leadCountMonth(){
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 date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and sd.BranchCode = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
+ //print_r($sql);
+ //to staff/trainee
+ $ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
+ 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."' and sd.StaffID = '".$requestedBy."' ";
+ $sltd=$this->db->query($ssql);
+ $stlead = $sltd->result();
+ // print_r($ssql);
if (count($tlead) > 0) {
$results['lList'] = true;
$results['l_data'] = $tlead;
+ $results['sl_data'] = $stlead;
} else {
$results['lList'] = false;
$results['message'] = 'No record found';
@@ -380,7 +396,7 @@ public function leadCountMonth(){
return $results;
}
- public function leadMonth(){
+ public function leadMonth($branchId = null,$requestedBy = null){
$sql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
@@ -390,12 +406,26 @@ public function leadCountMonth(){
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 month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and sd.BranchCode = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
+ //to staff/trainee
+ $ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
+ 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."' and sd.StaffID = '".$requestedBy."' ";
+ $sltd=$this->db->query($ssql);
+ $stlead = $sltd->result();
if (count($tlead) > 0) {
$results['lList'] = true;
$results['l_data'] = $tlead;
+ $results['sl_data'] = $stlead;
} else {
$results['lList'] = false;
$results['message'] = 'No record found';
@@ -403,7 +433,7 @@ public function leadCountMonth(){
return $results;
}
- public function leadTodayClosed(){
+ public function leadTodayClosed($branchId = null,$requestedBy = null){
$sql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
@@ -413,12 +443,26 @@ public function leadCountMonth(){
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 list.ListName like 'CLOSE'";
+ and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and list.ListName like 'CLOSE' and sd.BranchCode = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
+ //to staff
+ $ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
+ 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 list.ListName like 'CLOSE' and sd.BranchCode = '".$branchId."' and sd.StaffID = '".$requestedBy."' ";
+ $sltd=$this->db->query($ssql);
+ $stlead = $sltd->result();
if (count($tlead) > 0) {
$results['lList'] = true;
$results['l_data'] = $tlead;
+ $results['sl_data'] = $stlead;
} else {
$results['lList'] = false;
$results['message'] = 'No record found';
@@ -426,7 +470,7 @@ public function leadCountMonth(){
return $results;
}
- public function leadMonthClosed(){
+ public function leadMonthClosed($branchId = null,$requestedBy = null){
$sql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
@@ -436,12 +480,27 @@ public function leadCountMonth(){
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 list.ListName like 'CLOSE'";
+ and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and list.ListName like 'CLOSE' and sd.BranchCode = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
+ //to staff
+ $ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
+ 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 list.ListName like 'CLOSE' and sd.BranchCode = '".$branchId."' and sd.StaffID = '".$requestedBy."' ";
+ $sltd=$this->db->query($ssql);
+ $stlead = $sltd->result();
+
if (count($tlead) > 0) {
$results['lList'] = true;
$results['l_data'] = $tlead;
+ $results['sl_data'] = $stlead;
} else {
$results['lList'] = false;
$results['message'] = 'No record found';
@@ -518,7 +577,7 @@ public function leadCountMonth(){
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; ";
+ group by b.bcode ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
if (count($tlead) > 0) {
@@ -531,7 +590,7 @@ group by bcode) scb on scb.bcode = b.bcode
return $results;
}
- public function followupsToday(){
+ public function followupsToday($branchId = null, $requestedBy = null){
$sql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as FollowUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
@@ -541,12 +600,27 @@ group by bcode) scb on scb.bcode = b.bcode
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 STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) ";
+ and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and sd.BranchCode = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
+ //to staff
+ $ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as FollowUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
+ 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 STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and sd.BranchCode = '".$branchId."' and sd.StaffID = '".$requestedBy."' ";
+ $sltd=$this->db->query($ssql);
+ $stlead = $sltd->result();
+
if (count($tlead) > 0) {
$results['lList'] = true;
$results['l_data'] = $tlead;
+ $results['sl_data'] = $stlead;
} else {
$results['lList'] = false;
$results['message'] = 'No record found';
@@ -554,7 +628,7 @@ group by bcode) scb on scb.bcode = b.bcode
return $results;
}
- public function followupsPending(){
+ public function followupsPending($branchId = null, $requestedBy = null){
$sql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as FollowUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID
@@ -564,12 +638,27 @@ group by bcode) scb on scb.bcode = b.bcode
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 list.ListName not like 'CLOSE' and list.ListName like 'PENDING' ";
+ and list.ListName not like 'CLOSE' and list.ListName like 'PENDING' and sd.BranchCode = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
- if (count($tlead) > 0) {
+ //To staff
+ $ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as FollowUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
+ 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 list.ListName not like 'CLOSE' and list.ListName like 'PENDING' and sd.BranchCode = '".$branchId."' and sd.StaffID = '".$requestedBy."' ";
+ $sltd=$this->db->query($ssql);
+ $stlead = $sltd->result();
+
+ if ((count($tlead) > 0) or (count($stlead) > 0)) {
$results['lList'] = true;
$results['l_data'] = $tlead;
+ $results['sl_data'] = $stlead;
} else {
$results['lList'] = false;
$results['message'] = 'No record found';
diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js
index 4410606f..e3e90606 100755
--- a/Apollo/assets/js/controllers/dashboardCtrl.js
+++ b/Apollo/assets/js/controllers/dashboardCtrl.js
@@ -145,16 +145,28 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
//End of filters
$scope.l_dataToday = '';
+ $scope.sl_dataToday = '';
$scope.l_dataMonth = '';
+ $scope.sl_dataMonth = '';
$scope.l_dataDayClosed = '';
+ $scope.sl_dataDayClosed = '';
$scope.l_dataMonthClosed = '';
+ $scope.sl_dataMonthClosed = '';
$scope.adMonth = '';
$scope.adYear = '';
$scope.fout = '';
$scope.ftoday = '';
+ $scope.sftoday = '';
$scope.fpending = '';
+ $scope.sfpending = '';
$scope.adBatch = '';
$scope.adBatchfilter = '';
+ $scope.Dt_leadtoday = '';
+ $scope.Dt_leadmonth = '';
+ $scope.Dt_dataDayClosed = '';
+ $scope.Dt_dataMonthClosed = '';
+ $scope.Dt_ftoday = '';
+ $scope.Dt_fpending = '';
$scope.initDashboardDetails = function () {
//lead today
var leadToday = {
@@ -170,18 +182,36 @@ 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;
$scope.lt = false;
- //console.log($scope.l_dataToday);
+ //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;
+ $scope.ltl = false;
+
+ if($scope.l_dataToday == ''){
+ $scope.Dt_leadtoday = $scope.sl_dataToday;
+ // console.log($scope.Dt_leadtoday);
+ // console.log('if');
+ }
+ else{
+ $scope.Dt_leadtoday = $scope.l_dataToday;
+ // console.log($scope.Dt_leadtoday);
+ // console.log('else');
+ }
} else {
+ $scope.ltl = true;
$scope.lt = true;
$scope.message = response.data.message;
}
});
+
//Data grid
$scope.showColumnLines = true;
$scope.showRowLines = true;
@@ -206,7 +236,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
showColumnLines: "showColumnLines",
showRowLines: "showRowLines",
rowAlternationEnabled: "rowAlternationEnabled",
- dataSource: 'l_dataToday'
+ dataSource: 'Dt_leadtoday'
},
columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'followUpDate', 'status']
};
@@ -231,9 +261,24 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
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;
+ $scope.lml = false;
+ if($scope.l_dataMonth == ''){
+ $scope.Dt_leadmonth = $scope.sl_dataMonth;
+ // console.log($scope.Dt_leadmonth);
+ // console.log('if');
+ }
+ else{
+ $scope.Dt_leadmonth = $scope.l_dataMonth;
+ // console.log($scope.Dt_leadmonth);
+ // console.log('else');
+ }
} else {
$scope.lm = true;
+ $scope.lml = true;
$scope.message = response.data.message;
}
});
@@ -261,7 +306,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
showColumnLines: "showColumnLines",
showRowLines: "showRowLines",
rowAlternationEnabled: "rowAlternationEnabled",
- dataSource: 'l_dataMonth'
+ dataSource: 'Dt_leadmonth'
},
columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'followUpDate', 'status']
};
@@ -285,9 +330,25 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
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;
+ $scope.cdl = false;
+ if($scope.l_dataDayClosed == ''){
+ $scope.Dt_dataDayClosed = $scope.sl_dataDayClosed;
+ // console.log($scope.Dt_dataDayClosed);
+ // console.log('if');
+ }
+ else{
+ $scope.Dt_dataDayClosed = $scope.l_dataDayClosed;
+ // console.log($scope.Dt_dataDayClosed);
+ // console.log('else');
+ }
// console.log($scope.l_dataDayClosed);
} else {
$scope.cd = true;
+ $scope.cd1 = true;
$scope.message = response.data.message;
}
});
@@ -315,7 +376,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
showColumnLines: "showColumnLines",
showRowLines: "showRowLines",
rowAlternationEnabled: "rowAlternationEnabled",
- dataSource: 'l_dataDayClosed'
+ dataSource: 'Dt_dataDayClosed'
},
columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'followUpDate', 'status']
};
@@ -339,9 +400,25 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
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;
+ $scope.cml = false;
+ if($scope.l_dataMonthClosed == ''){
+ $scope.Dt_dataMonthClosed = $scope.sl_dataMonthClosed;
+ // console.log($scope.Dt_dataMonthClosed);
+ // console.log('if');
+ }
+ else{
+ $scope.Dt_dataMonthClosed = $scope.l_dataMonthClosed;
+ // console.log($scope.Dt_dataMonthClosed);
+ // console.log('else');
+ }
// console.log($scope.l_dataMonthClosed);
} else {
$scope.cm = true;
+ $scope.cml = true;
$scope.message = response.data.message;
}
});
@@ -660,9 +737,25 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
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;
+ $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');
+ }
} else {
$scope.fut = true;
+ $scope.futl = true;
$scope.message = response.data.message;
}
});
@@ -690,7 +783,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
showColumnLines: "showColumnLines",
showRowLines: "showRowLines",
rowAlternationEnabled: "rowAlternationEnabled",
- dataSource: 'ftoday'
+ dataSource: 'Dt_ftoday'
},
columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'FollowUpDate', 'status']
};
@@ -714,9 +807,25 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
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;
//console.log($scope.fpending);
+ if($scope.fpending == ''){
+ $scope.Dt_fpending = $scope.sfpending;
+ // console.log($scope.Dt_dataMonthClosed);
+ // console.log('if');
+ }
+ else{
+ $scope.Dt_fpending = $scope.fpending;
+ // console.log($scope.Dt_dataMonthClosed);
+ // console.log('else');
+ }
} else {
$scope.fp = true;
+ $scope.fp1 = true;
$scope.message = response.data.message;
}
});
@@ -744,7 +853,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
showColumnLines: "showColumnLines",
showRowLines: "showRowLines",
rowAlternationEnabled: "rowAlternationEnabled",
- dataSource: 'fpending'
+ dataSource: 'Dt_fpending'
},
columns: ['TrackingId', 'name', 'mobileNo', 'course', 'university', 'activity', 'AssignTo', 'FollowUpDate', 'status']
};
@@ -769,18 +878,22 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
$scope.adBatch[i].Sl_No = i+1;
// var gridData = $scope.adBatch;
$scope.adb = false;
- console.log($scope.adBatch);
+ //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"
@@ -788,18 +901,21 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", "
dataSource: {
fields: [{
caption: "Batches",
- width: 100,
+ width: 100,
dataField: "Batches",
area: "row"
}, {
- caption: "Staff",
+ 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
diff --git a/Apollo/assets/views/dashboard_tile1.html b/Apollo/assets/views/dashboard_tile1.html
index 6fdb77a5..ac403184 100644
--- a/Apollo/assets/views/dashboard_tile1.html
+++ b/Apollo/assets/views/dashboard_tile1.html
@@ -26,8 +26,8 @@