%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/dsr_code/resources/views/backend/member/manager/pages/target/
Upload File :
Create Path :
Current File : //home/silvzytp/dsr_code/resources/views/backend/member/manager/pages/target/index.blade.php

@extends('layouts.backend')
@section('title', $siteTitle)
@section('action')
    @permission('app.target.create')
        <a href="{{ route('app.targets.create') }}" class="btn btn-sm btn-primary"><i class="ti-plus fs-ism fw-800"></i> Add New</a>
    @endpermission
@endsection
@push('styles')
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<style>
    .onoffswitch {
        position: relative;
        width: 95px;
        -webkit-user-select:none;
        -moz-user-select:none;
        -ms-user-select: none;
    }
    .onoffswitch-checkbox {
        display: none;
    }
    .onoffswitch-label {
        display: block;
        overflow: hidden;
        cursor: pointer;
        border-radius: 20px;
        margin-bottom: 0;
    }
    .onoffswitch-inner {
        display: block;
        width: 200%;
        margin-left: -100%;
        transition: margin 0.3s ease-in 0s;
    }
    .onoffswitch-inner:before, .onoffswitch-inner:after {
        display: block;
        float: left;
        width: 50%;
        height: 25px;
        padding: 0;
        line-height: 25px;
        font-size: 14px;
        color: white;
        font-family: Trebuchet, Arial, sans-serif;
        font-weight: 400;
        box-sizing: border-box;
    }
    .onoffswitch-inner:before {
        content: "Enabled";
        padding-left: 10px;
        background-color: green;
        color: #FFFFFF;
    }
    .onoffswitch-inner:after {
        content: "Disabled";
        padding-right: 10px;
        background-color: red;
        color: #FFFFFF;
        text-align: right;
    }
    .onoffswitch-switch {
        display: block;
        width: 25px;
        margin: 2px;
        background: #FFFFFF;
        position: absolute;
        top: 0;
        bottom: 0;
        right: 67px;
        border-radius: 20px;
        transition: all 0.3s ease-in 0s;
    }
    .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
        margin-left: 0;
    }
    .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
        right: 0px;
    }
    .date-range{
        min-width: 100px;
    }
    .table-style tbody tr:not(.odd) td:last-child {
        text-align: center !important;
    }
</style>
@endpush

@section('content')

    <div class="row">
        <div class="col-12">
            <div class="ibox">
                <div class="ibox-body px-0">
                    <div class="table-responsive">
                        <table class="table table-sm w-100 table-borderless table-style" id="target-datatables">
                        <thead>
                            <th>Date</th>
                            <th>Sale Target</th>
                            <th>Action</th>
                        </thead>
                        <tbody>

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

@endsection

@push('scripts')
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script>
    table = $('#target-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: 25, //number of data show per page
        ajax: {
            url: "{{ route('app.targets.get-data') }}",
            type: "POST",
            dataType: "JSON",
            data: function(d) {
                d._token     = _token;
            },
        },
        columns: [
            // {data: 'bulk_check',orderable: false, searchable: false},
            {data: 'date'},
            {data: 's_target'},
            {data: 'action'}
        ],
        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: [
                {
                    text: '<i class="fa fa-refresh" aria-hidden="true"></i> Reload',
                    className: 'btn btn-sm btn-primary',
                    action: function (e, dt, node, config) {
                        dt.ajax.reload(null, false);
                    }
                },
                {
                    extend: 'pdf',
                    filename: 'target_{{ date("d_m_d") }}',
                    title: 'Target List',
                    text: '<i class="fa fa-file-pdf-o" aria-hidden="true"></i> PDF',
                    orientation: "portrait",
                    pageSize: "A4",
                    className: 'pdfButton btn btn-sm btn-primary',
                    exportOptions: {
                        columns: '0,1'
                    },
                    customize: function(doc) {
                        doc.defaultStyle.alignment = 'center';
                    }
                },
                {
                    extend: 'excel',
                    filename: 'target_{{ date("d-m-Y") }}',
                    title: 'Target List',
                    text: '<i class="fa fa-file-excel-o" aria-hidden="true"></i> Excel',
                    className: 'excelButton btn btn-sm btn-primary',
                    exportOptions: {
                        columns: '0,1'
                    },
                },
                {
                    extend: 'print',
                    text: '<i class="fa fa-print" aria-hidden="true"></i> Print',
                    className: 'printButton btn btn-sm btn-primary',
                    exportOptions: {
                        columns: '0,1'
                    },
                    customize: function (win){
                        $(win.document.body).find('table').css('text-align', 'center');
                        $(win.document.body).find('.table thead th').css('text-align', 'center');
                    }
                }
            ]
        }
    });

    @permission('app.target.destroy')
    // deletable btn
    $(document).on('click', 'button.confirm-deletable-action', function(){
        // modal data
        let data_id = $('#deletable-modal input.datatable').val();
        const url = "{{ route('app.targets.destroy') }}";

        deletable_action(data_id,url); // define function
    });
    @endpermission

</script>
@endpush

Zerion Mini Shell 1.0