JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "directory-list.blade.php"

Full Path: /var/www/lionsclub/core/resources/views/dashboard/topics/directory-list.blade.php
File size: 11.47 KB
MIME-type: text/html
Charset: utf-8

@extends('dashboard.layouts.master')
<?php
$title_var = "title_" . @Helper::currentLanguage()->code;
$title_var2 = "title_" . env('DEFAULT_LANGUAGE');
if ($WebmasterSection->$title_var != "") {
    $WebmasterSectionTitle = $WebmasterSection->$title_var;
} else {
    $WebmasterSectionTitle = $WebmasterSection->$title_var2;
}
?>

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <!-- DataTables JS -->
    <script src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
    <!-- Bootstrap JS -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
    <meta name="csrf-token" content="{{ csrf_token() }}">

@section('title', $WebmasterSectionTitle)
@push("after-styles")
    <link rel="stylesheet" href="{{ asset('assets/dashboard/js/datatables/datatables.min.css') }}">
@endpush
@section('content')
    <div class="padding">
        <div class="box">   
            <div>
            <div class="row p-a">
                    <div class="col-sm-12">
                        <div class=" p-a ">
                            @if(@Auth::user()->permissionsGroup->add_status)
                                <a class="btn btn-fw primary"
                                   href="{{route("membersCreate")}}">
                                    <i class="material-icons">&#xe02e;</i>
                                    &nbsp; {{ __('New Members') }}</a>
                            @endif
                        </div>
                    </div>
            </div>
                <form>
                <div class="table-responsive">
                    <table class="table table-bordered" style="width: 100%"
                           id="members-table">
                           <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>Full Name</th>
                                    <th>Mobile</th>
                                    <th>Position</th>
                                    <th>Disctrict</th>
                                    <th>Email</th>
                                    <th class="text-center" style="max-width:150px;">{{ __('backend.options') }}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <!-- Table body will be populated by DataTables -->
                            </tbody>
                    </table>
                    </div>
                <form>
                <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title" id="deleteModalLabel">Confirm Deletion</h5>
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                            </div>
                            <div class="modal-body">
                                Are you sure you want to delete this member?
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                                <button type="button" class="btn btn-danger" id="confirmDelete">Delete</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
       
    </div>

    <!-- .modal -->
    
