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
502b8df9
Commit
502b8df9
authored
Apr 14, 2025
by
Alfiro Pratama
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slot Bimbingan Dosen maks. 10 slot
parent
6859c79a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
app/Http/Controllers/Api/DosenController.php
+16
-2
app/Http/Controllers/Dosen/KelompokController.php
+1
-1
app/Http/Controllers/Mahasiswa/KelompokController.php
+1
-1
No files found.
app/Http/Controllers/Api/DosenController.php
View file @
502b8df9
...
...
@@ -4,6 +4,8 @@ namespace App\Http\Controllers\Api;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\GetDataApiController
;
use
App\Models\Kelompok
;
use
App\Models\Periode
;
use
Illuminate\Http\Request
;
class
DosenController
extends
Controller
...
...
@@ -17,6 +19,8 @@ class DosenController extends Controller
$total_count
=
0
;
$incomplete_results
=
true
;
$periode
=
Periode
::
where
(
'status'
,
1
)
->
first
();
$items
=
[];
if
(
empty
(
$getDosen
))
{
...
...
@@ -27,11 +31,20 @@ class DosenController extends Controller
foreach
(
$getDosen
[
'data'
]
as
$key
=>
$item
)
{
if
(
str_contains
(
strtolower
(
$item
[
'nm_sdm'
]),
strtolower
(
$keyword
))){
$jumlah_bimbingan
=
Kelompok
::
where
(
'id_sdm'
,
$item
[
'id_sdm'
])
->
where
(
'periode_id'
,
$periode
->
periode_id
)
->
where
(
'status_hapus'
,
0
)
->
where
(
'kirim'
,
1
)
->
whereYear
(
'created_at'
,
$periode
->
nama
)
->
count
();
$itemData
=
[
'id'
=>
encrypt
(
$item
[
'id_sdm'
]
.
'_'
.
$item
[
'nm_sdm'
]
.
'_'
.
$item
[
'nidn'
]),
'full_name'
=>
$item
[
'nm_sdm'
],
'description'
=>
$item
[
'prodi'
],
'description'
=>
$item
[
'prodi'
]
.
'<span style="margin-left: 2em">-</span><i style="margin-left: 2em">(Slot Bimbingan: '
.
(
10
-
$jumlah_bimbingan
)
.
' slot)</i>'
,
'nidn'
=>
$item
[
'nidn'
],
'bimbingan_count'
=>
$jumlah_bimbingan
,
'disabled'
=>
$jumlah_bimbingan
>=
10
?
true
:
false
,
];
$items
[]
=
$itemData
;
...
...
@@ -47,7 +60,8 @@ class DosenController extends Controller
'items'
=>
$items
,
];
//dd($data);
// dd($data);
// return response()->json($data);
return
response
(
$data
,
200
);
}
}
app/Http/Controllers/Dosen/KelompokController.php
View file @
502b8df9
...
...
@@ -28,7 +28,7 @@ class KelompokController extends Controller
$bio
=
auth
()
->
user
()
->
rBiodata
;
$getDosen
=
GetDataApiController
::
getDosen
();
// $periode = Periode::where('status', 1)->first();
$periode
=
Periode
::
query
()
->
get
();
$periode
=
Periode
::
query
()
->
orderBy
(
'nama'
,
'ASC'
)
->
get
();
$year
=
!
is_null
(
$request
->
year
)
?
$request
->
year
:
now
()
->
year
;
$kelompok
=
Kelompok
::
with
([
'rAnggota'
])
...
...
app/Http/Controllers/Mahasiswa/KelompokController.php
View file @
502b8df9
...
...
@@ -29,7 +29,7 @@ class KelompokController extends Controller
$bio
=
auth
()
->
user
()
->
rBiodata
;
$nim
=
$bio
->
noidentitas
;
$getDosen
=
GetDataApiController
::
getDosen
();
$periode
=
Periode
::
query
()
->
get
();
$periode
=
Periode
::
query
()
->
orderBy
(
'nama'
,
'ASC'
)
->
get
();
$periode_aktif
=
Periode
::
where
(
'status'
,
1
)
->
first
();
$year
=
!
is_null
(
$request
->
year
)
?
$request
->
year
:
now
()
->
year
;
...
...
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