IMMREX7

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

@extends('students.student_layout')
@section('content')
@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">
                    @php 
                    if(count($folders->items()) > 1)
                    $gal_images = \App\Gallery::where('idSchool', '=', $student->idSchool)->where('idFolder',$var->idFolder)->paginate(4)->items();
                    else 
                    $gal_images = \App\Gallery::where('idSchool', '=', $student->idSchool)->where('idFolder',$var->idFolder)->get();
                    @endphp
                    @foreach($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> </div>
                    @endforeach
                </div>
                @if(count($folders->items()) > 1)
                @if(\App\Gallery::where('idSchool', '=', $student->idSchool)->where('idFolder',$var->idFolder)->count() > 4)
                <ul class="body pagination pagination-primary"><li class="page-item active"><a class="page-link" href="{{url('student/gallery-folder').'/'.$var->idFolder}}">View All Images</a></li></ul>
                @endif
                @endif
            </div>
        </div>
    </div>
</div>
@endforeach
@if(count($folders->items()) > 1)
@php
$lastIndex = 15 + $folders->currentPage();
if($lastIndex > $folders->lastPage())
$lastPage = $folders->lastPage();
$startIndex = $folders->currentPage();
@endphp
<ul class="body pagination pagination-primary">
    @if($folders->currentPage() > 1)
    <li class="page-item"><a class="page-link" href="{{$folders->previousPageUrl()}}">Previous</a></li>
    @endif

    @for ($i = $startIndex ; $i < $lastIndex; $i++)
    <li class="page-item <?php if($i == $folders->currentPage()) echo 'active';?>"><a class="page-link" href="{{$folders->url($i)}}">{{$i}}</a></li>
    @endfor
    
    <li class="page-item"><a class="page-link" href="{{$folders->nextPageUrl()}}">Next</a></li>
</ul>
@endif
@stop
@section('script')
<script>
$(function () {
    $('#aniimated-thumbnials').lightGallery({
        thumbnail: true,
        selector: 'a'
    });
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7