%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/crm-ind-code/resources/views/backend/pages/calling/
Upload File :
Create Path :
Current File : //home/silvzytp/crm-ind-code/resources/views/backend/pages/calling/reject.blade.php

@extends('layouts.backend')
@section('title', $siteTitle)

@push('styles')
<style>
    .import-file {
        width: 100%;
        border: 1px dotted #ccc;
        padding: 20px;
        text-align: center;
        margin-bottom: 0;
    }

    label[for="all_checked"]::before {
        border-color: #fff !important;
    }
</style>
@endpush

@section('content')

    <div class="row">
        <div class="col-12">
            <div class="card mb-3">
                <div class="card-header">
                    <h6 class="card-title">Filter</h6>
                </div>
                <div class="card-body">
                    <form method="POST">
                        <div class="row">
                            <div class="col-md-2">
                                <select name="agent" class="form-control">
                                    <option value="">-- Select Agent --</option>
                                    @foreach ($agents as $agent)
                                    <option value="{{ $agent->id }}">{{ $agent->name }}</option>
                                    @endforeach
                                </select>
                            </div>

                            <div class="col-md-2">
                                <select class="form-control" name="status" onchange="select_status(this.value)">
                                    <option value="">-- Select Status --</option>
                                    @forelse ($statuses as $status)
                                        <option value="{{ $status->id }}">{{ $status->name }}</option>
                                    @empty

                                    @endforelse
                                </select>
                            </div>

                            <div class="col-md-2">
                                <select class="form-control" name="sub_status">
                                    <option value="">-- Select Sub Status --</option>
                                </select>
                            </div>
                            <div class="col-md-2">
                                <select class="form-control" name="potential">
                                    <option value="">-- Select Potential --</option>
                                    @foreach (POTENTIAL as $key=>$value)
                                    <option value="{{ $key }}">{{ $value }}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-md-2">
                                <input type="text" class="form-control" required id="date_range" placeholder="MM/DD/YY" autocomplete="off" autofocus>
                                <input type="hidden" name="start_date">
                                <input type="hidden" name="end_date">
                            </div>
                            <div class="col-md-2 text-right">
                                <button type="button" id="filter-btn" class="btn btn-md btn-primary"><i class="fas fa-search"></i></button>
                                <button type="button" id="filter-reset" class="btn btn-md btn-warning"><i class="fas fa-sync-alt"></i></button>
                            </div>
                        </div>
                        <div class="row mt-3">
                            <div class="col-12">
                                <input type="text" class="form-control" name="search" placeholder="file name, serial, name, email search here..">
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <div id="bulk-card" class="d-none">
                <form method="POST" id="bulk-form">
                    @csrf
                    <div class="d-flex align-items-center mb-3">
                        <x-form.selectbox name="operation" divClass="mb-0">
                            <option value="">-- Select --</option>
                            @permission('app.callings.assign')
                            <option value="delete">Delete</option>
                            @endpermission
                            @permission('app.callings.assign')
                            <option value="assign">Assign</option>
                            @endpermission
                        </x-form.selectbox>

                        @permission('app.callings.assign')
                        @if ($agents->isNotEmpty())
                            <x-form.selectbox name="managers" divClass="mb-0 ml-2 manager-list d-none">
                                <option value="">-- Select Agent --</option>
                                @foreach ($agents as $value)
                                    <option value="{{ $value->id }}">{{ $value->name }}</option>
                                @endforeach
                            </x-form.selectbox>
                        @endif
                        @endpermission

                        <div class="bulk-apply">
                            <button class="btn btn-md btn-primary rounded-0 ml-2 px-3">Apply</button>
                        </div>
                    </div>
                </form>
            </div>

            <div class="card">
                <div class="card-body px-0">
                    <div class="table-responsive">
                        <div class="table-responsive">
                            <table class="table table-sm table-bordered table-style" id="calling-read-pool-datatables">
                                <thead>
                                    <tr class="bg-primary text-light">
                                        <th>
                                            <div class="custom-control custom-checkbox">
                                                <input type="checkbox" class="custom-control-input" id="all_checked">
                                                <label class="custom-control-label" for="all_checked"></label>
                                            </div>
                                        </th>
                                        <th style="min-width: 80px;">File Name</th>
                                        <th style="min-width: 80px;">Date</th>
                                        <th style="min-width: 100px;">Agent</th>
                                        <th style="min-width: 60px;">Serial</th>
                                        <th style="min-width: 200px;">Name</th>
                                        <th style="min-width: 150px;">Email</th>
                                        <th style="min-width: 90px;">Phone</th>
                                        <th style="min-width: 90px;">Number 1</th>
                                        <th style="min-width: 90px;">Number 2</th>
                                        <th style="min-width: 80px;">Status</th>
                                        <th style="min-width: 90px;">Sub Status</th>
                                        <th>Potential</th>
                                        <th style="min-width: 100px;">Time Of Call</th>
                                        <th>Comment</th>
                                        <th style="min-width: 90px;">Follow up 1</th>
                                        <th style="min-width: 90px;">Follow up 2</th>
                                        <th style="min-width: 90px;">Follow up 3</th>
                                        <th class="text-right">Action</th>
                                    </tr>
                                </thead>
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    @include('backend.modal.calling-modal')
@endsection

