168 lines
8.4 KiB
PHP
168 lines
8.4 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', __('crm::lang.lead'))
|
|
|
|
@section('content')
|
|
@include('crm::layouts.nav')
|
|
|
|
<section class="content no-print crm-page">
|
|
<div class="crm-page-header">
|
|
<div>
|
|
<h1><i class="fas fa-user-tag" style="color:#4f46e5;margin-left:8px;"></i> @lang('crm::lang.leads')</h1>
|
|
<p class="crm-subtitle">@lang('crm::lang.all_leads')</p>
|
|
</div>
|
|
<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;">
|
|
<div class="btn-group btn-group-toggle" data-toggle="buttons">
|
|
<label class="crm-btn crm-btn-ghost list @if($lead_view != 'kanban') active @endif">
|
|
<input type="radio" name="lead_view" value="list_view" class="lead_view" data-href="{{action([\Modules\Crm\Http\Controllers\LeadController::class, 'index']).'?lead_view=list_view'}}">
|
|
<i class="fas fa-list"></i> @lang('crm::lang.list_view')
|
|
</label>
|
|
<label class="crm-btn crm-btn-ghost kanban @if($lead_view == 'kanban') active @endif">
|
|
<input type="radio" name="lead_view" value="kanban" class="lead_view" data-href="{{action([\Modules\Crm\Http\Controllers\LeadController::class, 'index']).'?lead_view=kanban'}}">
|
|
<i class="fas fa-columns"></i> @lang('crm::lang.kanban_board')
|
|
</label>
|
|
</div>
|
|
<button type="button" class="crm-btn crm-btn-ghost" id="toggle_lead_filters">
|
|
<i class="fas fa-filter"></i> @lang('crm::lang.filter_leads')
|
|
</button>
|
|
<button type="button" class="crm-btn crm-btn-primary btn-add-lead" data-href="{{action([\Modules\Crm\Http\Controllers\LeadController::class, 'create'])}}">
|
|
<i class="fa fa-plus"></i> @lang('messages.add')
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="crm-filters" id="lead_filters_panel">
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('source', __('crm::lang.source') . ':') !!}
|
|
{!! Form::select('source', $sources, null, ['class' => 'form-control select2 lead-filter', 'id' => 'source', 'placeholder' => __('messages.all')]); !!}
|
|
</div>
|
|
</div>
|
|
@if($lead_view != 'kanban')
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('life_stage', __('crm::lang.status') . ':') !!}
|
|
{!! Form::select('life_stage', $life_stages, null, ['class' => 'form-control select2 lead-filter', 'id' => 'life_stage', 'placeholder' => __('messages.all')]); !!}
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@if(count($users) > 0)
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('user_id', __('lang_v1.assigned_to') . ':') !!}
|
|
{!! Form::select('user_id', $users, null, ['class' => 'form-control select2 lead-filter', 'id' => 'user_id', 'placeholder' => __('messages.all')]); !!}
|
|
</div>
|
|
</div>
|
|
@endif
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('lead_state', __('crm::lang.show') . ':') !!}
|
|
{!! Form::select('lead_state', ['active' => __('crm::lang.active_leads'), 'archived' => __('crm::lang.archived_leads'), 'all' => __('crm::lang.everything')], 'active', ['class' => 'form-control select2 lead-filter', 'id' => 'lead_state']); !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('value_min', __('crm::lang.minimum_value') . ':') !!}
|
|
{!! Form::text('value_min', null, ['class' => 'form-control input_number lead-filter', 'id' => 'value_min', 'placeholder' => __('crm::lang.minimum')]); !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('value_max', __('crm::lang.maximum_value') . ':') !!}
|
|
{!! Form::text('value_max', null, ['class' => 'form-control input_number lead-filter', 'id' => 'value_max', 'placeholder' => __('crm::lang.maximum')]); !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('created_from', __('crm::lang.date_added_from') . ':') !!}
|
|
{!! Form::text('created_from', null, ['class' => 'form-control lead-filter start-date-picker', 'id' => 'created_from', 'readonly']); !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
{!! Form::label('created_to', __('crm::lang.date_added_to') . ':') !!}
|
|
{!! Form::text('created_to', null, ['class' => 'form-control lead-filter start-date-picker', 'id' => 'created_to', 'readonly']); !!}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<button type="button" class="crm-btn crm-btn-primary" id="apply_lead_filters">
|
|
<i class="fas fa-search"></i> @lang('crm::lang.apply_filter')
|
|
</button>
|
|
<button type="button" class="crm-btn crm-btn-ghost" id="reset_lead_filters">
|
|
@lang('crm::lang.reset')
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="crm-admin-section">
|
|
<div class="crm-card">
|
|
<div class="crm-card-header">
|
|
<h3 class="crm-card-title">@lang('crm::lang.all_leads')</h3>
|
|
</div>
|
|
<div class="crm-card-body">
|
|
@if($lead_view == 'list_view')
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-striped" id="leads_table">
|
|
<thead>
|
|
<tr>
|
|
<th>@lang('crm::lang.lead_title')</th>
|
|
<th>@lang('crm::lang.status')</th>
|
|
<th>@lang('crm::lang.lead_value')</th>
|
|
<th>@lang('messages.action')</th>
|
|
<th>@lang('contact.name')</th>
|
|
<th>@lang('lang_v1.added_on')</th>
|
|
<th>@lang('crm::lang.source')</th>
|
|
<th>@lang('lang_v1.assigned_to')</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
@endif
|
|
@if($lead_view == 'kanban')
|
|
<div class="lead-kanban-board">
|
|
<div class="page">
|
|
<div class="main">
|
|
<div class="meta-tasks-wrapper">
|
|
<div id="myKanban" class="meta-tasks"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade contact_modal" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel"></div>
|
|
<div class="modal fade convert_lead_modal" tabindex="-1" role="dialog" aria-labelledby="convertLeadModalLabel"></div>
|
|
<div class="modal fade schedule" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel"></div>
|
|
</section>
|
|
@endsection
|
|
|
|
@section('javascript')
|
|
<script src="{{ asset('modules/crm/js/crm.js?v=' . $asset_v) }}"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var lead_view = urlSearchParam('lead_view');
|
|
|
|
if (_.isEmpty(lead_view)) {
|
|
lead_view = 'list_view';
|
|
}
|
|
|
|
$('#toggle_lead_filters').on('click', function() {
|
|
$('#lead_filters_panel').slideToggle();
|
|
});
|
|
|
|
if (lead_view == 'kanban') {
|
|
$('.kanban').addClass('active');
|
|
$('.list').removeClass('active');
|
|
initializeLeadKanbanBoard();
|
|
} else if(lead_view == 'list_view') {
|
|
initializeLeadDatatable();
|
|
}
|
|
});
|
|
</script>
|
|
@endsection
|