Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
simpkm
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
Farendi Giotivano R.P
simpkm
Commits
ad07dac1
Commit
ad07dac1
authored
Feb 16, 2023
by
novanbagus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tambahan download excel proposal
parent
a9606001
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
146 additions
and
94 deletions
+146
-94
app/Exports/KelompokExport.php
+0
-80
app/Exports/ProposalExport.php
+67
-0
app/Http/Controllers/Operator/ProposalController.php
+12
-0
app/Models/DaftarProposal.php
+5
-0
resources/views/backend/operator/kelompok/index.blade.php
+0
-10
resources/views/backend/operator/proposal/excel.blade.php
+48
-0
resources/views/backend/operator/proposal/index.blade.php
+13
-3
routes/web.php
+1
-1
No files found.
app/Exports/KelompokExport.php
deleted
100644 → 0
View file @
a9606001
<?php
namespace
App\Exports
;
use
App\User
;
use
App\Models\Kota
;
use
App\Models\Provinsi
;
use
App\Models\Kecamatan
;
use
App\Models\Kelurahan
;
use
App\Models\Kuesioner
;
use
App\Models\UsersDetil
;
use
App\Models\KuesionerPage
;
use
App\Models\KuesionerField
;
use
App\Models\KuesionerAnswer
;
use
App\Models\KuesionerSection
;
use
Illuminate\Support\Facades\DB
;
use
App\Models\KuesionerAnswerDetil
;
use
Maatwebsite\Excel\Concerns\WithTitle
;
use
Maatwebsite\Excel\Concerns\WithHeadings
;
use
Maatwebsite\Excel\Concerns\FromCollection
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
class
KelompokExport
implements
FromCollection
,
WithHeadings
,
ShouldAutoSize
,
WithTitle
{
/**
* @return \Illuminate\Support\Collection
*/
public
function
__construct
(
$fakultas
,
$prodi
,
$lulusan
,
$group
)
{
$this
->
fakultas
=
$fakultas
;
$this
->
prodi
=
$prodi
;
$this
->
lulusan
=
$lulusan
;
$this
->
group
=
$group
;
}
public
function
title
()
:
string
{
return
'Users'
;
}
public
function
collection
()
{
$statement
=
" IS_ACTIVE = '1' "
;
if
(
$this
->
fakultas
!=
"0"
)
{
$statement
.=
" AND b.fakultas_id = '"
.
$this
->
fakultas
.
"'"
;
}
if
(
$this
->
prodi
!=
"0"
&&
$this
->
prodi
!=
""
)
{
$statement
.=
" AND b.prodi_id = '"
.
$this
->
prodi
.
"'"
;
}
if
(
$this
->
lulusan
!=
"0"
)
{
$statement
.=
" AND b.tahun_lulus = '"
.
$this
->
lulusan
.
"'"
;
}
if
(
$this
->
group
!=
"0"
)
{
$statement
.=
" AND role = '"
.
$this
->
group
.
"'"
;
}
$data
=
User
::
join
(
'users_detil as b'
,
'users.id'
,
'='
,
'b.users_id'
)
->
join
(
'users_group as e'
,
'users.role'
,
'='
,
'e.nama'
)
->
leftjoin
(
'fakultas as c'
,
'b.fakultas_id'
,
'='
,
'c.id'
)
->
leftjoin
(
'prodi as d'
,
'b.prodi_id'
,
'='
,
'd.id'
)
->
whereRaw
(
$statement
)
->
select
(
'nim'
,
'users.email'
,
'users.name'
,
'c.nama as nama_fakultas'
,
'd.nama as nama_prodi'
,
'tahun_lulus'
,
'b.no_tlp'
)
->
get
();
return
collect
(
$data
);
}
public
function
headings
()
:
array
{
return
[
"NIM"
,
"Email"
,
"Nama"
,
"Fakultas"
,
"Prodi"
,
"Lulusan"
,
"No HP"
];
}
}
app/Exports/ProposalExport.php
0 → 100644
View file @
ad07dac1
<?php
namespace
App\Exports
;
use
App\Models\DaftarProposal
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Contracts\View\View
;
use
Maatwebsite\Excel\Concerns\FromView
;
use
Maatwebsite\Excel\Concerns\ShouldAutoSize
;
class
ProposalExport
implements
FromView
,
ShouldAutoSize
{
/**
* @return \Illuminate\Support\Collection
*/
public
function
__construct
(
$jenis
,
$status
,
$tahun
)
{
$this
->
jenis
=
$jenis
;
$this
->
status
=
$status
;
$this
->
tahun
=
$tahun
;
}
public
function
view
()
:
View
{
$data
=
DaftarProposal
::
with
(
'rKelompokDetil'
)
->
get
();
$result
=
[];
$no
=
0
;
foreach
(
$data
as
$key
=>
$value
)
{
$dospem
=
"("
.
str_replace
(
"###"
,
") "
,
$value
->
identitas_dospem
);
$url
=
"https://statik.unesa.ac.id/simpkm/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
++
;
}
$result
[
$no
][
'rowspan'
]
=
count
(
$value
->
rKelompokDetil
);
$result
[
$no
][
'kode'
]
=
$value
->
kode
;
$result
[
$no
][
'jenis'
]
=
$value
->
jenis_pkm
;
$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
;
$no
++
;
}
}
$datas
[
'list_proposal'
]
=
$result
;
return
view
(
'backend.operator.proposal.excel'
,
$datas
);
}
}
app/Http/Controllers/Operator/ProposalController.php
View file @
ad07dac1
...
...
@@ -15,7 +15,9 @@ use App\Models\Jenis;
use
App\Models\Periode
;
use
Illuminate\Http\Request
;
use
App\Models\DaftarProposal
;
use
App\Exports\ProposalExport
;
use
App\Http\Controllers\Controller
;
use
Maatwebsite\Excel\Facades\Excel
;
class
ProposalController
extends
Controller
{
...
...
@@ -193,4 +195,14 @@ class ProposalController extends Controller
{
}
public
function
cetak_proposal
(
Request
$request
)
{
ini_set
(
'max_execution_time'
,
0
);
$jenis
=
$request
->
jenis
;
$status
=
$request
->
status
;
$tahun
=
$request
->
tahun
;
return
Excel
::
download
(
new
ProposalExport
(
$jenis
,
$status
,
$tahun
),
'proposal_export.xlsx'
);
}
}
app/Models/DaftarProposal.php
View file @
ad07dac1
...
...
@@ -13,4 +13,9 @@ class DaftarProposal extends Model
protected
$fillable
=
[
'proposal_id'
,
'jenis_id'
,
'kode'
,
'jenis_pkm'
,
'judul'
,
'status'
,
'status_hapus'
,
'status_administrasi_1'
,
'status_administrasi_2'
,
'nilai_1'
,
'nilai_2'
,
'reviewer_id_1'
,
'reviewer_id_2'
,
'status_final'
,
'nidn_reviewer_id_1'
,
'nidn_reviewer_id_2'
,
'upload_dokumen'
,
'date_upload'
,
'date_approval'
,
'identitas_ketua'
,
'identitas_dospem'
,
'periode'
];
public
function
rKelompokDetil
()
{
return
$this
->
hasMany
(
\App\Models\KelompokDetail
::
class
,
'kelompok_id'
,
'kelompok_id'
);
}
}
resources/views/backend/operator/kelompok/index.blade.php
View file @
ad07dac1
...
...
@@ -188,15 +188,5 @@
});
});
function
cetak
()
{
var
_token
=
$
(
'input[name="_token"]'
)
.
val
();
var
fakultas
=
$
(
"#reqFakultas"
)
.
val
();
var
prodi
=
$
(
"#reqProdi"
)
.
val
();
var
lulusan
=
$
(
"#reqLulusan"
)
.
val
();
var
group
=
$
(
"#reqGroup"
)
.
val
();
window
.
open
(
'{{url("/admin/cetak_users/")}}?fakultas='
+
fakultas
+
'&prodi='
+
prodi
+
'&lulusan='
+
lulusan
+
'&group='
+
group
+
'&_token='
+
_token
,
'_blank'
);
};
</
script
>
@
endsection
resources/views/backend/operator/proposal/excel.blade.php
0 → 100644
View file @
ad07dac1
<table
border=
"1"
>
<thead>
<tr>
<td
style=
"border: 1px solid #000000;"
><strong>
No
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Kode Kelompok
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Jenis PKM
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Fak.
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Nama
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
NIM
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Ketua/Anggota
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Judul Proposal
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Dosen Pembimbing
</strong></td>
<td
style=
"border: 1px solid #000000;"
><strong>
Link Proposal
</strong></td>
</tr>
</thead>
<tbody>
@php
$no = 1;
$tempKode = '';
@endphp
@foreach ($list_proposal as $proposal)
@if($tempKode != $proposal['kode'])
<tr>
<th
rowspan=
"{{ $proposal['rowspan'] }}"
style=
"vertical-align: top; border: 1px solid #000000;"
>
{{ $no++ }}
</th>
<th
rowspan=
"{{ $proposal['rowspan'] }}"
style=
"vertical-align: top; border: 1px solid #000000;"
>
{{ $proposal['kode'] }}
</th>
<th
rowspan=
"{{ $proposal['rowspan'] }}"
style=
"vertical-align: top; border: 1px solid #000000;"
>
{{ $proposal['jenis'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['fak'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['nama'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['nim'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['keanggotaan'] }}
</th>
<th
rowspan=
"{{ $proposal['rowspan'] }}"
style=
"vertical-align: top; border: 1px solid #000000;"
>
{{ $proposal['judul'] }}
</th>
<th
rowspan=
"{{ $proposal['rowspan'] }}"
style=
"vertical-align: top; border: 1px solid #000000;"
>
{{ $proposal['dospem'] }}
</th>
<th
rowspan=
"{{ $proposal['rowspan'] }}"
style=
"vertical-align: top; border: 1px solid #000000;"
><a
href=
"{{ $proposal['link'] }}"
target=
"_blank"
>
Link
</a></th>
</tr>
@else
<tr
valign=
"top"
>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['fak'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['nama'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['nim'] }}
</th>
<th
style=
"border: 1px solid #000000;"
>
{{ $proposal['keanggotaan'] }}
</th>
</tr>
@endif
@php
$tempKode = $proposal['kode'];
@endphp
@endforeach
</tbody>
</table>
resources/views/backend/operator/proposal/index.blade.php
View file @
ad07dac1
...
...
@@ -20,11 +20,11 @@
<li class="
breadcrumb
-
item
">{!!
$title
!!}</li>
</ol>
</div>
{{--
<div class="
col
-
md
-
4
">
<div class="
col
-
md
-
4
">
<div class="
float
-
end
d
-
none
d
-
md
-
block
">
<a href="
{{
URL
::
to
(
'operator/user-external/create'
)
}}
" type="
button
" class="
btn
btn
-
primary
waves
-
effect
waves
-
light
"> <i class="
fas
fa
-
plus
-
circle
"></i> Tambah Data</a>
<button onclick="
cetak
()
" class="
btn
btn
-
primary
waves
-
effect
waves
-
light
"> <i class="
fas
fa
-
file
-
excel
"></i> Unduh</button>
</div>
</div>
</div> --}}
</div>
</div>
<!-- end page title -->
...
...
@@ -35,6 +35,7 @@
<div class="
col
-
12
">
<div class="
card
">
<div class="
card
-
body
">
{!! csrf_field() !!}
<div class="
row
">
<div class="
col
-
md
-
4
">
<div class="
row
">
...
...
@@ -178,5 +179,14 @@
});
});
function
cetak
()
{
var
_token
=
$
(
'input[name="_token"]'
)
.
val
();
var
jenis
=
$
(
"#reqJenisPkm"
)
.
val
();
var
status
=
$
(
"#reqStatus"
)
.
val
();
var
tahun
=
$
(
"#reqTahun"
)
.
val
();
window
.
open
(
'{{url("/operator/cetak-proposal/")}}?jenis='
+
jenis
+
'&tahun='
+
tahun
+
'&status='
+
status
+
'&_token='
+
_token
,
'_blank'
);
};
</
script
>
@
endsection
routes/web.php
View file @
ad07dac1
...
...
@@ -142,11 +142,11 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route
::
resource
(
'kelompok'
,
KelompokController
::
class
);
Route
::
get
(
'getKelompok'
,
[
KelompokController
::
class
,
'getData'
])
->
name
(
'getKelompok'
);
Route
::
get
(
'getDetilKelompok'
,
[
KelompokController
::
class
,
'getDetil'
])
->
name
(
'getDetilKelompok'
);
Route
::
get
(
'cetak_kelompok'
,
[
KelompokController
::
class
,
'cetak_kelompok'
])
->
name
(
'cetak_users'
);
Route
::
resource
(
'proposal'
,
ProposalController
::
class
);
Route
::
get
(
'getProposal'
,
[
ProposalController
::
class
,
'getData'
])
->
name
(
'getProposal'
);
Route
::
get
(
'getDetilProposal'
,
[
ProposalController
::
class
,
'getDetil'
])
->
name
(
'getDetilProposal'
);
Route
::
get
(
'cetak-proposal'
,
[
ProposalController
::
class
,
'cetak_proposal'
])
->
name
(
'cetak-proposal'
);
Route
::
resource
(
'jenis'
,
JenisController
::
class
);
Route
::
get
(
'getJenis'
,
[
JenisController
::
class
,
'getData'
])
->
name
(
'getJenis'
);
...
...
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