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/index.blade.php

@extends('schools.school_layout')
@section('content')
<style>
    .pagination {
            display: flex;
            list-style: none;
            gap: 8px;
            padding: 0;
        }

        .pagination li {
            display: inline-block;
        }

        .pagination a {
            text-decoration: none;
            color: #333;
            font-size: 16px;
            padding: 10px 15px;
            border-radius: 8px;
            background: white;
            border: 1px solid #ddd;
            transition: all 0.3s ease-in-out;
        }

        .pagination a:hover {
            background: #007bff;
            color: white;
            border-color: #007bff;
        }

        .pagination .active a {
            background: #007bff;
            color: white;
            font-weight: bold;
            border-color: #007bff;
        }

        .pagination .disabled a {
            color: #ccc;
            pointer-events: none;
        }
</style>
@foreach($folders as $var)
<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 {{$var->folderName}} Folder</strong></h2>
            </div>
            <div class="body">
                <div id="aniimated-thumbnials" class="list-unstyled row clearfix">
                    @foreach($var->gal_images->take(2) 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>
                <a href="{{url('/school/gfolders/'.$var->idFolder.'/images')}}">View All Images From This Folder</a>
            </div>
        </div>
    </div>
</div>
@endforeach
<div>
{{ $folders->links() }}
</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