Commit 9d9e9568 by Farendi Giotivano R.P

update seleksi belmawa

parent 27e19bc4
...@@ -16,6 +16,7 @@ use App\Models\Jenis; ...@@ -16,6 +16,7 @@ use App\Models\Jenis;
use Session; use Session;
use Alert; use Alert;
use App\Models\DaftarProposal; use App\Models\DaftarProposal;
use App\Models\SeleksiBelmawa;
use Auth; use Auth;
use DB; use DB;
...@@ -92,7 +93,7 @@ class SeleksiController extends Controller ...@@ -92,7 +93,7 @@ class SeleksiController extends Controller
$periode = Periode::query()->get(); $periode = Periode::query()->get();
$year = !is_null($request->year) ? $request->year : now()->year; $year = !is_null($request->year) ? $request->year : now()->year;
$proposal = Proposal::with(['rKelompok', 'rJenis', 'rNilai']) $proposal = Proposal::with(['rKelompok', 'rJenis', 'rNilai', 'rReviewProposal', 'rBelmawa'])
->whereHas('rKelompok', function ($query) use($nim){ ->whereHas('rKelompok', function ($query) use($nim){
$query->whereHas('rAnggota', function ($query) use($nim){ $query->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim); $query->where('nim', $nim);
...@@ -143,13 +144,15 @@ class SeleksiController extends Controller ...@@ -143,13 +144,15 @@ class SeleksiController extends Controller
$proposal = Proposal::with(['rPeriode'])->find($pro['proposal_id']); $proposal = Proposal::with(['rPeriode'])->find($pro['proposal_id']);
$belmawa = SeleksiBelmawa::where('proposal_id', $pro['proposal_id'])->first();
$file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension(); $file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/proposal/revisi/'.$proposal->rPeriode->nama.'/'.$file_nama, file_get_contents($pro['file']->getRealPath())); Storage::disk('static')->put('simpkm/proposal/revisi/'.$proposal->rPeriode->nama.'/'.$file_nama, file_get_contents($pro['file']->getRealPath()));
$proposal->revisi_filebelmawa = $file_nama ; $belmawa->upload_dokumen = $file_nama ;
$proposal->revisi_datebelmawa = now(); $belmawa->date_upload = now();
$proposal->save(); $belmawa->save();
return redirect()->route('mahasiswa.seleksi-belmawa')->with('success', 'Proposal Berhasil revisi'); return redirect()->route('mahasiswa.seleksi-belmawa')->with('success', 'Proposal Berhasil revisi');
} }
......
...@@ -97,5 +97,15 @@ class Proposal extends Model ...@@ -97,5 +97,15 @@ class Proposal extends Model
{ {
return $this->hasOne(DaftarProposal::class, 'proposal_id', 'proposal_id'); return $this->hasOne(DaftarProposal::class, 'proposal_id', 'proposal_id');
} }
public function rReviewProposal()
{
return $this->hasOne(ReviewerProposal::class, 'proposal_id', 'proposal_id');
}
public function rBelmawa()
{
return $this->hasOne(SeleksiBelmawa::class, 'proposal_id', 'proposal_id');
}
} }
...@@ -15,4 +15,9 @@ class SeleksiBelmawa extends Model ...@@ -15,4 +15,9 @@ class SeleksiBelmawa extends Model
protected $fillable = [ protected $fillable = [
'seleksi_belmawa_id', 'proposal_id', 'upload_dokumen', 'date_upload', 'status', 'komentar', 'date_approval', 'created_user', 'created_at', 'updated_user', 'updated_at' 'seleksi_belmawa_id', 'proposal_id', 'upload_dokumen', 'date_upload', 'status', 'komentar', 'date_approval', 'created_user', 'created_at', 'updated_user', 'updated_at'
]; ];
public function rBelmawa()
{
return $this->hasOne(Proposal::class, 'proposal_id', 'proposal_id');
}
} }
...@@ -76,18 +76,22 @@ ...@@ -76,18 +76,22 @@
<td>{{ $item->rJenis->nama }}</td> <td>{{ $item->rJenis->nama }}</td>
<td>{{ $item->judul }}</td> <td>{{ $item->judul }}</td>
<td> <td>
@if(is_null($item->status)) @if($item->rReviewProposal)
@if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span> <span class="badge bg-success">Lolos Seleksi Internal</span>
@else @else
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span> <span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif @endif
@endif
</td> </td>
<td> <td>
@if(is_null($item->revisi_filebelmawa)) @if($item->rReviewProposal)
@if(is_null($item->rBelmawa->upload_dokumen))
<span class="badge bg-danger">Belum Upload Proposal</span> <span class="badge bg-danger">Belum Upload Proposal</span>
@else @else
<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">Lihat</button> <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">Lihat</button>
@endif @endif
@endif
<div id="{{ 'lihat'.$item->proposal_id }}" class="modal fade" tabindex="-1" role="dialog" <div id="{{ 'lihat'.$item->proposal_id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true"> aria-labelledby="lihatLabel" aria-hidden="true">
...@@ -112,18 +116,20 @@ ...@@ -112,18 +116,20 @@
<tr> <tr>
<th>Status</th> <th>Status</th>
<td> <td>
@if(is_null($item->status)) @if($item->rReviewProposal)
<span class="badge bg-danger">Lolos Seleksi Internal</span> @if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span>
@else @else
<span class="badge bg-success">Tidak Lolos Seleksi Internal</span> <span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif
@endif @endif
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Proposal</th> <th>Proposal</th>
<td> <td>
<a href="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->revisi_filebelmawa }}" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a> <a href="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->rBelmawa->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="200px" src="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->revisi_filebelmawa }}" frameborder="0"></iframe> <iframe id="view-pdf" width="100%" height="200px" src="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->rBelmawa->upload_dokumen }}" frameborder="0"></iframe>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -78,15 +78,17 @@ ...@@ -78,15 +78,17 @@
<td>{{ $item->rJenis->nama }}</td> <td>{{ $item->rJenis->nama }}</td>
<td>{{ $item->judul }}</td> <td>{{ $item->judul }}</td>
<td> <td>
@if($item->status == '2') @if($item->rReviewProposal)
@if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span> <span class="badge bg-success">Lolos Seleksi Internal</span>
@else @else
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span> <span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif @endif
@endif
</td> </td>
<td> <td>
@if($item->status == '2') @if($item->rReviewProposal)
@if(is_null($item->revisi_filebelmawa)) @if(is_null($item->rBelmawa->upload_dokumen))
<a href="{{ URL::to('mahasiswa/seleksi-belmawa/revisi', $item->proposal_id) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-edit"></i> Edit</a> <a href="{{ URL::to('mahasiswa/seleksi-belmawa/revisi', $item->proposal_id) }}" type="button" class="btn btn-warning btn-sm waves-effect waves-light"> <i class="fas fa-edit"></i> Edit</a>
@else @else
<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">Lihat</button> <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">Lihat</button>
...@@ -116,18 +118,20 @@ ...@@ -116,18 +118,20 @@
<tr> <tr>
<th>Status</th> <th>Status</th>
<td> <td>
@if(is_null($item->status)) @if($item->rReviewProposal)
@if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span> <span class="badge bg-success">Lolos Seleksi Internal</span>
@else @else
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span> <span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif @endif
@endif
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Proposal</th> <th>Proposal</th>
<td> <td>
<a href="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->revisi_filebelmawa }}" target="_blank" class="btn btn-success btn-sm"> <i class="far fa-eye"></i> Lihat Proposal</a> <a href="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->rBelmawa->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/revisi/{{ $item->rPeriode->nama }}/{{ $item->revisi_filebelmawa }}" frameborder="0"></iframe> <iframe id="view-pdf" width="100%" height="400px" src="https://statik.unesa.ac.id/simpkm/proposal/revisi/{{ $item->rPeriode->nama }}/{{ $item->rBelmawa->upload_dokumen }}" frameborder="0"></iframe>
</td> </td>
</tr> </tr>
<tr> <tr>
......
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