@push('scripts')
    <script>
        table = $('#calling-read-pool-datatables').DataTable({
            processing: true,
            serverSide: true,
            order: [], //Initial no order
            bInfo: true, //TO show the total number of data
            bFilter: false, //For datatable default search box show/hide
            responsive: true,
            ordering: false,
            lengthMenu: [
                [5, 10, 15, 25, 50, 100, 1000, 10000, -1],
                [5, 10, 15, 25, 50, 100, 1000, 10000, "All"]
            ],
            pageLength: 10, //number of data show per page
            ajax: {
                url: "{{ route(routeName().'.callings.reject.get-data') }}",
                type: "POST",
                dataType: "JSON",
                data: function(d) {
                    d._token = _token;
                    d.status = $('select[name="status"]').val();
                    d.sub_status = $('select[name="sub_status"]').val();
                    d.agent = $('select[name="agent"]').val();
                    d.potential = $('select[name="potential"]').val();
                    d.start_date = $('input[name="start_date"]').val();
                    d.end_date   = $('input[name="end_date"]').val();
                    d.search_text = $('input[name="search"]').val();
                },
            },
            columns: [
                {data: 'bulk_check',orderable: false, searchable: true},
                {data: 'file_name'},
                {data: 'date'},
                {data: 'agent'},
                {data: 'serial'},
                {data: 'name'},
                {data: 'email'},
                {data: 'phone'},
                {data: 'number_1'},
                {data: 'number_2'},
                {data: 'status'},
                {data: 'sub_status'},
                {data: 'potential'},
                {data: 'time_of_call'},
                {data: 'comment'},
                {data: 'follow_up1'},
                {data: 'follow_up2'},
                {data: 'follow_up3'},
                {data: 'action', orderable: false, searchable: false},
            ],
            language: {
                processing: '<img src="{{ asset("uploads/images/table-loading.svg") }}">',
                emptyTable: '<strong class="text-danger">No Data Found</strong>',
                infoEmpty: '',
                zeroRecords: '<strong class="text-danger">No Data Found</strong>',
                oPaginate: {
                    sPrevious: "Previous", // This is the link to the previous page
                    sNext: "Next", // This is the link to the next page
                },
                lengthMenu: "_MENU_"
            },
            dom: "<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6' <'float-right pr-15'B>>>" +
            "<'row'<'col-sm-12'tr>>" +
            "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'<'float-right pr-15'p>>>",
            buttons: {
                buttons: [
                    {
                        extend: 'pdf',
                        filename: 'users_{{ date("d_m_d") }}',
                        title: 'User List',
                        orientation: "portrait",
                        pageSize: "A4",
                        className: 'pdfButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '0,1,2,3,4,5,6,7,8,9,10,11'
                        },
                    },
                    {
                        extend: 'excel',
                        filename: 'users_{{ date("d_m_d") }}',
                        title: 'User List',
                        className: 'excelButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '0,1,2,3,4,5,6,7,8,9,10,11'
                        },
                    },
                    {
                        extend: 'csv',
                        filename: 'users_{{ date("d_m_d") }}',
                        title: 'User List',
                        className: 'csvButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '1,2,3,4,5,6,7,8,9,10,11,12'
                        },
                    },
                    {
                        extend: 'print',
                        title: 'User List',
                        orientation: "landscape",
                        pageSize: "A4",
                        className: 'printButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '0,1,2,3,4,5,6,7,8,9,10,11'
                        },
                        customize: function ( win ) {
                            $(win.document.body)
                                .addClass('bg-white')
                                .css('font-size','10pt');

                            $(win.document.body).find('table')
                                .addClass('compact bg-white')
                                .css('font-size','inherit' );
                        }
                    }
                ]
            }
        });

        // user bulk operation
        $(document).on('click', 'button.bulk-deletable-action', function(){
            var data_id = $('#deletable-modal input.datatable').val();
            var operation_type = $('#deletable-modal .modal-body input.operation-type').val();
            const url = "{{ route(routeName().'.callings.read-pool.operation') }}";
            var assign_user = $('#deletable-modal .modal-body input.manager-select').val();
            bulk_deletable_action(data_id,operation_type,assign_user,url);
        });

        // operation assign manager
        $(document).on('change','select[name="operation"]', function(){
            let selected_value = $(this).val();
            if (selected_value == 'assign') {
                $('.manager-list').removeClass('d-none');
            }else{
                $('.manager-list').addClass('d-none');
            }
        });

        $(document).on('click', 'button.data-view', function(){
            var data_id = $(this).data('id');
            var type_name = $(this).data('type');
            var content = $(this).data('content');
            var serial = $(this).data('serial');
            $('#calling-single-modal .modal-title').text(type_name+' ('+serial+')');
            $('#calling-single-modal .content').text(content == '' ? type_name +' is empty!' : content);
            $('#calling-single-modal').modal({
                keyboard: false,
                backdrop: 'static'
            });
        });

        function select_status(status){
            $.ajax({
                type: "POST",
                url: "{{ route(routeName().'.callings.status.get-data') }}",
                data: {_token:_token,status:status},
                dataType: "JSON",
                success: function (response) {
                    $('select[name="sub_status"]').html('');
                    if (response) {
                        $('select[name="sub_status"]').html(response);
                    }
                }
            });
        }

        $(document).on('click', 'button#filter-btn',function(){
            table.ajax.reload();
        });

        $(document).on('click', 'button#filter-reset',function(){
            $('form')[0].reset();
            table.ajax.reload();
        });

        $(document).on('keyup keypress', 'input[name="search"]',function(){
            table.ajax.reload();
        });

        // datepicker
        $('input#date_range').daterangepicker({
            opens: 'right',
            autoUpdateInput: false,
            locale: {
                cancelLabel: 'Clear'
            },
            ranges: {
                'Today'       : [moment(), moment()],
                'Last 7 Days' : [moment().subtract(6, 'days'), moment()],
                'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                'This Month'  : [moment().startOf('month'), moment().endOf('month')],
                'Last Month'  : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
            }
        }, function(start, end, label) {
            $('input[name="start_date"]').val(start.format('YYYY-MM-DD'));
            $('input[name="end_date"]').val(end.format('YYYY-MM-DD'));
        });

        $('input#date_range').on('apply.daterangepicker', function(ev, picker) {
            $(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
        });

        $('input#date_range').on('cancel.daterangepicker', function(ev, picker) {
            $(this).val('');
        });

        $(document).on('click', 'button.data-time-view', function(){
            var serial = $(this).data('serial');
            var data_time = $(this).data('time');
            $('#calling-single-modal .modal-title').text(serial);
            $('#calling-single-modal .content').html(data_time);
            $('#calling-single-modal').modal({
                keyboard: false,
                backdrop: 'static'
            });
        });

        $(document).on('click', 'button#btn-time-data', function(){
            $('.modal-title').text('Time Of Call');
            $('.content > p').text('');
            var data_id = $(this).data('id');
            $.ajax({
                type: "POST",
                url: "{{ route(routeName().'.callings.time') }}",
                data: {
                    _token:_token,
                    data_id:data_id
                },
                dataType: "JSON",
                success: function (response) {
                    $('#calling-data').html('');
                    if (response) {
                        $('#calling-data').append(response)
                        $('#calling-single-modal').modal({
                            keyboard: false,
                            backdrop: 'static'
                        });
                    }
                }
            });
        });
    </script>
@endpush

Zerion Mini Shell 1.0