@extends('layouts.site') @php $RecordsPerSite = 15; $i = 1; $page_back = session()->get('page_back_f1002'); if(isset($_GET['page'])){ $page = $_GET['page']; }else if(isset($page_back)){ $page = $page_back; }else{ $page = null; } if(isset($page) && $page > 1){ $i = (($page -1 ) * $RecordsPerSite) + 1; } session()->flash('page_back_f1002', $page); // Pobieram dane z adresu - page, sort, direction. my_SetExtendAddress(); //$page = session()->get('page'); $sort = session()->get('sort'); $direction = session()->get('direction'); $HowManyAllRecords = DB::table('sw020_komorki_organizacyjne')->count(); $filter = session()->get('filter'); $HowManyRecords = DB::table('sw020_komorki_organizacyjne') ->where('nazwa_pelna', 'like', '%'.$filter.'%') ->orWhere('nazwa_skrot', 'like', '%'.$filter.'%') ->count(); $sw020_struktura = DB::table('sw020_komorki_organizacyjne'); $sw020_struktura_2 = $sw020_struktura->paginate(15,['*'],'page',$page); @endphp @section('title','Strona Startowa') @section('content')