@php use App\Http\Controllers\TestController; use App\Models\Demography; use App\Models\Unixperts; $ModuleId="806867ab-96a5-11eb-948a-56b1773fd56f"; $file_type = "vnd.ms-excel"; $file_name= $ReportName."-DrillDown.xls"; header("Content-Type: application/$file_type"); header("Content-Disposition: attachment; filename=$file_name"); $demography = new Demography(); $LeadSourceDetDropDown=$GetDropdownLists['68']; $BranchOfficeDropDown=$GetDropdownLists['69']; $StudyDestinationDropDown=$GetDropdownLists['71']; $StudyLevelDropdown=$GetDropdownLists['76']; $LastLevelEducationDropdown=$GetDropdownLists['79']; $IntakeDropdown=$GetDropdownLists['74']; $StudyYearDropdown=$GetDropdownLists['72']; $VendorDropDown=$LeadGetDropdownLists[82]; $LeadDispositionDropDown=$LeadGetDropdownLists[65]; $LeadSubDispositionDropDown=$LeadGetDropdownLists[66]; $LeadSourceDropDown=$LeadGetDropdownLists['ddfb84a7-5564-4335-9a18-f1a782c018cf']; $qry2=base64_decode($Query); $Count=$totalcount; $recordsPerPage=500; $totalRecords=$Count; $totalPages=ceil($totalRecords/$recordsPerPage); $GetREsult=DB::select($qry2); $AppointmentArray=array(); foreach($GetREsult as $EachData) { $LeadId=$EachData->LeadId; $EMailId=$EachData->EMailId; $GetAppointMentDetail=Unixperts::GetAppointMentDetail($LeadId); $AppointmentArray[$LeadId]=$GetAppointMentDetail; if($EMailId) { $EmailsArray[$EMailId]=$demography->GetEmailValues($EMailId); } } $a=1; @endphp @foreach($GetREsult as $EachRecord) @php $EMailId=$EachRecord->EMailId; $BranchOffice=$EachRecord->BranchOffice; $LeadSourceDet=$EachRecord->LeadSourceDet; $StudyDestination=$EachRecord->StudyDestination; $CreatedDate=$EachRecord->CreatedDate; $CreatedBy=$EachRecord->CreatedBy; $LeadId=$EachRecord->LeadId; $LeadFirstName=$EachRecord->LeadFirstName; $LeadLastName=$EachRecord->LeadLastName; $LeadFullName=$LeadFirstName." ".$LeadLastName; $LeadPhoneMobile=$EachRecord->LeadPhoneMobile; $Vendors=$EachRecord->Vendors; $LeadDisposition=$EachRecord->LeadDisposition; $LeadSubDisposition=$EachRecord->LeadSubDisposition; $LeadSource=$EachRecord->LeadSource; $LeadCreatedDate=$EachRecord->LeadCreatedDate; $StudyLevel=$EachRecord->StudyLevel; $LastLevelEducation=$EachRecord->LastLevelEducation; $Intake=$EachRecord->Intake; $StudyYear=$EachRecord->StudyYear; //$AppointmentCreatedDate=$EachRecord->AppointmentCreatedDate; //$MeetingDateandTime=$EachRecord->MeetingDateandTime; $AppointmentCreatedDatenew=''; $MeetingDateandTimeNew=''; $EmailValues=''; if(array_key_exists($LeadId,$AppointmentArray)) { try { $AppointmentCreatedDatenew=$AppointmentArray[$LeadId]->CreatedDate; $MeetingDateandTimeNew=$AppointmentArray[$LeadId]->MeetingDateandTime; } catch(\Exception $e) { $AppointmentCreatedDatenew=''; $MeetingDateandTimeNew=''; } } if(array_key_exists($EMailId,$EmailsArray)) { $EmailValues=$EmailsArray[$EMailId][0]; } @endphp @php $a++; @endphp @endforeach
Sl.No Student Registration Leads Appointments
First Name Last Name Phone Mobile Email Id Branch Office Lead Source Det Study Destination Created By Student Registration Created Date Study Level Last Level of Education Intake Study Year Lead Full Name Lead Mobile Number Vendors Lead Disposition Lead Sub Disposition Lead Source Lead Created Date Appointment Created Date Meeting Date and Time
{{$a}} {{$EachRecord->FirstName}} {{$EachRecord->LastName}} {{$EachRecord->MobileNumber}} {{$EmailValues}} @if(array_key_exists($BranchOffice,$BranchOfficeDropDown)) {{$BranchOfficeDropDown[$BranchOffice]}} @else {{$BranchOffice}} @endif @if(array_key_exists($LeadSourceDet,$LeadSourceDetDropDown)) {{$LeadSourceDetDropDown[$LeadSourceDet]}} @else {{$LeadSourceDet}} @endif {{$LeadSourceDet}} @if(array_key_exists($StudyDestination,$StudyDestinationDropDown)) {{$StudyDestinationDropDown[$StudyDestination]}} @else {{$StudyDestination}} @endif @if(array_key_exists($CreatedBy,$getActiveUsersList)) {{$getActiveUsersList[$CreatedBy]['name']}} @else {{$CreatedBy}} @endif {{$CreatedDate}} @if(array_key_exists($StudyLevel,$StudyLevelDropdown)) {{$StudyLevelDropdown[$StudyLevel]}} @else {{$StudyLevel}} @endif @if(array_key_exists($LastLevelEducation,$LastLevelEducationDropdown)) {{$LastLevelEducationDropdown[$LastLevelEducation]}} @else {{$LastLevelEducation}} @endif @if(array_key_exists($Intake,$IntakeDropdown)) {{$IntakeDropdown[$Intake]}} @else {{$Intake}} @endif @if(array_key_exists($StudyYear,$StudyYearDropdown)) {{$StudyYearDropdown[$StudyYear]}} @else {{$StudyYear}} @endif {{$LeadFullName}} {{$LeadPhoneMobile}} @if(array_key_exists($Vendors,$VendorDropDown)) {{$VendorDropDown[$Vendors]}} @else {{$Vendors}} @endif @if(array_key_exists($LeadDisposition,$LeadDispositionDropDown)) {{$LeadDispositionDropDown[$LeadDisposition]}} @else {{$LeadDisposition}} @endif @if(array_key_exists($LeadSubDisposition,$LeadSubDispositionDropDown)) {{$LeadSubDispositionDropDown[$LeadSubDisposition]}} @else {{$LeadSubDisposition}} @endif @if(array_key_exists($LeadSource,$LeadSourceDropDown)) {{$LeadSourceDropDown[$LeadSource]}} @else {{$LeadSource}} @endif {{$LeadCreatedDate}} {{$AppointmentCreatedDatenew}} {{$MeetingDateandTimeNew}}