Commit 00619a49 by Farendi Giotivano R.P

update proposal dan kelompok

parent 42df44c1
......@@ -80,4 +80,38 @@ class KelompokController extends Controller
return redirect()->route('dosen.kelompok.index');
}
public function lihat(Request $request)
{
$kelompok_detil = KelompokDetail::where('kelompok_id', $request->kelompok_id)->get();
$data = '';
$no = 1;
$anggota= 0;
foreach ($kelompok_detil as $key => $value) {
if($value->status_ketua == 1)
$keterangan = "Ketua";
else
{
$anggota++;
$keterangan = "Anggota ".$anggota?:1;
}
$data .= "
<tr>
<td>".$no."</td>
<td>".$value->nama."</td>
<td>".$value->nim."</td>
<td>".$value->fakultas."</td>
<td>".$value->prodi."</td>
<td>".$keterangan."</td>
</tr>
";
$no++;
}
$response['html'] = $data;
echo json_encode($response);
}
}
......@@ -64,4 +64,61 @@ class ProposalController extends Controller
return redirect()->route('dosen.proposal.index');
}
public function lihat(Request $request)
{
$item = Proposal::where('proposal_id', $request->proposal_id)->first();
$data = '';
$no = 1;
if($item->upload_dokumen){
$dokumen = ' <a href="https://statik.unesa.ac.id/simpkm/proposal/'. $item->rPeriode->nama .'/'. $item->upload_dokumen.'" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a>
<iframe id="view-pdf" width="100%" height="400px" src="https://statik.unesa.ac.id/simpkm/proposal/'. $item->rPeriode->nama .'/'.$item->upload_dokumen .'" frameborder="0"></iframe>';
}else{
$dokumen = '<div class="alert alert-danger alert-dismissible fade show mb-0" role="alert">
<strong>Informasi!</strong><br/> File tidak ditemukan.
</div>';
}
if(is_null($item->status)){
$status = '<span class="badge bg-danger">Menunggu Persetujuan Dosen</span>';
}else{
$status = '<span class="badge bg-success">Sudah Disetujui Dosen</span>';
}
$data .= "
<tr>
<td>Judul Proposal</td>
<td>".$item->judul."</td>
</tr>
<tr>
<td>Jenis PKM</td>
<td>".$item->rJenis->nama."</td>
</tr>
<tr>
<td>Status</td>
<td>".$status."</td>
</tr>
<tr>
<td>Proposal</td>
<td>".$dokumen."</td>
</tr>
";
$response['html'] = $data;
echo json_encode($response);
}
public function approve($id)
{
$proposal = Proposal::query()->find(decrypt($id));
return response()->json([
'data' => $proposal
]);
}
}
......@@ -40,7 +40,7 @@ class KelompokController extends Controller
->orderBy('kode')
->get();
$cekKel = $kelompok->where('created_user', auth()->user()->id)->count();
$cekKel = $kelompok->where('created_user', auth()->user()->id)->whereIn('status', [0,1])->count();
// $getMhs = GetDataApiController::getAccount(20030244001);
// dd($getMhs);
......
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Mahasiswa;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\GetDataApiController;
use App\Models\JadwalKegiatan;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
......@@ -12,6 +13,7 @@ use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\Jenis;
use Carbon\Carbon;
use Session;
use Alert;
......@@ -70,12 +72,20 @@ class ProposalController extends Controller
$kelompok = Kelompok::where('created_user', auth()->user()->id)
->where('periode_id', $periode->periode_id)
->where('kirim', '1')
->where('status', '1')
->first();
$cekproposal = Proposal::where('created_user', auth()->user()->id)
->where('periode_id', $periode->periode_id)
->first();
$jadwal = JadwalKegiatan::where('periode_id', $periode->where('status', 1)->first()->periode_id)
->where('nama','Upload Proposal Seleksi Internal')->first();
if(($jadwal->tanggal_mulai <= Carbon::now()) && ($jadwal->tanggal_selesai >= Carbon::now())){
return redirect()->route('mahasiswa.proposal.index')->with('warning', 'Batas Pengajuan telah berakhir!');
}
if($cekproposal) {
return redirect()->route('mahasiswa.proposal.index')->with('warning', 'Sudah ada Proposal yang di ajukan!');
}
......@@ -91,7 +101,8 @@ class ProposalController extends Controller
'periode' => $periode,
'jenis' => $jenis,
'kelompok' => $kelompok,
'proposal' => $proposal
'proposal' => $proposal,
'jadwal' => $jadwal,
];
return view('backend.mahasiswa.proposal.create', $data);
......
......@@ -88,7 +88,8 @@
</td>
<td>
<button data-bs-toggle="modal" data-bs-target="{{ '#lihat'.$item->kelompok_id }}" href="{{ URL::to('mahasiswa/kelompok-new', encrypt($item->kelompok_id)) }}" class="btn btn-info btn-sm"><i class="far fa-eye"></i> Lihat</button>
{{-- <button data-bs-toggle="modal" data-bs-target="{{ '#lihat'.$item->kelompok_id }}" href="{{ URL::to('mahasiswa/kelompok-new', encrypt($item->kelompok_id)) }}" class="btn btn-info btn-sm"><i class="far fa-eye"></i> Lihat</button> --}}
<a data-toggle="tooltip" data-id="{{ $item->kelompok_id }}" data-original-title="Lihat" class="btn btn-info btn-sm lihatDet"><i class="far fa-eye"></i> Lihat</a>
@if($item->status == 0)
<a onclick="setuju('{{ encrypt($item->kelompok_id) }}', 'row-{{ $token }}')" class="btn btn-success btn-sm"><i class="fas fa-check"></i> Setuju</a>
......@@ -100,57 +101,7 @@
<a onclick="hapus('{{ encrypt($item->kelompok_id) }}', 'row-{{ $token }}')" class="btn btn-danger btn-sm">Hapus</a>
@endif
<div id="{{ 'lihat'.$item->kelompok_id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="lihatLabel">Data Kelompok </h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
<div class="table-responsive">
<table class="table table-striped mb-0">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>NIM</th>
<th>Fakultas</th>
<th>Program Studi</th>
<th>Keterangan</th>
</tr>
</thead>
<tbody>
<tr>
@foreach ($item->rAnggota as $value)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $value->nama }}</td>
<td>{{ $value->nim }}</td>
<td>{{ $value->fakultas }}</td>
<td>{{ $value->prodi }}</td>
<td>
@if($value->status_ketua == 1)
Ketua
@else
Anggota {{ $loop->iteration-1 }}
@endif
</td>
</tr>
@endforeach
</tr>
</tbody>
</table>
</div>
</p>
</div>
</div>
</div>
</div>
</div>
</td>
......@@ -164,46 +115,35 @@
</div> <!-- end col -->
</div> <!-- end row -->
@php
/*
@endphp
<div id="tmbhKel" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div id="lihatDetail" class="modal fade">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<form action="{{ route('mahasiswa.kelompok.store') }}" method="POST">
@csrf
<div class="modal-header">
<h5 class="modal-title" id="myModalLabel">Tambah Kelompok Baru</h5>
<h5 class="modal-title" id="lihatLabel">Detail Kelompok</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="col-12">
<h5 class="font-size-16">Silahkan pilih dosen pembimbing : </h5>
<p>
<input type="hidden" name="periode" value="{{ $periode->where('status', 1)->first()->periode_id; }}" >
<select class="form-select" style="width: 100%" id="selectmodal" name="dosen">
<option selected>Pilih Dosen</option>
@foreach($dosen as $item)
<option value="{{ encrypt($item['id_sdm'].'_'.$item['nm_sdm'].'_'.$item['nidn']) }}">{{ $item['nm_sdm'].' - '.$item['prodi']}}</option>
@endforeach
</select>
</p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary waves-effect waves-light">Save changes</button>
<p>
<table class="table table-bordered data-table mb-0" id="tableDetail">
<thead>
<tr>
<th>No</th>
<th>Nama</th>
<th>NIM</th>
<th>Fakultas</th>
<th>Program Studi</th>
<th>Keterangan</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</p>
</div>
</form>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
@php
*/
@endphp
@endsection
@section('js')
......@@ -297,5 +237,33 @@
})
}
$(document).ready(function(){
$('#datatable').on('click','.lihatDet',function(){
var kelId = $(this).attr('data-id');
if(kelId != null || kelId != ''){
// Empty modal data
$('#tableDetail tbody').empty();
$.ajax({
url: "{{route('dosen.kelompok.lihat')}}",
data : {
"kelompok_id": kelId,
},
dataType: 'json',
success: function(response){
// Add user details
$('#tableDetail tbody').html(response.html);
// Display Modal
$('#lihatDetail').modal('show');
}
});
}
});
});
</script>
@endsection
......@@ -97,62 +97,13 @@
@endif
</td>
<td>
<button data-bs-toggle="modal" data-bs-target="{{ '#lihat'.$item->proposal_id }}" href="{{ URL::to('mahasiswa/kelompok-new', encrypt($item->proposal_id)) }}" class="btn btn-info btn-sm"><i class="far fa-eye"></i> Lihat</button>
<a data-toggle="tooltip" data-id="{{ $item->proposal_id }}" data-original-title="Lihat" class="btn btn-info btn-sm lihatDet"><i class="far fa-eye"></i> Lihat</a>
@if($item->status == '0')
<a onclick="setuju('{{ encrypt($item->proposal_id) }}', 'row-{{ $token }}')" class="btn btn-success btn-sm"><i class="fas fa-check"></i> Setuju</a>
{{-- <a href="" id="editCompany" data-toggle="modal" data-target='#practice_modal' data-id="{{ encrypt($item->proposal_id) }}" class="btn btn-danger btn-sm">Tolak</a> --}}
@endif
<div id="{{ 'lihat'.$item->proposal_id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="lihatLabel">Detail Proposal </h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
<div class="table-responsive">
<table class="table mb-0">
<tr>
<th>Judul Proposal</th>
<td>{{ $item->judul }}</td>
</tr>
<tr>
<th>Jenis PKM</th>
<td>{{ $item->rJenis->nama }}</td>
</tr>
<tr>
<th>Status</th>
<td>
@if(is_null($item->status))
<span class="badge bg-danger">Menunggu Persetujuan Dosen</span>
@else
<span class="badge bg-success">Sudah Disetujui Dosen</span>
@endif
</td>
</tr>
<tr>
<th>Proposal</th>
<td>
@if($item->upload_dokumen)
<a href="https://statik.unesa.ac.id/simpkm/proposal/{{ $item->rPeriode->nama }}/{{ $item->upload_dokumen }}" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a>
<iframe id="view-pdf" width="100%" height="400px" src="https://statik.unesa.ac.id/simpkm/proposal/{{ $item->rPeriode->nama }}/{{ $item->upload_dokumen }}" frameborder="0"></iframe>
@else
<div class="alert alert-danger alert-dismissible fade show mb-0" role="alert">
<strong>Informasi!</strong><br/> File tidak ditemukan.
</div>
@endif
</td>
</tr>
</table>
</div>
</p>
</div>
</div>
</div>
</div>
</div>
</td>
......@@ -166,6 +117,43 @@
</div> <!-- end col -->
</div> <!-- end row -->
<div id="lihatDetail" class="modal fade">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="lihatLabel">Detail Proposal </h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>
<div class="table-responsive">
<table class="table mb-0" id="tableDetail">
<tbody>
</tbody>
</table>
</div>
</p>
</div>
</div>
</div>
</div>
<div class="modal fade" id="practice_modal">
<div class="modal-dialog">
<form id="companydata">
<div class="modal-content">
<input type="hidden" id="proposal_id" name="proposal_id" value="">
<div class="modal-body">
<input type="text" name="judul" id="judul" value="" class="form-control">
</div>
<input type="submit" value="Submit" id="submit" class="btn btn-sm btn-outline-danger py-0" style="font-size: 0.8em;">
</div>
</form>
</div>
</div>
@endsection
@section('js')
......@@ -213,5 +201,51 @@ function setuju(id, rowId){
}
})
}
$(document).ready(function(){
$('#datatable').on('click','.lihatDet',function(){
var proId = $(this).attr('data-id');
if(proId != null || proId != ''){
// Empty modal data
$('#tableDetail tbody').empty();
$.ajax({
url: "{{route('dosen.proposal.lihat')}}",
data : {
"proposal_id": proId,
},
dataType: 'json',
success: function(response){
// Add user details
$('#tableDetail tbody').html(response.html);
// Display Modal
$('#lihatDetail').modal('show');
}
});
}
});
});
$('body').on('click', '#editCompany', function (event) {
event.preventDefault();
var id = $(this).data('id');
console.log(id)
$.get('proposal-approv/' + id, function (data) {
$('#userCrudModal').html("Edit category");
$('#submit').val("Edit category");
$('#practice_modal').modal('show');
$('#proposal_id').val(data.data.proposal_id);
$('#judul').val(data.data.judul);
})
});
</script>
@endsection
......@@ -83,7 +83,9 @@
<td>
@if(!is_null($item->kirim))
@if($item->status == 0)
<span class="badge bg-danger">Menunggu Persetujuan Dosen</span>
<span class="badge bg-warning">Menunggu Persetujuan Dosen</span>
@elseif($item->status == 2)
<span class="badge bg-danger">Di Tolak Dosen</span>
@else
<span class="badge bg-success">Sudah Disetujui Dosen</span>
@endif
......
......@@ -23,7 +23,7 @@
</div>
<div class="col-md-4">
<div class="float-end d-none d-md-block">
<a href="{{ URL::to('mahasiswa/proposal/create') }}" type="button" class="btn btn-primary waves-effect waves-light"> <i class="fas fa-plus-circle"></i> Tambah Data</a>
{{-- <a href="{{ URL::to('mahasiswa/proposal/create') }}" type="button" class="btn btn-primary waves-effect waves-light"> <i class="fas fa-plus-circle"></i> Tambah Data</a> --}}
</div>
</div>
</div>
......
......@@ -119,10 +119,13 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
Route::get('/kelompok-new/{id}', [DosenKelompok::class, 'newkelompok'])->name('kelompok.createnew');
Route::post('/kelompok-tolak', [DosenKelompok::class, 'tolak'])->name('kelompok.tolak');
Route::post('/kelompok-terima', [DosenKelompok::class, 'terima'])->name('kelompok.terima');
Route::get('/kelompok-lihat', [DosenKelompok::class, 'lihat'])->name('kelompok.lihat');
//proposal
Route::resource('proposal', DosenProposal::class);
Route::post('/proposal-setuju', [DosenProposal::class, 'setuju'])->name('proposal.setuju');
Route::get('/proposal-lihat', [DosenProposal::class, 'lihat'])->name('proposal.lihat');
Route::get('/proposal-approv/{id}', [DosenProposal::class, 'approve'])->name('proposal.approv');
//seleksi
Route::resource('seleksi', DosenSeleksi::class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment