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
b702422a
Commit
b702422a
authored
May 07, 2024
by
Siti Aisah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tarik saku
parent
685c324f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
34 deletions
+98
-34
app/Http/Controllers/Admin/SakuController.php
+29
-0
app/Http/Controllers/Admin/TransaksiController.php
+47
-30
app/Models/Admin/Penelaah.php
+7
-1
resources/views/layouts/menu.blade.php
+1
-1
resources/views/transaksi/index.blade.php
+11
-1
routes/web.php
+3
-1
No files found.
app/Http/Controllers/Admin/SakuController.php
0 → 100644
View file @
b702422a
<?php
namespace
App\Http\Controllers\Admin
;
use
App\Http\Support\ValidationRule
;
use
App\Http\Controllers\Controller
;
use
App\Models\Admin\Pengajuan
;
use
Exception
;
use
Storage
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\Facades\Redirect
;
class
SakuController
extends
Controller
{
public
function
index
()
{
$pengusul
=
DB
::
table
(
'bantuan_pengusul'
)
->
get
();
$kategori
=
DB
::
table
(
'ms_kategori'
)
->
orderBy
(
'kode_kategori'
,
'asc'
)
->
get
();
$data
=
[
'pengusul'
=>
$pengusul
,
'kategori'
=>
$kategori
];
return
view
(
'transaksi.index'
,
$data
);
}
}
app/Http/Controllers/TransaksiController.php
→
app/Http/Controllers/
Admin/
TransaksiController.php
View file @
b702422a
<?php
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
\Admin
;
use
App\Http\Support\ValidationRule
;
use
App\Http\Controllers\Controller
;
use
App\Models\Admin\Penelaah
;
use
App\Models\Admin\Pengajuan
;
use
Exception
;
use
Storage
;
...
...
@@ -28,42 +29,58 @@ public function index() {
}
public
function
store
(
Request
$request
){
$rule
=
[
'kategori'
=>
'required'
,
'file_ec'
=>
'required'
,
'nosurat'
=>
'required'
];
$request
->
validate
(
$rule
,
ValidationRule
::
getErrorMessage
(
$rule
));
DB
::
beginTransaction
();
if
(
$request
->
hasFile
(
'file_ec'
)){
$file
=
$request
->
file
(
'file_ec'
);
$filename
=
$file
->
getClientOriginalName
();
Storage
::
disk
(
'uploads'
)
->
put
(
'sipeka/'
.
$filename
,
file_get_contents
(
$file
->
getRealPath
()));
}
try
{
$transaksi
=
[
'id_pengajuan'
=>
$request
->
idpengajuan
,
'judul'
=>
$request
->
judul
,
'pengusul'
=>
$request
->
pengusul
,
'klasifikasi'
=>
$request
->
klasifikasi
,
'tahun'
=>
$request
->
tahun
,
'id_kategori'
=>
$request
->
kategori
,
'file_ec'
=>
$filename
,
'no_sk'
=>
$request
->
nosurat
,
];
Pengajuan
::
query
()
->
create
(
$transaksi
);
DB
::
commit
();
return
Redirect
::
route
(
'transaksi.index'
)
// if($request->hasFile('file_ec')){
// $file = $request->file('file_ec');
// $filename = $file->getClientOriginalName();
// Storage::disk('uploads')->put('sipeka/'.$filename, file_get_contents($file->getRealPath()));
// }
try
{
$transaksi
=
[
'id_pengajuan'
=>
$request
->
idpengajuan
,
'judul'
=>
$request
->
judul
,
'pengusul'
=>
$request
->
pengusul
,
'klasifikasi'
=>
$request
->
klasifikasi
,
'tahun'
=>
$request
->
tahun
,
'id_kategori'
=>
$request
->
kategori
,
// 'file_ec' => $filename,
'no_sk'
=>
$request
->
nosurat
,
];
Pengajuan
::
query
()
->
create
(
$transaksi
);
$hasil
=
DB
::
table
(
'tr_pengajuan'
)
->
where
(
'id_pengajuan'
,
$request
->
idpengajuan
)
->
get
();
$reviewer
=
DB
::
table
(
'bantuan_penelaah'
)
->
where
(
'id_pengajuan'
,
$request
->
idpengajuan
)
->
get
();
foreach
(
$reviewer
as
$r
){
$isdm
=
DB
::
connection
(
'isdm'
)
->
table
(
'v_detil_pegawai'
)
->
where
(
'noktp'
,
$r
->
nik
)
->
select
(
'namalengkap'
,
'nip'
)
->
first
();
$saku
=
[
'id_pengajuan'
=>
$hasil
->
id
,
'nik'
=>
$r
->
nik
,
'nama'
=>
$isdm
->
namalengkap
,
'nip'
=>
$isdm
->
nip
];
Penelaah
::
query
()
->
create
(
$saku
);
}
DB
::
commit
();
return
Redirect
::
route
(
'transaksi.index'
)
->
with
(
'success'
,
'Data kategori berhasil diupdate'
);
}
catch
(
Exception
$e
){
...
...
@@ -71,7 +88,7 @@ public function store(Request $request){
DB
::
rollBack
();
return
Redirect
::
route
(
'transaksi.index'
)
->
with
(
'error'
,
'Data kategori gagal diupdate'
);
->
with
(
'error'
,
'Data kategori gagal diupdate'
);
}
}
}
app/Models/Admin/Penelaah.php
View file @
b702422a
...
...
@@ -15,5 +15,11 @@ class Penelaah extends Model
protected
$table
=
'tr_penelaah'
;
protected
$keyType
=
'string'
;
protected
$guarded
=
[];
protected
$fillable
=
[
'id'
,
'id_pengajuan'
,
'nik'
,
'nama'
,
'nip'
];
}
resources/views/layouts/menu.blade.php
View file @
b702422a
...
...
@@ -13,7 +13,7 @@
<ul
class=
"dropdown-menu"
data-bs-popper=
"none"
>
<li
data-menu=
""
class=
"{{ (request()->getRequestUri() == "
/
transaksi
")
?
'
active
'
:
''
}}"
><a
href=
"{{ route('transaksi.index') }}"
class=
"dropdown-item d-flex align-items-center"
data-bs-toggle=
""
data-i18n=
"Email"
><i
data-feather=
"check-square"
></i><span
data-i18n=
"Email"
>
Update Kategori
</span></a>
</li>
<li
data-menu=
""
class=
"{{ (request()->
is('pasien/antrian')) ? 'active' : '' }}"
><a
href=
"#
"
class=
"dropdown-item d-flex align-items-center"
data-bs-toggle=
""
data-i18n=
"Todo"
><i
data-feather=
'log-in'
></i><span
data-i18n=
"Todo"
>
Tarik Data SAKU
</span></a>
<li
data-menu=
""
class=
"{{ (request()->
getRequestUri() == "
/
saku
")
?
'
active
'
:
''
}}"
><a
href=
"{{ route('saku.index') }}
"
class=
"dropdown-item d-flex align-items-center"
data-bs-toggle=
""
data-i18n=
"Todo"
><i
data-feather=
'log-in'
></i><span
data-i18n=
"Todo"
>
Tarik Data SAKU
</span></a>
</li>
</ul>
</li>
...
...
resources/views/transaksi/index.blade.php
View file @
b702422a
...
...
@@ -35,7 +35,7 @@
<th style="
text
-
align
:
left
">Tahun</th>
<th style="
text
-
align
:
left
">Reviewer</th>
<th style="
text
-
align
:
left
">Klasifikasi</th>
<th style="
text
-
align
:
left
">
Update
Kategori</th>
<th style="
text
-
align
:
left
">Kategori</th>
</tr>
</thead>
<tbody>
...
...
@@ -54,9 +54,19 @@
@endforeach
</td>
<td style="
text
-
align
:
left
">{{
$item->klasifikasi
}}</td>
@php
$pengajuan
= DB::table('tr_pengajuan')->where('id_pengajuan',
$item->id_pengajuan
)->first();
@endphp
@if(empty(
$pengajuan
))
<td>
<button type="
button
" class="
btn
btn
-
warning
btn
-
sm
" data-bs-toggle="
modal
" data-bs-target="
#updateKategoriModal{{ $item->id_pengajuan }}"><i data-feather='edit'></i></button>
</
td
>
@
else
@
php
$kat
=
DB
::
table
(
'ms_kategori'
)
->
where
(
'id'
,
$pengajuan
->
id_kategori
)
->
first
();
@
endphp
<
td
style
=
"text-align: left"
>
{{
$kat
->
nama_kategori
}}
</
td
>
@
endif
</
tr
>
<!--
edit
registrasi
modal
-->
...
...
routes/web.php
View file @
b702422a
<?php
use
App\Http\Controllers\Admin\KategoriController
;
use
App\Http\Controllers\TransaksiController
;
use
App\Http\Controllers\Admin\TransaksiController
;
use
App\Http\Controllers\Admin\SakuController
;
use
Illuminate\Support\Facades\Route
;
/*
...
...
@@ -24,5 +25,6 @@
// Admin
Route
::
resource
(
'kategori'
,
KategoriController
::
class
);
Route
::
resource
(
'transaksi'
,
TransaksiController
::
class
);
Route
::
resource
(
'saku'
,
SakuController
::
class
);
// End of Admin
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