0001604: Dash Board
This commit is contained in:
parent
e287bbc937
commit
2913023e37
@ -222,7 +222,7 @@ from T_Lead_Tracking_Followup as ltf
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' ";
|
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltCount=$this->db->query($ltsql);
|
$ltCount=$this->db->query($ltsql);
|
||||||
$lcount = $ltCount->result();
|
$lcount = $ltCount->result();
|
||||||
$sltsql = "select count(InteractionID) as count
|
$sltsql = "select count(InteractionID) as count
|
||||||
@ -234,7 +234,7 @@ from T_Lead_Tracking_Followup as ltf
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltCount=$this->db->query($sltsql);
|
$sltCount=$this->db->query($sltsql);
|
||||||
$slcount = $sltCount->result();
|
$slcount = $sltCount->result();
|
||||||
//print_r($lcount);
|
//print_r($lcount);
|
||||||
@ -259,7 +259,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' ";
|
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltCount=$this->db->query($ltsql);
|
$ltCount=$this->db->query($ltsql);
|
||||||
$lcount = $ltCount->result();
|
$lcount = $ltCount->result();
|
||||||
$sltsql = "select count(InteractionID) as count
|
$sltsql = "select count(InteractionID) as count
|
||||||
@ -271,7 +271,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltCount=$this->db->query($sltsql);
|
$sltCount=$this->db->query($sltsql);
|
||||||
$slcount = $sltCount->result();
|
$slcount = $sltCount->result();
|
||||||
if (count($lcount) > 0) {
|
if (count($lcount) > 0) {
|
||||||
@ -295,7 +295,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' ";
|
and date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltCount=$this->db->query($ltsql);
|
$ltCount=$this->db->query($ltsql);
|
||||||
$lcount = $ltCount->result();
|
$lcount = $ltCount->result();
|
||||||
$sltsql = "select count(InteractionID) as count
|
$sltsql = "select count(InteractionID) as count
|
||||||
@ -307,7 +307,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltCount=$this->db->query($sltsql);
|
$sltCount=$this->db->query($sltsql);
|
||||||
$slcount = $sltCount->result();
|
$slcount = $sltCount->result();
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' ";
|
and month(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltCount=$this->db->query($ltsql);
|
$ltCount=$this->db->query($ltsql);
|
||||||
$lcount = $ltCount->result();
|
$lcount = $ltCount->result();
|
||||||
$sltsql = "select count(InteractionID) as count
|
$sltsql = "select count(InteractionID) as count
|
||||||
@ -344,7 +344,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and month(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltCount=$this->db->query($sltsql);
|
$sltCount=$this->db->query($sltsql);
|
||||||
$slcount = $sltCount->result();
|
$slcount = $sltCount->result();
|
||||||
if (count($lcount) > 0) {
|
if (count($lcount) > 0) {
|
||||||
@ -391,6 +391,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
//and list.ListName like 'PENDING'
|
||||||
public function followupsCountToday($branchId = null, $requestedBy = null){
|
public function followupsCountToday($branchId = null, $requestedBy = null){
|
||||||
$sql = "select count(ltf.TrackingID) as count
|
$sql = "select count(ltf.TrackingID) as count
|
||||||
from T_Lead_Tracking_Followup as ltf
|
from T_Lead_Tracking_Followup as ltf
|
||||||
@ -401,7 +402,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'PENDING' and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' ";
|
and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and list.ListName not like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$followupsCount=$this->db->query($sql);
|
$followupsCount=$this->db->query($sql);
|
||||||
$fcount = $followupsCount->result();
|
$fcount = $followupsCount->result();
|
||||||
$ssql = "select count(ltf.TrackingID) as count
|
$ssql = "select count(ltf.TrackingID) as count
|
||||||
@ -413,7 +414,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'PENDING' and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and list.ListName not like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sfollowupsCount=$this->db->query($ssql);
|
$sfollowupsCount=$this->db->query($ssql);
|
||||||
$sfcount = $sfollowupsCount->result();
|
$sfcount = $sfollowupsCount->result();
|
||||||
//print_r($sql);die();and ltf.StatusName ='S020'
|
//print_r($sql);die();and ltf.StatusName ='S020'
|
||||||
@ -428,6 +429,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
//and list.ListName like 'PENDING'
|
||||||
public function followupsCountMonth($branchId = null, $requestedBy = null){
|
public function followupsCountMonth($branchId = null, $requestedBy = null){
|
||||||
$sql = "select count(ltf.TrackingID) as count
|
$sql = "select count(ltf.TrackingID) as count
|
||||||
from T_Lead_Tracking_Followup as ltf
|
from T_Lead_Tracking_Followup as ltf
|
||||||
@ -438,7 +440,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'PENDING' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' ";
|
and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and list.ListName not like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$followupsCount=$this->db->query($sql);
|
$followupsCount=$this->db->query($sql);
|
||||||
$fcount = $followupsCount->result();
|
$fcount = $followupsCount->result();
|
||||||
//and ltf.StatusName ='S020'
|
//and ltf.StatusName ='S020'
|
||||||
@ -451,7 +453,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'PENDING' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and list.ListName not like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sfollowupsCount=$this->db->query($ssql);
|
$sfollowupsCount=$this->db->query($ssql);
|
||||||
|
|
||||||
//print_r($sql);die();
|
//print_r($sql);die();
|
||||||
@ -479,7 +481,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' ";
|
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
// print_r($sql);
|
// print_r($sql);
|
||||||
@ -493,7 +495,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltd=$this->db->query($ssql);
|
$sltd=$this->db->query($ssql);
|
||||||
$stlead = $sltd->result();
|
$stlead = $sltd->result();
|
||||||
// print_r($ssql);
|
// print_r($ssql);
|
||||||
@ -518,7 +520,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' ";
|
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
//to staff/trainee
|
//to staff/trainee
|
||||||
@ -531,7 +533,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltd=$this->db->query($ssql);
|
$sltd=$this->db->query($ssql);
|
||||||
$stlead = $sltd->result();
|
$stlead = $sltd->result();
|
||||||
if (count($tlead) > 0) {
|
if (count($tlead) > 0) {
|
||||||
@ -555,7 +557,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 ltf.IsActive = 1 and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
|
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
//to staff
|
//to staff
|
||||||
@ -568,7 +570,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 ltf.IsActive = 1 and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltd=$this->db->query($ssql);
|
$sltd=$this->db->query($ssql);
|
||||||
$stlead = $sltd->result();
|
$stlead = $sltd->result();
|
||||||
if (count($tlead) > 0) {
|
if (count($tlead) > 0) {
|
||||||
@ -592,7 +594,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
|
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
// echo $sql;
|
// echo $sql;
|
||||||
@ -606,7 +608,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltd=$this->db->query($ssql);
|
$sltd=$this->db->query($ssql);
|
||||||
$stlead = $sltd->result();
|
$stlead = $sltd->result();
|
||||||
|
|
||||||
@ -708,7 +710,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//print_r($sql);
|
// print_r($sql); die();
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
if (count($tlead) > 0) {
|
if (count($tlead) > 0) {
|
||||||
@ -813,6 +815,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to
|
|||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
//and list.ListName like 'PENDING'
|
||||||
public function followupsToday($branchId = null, $requestedBy = null, $logintype = null){
|
public function followupsToday($branchId = null, $requestedBy = null, $logintype = 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
|
$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
|
from T_Lead_Tracking_Followup as ltf
|
||||||
@ -823,7 +826,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'PENDING' and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and lt.CreatedBranch = '".$branchId."' ";
|
and list.ListName not like 'CLOSE' and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
//to staff
|
//to staff
|
||||||
@ -836,7 +839,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName like 'PENDING' and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and list.ListName not like 'CLOSE' and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltd=$this->db->query($ssql);
|
$sltd=$this->db->query($ssql);
|
||||||
$stlead = $sltd->result();
|
$stlead = $sltd->result();
|
||||||
|
|
||||||
@ -862,7 +865,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName not like 'CLOSE' and list.ListName like 'PENDING' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and lt.CreatedBranch = '".$branchId."' ";
|
and list.ListName not like 'CLOSE' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and lt.CreatedBranch = '".$branchId."' ";
|
||||||
$ltd=$this->db->query($sql);
|
$ltd=$this->db->query($sql);
|
||||||
$tlead = $ltd->result();
|
$tlead = $ltd->result();
|
||||||
//To staff
|
//To staff
|
||||||
@ -875,7 +878,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to
|
|||||||
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus
|
||||||
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
join T_PickListDetails list on list.ListCode=ltf.StatusName
|
||||||
where 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 list.ListName not like 'CLOSE' and list.ListName like 'PENDING' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
and list.ListName not like 'CLOSE' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
|
||||||
$sltd=$this->db->query($ssql);
|
$sltd=$this->db->query($ssql);
|
||||||
$stlead = $sltd->result();
|
$stlead = $sltd->result();
|
||||||
//echo $requestedBy;
|
//echo $requestedBy;
|
||||||
|
|||||||
@ -2188,7 +2188,7 @@ $REGID='';
|
|||||||
$result['deleteStatus']=false;
|
$result['deleteStatus']=false;
|
||||||
$result['message']="Something went wrong.please try again";
|
$result['message']="Something went wrong.please try again";
|
||||||
}
|
}
|
||||||
print_r($this->db->last_query());die();
|
// print_r($this->db->last_query());die();
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user