This commit is contained in:
venbatechnologies@gmail.com 2019-01-23 16:46:26 +05:30
commit 41aca6906e
3 changed files with 31 additions and 28 deletions

View File

@ -222,7 +222,7 @@ from T_Lead_Tracking_Followup as ltf
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 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);
$lcount = $ltCount->result();
$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
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 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);
$slcount = $sltCount->result();
//print_r($lcount);
@ -259,7 +259,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$lcount = $ltCount->result();
$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
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 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);
$slcount = $sltCount->result();
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
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 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);
$lcount = $ltCount->result();
$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
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 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);
$slcount = $sltCount->result();
@ -332,7 +332,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$lcount = $ltCount->result();
$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
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 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);
$slcount = $sltCount->result();
if (count($lcount) > 0) {
@ -391,6 +391,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
return $results;
}
//and list.ListName like 'PENDING'
public function followupsCountToday($branchId = null, $requestedBy = null){
$sql = "select count(ltf.TrackingID) as count
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
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 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);
$fcount = $followupsCount->result();
$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
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 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);
$sfcount = $sfollowupsCount->result();
//print_r($sql);die();and ltf.StatusName ='S020'
@ -428,6 +429,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
return $results;
}
//and list.ListName like 'PENDING'
public function followupsCountMonth($branchId = null, $requestedBy = null){
$sql = "select count(ltf.TrackingID) as count
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
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 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);
$fcount = $followupsCount->result();
//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
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 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);
//print_r($sql);die();
@ -479,10 +481,10 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$tlead = $ltd->result();
//print_r($sql);
// 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
@ -493,7 +495,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$stlead = $sltd->result();
// print_r($ssql);
@ -518,7 +520,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$tlead = $ltd->result();
//to staff/trainee
@ -531,7 +533,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$stlead = $sltd->result();
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
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 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);
$tlead = $ltd->result();
//to staff
@ -568,7 +570,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$stlead = $sltd->result();
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
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 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);
$tlead = $ltd->result();
// echo $sql;
@ -606,7 +608,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){
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 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);
$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);
$tlead = $ltd->result();
if (count($tlead) > 0) {
@ -813,6 +815,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to
return $results;
}
//and list.ListName like 'PENDING'
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
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
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 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);
$tlead = $ltd->result();
//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
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 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);
$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
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 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);
$tlead = $ltd->result();
//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
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 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);
$stlead = $sltd->result();
//echo $requestedBy;

View File

@ -2188,7 +2188,7 @@ $REGID='';
$result['deleteStatus']=false;
$result['message']="Something went wrong.please try again";
}
print_r($this->db->last_query());die();
// print_r($this->db->last_query());die();
return $result;

View File

@ -148,7 +148,7 @@
<td><input type="checkbox" ng-checked="myModel.all" id="{{p.StudentID}}" name="{{p.StudentID}}" class="" ng-click="isClick($event);"></td>
<td>{{p.Firstname}}{{p.Lastname}}</td>
<!-- <td>{{p.UniversityShortName}}</td> -->
<td>{{p.CourseName}}{{(p.CourseCode)}}</td>
<td>{{p.CourseName}}</td>
<td>{{p.MobileNumber}}</td>
<td>{{p.EmailID}}</td>
<td>{{p.SessionName}}</td>