@endsection
@push("after-scripts")


    <script src="{{ URL::asset('assets/frontend/js/Chart.min.js') }}"></script>
    <script>
        var dynamicColors = function () {
            var r = Math.floor(Math.random() * 255);
            var g = Math.floor(Math.random() * 255);
            var b = Math.floor(Math.random() * 255);
            return "rgb(" + r + "," + g + "," + b + ")";
        };

        var randomScalingFactor = function () {
            return Math.round(Math.random() * 100);
        };

        window.onload = function () {
            @foreach($WebmasterSection->customFields as $customField)
            @if($customField->in_statics && ($customField->type==6 || $customField->type==7))
            <?php
            $cf_details_var = "details_" . @Helper::currentLanguage()->code;
            $cf_details_var2 = "details_en" . env('DEFAULT_LANGUAGE');
            if ($customField->$cf_details_var != "") {
                $cf_details = $customField->$cf_details_var;
            } else {
                $cf_details = $customField->$cf_details_var2;
            }
            $cf_details_lines = preg_split('/\r\n|[\r\n]/', $cf_details);
            ?>
            new Chart(document.getElementById('chart-area-{{ $customField->id }}').getContext('2d'), {
                type: 'pie',
                data: {
                    datasets: [{
                        data: [
                            <?php
                            $line_num = 1;
                            ?>
                            @foreach ($cf_details_lines as $cf_details_line)
                            {{ (@$statics[$customField->id][$line_num] !="")?@$statics[$customField->id][$line_num]:0 }},
                            <?php
                            $line_num++;
                            ?>
                            @endforeach
                        ],
                        backgroundColor: [
                            <?php
                            $line_num = 1;
                            ?>
                            @foreach ($cf_details_lines as $cf_details_line)

                            dynamicColors(),
                            <?php
                            $line_num++;
                            ?>
                            @endforeach
                        ],
                        label: 'Dataset 1'
                    }],
                    labels: [
                        <?php
                            $line_num = 1;
                            ?>
                            @foreach ($cf_details_lines as $cf_details_line)
                        ('{{ $cf_details_line }}').substring(0, 40) + ((('{{ $cf_details_line }}').length > 40) ? '..' : '') + " ( " + '{{ (@$statics[$customField->id][$line_num] !="")?@$statics[$customField->id][$line_num]:0 }}' + ' )',
                        <?php
                        $line_num++;
                        ?>
                        @endforeach
                    ]
                },
                options: {
                    responsive: false,
                    legend: {
                        display: true,
                        position: 'left',
                        labels: {

                            // font size, default is defaultFontSize
                            fontSize: 11,

                            // font color, default is '#fff'
                            fontColor: '#666',

                            // font style, default is defaultFontStyle
                            fontStyle: 'normal',

                            // font family, default is defaultFontFamily
                            fontFamily: "smart4dsTitles, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"
                        }
                    }
                }
            });
            @endif
            @endforeach
        };
    </script>


    <script src="{{ asset('assets/dashboard/js/datatables/datatables.min.js') }}"></script>
    <script type="text/javascript">
        $("#checkAll").click(function () {
            $('input:checkbox').not(this).prop('checked', this.checked);
        });
        $("#action").change(function () {
            if (this.value == "delete") {
                $("#submit_all").css("display", "none");
                $("#submit_show_msg").css("display", "inline-block");
            } else {
                $("#submit_all").css("display", "inline-block");
                $("#submit_show_msg").css("display", "none");
            }
        });
        $(document).ready(function () {
            
            var table_name = "#topics_{{ $WebmasterSection->id }}";
                $('#members-table').DataTable({
                    processing: true,
                    serverSide: true,
                    ajax: "{{ route('members.lists') }}",
                    columns: [
                        { data: 'id', name: 'id' },
                        { data: 'full_name', name: 'full_name' },
                        { data: 'mobile_numbers', name: 'mobile_numbers' },
                        { data: 'position', name: 'Position' },
                        { data: 'district', name: 'district' },
                        { data: 'email_id', name: 'email_id' },
                        {
                            data: 'action',
                            name: 'action',
                            orderable: false,
                            searchable: false
                        }
                    ]
                });
        });

        $("#filter_btn").click(function () {
            $("#filter_div").slideToggle();
        });

        function DeleteTopic(id) {
            $("#topic_delete_btn").attr("row-id", id);
            $("#delete-topic").modal("show");
        }

        $("#topic_delete_btn").click(function () {
            $(this).html("<img src=\"{{ asset('assets/dashboard/images/loading.gif') }}\" style=\"height: 25px\"/> {!! __('backend.yes') !!}");
            var row_id = $(this).attr('row-id');
            if (row_id != "") {
                $.ajax({
                    type: "GET",
                    url: "<?php echo route("topicsDestroy", ["webmasterId" => $WebmasterSection->id]); ?>/" + row_id,
                    success: function (result) {
                        var obj_result = jQuery.parseJSON(result);
                        if (obj_result.stat == 'success') {
                            $('#topic_delete_btn').html("{!! __('backend.yes') !!}");
                            $('#topics_{{ $WebmasterSection->id }}').DataTable().ajax.reload();
                        }
                        $('#delete-topic').modal('hide');
                        $('.modal-backdrop').hide();
                    }
                });
            }
        });

        $('#members-table').on('click', '.delete-btn', function() {
            var memberId = $(this).data('id');
            console.log('testing');
            $('#deleteModal').data('id', memberId).modal('show');
            return false;
        });

        // Confirm deletion
        $('#confirmDelete').on('click', function() {
            var memberId = $('#deleteModal').data('id');
            $.ajax({
                url: '/admin/admin/members/delete/' + memberId,
                type: 'DELETE',
                data: {
                    _token: $('meta[name="csrf-token"]').attr('content')
                },
                success: function(response) {
                    $('#deleteModal').modal('hide');
                    $('#members-table').DataTable().ajax.reload();
                    alert(response.success);
                },
                error: function(response) {
                    alert('Error deleting member.');
                }
            });
        });


    </script>
@endpush