IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/gallery/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/gallery/folder_images.blade.php

@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Gallery  : Pictures taken from {{$folder->folderName}} Folder</strong></h2>
            </div>
            <div class="body">
                <div id="aniimated-thumbnials" class="list-unstyled row clearfix">
                    @foreach($folder->gal_images as $value)
                    <div class="col-xl-3 col-lg-4 col-md-6 col-sm-12 m-b-20">
                         <a href="{{ asset('storage/schools/'.$value->idSchool.'/galleries/'.$value->folder->folderName.'/'.$value->image)}}"> 
                            <img class="img-fluid img-thumbnail" src="{{ asset('storage/schools/'.$value->idSchool.'/galleries/'.$value->folder->folderName.'/'.$value->image)}}" alt=""> </a>
                            <button type="button" class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="{{$value->idGallery}}">Delete</button>  
                            </div>
                          
                    @endforeach
                </div>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(function () {
    $('#aniimated-thumbnials').lightGallery({
        thumbnail: true,
        selector: 'a'
    });
});
 $(document).on('click', '.js-sweetalert', function (e) {
    $.ajaxSetup({
        headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    e.preventDefault();
    var id = $(this).data('id');
    swal({
            title: "Are you sure?",
            text: "Are You sure you want to delete this Gallery Image!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, delete it!",
            closeOnConfirm: true
        },
        function() {
         //   console.log('here');
            $.ajax({
                type: "DELETE",
                url: "{{url('/school/galleries/')}}" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Gallery has been successfully deleted", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
    });
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7