Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sipeka
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
sipeka
Commits
ef9c054f
Commit
ef9c054f
authored
Nov 06, 2024
by
Siti Aisah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tambah datatable dan filter periode saku
parent
6f38d6b7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
9 deletions
+95
-9
app/Http/Controllers/Admin/LaporanController.php
+50
-4
resources/views/laporan/index.blade.php
+20
-3
resources/views/layouts/headpg.blade.php
+1
-0
resources/views/saku/index.blade.php
+12
-1
resources/views/transaksi/index.blade.php
+12
-1
No files found.
app/Http/Controllers/Admin/LaporanController.php
View file @
ef9c054f
...
...
@@ -5,21 +5,67 @@
use
App\Http\Controllers\Controller
;
use
App\Models\Admin\Vsaku
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Session
;
class
LaporanController
extends
Controller
{
public
function
index
()
{
public
function
index
(
Request
$request
)
{
$data
[
'rs'
]
=
Vsaku
::
get
();
$filter_periode
=
DB
::
table
(
'ms_periode'
)
->
orderBy
(
'periode'
,
'asc'
)
->
get
();
Session
::
put
(
'periode'
,
$request
->
periode
);
if
(
empty
(
Session
::
get
(
'periode'
)))
{
$rs
=
DB
::
table
(
'v_saku_new'
)
->
select
(
'nama'
,
'nip'
,
'unit'
,
DB
::
raw
(
'COUNT(id_pengajuan) as jumlah'
))
->
groupBy
(
'nama'
,
'nip'
,
'unit'
)
->
get
();
}
else
{
$periode
=
DB
::
table
(
'ms_periode'
)
->
where
(
'periode'
,
Session
::
get
(
'periode'
))
->
first
();
$rs
=
DB
::
table
(
'v_saku_new'
)
->
select
(
'nama'
,
'nip'
,
'unit'
,
DB
::
raw
(
'COUNT(id_pengajuan) as jumlah'
))
->
whereBetween
(
'tanggal_keputusan'
,
[
$periode
->
tanggal_awal
,
$periode
->
tanggal_akhir
])
->
groupBy
(
'nama'
,
'nip'
,
'unit'
)
->
get
();
}
$data
=
[
'rs'
=>
$rs
,
'periode'
=>
$filter_periode
];
return
view
(
'laporan.index'
,
$data
);
}
public
function
download
(
Request
$request
)
{
$data
[
'nama_file'
]
=
'Laporan Reviewer Sipeka '
.
date
(
'Y-m-d'
);
$data
[
'rs'
]
=
Vsaku
::
get
();
if
(
empty
(
Session
::
get
(
'periode'
)))
{
$data
[
'rs'
]
=
DB
::
table
(
'v_saku_new'
)
->
select
(
'nama'
,
'nip'
,
'unit'
,
DB
::
raw
(
'COUNT(id_pengajuan) as jumlah'
))
->
groupBy
(
'nama'
,
'nip'
,
'unit'
)
->
get
();
$data
[
'nama_file'
]
=
'Laporan Reviewer Sipeka Semua Periode'
;
}
else
{
$periode
=
DB
::
table
(
'ms_periode'
)
->
where
(
'periode'
,
Session
::
get
(
'periode'
))
->
first
();
$data
[
'rs'
]
=
DB
::
table
(
'v_saku_new'
)
->
select
(
'nama'
,
'nip'
,
'unit'
,
DB
::
raw
(
'COUNT(id_pengajuan) as jumlah'
))
->
whereBetween
(
'tanggal_keputusan'
,
[
$periode
->
tanggal_awal
,
$periode
->
tanggal_akhir
])
->
groupBy
(
'nama'
,
'nip'
,
'unit'
)
->
get
();
$data
[
'nama_file'
]
=
'Laporan Reviewer Sipeka Periode '
.
$periode
->
periode
;
}
return
view
(
'laporan.excel'
,
$data
);
}
...
...
resources/views/laporan/index.blade.php
View file @
ef9c054f
...
...
@@ -5,15 +5,32 @@
<div class="
card
">
<div class="
card
-
header
">
<h4 class="
card
-
title
">SAKU Reviewer</h4>
<form action="
{{
route
(
'laporan.download'
)
}}
" method="
POST
">
@csrf
<button type="
submit
" class="
btn
btn
-
success
pull
-
lefts
">Download Excel</button>
</form>
</div>
<div class="
card
-
body
">
<div class="
card
-
text
">
<div class="
row
">
<div class="
panel
panel
-
info
">
<div class="
panel
-
body
">
<form action="
{{
route
(
'laporan.download'
)
}}
" method="
POST
">
@csrf
<button type="
submit
" class="
btn
btn
-
success
pull
-
lefts
">Download Excel</button>
<form action="
{{
route
(
'laporan.index'
)
}}
" method="
GET
">
<div class="
row
">
<div class="
col
-
md
-
3
">
<label>Periode</label>
<select name="
periode
" class="
form
-
control
">
<option value="">Semua</option>
@foreach(
$periode
as
$p
)
<option value={{
$p->periode
}} @if( Session::get('periode') ==
$p->periode
) selected="
selected
" @endif>{{
$p->periode
}}</option>
@endforeach
</select>
</div>
<div class="
col
-
md
-
2
">
<br>
<button class="
btn
btn
-
info
pull
-
lefts
">Cari</button>
</div>
</div>
</form>
</div>
</div>
...
...
resources/views/layouts/headpg.blade.php
View file @
ef9c054f
...
...
@@ -59,6 +59,7 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url('theme/css/plugins/forms/pickers/form-pickadate.css') }}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url('theme/css/pages/app-invoiceE.css') }}"
>
<link
rel=
"stylesheet"
href=
"https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css"
>
<!-- BEGIN: Custom CSS-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{ url('theme/assets/css/style.css') }}"
>
...
...
resources/views/saku/index.blade.php
View file @
ef9c054f
...
...
@@ -26,7 +26,7 @@
</div>
<div class="
table
-
responsive
mb
-
4
">
<table id="
zero
-
config
" class="
table
table
-
hover
" style="
width
:
100
%
">
<table id="
datatable
" class="
table
data
-
table
table
-
hover
" style="
width
:
100
%
">
<thead>
<tr>
<th>No</th>
...
...
@@ -92,5 +92,16 @@
</div>
</div>
@push('js')
<!-- Include DataTable JS -->
<script src="
https
://
code
.
jquery
.
com
/
jquery
-
3.6
.
0.
min
.
js
"></script>
<script src="
https
://
cdn
.
datatables
.
net
/
1.12
.
1
/
js
/
jquery
.
dataTables
.
min
.
js
"></script>
<script src="
https
://
cdn
.
jsdelivr
.
net
/
npm
/
feather
-
icons
"></script>
<script>
$(document).ready(function() {
$('#datatable').DataTable();
});
feather.replace();
</script>
@endpush
@stop
resources/views/transaksi/index.blade.php
View file @
ef9c054f
...
...
@@ -57,7 +57,7 @@
</div>
<div class="
table
-
responsive
mb
-
4
">
<table id="
zero
-
config
" class="
table
table
-
hover
" style="
width
:
100
%
">
<table id="
datatable
" class="
table
data
-
table
table
-
hover
" style="
width
:
100
%
">
<thead>
<tr>
@php
...
...
@@ -182,5 +182,16 @@
</div>
</div>
@push('js')
<!-- Include DataTable JS -->
<script src="
https
://
code
.
jquery
.
com
/
jquery
-
3.6
.
0.
min
.
js
"></script>
<script src="
https
://
cdn
.
datatables
.
net
/
1.12
.
1
/
js
/
jquery
.
dataTables
.
min
.
js
"></script>
<script src="
https
://
cdn
.
jsdelivr
.
net
/
npm
/
feather
-
icons
"></script>
<script>
$(document).ready(function() {
$('#datatable').DataTable();
});
feather.replace();
</script>
@endpush
@stop
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment