KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/_hpe.edukrypt.in/resources/views/admin/content/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/_hpe.edukrypt.in/resources/views/admin/content/add-video-content.blade.php
@extends('admin.layout')
@section('content')



    <!-- begin::main content -->

    <main class="main-content">

        <div class="container">

            <!-- begin::page header -->
            <div class="page-header">
                <h3>Video Content | {{ $info->name }} / {{ $category->name }}</h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="{{ URL::to('admin/dashboard') }}">Dashboard</a></li>
                        <li class="breadcrumb-item"><a href="{{ URL::to('admin/product-list/') }}">Product List</a></li>
                        <li class="breadcrumb-item"><a
                                href="{{ asset('admin/category-list/' . $info->id) }}">{{ $info->name }}</a></li>
                        <li class="breadcrumb-item"><a
                                href="{{ asset('admin/content-list/' . $info->id) . '/' . $category->id }}">{{ $category->name }}</a>
                        </li>
                        <li class="breadcrumb-item active">Video Content</li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->

            <x-flashMessage />
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-header">
                            <h4 class="card-title pull-left m-t-10">Add Video Content</h4>

                            <a href="{{ asset('admin/mcq-list/') }}" class="btn btn-primary pull-right text-white"><i
                                    class="fa fa-file-movie-o"></i>&nbsp;Bulk Mapping Video
                                List</a>

                            <a href="{{ asset('admin/content-list/' . Request::segment(3) . '/' . Request::segment(4)) }}"
                                class="btn btn-primary pull-right text-white m-r-10"><i
                                    class="fa fa-reorder"></i>&nbsp;Other
                                Content
                                Type</a>

                        </div>
                        <div class="card-body">
                            <form
                                action="{{ asset('admin/add-content/' . Request::segment(3) . '/' . Request::segment(4)) }}"
                                method="post" enctype="multipart/form-data">
                                @csrf

                                {{-- TAGS --}}
                                <div class="form-group">
                                    <label for="tag">Select Tags</label>

                                    <select class="form-control" name="tags[]" id="tag">
                                        <option selected value="">--select-tag--</option>
                                        @if (!empty($videoTags))
                                            @foreach ($videoTags as $tag)
                                                <option value="{{ $tag->name }}">{{ $tag->name }}</option>
                                            @endforeach
                                        @endif
                                    </select>

                                    @if ($errors->has('tag'))
                                        <div class="error">
                                            {{ $errors->first('tag') }}
                                        </div>
                                    @endif

                                </div>

                                <div class="form-group">
                                    <label for="video_tag">Select Video</label>
                                    <select id="video_tag" class="video_tag" multiple name="video_tag[]">
                                    </select>

                                    <input type="hidden" name="type" value="video">
                                    @if ($errors->has('video_tag'))
                                        <div class="error">
                                            {{ $errors->first('video_tag') }}
                                        </div>
                                    @endif
                                </div>
                                <button type="submit" class="btn btn-primary">Submit</button>
                            </form>
                        </div>
                    </div>

                    {{-- List --}}
                    <div class="card">
                        <div class="card-header">
                            <h4 class="pull-left m-t-10">Video Content List</h4>
                        </div>
                        <div class="card-body">

                            @if (isset($contents))
                                <table class="table table-striped table-bordered">
                                    <thead>
                                        <tr>
                                            <th>Id</th>
                                            <th>Name</th>
                                            <th>Sorting</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @if (!empty($contents))
                                            @foreach ($contents as $content)
                                                <tr>
                                                    <td>{{ $content->content_id }}</td>
                                                    <td>
                                                        {{ $content->filename }}
                                                    </td>
                                                    <td>{{ $content->st }}</td>
                                                    <td>
                                                        <?php
                                                        $permission = App\Helpers\PermissionActivity::getPermissionByAdminId(session('loggedIn')['id'], 6);
                                                        ?>

                                                        @if ($permission == 'delete')
                                                            <a
                                                                href="{{ asset('admin/edit-video-content/' . $content->content_id . '/' . Request::segment(3) . '/' . Request::segment(4)) }}">
                                                                <i class="fa fa-edit text-dark fa-lg"></i>
                                                            </a>&nbsp;
                                                            <a href="{{ asset('admin/delete-content/' . $content->content_id) }}"
                                                                class="delete-confirm">
                                                                <i class="fa fa-trash text-danger fa-lg"></i>
                                                            </a>
                                                        @endif


                                                    </td>

                                                </tr>
                                            @endforeach
                                        @else
                                            <h1>No Record Found!!</h1>
                                        @endif

                                    </tbody>

                                </table>
                                <div class="pagination-block">

                                    @if (request()->input('search'))
                                        {{ $contents->appends(['search' => request()->input('search')])->links('admin.includes.paginationlinks') }}
                                    @else
                                        {{ $contents->links('admin.includes.paginationlinks') }}
                                    @endif

                                    <label>Total Record Found- <?php echo count($contents); ?></label>
                                </div>

                            @endif

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <!-- end::main content -->
    {{-- var values = "{{ $video->tags}}";
     var array = values.split(',');
     $("#tag").val(array).trigger("change"); --}}
@endsection
@push('footer-script')
    <!-- begin::select2 -->
    <link rel="stylesheet" href="{{ asset('public/admin/vendors/select2/css/select2.min.css') }}" type="text/css">
    <script src="{{ asset('public/admin/vendors/select2/js/select2.min.js') }}"></script>

    <script>
        $(document).ready(function() {

            var CSRF_TOKEN = $('meta[name="csrf-token"]').attr('content');
            $("#video_tag").select2({
                placeholder: 'Select',
                multiple: true,
                tokenSeparators: [',', ' '],
                minimumInputLength: 3,
                minimumResultsForSearch: 10,
                ajax: {
                    url: "{{ asset('admin/get-all-videos-list') }}",
                    dataType: "json",
                    type: "GET",
                    delay: 50,
                    cache: true,
                    data: function(params) {
                        return {
                            _token: CSRF_TOKEN,
                            search: params.term // search term
                        };
                    },
                    processResults: function(data) {
                        return {
                            results: $.map(data, function(item) {
                                console.log(item.text);
                                return {
                                    text: item.text,
                                    id: item.id
                                }
                            })
                        };
                    }
                }
            });


            $('#tag').select2({
                placeholder: 'Select'
            });

            $('#tag').on("select2:select", function(event) {
                var value = $(event.currentTarget).find("option:selected").val();
                $.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
                });
                $.ajax({
                    /* the route pointing to the post function */
                    url: "{{ asset('admin/get-videos-list') }}",
                    type: 'POST',
                    /* send the csrf-token and the input to the controller */
                    data: {
                        id: value
                    },
                    dataType: 'JSON',
                    /* remind that 'data' is the response of the AjaxController */
                    success: function(data) {
                        $("#video_tag").html('').select2({
                            data: data
                        });
                    }
                });
            });

        });
    </script>
    <!-- end::select2 -->
@endpush

Anon7 - 2021