application/models/Assignments_model.php
// Today Follow Up Appoints List Start //
Today Follow Up Appoints List Start
Today Follow Up Appoints List Start
function TodayFollowUpAppointmentList($today,$userid){
		if($userid!=''){
			$userid="\n AND(assignments.tele_marketing_user_id ='$userid')";
		}else{
			$userid=" ";
		}
        if($today!=''){
			$searchdate="\n  AND assignments.next_followup_date = '$today' ";
		  }else{
			$searchdate=" ";
		  }
     $searchagentData=Capsule::select("SELECT assignments.id as id, assignments.message,business_details.company_name,business_details.person_name,DATE_FORMAT( assignments.appointment_date,'%d-%m-%Y') as appointment_date,DATE_FORMAT(assignments.appointment_time,'%h:%i:%s %p') as appointment_time,DATE_FORMAT(assignments.created_on,'%d-%m-%Y %h:%i:%s %p') as work_assigned_date,CONCAT(user_details.first_name,' ',user_details.last_name) as marketing_name,CONCAT(ud.first_name,' ',ud.last_name) as tele_name,CONCAT(udd.first_name,' ',udd.last_name) as marketlead_name,marketing_message,DATE_FORMAT(assignments.modified_on,'%d-%m-%Y %h:%i:%s %p') as assignmentmsg_datetime, DATE_FORMAT(CONCAT(appointment_date,' ',appointment_time),'%d-%m-%Y %h:%i:%s %p') as appointment_datetime,status_value,CONCAT(company_name,'<br>',business_details.business_id) as company_name_id , CONCAT(person_name,' <br>',mobile_no) as person_name_mobile,cityname
		from assignments
		left join user_details on user_details.user_id=assignments.marketing_user_id 
		left join user_details ud on ud.user_id=assignments.tele_marketing_user_id
		left join user_details udd on udd.user_id=assignments.marketlead_user_id
		join business_details on business_details.id=assignments.business_details_id 
		join address on address.id=business_details.address_id
		join cities on cities.cityid = address.city_id 
		left join business_status on business_status.id = assignments.assignment_status
	   WHERE assignments.id !=0".$searchdate.$userid);     
	   return $searchagentData;
	   }
function TodayFollowUpAppointmentList ( $ today , $ userid ) { if ( $ userid != '' ) { $ userid = " \n  AND(assignments.tele_marketing_user_id =' $ userid ') " ; } else { $ userid = " " ; } if ( $ today != '' ) { $ searchdate = " \n   AND assignments.next_followup_date = ' $ today '  " ; } else { $ searchdate = " " ; } $ searchagentData = Capsule :: select ( " SELECT assignments.id as id, assignments.message,business_details.company_name,business_details.person_name,DATE_FORMAT( assignments.appointment_date,'%d-%m-%Y') as appointment_date,DATE_FORMAT(assignments.appointment_time,'%h:%i:%s %p') as appointment_time,DATE_FORMAT(assignments.created_on,'%d-%m-%Y %h:%i:%s %p') as work_assigned_date,CONCAT(user_details.first_name,' ',user_details.last_name) as marketing_name,CONCAT(ud.first_name,' ',ud.last_name) as tele_name,CONCAT(udd.first_name,' ',udd.last_name) as marketlead_name,marketing_message,DATE_FORMAT(assignments.modified_on,'%d-%m-%Y %h:%i:%s %p') as assignmentmsg_datetime, DATE_FORMAT(CONCAT(appointment_date,' ',appointment_time),'%d-%m-%Y %h:%i:%s %p') as appointment_datetime,status_value,CONCAT(company_name,'<br>',business_details.business_id) as company_name_id , CONCAT(person_name,' <br>',mobile_no) as person_name_mobile,cityname
		from assignments
		left join user_details on user_details.user_id=assignments.marketing_user_id 
		left join user_details ud on ud.user_id=assignments.tele_marketing_user_id
		left join user_details udd on udd.user_id=assignments.marketlead_user_id
		join business_details on business_details.id=assignments.business_details_id 
		join address on address.id=business_details.address_id
		join cities on cities.cityid = address.city_id 
		left join business_status on business_status.id = assignments.assignment_status
	   WHERE assignments.id !=0 " . $ searchdate . $ userid ) ; return $ searchagentData ; }
Today Follow Up Appoints List Start
Today Follow Up Appoints List Start