377 lines
26 KiB
PHP
377 lines
26 KiB
PHP
@extends('Admin.layouts.master')
|
|
@section('title', 'Manage Leads')
|
|
@section('style')
|
|
<style>
|
|
.dataTables_filter {
|
|
display: none;
|
|
}
|
|
|
|
.dt-buttons {
|
|
display: none;
|
|
}
|
|
</style>
|
|
@endsection
|
|
@section('content')
|
|
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
|
<div class="d-flex flex-column flex-column-fluid">
|
|
<div id="kt_app_content_container" class="app-container container-xxl">
|
|
<div class="row max-w-100 mt-10 mb-5">
|
|
<div class="col-md-4 index-box px-5">
|
|
<a href="{{ route('new_leads') }}">
|
|
<div class="card card-flush mb-5 mb-xl-10">
|
|
<div class="card-header pt-5">
|
|
<div class="card-title d-flex flex-column">
|
|
<span class="fs-2x fw-bold text-white me-2 lh-1 ls-n2">{{ $newCount }}</span>
|
|
<span class="text-white opacity-75 pt-1 fw-semibold fs-7">New Leads</span>
|
|
</div>
|
|
<div class="title_icon_area">
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#fff"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M6.28548 15.0861C7.34369 13.1814 9.35142 12 11.5304 12H12.4696C14.6486 12 16.6563 13.1814 17.7145 15.0861L19.3493 18.0287C20.0899 19.3618 19.1259 21 17.601 21H6.39903C4.87406 21 3.91012 19.3618 4.65071 18.0287L6.28548 15.0861Z"
|
|
fill="#fff" />
|
|
<rect opacity="0.4" x="8" y="3" width="8" height="8"
|
|
rx="4" fill="#fff" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body d-flex align-items-end pt-0">
|
|
<div class="d-flex align-items-center flex-column mt-3 w-100">
|
|
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
|
|
<div class="bg-white rounded h-8px" role="progressbar" style="width: 72%;"
|
|
aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-md-4 index-box px-5">
|
|
<a href="{{ route('ongoing_leads') }}">
|
|
<div class="card card-flush mb-5 mb-xl-10">
|
|
<div class="card-header pt-5">
|
|
<div class="card-title d-flex flex-column">
|
|
<span class="fs-2x fw-bold text-white me-2 lh-1 ls-n2">{{ $ongoingCount }}</span>
|
|
<span class="text-white opacity-75 pt-1 fw-semibold fs-7">Ongoing Leads</span>
|
|
</div>
|
|
<div class="title_icon_area">
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#fff"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M6.28548 15.0861C7.34369 13.1814 9.35142 12 11.5304 12H12.4696C14.6486 12 16.6563 13.1814 17.7145 15.0861L19.3493 18.0287C20.0899 19.3618 19.1259 21 17.601 21H6.39903C4.87406 21 3.91012 19.3618 4.65071 18.0287L6.28548 15.0861Z"
|
|
fill="#fff" />
|
|
<rect opacity="0.4" x="8" y="3" width="8" height="8"
|
|
rx="4" fill="#fff" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body d-flex align-items-end pt-0">
|
|
<div class="d-flex align-items-center flex-column mt-3 w-100">
|
|
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
|
|
<div class="bg-white rounded h-8px" role="progressbar" style="width: 72%;"
|
|
aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-md-4 index-box px-5">
|
|
<a href="{{ route('completed_leads') }}">
|
|
<div class="card card-flush mb-5 mb-xl-10">
|
|
<div class="card-header pt-5">
|
|
<div class="card-title d-flex flex-column">
|
|
<span class="fs-2x fw-bold text-white me-2 lh-1 ls-n2">{{ $completedCount }}</span>
|
|
<span class="text-white opacity-75 pt-1 fw-semibold fs-7">Completed Leads</span>
|
|
</div>
|
|
<div class="title_icon_area">
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#fff"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M6.28548 15.0861C7.34369 13.1814 9.35142 12 11.5304 12H12.4696C14.6486 12 16.6563 13.1814 17.7145 15.0861L19.3493 18.0287C20.0899 19.3618 19.1259 21 17.601 21H6.39903C4.87406 21 3.91012 19.3618 4.65071 18.0287L6.28548 15.0861Z"
|
|
fill="#fff" />
|
|
<rect opacity="0.4" x="8" y="3" width="8" height="8"
|
|
rx="4" fill="#fff" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body d-flex align-items-end pt-0">
|
|
<div class="d-flex align-items-center flex-column mt-3 w-100">
|
|
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
|
|
<div class="bg-white rounded h-8px" role="progressbar" style="width: 72%;"
|
|
aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-md-4 index-box px-5">
|
|
<a href="{{ route('old_leads') }}">
|
|
<div class="card card-flush mb-5 mb-xl-10">
|
|
<div class="card-header pt-5">
|
|
<div class="card-title d-flex flex-column">
|
|
<span class="fs-2x fw-bold text-white me-2 lh-1 ls-n2">{{ $oldCount }}</span>
|
|
<span class="text-white opacity-75 pt-1 fw-semibold fs-7">Old Leads</span>
|
|
</div>
|
|
<div class="title_icon_area">
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#fff"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M6.28548 15.0861C7.34369 13.1814 9.35142 12 11.5304 12H12.4696C14.6486 12 16.6563 13.1814 17.7145 15.0861L19.3493 18.0287C20.0899 19.3618 19.1259 21 17.601 21H6.39903C4.87406 21 3.91012 19.3618 4.65071 18.0287L6.28548 15.0861Z"
|
|
fill="#fff" />
|
|
<rect opacity="0.4" x="8" y="3" width="8" height="8"
|
|
rx="4" fill="#fff" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body d-flex align-items-end pt-0">
|
|
<div class="d-flex align-items-center flex-column mt-3 w-100">
|
|
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
|
|
<div class="bg-white rounded h-8px" role="progressbar" style="width: 72%;"
|
|
aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-md-4 index-box px-5">
|
|
<a href="{{ route('lost_leads') }}">
|
|
<div class="card card-flush mb-5 mb-xl-10">
|
|
<div class="card-header pt-5">
|
|
<div class="card-title d-flex flex-column">
|
|
<span class="fs-2x fw-bold text-white me-2 lh-1 ls-n2">{{ $lostCount }}</span>
|
|
<span class="text-white opacity-75 pt-1 fw-semibold fs-7">Lost Leads</span>
|
|
</div>
|
|
<div class="title_icon_area">
|
|
<span class="svg-icon svg-icon-1">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="#fff"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M6.28548 15.0861C7.34369 13.1814 9.35142 12 11.5304 12H12.4696C14.6486 12 16.6563 13.1814 17.7145 15.0861L19.3493 18.0287C20.0899 19.3618 19.1259 21 17.601 21H6.39903C4.87406 21 3.91012 19.3618 4.65071 18.0287L6.28548 15.0861Z"
|
|
fill="#fff" />
|
|
<rect opacity="0.4" x="8" y="3" width="8" height="8"
|
|
rx="4" fill="#fff" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body d-flex align-items-end pt-0">
|
|
<div class="d-flex align-items-center flex-column mt-3 w-100">
|
|
<div class="h-8px mx-3 w-100 bg-white bg-opacity-50 rounded">
|
|
<div class="bg-white rounded h-8px" role="progressbar" style="width: 72%;"
|
|
aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row max-w-100">
|
|
<div class="top_header d-flex justify-content-between align-items-center">
|
|
<p class='fs-2 fw-bold mb-0'>Manage Leads</p>
|
|
<div class="table_right_options d-flex">
|
|
<button type="button" class="btn btn-light-primary me-3" id="ExportReporttoExcel">
|
|
<span class="svg-icon svg-icon-2">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<rect opacity="0.3" x="12.75" y="4.25" width="12" height="2"
|
|
rx="1" transform="rotate(90 12.75 4.25)" fill="currentColor"></rect>
|
|
<path
|
|
d="M12.0573 6.11875L13.5203 7.87435C13.9121 8.34457 14.6232 8.37683 15.056 7.94401C15.4457 7.5543 15.4641 6.92836 15.0979 6.51643L12.4974 3.59084C12.0996 3.14332 11.4004 3.14332 11.0026 3.59084L8.40206 6.51643C8.0359 6.92836 8.0543 7.5543 8.44401 7.94401C8.87683 8.37683 9.58785 8.34458 9.9797 7.87435L11.4427 6.11875C11.6026 5.92684 11.8974 5.92684 12.0573 6.11875Z"
|
|
fill="currentColor"></path>
|
|
<path opacity="0.3"
|
|
d="M18.75 8.25H17.75C17.1977 8.25 16.75 8.69772 16.75 9.25C16.75 9.80228 17.1977 10.25 17.75 10.25C18.3023 10.25 18.75 10.6977 18.75 11.25V18.25C18.75 18.8023 18.3023 19.25 17.75 19.25H5.75C5.19772 19.25 4.75 18.8023 4.75 18.25V11.25C4.75 10.6977 5.19771 10.25 5.75 10.25C6.30229 10.25 6.75 9.80228 6.75 9.25C6.75 8.69772 6.30229 8.25 5.75 8.25H4.75C3.64543 8.25 2.75 9.14543 2.75 10.25V19.25C2.75 20.3546 3.64543 21.25 4.75 21.25H18.75C19.8546 21.25 20.75 20.3546 20.75 19.25V10.25C20.75 9.14543 19.8546 8.25 18.75 8.25Z"
|
|
fill="currentColor"></path>
|
|
</svg>
|
|
</span>
|
|
Export
|
|
</button>
|
|
<a type="button" href="{{ route('add-lead') }}" class="btn btn-light-primary me-3"
|
|
data-kt-menu-trigger="click" data-kt-menu-attach="parent"
|
|
data-kt-menu-placement="bottom-start">
|
|
<span class="svg-icon svg-icon-2">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<rect opacity="0.5" x="11.364" y="20.364" width="16" height="2"
|
|
rx="1" transform="rotate(-90 11.364 20.364)" fill="currentColor">
|
|
</rect>
|
|
<rect x="4.36396" y="11.364" width="16" height="2" rx="1"
|
|
fill="currentColor"></rect>
|
|
</svg>
|
|
</span>
|
|
Create Lead
|
|
</a>
|
|
<div class="d-flex align-items-center position-relative">
|
|
<span class="svg-icon svg-icon-1 position-absolute ms-6">
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<rect opacity="0.5" x="17.0365" y="15.1223" width="8.15546" height="2"
|
|
rx="1" transform="rotate(45 17.0365 15.1223)" fill="currentColor" />
|
|
<path
|
|
d="M11 19C6.55556 19 3 15.4444 3 11C3 6.55556 6.55556 3 11 3C15.4444 3 19 6.55556 19 11C19 15.4444 15.4444 19 11 19ZM11 5C7.53333 5 5 7.53333 5 11C5 14.4667 7.53333 17 11 17C14.4667 17 17 14.4667 17 11C17 7.53333 14.4667 5 11 5Z"
|
|
fill="currentColor" />
|
|
</svg>
|
|
</span>
|
|
<input type="text" data-kt-user-table-filter="search"
|
|
class="form-control bg-white form-control-solid w-250px ps-14"
|
|
placeholder="Search Leads" id="searchbox" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="dataTable_area my-5 mb-0">
|
|
<div class="card">
|
|
<div class="card-header border-0 pt-0 h-0">
|
|
<div class="card-toolbar">
|
|
<div class="d-flex justify-content-end" data-kt-user-table-toolbar="base">
|
|
<div class="d-flex justify-content-end align-items-center d-none"
|
|
data-kt-user-table-toolbar="selected">
|
|
<button type="button" class="btn btn-danger"
|
|
data-kt-user-table-select="delete_selected">Delete Selected</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body py-4">
|
|
<div class="table-responsive">
|
|
<table class="table align-middle table-row-dashed fs-6 gy-5" id="manage-leads">
|
|
<thead>
|
|
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
|
|
<th class="w-50px min-w-50px pe-2 align-top">Sr. No.</th>
|
|
<th class="min-w-125px w-100px align-top">Investor name</th>
|
|
<th class="min-w-125px w-125px align-top">Email</th>
|
|
<th class="min-w-125px w-125px align-top">Product Name</th>
|
|
<th class="min-w-125px w-125px align-top">Product Category</th>
|
|
<th class="min-w-125px w-125px align-top">KYC Status</th>
|
|
<th class="min-w-100px w-100px align-top">Lead Source</th>
|
|
<th class="min-w-50px w-75px align-top">Contact Number</th>
|
|
<th class="min-w-50px w-75px align-top">Lead Status</th>
|
|
<th class="min-w-50px w-75px align-top">Created Date</th>
|
|
<th class="text-center min-w-100px align-top notexport">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-gray-600 fw-semibold">
|
|
{{-- @dd($leads[0]) --}}
|
|
@foreach ($leads as $lead)
|
|
<tr>
|
|
<td>
|
|
<div
|
|
class="form-check form-check-sm form-check-custom form-check-solid">
|
|
{{ $loop->iteration }}
|
|
</div>
|
|
</td>
|
|
<td>{{ $lead->user->name ?? $lead->investor_name }}
|
|
</td>
|
|
<td>{{ $lead->email }}</td>
|
|
<td>{{ $productName[$loop->index]['product_name'] }}</td>
|
|
<td>{{ $lead->product == false ? 'No category' : $lead->product->category->category_name }}
|
|
</td>
|
|
<td>{{$lead->kyc == null ? 'No KYC' : $lead->kyc->status }}</td>
|
|
<td>
|
|
{{$lead->lead_source != null ? $lead->lead_source : 'No lead assigned'}}
|
|
</td>
|
|
<td class='w-75px'>{{ $lead->mobile }}</td>
|
|
<td>{{ $lead->lead_status }}</td>
|
|
<td>
|
|
<div class="badge badge-light fw-bold">
|
|
{{ $lead->created_at->format('d/m/Y') }}</div>
|
|
</td>
|
|
<td class="text-end d-flex align-items-center justify-content-around">
|
|
<a href='{{ route('view-lead', $lead->id) }}' class="action_icon"
|
|
title="View lead">
|
|
<i class="fa-regular fa-eye"></i>
|
|
</a>
|
|
<a href="{{ route('edit-lead', $lead->id) }}" title="Edit lead"
|
|
class="action_icon" data-bs-toggle="tooltip"
|
|
data-bs-custom-class="tooltip-inverse" data-bs-placement="top"
|
|
data-kt-initialized="1">
|
|
<svg class="svg-inline--fa fa-pen-to-square" aria-hidden="true"
|
|
focusable="false" data-prefix="fas" data-icon="pen-to-square"
|
|
role="img" xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 512 512" data-fa-i2svg="">
|
|
<path fill="currentColor"
|
|
d="M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.8 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160V416c0 53 43 96 96 96H352c53 0 96-43 96-96V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96z">
|
|
</path>
|
|
</svg>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
@section('scripts')
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var table = $('#manage-leads').DataTable({
|
|
dom: "Bfrtip",
|
|
scrollX: true,
|
|
buttons: [{
|
|
extend: "excel",
|
|
title: "Leads List",
|
|
text: "Export Search Results",
|
|
className: "btn btn-default",
|
|
exportOptions: {
|
|
columns: ":not(.notexport)",
|
|
},
|
|
}, ],
|
|
});
|
|
$("#ExportReporttoExcel").on("click", function() {
|
|
table.button(".buttons-excel").trigger();
|
|
});
|
|
$("#searchbox").keyup(function() {
|
|
table.search($(this).val()).draw();
|
|
});
|
|
|
|
});
|
|
$(document).ready(function() {
|
|
// var ids = $('.current).attr('#data-dt-idx');
|
|
// alert(ids);
|
|
// console.log($('.previous span:first'))
|
|
//$('.previous').each(function(){
|
|
//console.log($(this).find('span a:first'));
|
|
// console.log($(this).prop('span'));
|
|
//})
|
|
|
|
console.log($('.previous > span > a:first').attr('#data-dt-idx'));
|
|
|
|
$('#manage-leads_previous').addClass('d-none');
|
|
});
|
|
// $('.paginate_button').on('click',function(){
|
|
// alert('hello');
|
|
// var id = $(this).data('dt-idx');
|
|
// alert(id);
|
|
// if(id == 0)
|
|
// {
|
|
// $('#manage-leads_previous').addClass('d-none');
|
|
// }
|
|
// else
|
|
// {
|
|
// $('#manage-leads_previous').removeClass('d-none');
|
|
// }
|
|
// });
|
|
</script>
|
|
@endsection
|