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
5629fab6
Commit
5629fab6
authored
Sep 04, 2024
by
Alfiro Pratama
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edit Ketua Kelompok by Operator
parent
1e425193
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
13 deletions
+95
-13
app/Http/Controllers/Operator/KelompokController.php
+45
-9
resources/views/backend/operator/kelompok/index.blade.php
+46
-2
resources/views/layouts/inijs.blade.php
+1
-0
resources/views/layouts/master.blade.php
+2
-2
routes/web.php
+1
-0
No files found.
app/Http/Controllers/Operator/KelompokController.php
View file @
5629fab6
...
@@ -138,7 +138,10 @@ class KelompokController extends Controller
...
@@ -138,7 +138,10 @@ class KelompokController extends Controller
public
function
getDetil
(
Request
$request
)
public
function
getDetil
(
Request
$request
)
{
{
$reqKelompokId
=
Crypt
::
decrypt
(
$request
->
kelompok_id
);
$reqKelompokId
=
Crypt
::
decrypt
(
$request
->
kelompok_id
);
$kelompok_detil
=
KelompokDetail
::
where
(
'kelompok_id'
,
$reqKelompokId
)
->
get
();
$kelompok_detil
=
KelompokDetail
::
where
(
'kelompok_id'
,
$reqKelompokId
)
->
orderBy
(
'status_ketua'
,
'ASC'
)
->
orderBy
(
'status_ketua'
,
'DESC'
)
->
get
();
$data
=
''
;
$data
=
''
;
$no
=
1
;
$no
=
1
;
...
@@ -151,15 +154,29 @@ class KelompokController extends Controller
...
@@ -151,15 +154,29 @@ class KelompokController extends Controller
$anggota
++
;
$anggota
++
;
$keterangan
=
"Anggota "
.
$anggota
?:
1
;
$keterangan
=
"Anggota "
.
$anggota
?:
1
;
}
}
$select
=
"<div class='d-flex align-items-center'>
<select name='keterangan[]' class=''>
<option value='1' "
.
(
$value
->
status_ketua
==
'1'
?
'selected'
:
''
)
.
">Ketua</option>
<option value='2' "
.
(
$value
->
status_ketua
==
'2'
?
'selected'
:
''
)
.
">Anggota</option>
</select>
<input type='hidden' name='kelompok_detil_id[]' value='"
.
$value
->
kelompok_detil_id
.
"'>"
;
if
(
$value
->
status_ketua
!=
'1'
)
{
$select
.=
"<span style='margin-left: 10px;'>"
.
$anggota
.
"</span>"
;
}
$select
.=
"</div>"
;
$data
.=
"
$data
.=
"
<tr>
<tr>
<td>"
.
$no
.
"</td>
<td>"
.
$no
.
"</td>
<td>"
.
$value
->
nama
.
"</td>
<td>"
.
$value
->
nama
.
"</td>
<td>"
.
$value
->
nim
.
"</td>
<td>"
.
$value
->
nim
.
"</td>
<td>"
.
$value
->
fakultas
.
"</td>
<td>"
.
$value
->
fakultas
.
"</td>
<td>"
.
$value
->
prodi
.
"</td>
<td>"
.
$value
->
prodi
.
"</td>
<td>"
.
$keterangan
.
"</td>
<td>"
.
$select
.
"</td>
</tr>
</tr>
"
;
"
;
$no
++
;
$no
++
;
}
}
...
@@ -184,7 +201,26 @@ class KelompokController extends Controller
...
@@ -184,7 +201,26 @@ class KelompokController extends Controller
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
}
public
function
updateKetua
(
Request
$request
)
{
DB
::
beginTransaction
();
try
{
foreach
(
$request
->
kelompok_detil_id
as
$key
=>
$kelompok_detil_id
)
{
$status_ketua
=
$request
->
keterangan
[
$key
];
KelompokDetail
::
where
(
'kelompok_detil_id'
,
$kelompok_detil_id
)
->
update
([
'status_ketua'
=>
$status_ketua
]);
}
DB
::
commit
();
return
response
()
->
json
([
'success'
=>
true
,
'message'
=>
'Data berhasil disimpan.'
]);
}
catch
(
\Exception
$e
)
{
DB
::
rollback
();
return
response
()
->
json
([
'error'
=>
true
,
'message'
=>
'Data gagal disimpan.'
]);
}
}
}
public
function
destroy
(
$id
)
public
function
destroy
(
$id
)
...
...
resources/views/backend/operator/kelompok/index.blade.php
View file @
5629fab6
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
</div>
</div>
<!-- end page title -->
<!-- end page title -->
<div class="
row
">
<div class="
row
">
<div class="
col
-
12
">
<div class="
col
-
12
">
<div class="
card
">
<div class="
card
">
...
@@ -92,6 +90,9 @@
...
@@ -92,6 +90,9 @@
</div>
</div>
<div class="
modal
-
body
">
<div class="
modal
-
body
">
<div class="
table
-
responsive
">
<div class="
table
-
responsive
">
<form id="
form
-
update
-
ketua
" method="
POST
" action="
{{
route
(
'operator.update-kelompok'
)
}}
">
@csrf
{{-- @method('PUT') --}}
<table class="
w
-
100
" id="
tblempinfo
">
<table class="
w
-
100
" id="
tblempinfo
">
<thead>
<thead>
<tr>
<tr>
...
@@ -105,10 +106,12 @@
...
@@ -105,10 +106,12 @@
</thead>
</thead>
<tbody></tbody>
<tbody></tbody>
</table>
</table>
</form>
</div>
</div>
</div>
</div>
<div class="
modal
-
footer
">
<div class="
modal
-
footer
">
<button type="
button
" class="
btn
btn
-
danger
" data-bs-dismiss="
modal
">Close</button>
<button type="
button
" class="
btn
btn
-
danger
" data-bs-dismiss="
modal
">Close</button>
<button type="
submit
" class="
btn
btn
-
primary
" form="
form
-
update
-
ketua
">Submit</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -228,6 +231,47 @@
...
@@ -228,6 +231,47 @@
}
}
});
});
$
(
'#form-update-ketua'
)
.
on
(
'submit'
,
function
(
e
)
{
e
.
preventDefault
();
var
form
=
$
(
this
);
var
url
=
form
.
attr
(
'action'
);
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
data
:
form
.
serialize
(),
// serializes the form's elements
dataType
:
'json'
,
success
:
function
(
response
)
{
if
(
response
.
success
)
{
swal
({
title
:
"Berhasil!"
,
text
:
response
.
message
,
icon
:
"success"
,
button
:
"OK"
,
})
.
then
(
function
()
{
// Reload or redirect after success if needed
location
.
reload
();
});
}
else
{
swal
({
title
:
"Gagal!"
,
text
:
response
.
message
,
icon
:
"error"
,
button
:
"OK"
,
});
}
},
error
:
function
(
xhr
,
status
,
error
)
{
swal
({
title
:
"Gagal!"
,
text
:
"Terjadi kesalahan pada server."
,
icon
:
"error"
,
button
:
"OK"
,
});
}
});
});
});
});
</
script
>
</
script
>
@
endsection
@
endsection
resources/views/layouts/inijs.blade.php
View file @
5629fab6
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
{{--
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
></script>
--}}
{{--
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
></script>
--}}
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"
></script>
<script
src=
"https://unpkg.com/sweetalert/dist/sweetalert.min.js"
></script>
{{--
<script
type=
"text/javascript"
src=
"{{ asset('theme/js/eModal.js') }}"
></script>
--}}
{{--
<script
type=
"text/javascript"
src=
"{{ asset('theme/js/eModal.js') }}"
></script>
--}}
{{--
<script>
{{--
<script>
...
...
resources/views/layouts/master.blade.php
View file @
5629fab6
...
@@ -43,9 +43,9 @@
...
@@ -43,9 +43,9 @@
</b>
</b>
{{-- @php dd(Auth::user()->roles->first()); @endphp --}}
{{-- @php dd(Auth::user()->roles->first()); @endphp --}}
@if (Auth::user()->roles->first()->name == 'mahasiswa')
@if (Auth::user()->roles->first()->name == 'mahasiswa')
<img src="
{{
is_null
(
Auth
::
user
()
->
rBiodata
)
?
asset
(
'theme/images/users/user-null.jpg'
)
:
is_null
(
Auth
::
user
()
->
rBiodata
->
noidentitas
)
?
asset
(
'theme/images/users/user-null'
)
:
'https://siakadu.unesa.ac.id/photo/fotomhs/'
.
Auth
::
user
()
->
rBiodata
->
noidentitas
}}
.
jpg
" alt="
Header
Avatar
" class="
rounded
-
circle
header
-
profile
-
user
" >
<img src="
{{
is_null
(
Auth
::
user
()
->
rBiodata
)
?
asset
(
'theme/images/users/user-null.jpg'
)
:
(
is_null
(
Auth
::
user
()
->
rBiodata
->
noidentitas
)
?
asset
(
'theme/images/users/user-null'
)
:
'https://siakadu.unesa.ac.id/photo/fotomhs/'
.
Auth
::
user
()
->
rBiodata
->
noidentitas
)
}}
.
jpg
" alt="
Header
Avatar
" class="
rounded
-
circle
header
-
profile
-
user
" >
@else
@else
<img src="
{{
is_null
(
Auth
::
user
()
->
rBiodata
)
?
asset
(
'theme/images/users/user-null.jpg'
)
:
is_null
(
Auth
::
user
()
->
rBiodata
->
noidentitas
)
?
asset
(
'theme/images/users/user-null'
)
:
'https://siakadu.unesa.ac.id/photo/'
.
Auth
::
user
()
->
rBiodata
->
noidentitas
}}
.
jpg
" alt="
Header
Avatar
" class="
rounded
-
circle
header
-
profile
-
user
" >
<img src="
{{
is_null
(
Auth
::
user
()
->
rBiodata
)
?
asset
(
'theme/images/users/user-null.jpg'
)
:
(
is_null
(
Auth
::
user
()
->
rBiodata
->
noidentitas
)
?
asset
(
'theme/images/users/user-null'
)
:
'https://siakadu.unesa.ac.id/photo/'
.
Auth
::
user
()
->
rBiodata
->
noidentitas
)
}}
.
jpg
" alt="
Header
Avatar
" class="
rounded
-
circle
header
-
profile
-
user
" >
@endif
@endif
</button>
</button>
<div class="
dropdown
-
menu
dropdown
-
menu
-
end
">
<div class="
dropdown
-
menu
dropdown
-
menu
-
end
">
...
...
routes/web.php
View file @
5629fab6
...
@@ -156,6 +156,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
...
@@ -156,6 +156,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route
::
get
(
'getKelompok'
,
[
KelompokController
::
class
,
'getData'
])
->
name
(
'getKelompok'
);
Route
::
get
(
'getKelompok'
,
[
KelompokController
::
class
,
'getData'
])
->
name
(
'getKelompok'
);
Route
::
get
(
'getDetilKelompok'
,
[
KelompokController
::
class
,
'getDetil'
])
->
name
(
'getDetilKelompok'
);
Route
::
get
(
'getDetilKelompok'
,
[
KelompokController
::
class
,
'getDetil'
])
->
name
(
'getDetilKelompok'
);
Route
::
post
(
'proses-kelompok'
,
[
KelompokController
::
class
,
'prosesKelompok'
])
->
name
(
'proses-kelompok'
);
Route
::
post
(
'proses-kelompok'
,
[
KelompokController
::
class
,
'prosesKelompok'
])
->
name
(
'proses-kelompok'
);
Route
::
post
(
'kelompok/update-kelompok'
,
[
KelompokController
::
class
,
'updateKetua'
])
->
name
(
'update-kelompok'
);
Route
::
resource
(
'proposal'
,
ProposalController
::
class
);
Route
::
resource
(
'proposal'
,
ProposalController
::
class
);
Route
::
get
(
'getProposal'
,
[
ProposalController
::
class
,
'getData'
])
->
name
(
'getProposal'
);
Route
::
get
(
'getProposal'
,
[
ProposalController
::
class
,
'getData'
])
->
name
(
'getProposal'
);
...
...
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