Commit 9d9e9568 by Farendi Giotivano R.P

update seleksi belmawa

parent 27e19bc4
......@@ -16,6 +16,7 @@ use App\Models\Jenis;
use Session;
use Alert;
use App\Models\DaftarProposal;
use App\Models\SeleksiBelmawa;
use Auth;
use DB;
......@@ -92,7 +93,7 @@ class SeleksiController extends Controller
$periode = Periode::query()->get();
$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){
$query->whereHas('rAnggota', function ($query) use($nim){
$query->where('nim', $nim);
......@@ -143,13 +144,15 @@ class SeleksiController extends Controller
$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();
Storage::disk('static')->put('simpkm/proposal/revisi/'.$proposal->rPeriode->nama.'/'.$file_nama, file_get_contents($pro['file']->getRealPath()));
$proposal->revisi_filebelmawa = $file_nama ;
$proposal->revisi_datebelmawa = now();
$proposal->save();
$belmawa->upload_dokumen = $file_nama ;
$belmawa->date_upload = now();
$belmawa->save();
return redirect()->route('mahasiswa.seleksi-belmawa')->with('success', 'Proposal Berhasil revisi');
}
......
......@@ -97,5 +97,15 @@ class Proposal extends Model
{
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
protected $fillable = [
'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 @@
<td>{{ $item->rJenis->nama }}</td>
<td>{{ $item->judul }}</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>
@else
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif
@endif
</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>
@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>
@endif
@endif
<div id="{{ 'lihat'.$item->proposal_id }}" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="lihatLabel" aria-hidden="true">
......@@ -112,18 +116,20 @@
<tr>
<th>Status</th>
<td>
@if(is_null($item->status))
<span class="badge bg-danger">Lolos Seleksi Internal</span>
@if($item->rReviewProposal)
@if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span>
@else
<span class="badge bg-success">Tidak Lolos Seleksi Internal</span>
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif
@endif
</td>
</tr>
<tr>
<th>Proposal</th>
<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>
<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>
<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->rBelmawa->upload_dokumen }}" frameborder="0"></iframe>
</td>
</tr>
<tr>
......
......@@ -78,15 +78,17 @@
<td>{{ $item->rJenis->nama }}</td>
<td>{{ $item->judul }}</td>
<td>
@if($item->status == '2')
@if($item->rReviewProposal)
@if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span>
@else
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif
@endif
</td>
<td>
@if($item->status == '2')
@if(is_null($item->revisi_filebelmawa))
@if($item->rReviewProposal)
@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>
@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>
......@@ -116,18 +118,20 @@
<tr>
<th>Status</th>
<td>
@if(is_null($item->status))
@if($item->rReviewProposal)
@if($item->rReviewProposal->status_final == '1')
<span class="badge bg-success">Lolos Seleksi Internal</span>
@else
<span class="badge bg-danger">Tidak Lolos Seleksi Internal</span>
@endif
@endif
</td>
</tr>
<tr>
<th>Proposal</th>
<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>
<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>
<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->rBelmawa->upload_dokumen }}" frameborder="0"></iframe>
</td>
</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