Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
simpmw
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
Alfiro Pratama
simpmw
Commits
b5284363
Commit
b5284363
authored
Dec 05, 2024
by
Alfiro Pratama
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Monev Export Excel
parent
1ba2c50c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
37 deletions
+122
-37
app/Exports/DaftarProposalMonevExport.php
+114
-34
app/Http/Controllers/Operator/MonevProposalController.php
+5
-2
resources/views/backend/operator/daftar_proposal/monev.blade.php
+3
-1
No files found.
app/Exports/DaftarProposalMonevExport.php
View file @
b5284363
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
App\Exports
;
namespace
App\Exports
;
use
App\Models\DaftarProposalBelmawa
;
use
App\Models\DaftarProposalBelmawa
;
use
App\Models\DaftarProposalMonev
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Contracts\View\View
;
use
Illuminate\Contracts\View\View
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\FromView
;
...
@@ -14,16 +14,17 @@ class DaftarProposalMonevExport implements FromView,ShouldAutoSize
...
@@ -14,16 +14,17 @@ class DaftarProposalMonevExport implements FromView,ShouldAutoSize
/**
/**
* @return \Illuminate\Support\Collection
* @return \Illuminate\Support\Collection
*/
*/
public
function
__construct
(
$jenis
,
$status
,
$tahun
)
public
function
__construct
(
$jenis
,
$status
,
$tahun
,
$monev
)
{
{
$this
->
jenis
=
$jenis
;
$this
->
jenis
=
$jenis
;
$this
->
status
=
$status
;
$this
->
status
=
$status
;
$this
->
tahun
=
$tahun
;
$this
->
tahun
=
$tahun
;
$this
->
monev
=
$monev
;
}
}
public
function
view
()
:
View
public
function
view
()
:
View
{
{
$statement
=
" STATUS_HAPUS = '0'
"
;
$statement
=
" STATUS_HAPUS = '0'"
;
if
(
$this
->
jenis
!=
"0"
)
if
(
$this
->
jenis
!=
"0"
)
{
{
...
@@ -42,47 +43,126 @@ class DaftarProposalMonevExport implements FromView,ShouldAutoSize
...
@@ -42,47 +43,126 @@ class DaftarProposalMonevExport implements FromView,ShouldAutoSize
$statement
.=
" AND PERIODE = '"
.
$this
->
tahun
.
"'"
;
$statement
.=
" AND PERIODE = '"
.
$this
->
tahun
.
"'"
;
}
}
$data
=
DaftarProposalBelmawa
::
with
(
'rKelompokDetil'
)
->
whereRaw
(
$statement
)
->
get
();
if
(
isset
(
$this
->
monev
))
$result
=
[];
{
$statement
.=
" AND jenis_monev_desc = '"
.
$this
->
monev
.
"'"
;
}
$no
=
0
;
$data
=
DaftarProposalMonev
::
with
(
'rKelompokDetil'
)
->
whereRaw
(
$statement
)
->
get
();
// $result = [];
// $no = 0;
// foreach ($data as $key => $value) {
// // $dospem = "(".str_replace("###",") ",$value->identitas_dospem);
// $data_dospem = explode('###', $value->identitas_dospem);
// $data_ketua = explode('###', $value->identitas_ketua);
// $dospem = "(".$data_dospem[0].") ".$data_dospem[1];
// $url = "https://statik.unesa.ac.id/simpmw/proposal/".$value->periode."/".$value->upload_dokumen;
// // $urut = 1;
// // foreach ($value->rKelompokDetil as $keys => $detil) {
// // if($detil->status_ketua == '1')
// // {
// // $keanggotaan = "Ketua";
// // }
// // else
// // {
// // $keanggotaan = "Anggota ".$urut;
// // $urut++;
// // }
// $urut = 1;
// $det = array();
// $no = 0;
// foreach ($value->rKelompokDetil as $keys => $detil) {
// if($detil->status_ketua == '1')
// {
// $keanggotaan = "Ketua";
// }
// else
// {
// $keanggotaan = "Anggota ".$urut;
// $urut++;
// }
// $det[$no]['fak'] = $detil->fakultas;
// $det[$no]['nama'] = $detil->nama;
// $det[$no]['nim']= $detil->nim;
// $det[$no]['keanggotaan'] = $keanggotaan;
// $no++;
// }
// $result[$no]['rowspan'] = count($value->rKelompokDetil);
// $result[$no]['kode'] = $value->kode;
// $result[$no]['jenis'] = $value->jenis_pkm;
// $result[$no]['detil'] = $det;
// $result[$no]['fak'] = $detil->fakultas;
// $result[$no]['nama'] = $detil->nama;
// $result[$no]['nim'] = $detil->nim;
// $result[$no]['keanggotaan'] = $keanggotaan;
// $result[$no]['judul'] = $value->judul;
// $result[$no]['dospem'] = $dospem;
// $result[$no]['link'] = $url;
// $result[$no]['status'] = $value->status_desc;
// $result[$no]['rata'] = $value->rata;
// $result[$no]['email_dospem'] = end($data_dospem);
// $result[$no]['email_ketua'] = end($data_ketua);
// $no++;
// }
$result
=
[];
// Untuk data hasil akhir
$urut
=
1
;
// Untuk nomor anggota (reset setiap proposal)
$index
=
0
;
// Indeks untuk $result
foreach
(
$data
as
$key
=>
$value
)
{
foreach
(
$data
as
$key
=>
$value
)
{
$dospem
=
"("
.
str_replace
(
"###"
,
") "
,
$value
->
identitas_dospem
);
$data_dospem
=
explode
(
'###'
,
$value
->
identitas_dospem
);
$data_ketua
=
explode
(
'###'
,
$value
->
identitas_ketua
);
$dospem
=
"("
.
$data_dospem
[
0
]
.
") "
.
$data_dospem
[
1
];
$url
=
"https://statik.unesa.ac.id/simpmw/proposal/"
.
$value
->
periode
.
"/"
.
$value
->
upload_dokumen
;
$url
=
"https://statik.unesa.ac.id/simpmw/proposal/"
.
$value
->
periode
.
"/"
.
$value
->
upload_dokumen
;
$
urut
=
1
;
$
det
=
[];
// Untuk detail anggota setiap proposal
foreach
(
$value
->
rKelompokDetil
as
$keys
=>
$detil
)
{
$urut
=
1
;
// Reset nomor anggota untuk setiap proposal
if
(
$detil
->
status_ketua
==
'1'
)
foreach
(
$value
->
rKelompokDetil
as
$detil
)
{
{
$keanggotaan
=
$detil
->
status_ketua
==
'1'
?
"Ketua"
:
"Anggota "
.
$urut
;
$keanggotaan
=
"Ketua"
;
if
(
$detil
->
status_ketua
!=
'1'
)
{
}
else
{
$keanggotaan
=
"Anggota "
.
$urut
;
$urut
++
;
$urut
++
;
}
}
$result
[
$no
][
'rowspan'
]
=
count
(
$value
->
rKelompokDetil
);
$det
[]
=
[
$result
[
$no
][
'kode'
]
=
$value
->
kode_kelompok
;
'fak'
=>
$detil
->
fakultas
,
$result
[
$no
][
'jenis'
]
=
$value
->
jenis_pkm
;
'nama'
=>
$detil
->
nama
,
$result
[
$no
][
'fak'
]
=
$detil
->
fakultas
;
'nim'
=>
$detil
->
nim
,
$result
[
$no
][
'nama'
]
=
$detil
->
nama
;
'keanggotaan'
=>
$keanggotaan
,
$result
[
$no
][
'nim'
]
=
$detil
->
nim
;
];
$result
[
$no
][
'keanggotaan'
]
=
$keanggotaan
;
$result
[
$no
][
'judul'
]
=
$value
->
judul
;
$result
[
$no
][
'dospem'
]
=
$dospem
;
$result
[
$no
][
'link'
]
=
$url
;
$result
[
$no
][
'status'
]
=
$value
->
status_desc
;
$no
++
;
}
}
}
$result
[
$index
]
=
[
'rowspan'
=>
count
(
$value
->
rKelompokDetil
),
'kode'
=>
$value
->
kode
,
'jenis'
=>
$value
->
jenis_pkm
,
'detil'
=>
$det
,
'judul'
=>
$value
->
judul
,
'dospem'
=>
$dospem
,
'link'
=>
$url
,
'status'
=>
$value
->
status_desc
,
'rata'
=>
$value
->
rata
,
'email_dospem'
=>
end
(
$data_dospem
),
'email_ketua'
=>
end
(
$data_ketua
),
];
$index
++
;
// Tambahkan indeks setelah setiap proposal
}
$datas
[
'list_proposal'
]
=
$result
;
$datas
[
'list_proposal'
]
=
$result
;
$datas
[
'jenis_monev'
]
=
'Seleksi
Belmawa
'
;
$datas
[
'jenis_monev'
]
=
'Seleksi
Monev
'
;
return
view
(
'backend.operator.daftar_proposal.excel'
,
$datas
);
return
view
(
'backend.operator.daftar_proposal.excel
_new
'
,
$datas
);
}
}
}
}
app/Http/Controllers/Operator/MonevProposalController.php
View file @
b5284363
...
@@ -571,8 +571,11 @@ class MonevProposalController extends Controller
...
@@ -571,8 +571,11 @@ class MonevProposalController extends Controller
$id
=
$request
->
id
;
$id
=
$request
->
id
;
$jenis
=
$request
->
jenis
;
$jenis
=
$request
->
jenis
;
$status
=
$request
->
status
;
$status
=
$request
->
status
;
$tahun
=
$request
->
tahun
;
$tahun
=
$request
->
tahun
;
$monev
=
$request
->
monev
;
return
Excel
::
download
(
new
DaftarProposalMonevExport
(
$jenis
,
$status
,
$tahun
),
'seleksi_monev_export.xlsx'
);
return
Excel
::
download
(
new
DaftarProposalMonevExport
(
$jenis
,
$status
,
$tahun
,
$monev
),
'seleksi_monev_export.xlsx'
);
// $data = new DaftarProposalMonevExport($jenis, $status, $tahun, $monev);
// return $data->view();
}
}
}
}
resources/views/backend/operator/daftar_proposal/monev.blade.php
View file @
b5284363
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
<div class="
col
-
md
-
4
">
<div class="
col
-
md
-
4
">
<div class="
float
-
end
d
-
none
d
-
md
-
block
">
<div class="
float
-
end
d
-
none
d
-
md
-
block
">
<button onclick="
cetak
()
" class="
btn
btn
-
primary
waves
-
effect
waves
-
light
"> <i class="
fas
fa
-
file
-
excel
"></i> Unduh</button>
<button onclick="
cetak
()
" class="
btn
btn
-
primary
waves
-
effect
waves
-
light
"> <i class="
fas
fa
-
file
-
excel
"></i> Unduh</button>
<input type="
hidden
" name="
reqMonev
" id="
reqMonev
" value="
{{
$jenis_monev
->
nama
}}
">
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -292,8 +293,9 @@
...
@@ -292,8 +293,9 @@
var
jenis
=
$
(
"#reqJenisPkm"
)
.
val
();
var
jenis
=
$
(
"#reqJenisPkm"
)
.
val
();
var
status
=
$
(
"#reqStatus"
)
.
val
();
var
status
=
$
(
"#reqStatus"
)
.
val
();
var
tahun
=
$
(
"#reqTahun"
)
.
val
();
var
tahun
=
$
(
"#reqTahun"
)
.
val
();
var
monev
=
$
(
"#reqMonev"
)
.
val
();
window
.
open
(
'{{url("/operator/cetak-daftar-monev-internal/")}}?id='
+
id
+
'&jenis='
+
jenis
+
'&tahun='
+
tahun
+
'&status='
+
status
+
'&_token='
+
_token
,
'_blank'
);
window
.
open
(
'{{url("/operator/cetak-daftar-monev-internal/")}}?id='
+
id
+
'&jenis='
+
jenis
+
'&tahun='
+
tahun
+
'&status='
+
status
+
'&
monev='
+
monev
+
'&
_token='
+
_token
,
'_blank'
);
};
};
</
script
>
</
script
>
...
...
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