Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
instrument
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
Windy Chikita
instrument
Commits
19ccab77
Commit
19ccab77
authored
Jun 20, 2022
by
windychikita20
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tambahan instrument
parent
4b2e78cd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
50 deletions
+76
-50
app/Http/Controllers/Admin/LembarInstrumentMonitoringController.php
+72
-47
app/Http/Controllers/Admin/PernyataanInstrumentController.php
+2
-2
resources/views/content/backend/masters/lembar_instrument_monitoring/index.blade.php
+0
-0
resources/views/content/backend/masters/lembar_instrument_monitoring/laporan.blade.php
+0
-0
routes/web.php
+2
-1
No files found.
app/Http/Controllers/Admin/LembarInstrumentMonitoringController.php
View file @
19ccab77
...
...
@@ -34,15 +34,30 @@ class LembarInstrumentMonitoringController extends Controller
$data
[
'instrumentdetail'
]
=
Instrument
::
query
()
->
where
(
'id'
,
$data
[
'filter_instrument'
])
->
first
();
$data
[
'pernyataan_instrument'
]
=
Pernyataan_Instrument
::
query
()
->
orderBy
(
'pernyataan_instrument'
)
->
get
();
$data
[
'sub_instrument'
]
=
Sub_Instrument
::
query
()
->
where
(
'id_instrument'
,
$data
[
'filter_instrument'
]
)
->
orderBy
(
'id_instrument'
)
->
get
();
$data
[
'pernyataan_instrument'
]
=
Pernyataan_Instrument
::
query
()
->
orderBy
(
'created_at'
,
'asc'
)
->
get
();
$data
[
'sub_instrument'
]
=
Sub_Instrument
::
query
()
->
with
(
'jenis_input'
)
->
where
(
'id_instrument'
,
$data
[
'filter_instrument'
]
)
->
orderBy
(
'created_at'
,
'asc'
)
->
get
();
$data
[
'sub_pernyataan_instrument'
]
=
Sub_Pernyataan_Instrument
::
query
()
->
orderBy
(
'sub_peryataan'
)
->
get
();
$data
[
'fakultas'
]
=
Fakultas
::
query
()
->
orderBy
(
'id'
)
->
get
();
$data
[
'instrument'
]
=
Instrument
::
query
()
->
orderBy
(
'instrument'
)
->
get
();
$data
[
'tahun'
]
=
Tahun
::
query
()
->
orderBy
(
'tahun'
)
->
get
();
$data
[
'hasil_instrumen'
]
=
Hasil_Instrument
::
query
()
->
get
();
$data
[
'arr_hasil'
]
=
[];
foreach
(
$data
[
'hasil_instrumen'
]
as
$item
){
$data
[
'arr_hasil'
][
$item
->
id_pernyataan_instrument
][
$item
->
id_sub_pernyataan_instrument
][
$item
->
id_fakultas
][
$item
->
tahun
]
=
$item
;
}
$data
[
'arr_hasil_total'
]
=
[];
foreach
(
$data
[
'hasil_instrumen'
]
as
$item
)
{
$data
[
'arr_hasil_total'
][
$item
->
id_sub_instrument
][
$item
->
id_fakultas
][
$item
->
tahun
]
=
$item
;
}
//dd($data['arr_hasil_total']->toArray());
return
view
(
'content.backend.masters.lembar_instrument_monitoring.index'
,
$data
);
}
...
...
@@ -73,57 +88,50 @@ class LembarInstrumentMonitoringController extends Controller
*/
public
function
store
(
Request
$request
)
{
//dd($request->
id_pernyataan_instrument
);
//dd($request->
all()
);
foreach
(
$request
->
input
(
'jumlah_pernyataan_instrument'
)
as
$index
=>
$value
)
{
if
(
!
empty
(
$request
->
jumlah_pernyataan_instrument
[
$index
]))
{
if
(
empty
(
$request
->
id
[
$index
]))
{
$post
=
Hasil_Instrument
::
create
(
$post
=
Hasil_Instrument
::
updateOrCreate
(
[
'id_pernyataan_instrument'
=>
$request
->
id_pernyataan_instrument
[
$index
],
'tahun'
=>
$request
->
input
(
'tahun'
),
'id_fakultas'
=>
$request
->
id_fakultas
[
$index
],
'jumlah'
=>
$request
->
jumlah_pernyataan_instrument
[
$index
],
'id_sub_instrument'
=>
$request
->
id_sub_instrument
,
],
[
'jumlah'
=>
$request
->
jumlah_pernyataan_instrument
[
$index
]
]);
}
else
{
$update
=
Hasil_Instrument
::
where
(
'id'
,
$request
->
id
[
$index
])
->
update
([
'jumlah'
=>
$request
->
jumlah_pernyataan_instrument
[
$index
]]);
}
}
}
if
(
!
empty
(
$request
->
input
(
'
id_sub_pernyataan_instrument
'
)))
if
(
!
empty
(
$request
->
input
(
'
jumlah_sub_peryataan
'
)))
{
foreach
(
$request
->
input
(
'jumlah_sub_peryataan'
)
as
$i
ndex
=>
$value
)
foreach
(
$request
->
input
(
'jumlah_sub_peryataan'
)
as
$i
dparent
=>
$value
)
{
if
(
empty
(
$request
->
id_subhasil
[
$index
]))
foreach
(
$value
as
$idsubparent
=>
$value1
)
{
$post
=
Hasil_Instrument
::
create
(
[
'id_pernyataan_instrument'
=>
$request
->
id_pernyataan_instrument
[
$index
],
'id_sub_pernyataan_instrument'
=>
$request
->
id_sub_pernyataan_instrument
[
$index
],
'tahun'
=>
$request
->
input
(
'tahun'
),
'id_fakultas'
=>
$request
->
id_fakultas
[
$index
],
'jumlah'
=>
$request
->
jumlah_sub_peryataan
[
$index
],
'id_sub_instrument'
=>
$request
->
id_sub_instrument
,
]);
foreach
(
$value1
as
$idfakultas
=>
$value2
)
{
$post
=
Hasil_Instrument
::
updateOrCreate
(
[
'id_pernyataan_instrument'
=>
$idparent
,
'id_sub_pernyataan_instrument'
=>
$idsubparent
,
'tahun'
=>
$request
->
input
(
'tahun'
),
'id_fakultas'
=>
$idfakultas
,
'id_sub_instrument'
=>
$request
->
id_sub_instrument
,
],
[
'jumlah'
=>
$value2
,
]);
}
}
else
{
$update
=
Hasil_Instrument
::
where
(
'id'
,
$request
->
id_subhasil
[
$index
])
->
update
([
'jumlah'
=>
$request
->
jumlah_sub_peryataan
[
$index
]]);
}
}
...
...
@@ -154,19 +162,36 @@ class LembarInstrumentMonitoringController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
cetak_pdf
(
$id
,
$id2
)
public
function
cetak_pdf
(
Request
$request
)
{
$data
[
'filter_instrument'
]
=
decrypt
(
$id
);
$data
[
'filter_tahun'
]
=
decrypt
(
$id2
);
$data
[
'instrumentdetail'
]
=
Instrument
::
query
()
->
where
(
'id'
,
decrypt
(
$id
))
->
first
();
$data
[
'no_dokumen'
]
=
$request
->
input
(
'no_dokumen'
);
$data
[
'revisi'
]
=
$request
->
input
(
'revisi'
);
$data
[
'tanggal_terbit'
]
=
$request
->
input
(
'tanggal_terbit'
);
$data
[
'filter_instrument'
]
=
$request
->
input
(
'filter_instrument'
);
$data
[
'filter_tahun'
]
=
$request
->
input
(
'filter_tahun'
);
$data
[
'instrumentdetail'
]
=
Instrument
::
query
()
->
where
(
'id'
,
$request
->
input
(
'filter_instrument'
))
->
first
();
$data
[
'pernyataan_instrument'
]
=
Pernyataan_Instrument
::
query
()
->
orderBy
(
'pernyataan_instrument'
)
->
get
();
$data
[
'sub_instrument'
]
=
Sub_Instrument
::
query
()
->
where
(
'id_instrument'
,
decrypt
(
$id
))
->
orderBy
(
'id_instrument'
)
->
get
();
$data
[
'sub_instrument'
]
=
Sub_Instrument
::
query
()
->
where
(
'id_instrument'
,
$request
->
input
(
'filter_instrument'
))
->
orderBy
(
'id_instrument'
)
->
get
();
$data
[
'sub_pernyataan_instrument'
]
=
Sub_Pernyataan_Instrument
::
query
()
->
orderBy
(
'sub_peryataan'
)
->
get
();
$data
[
'fakultas'
]
=
Fakultas
::
query
()
->
orderBy
(
'id'
)
->
get
();
$data
[
'hasil_instrumen'
]
=
Hasil_Instrument
::
query
()
->
get
();
$data
[
'arr_hasil'
]
=
[];
foreach
(
$data
[
'hasil_instrumen'
]
as
$item
){
$data
[
'arr_hasil'
][
$item
->
id_pernyataan_instrument
][
$item
->
id_sub_pernyataan_instrument
][
$item
->
id_fakultas
][
$item
->
tahun
]
=
$item
;
}
$data
[
'arr_hasil_total'
]
=
[];
foreach
(
$data
[
'hasil_instrumen'
]
as
$item
)
{
$data
[
'arr_hasil_total'
][
$item
->
id_sub_instrument
][
$item
->
id_fakultas
][
$item
->
tahun
]
=
$item
;
}
$pdf
=
PDF
::
loadview
(
'content.backend.masters.lembar_instrument_monitoring.laporan'
,
$data
);
return
$pdf
->
download
(
'laporan-pegawai-pdf'
);
$pdf
=
PDF
::
loadview
(
'content.backend.masters.lembar_instrument_monitoring.laporan'
,
$data
)
->
setPaper
(
'a4'
,
'landscape'
)
;
return
$pdf
->
stream
(
'laporan-pegawai-pdf'
);
}
}
app/Http/Controllers/Admin/PernyataanInstrumentController.php
View file @
19ccab77
...
...
@@ -27,8 +27,8 @@ class PernyataanInstrumentController extends Controller
*/
public
function
index
()
{
$data
[
'pernyataan_instrument'
]
=
Pernyataan_Instrument
::
query
()
->
orderBy
(
'
pernyataan_instrument
'
)
->
get
();
$data
[
'sub_instrument'
]
=
Sub_Instrument
::
query
()
->
orderBy
(
'
id_instrument
'
)
->
get
();
$data
[
'pernyataan_instrument'
]
=
Pernyataan_Instrument
::
query
()
->
orderBy
(
'
created_at'
,
'asc
'
)
->
get
();
$data
[
'sub_instrument'
]
=
Sub_Instrument
::
query
()
->
orderBy
(
'
created_at'
,
'asc
'
)
->
get
();
$data
[
'sub_instrument_pernyataan'
]
=
Pernyataan_Instrument
::
with
([
'sub_instrument'
=>
function
(
$q
)
...
...
resources/views/content/backend/masters/lembar_instrument_monitoring/index.blade.php
View file @
19ccab77
This diff is collapsed.
Click to expand it.
resources/views/content/backend/masters/lembar_instrument_monitoring/laporan.blade.php
View file @
19ccab77
This diff is collapsed.
Click to expand it.
routes/web.php
View file @
19ccab77
...
...
@@ -57,5 +57,5 @@ Route::middleware(['auth:sanctum'])->group(function () {
Route
::
resource
(
'/lembar_instrument_monitoring'
,
LembarInstrumentMonitoringController
::
class
);
Route
::
post
(
'/filter'
,[
LembarInstrumentMonitoringController
::
class
,
'filter'
])
->
name
(
'filter'
);
Route
::
get
(
'cetak_pdf/{id}/{id2}
'
,
[
LembarInstrumentMonitoringController
::
class
,
'cetak_pdf'
])
->
name
(
'cetak_pdf'
);
Route
::
post
(
'cetak_pdf
'
,
[
LembarInstrumentMonitoringController
::
class
,
'cetak_pdf'
])
->
name
(
'cetak_pdf'
);
});
\ No newline at end of file
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