Commit 40b7e7c7 by Farendi Giotivano R.P

tambahan

parent 3d359ced
...@@ -33,6 +33,7 @@ class KelompokController extends Controller ...@@ -33,6 +33,7 @@ class KelompokController extends Controller
$kelompok = Kelompok::with(['rAnggota']) $kelompok = Kelompok::with(['rAnggota'])
->where('nidn_dosen', $bio->noidentitas) ->where('nidn_dosen', $bio->noidentitas)
->where('kirim', '1')
->whereYear('created_at', $year) ->whereYear('created_at', $year)
->orderBy('kode') ->orderBy('kode')
->get(); ->get();
......
...@@ -50,6 +50,16 @@ class LuaranController extends Controller ...@@ -50,6 +50,16 @@ class LuaranController extends Controller
$proposal = Proposal::with(['rPeriode'])->find($luaran['proposal_id']); $proposal = Proposal::with(['rPeriode'])->find($luaran['proposal_id']);
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'_'.$luaran['jenis_luaran'].'.'.$luaran['file']->getClientOriginalExtension(); $file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'_'.$luaran['jenis_luaran'].'.'.$luaran['file']->getClientOriginalExtension();
Storage::disk('static')->put('simpkm/luaran/'.$luaran['jenis_luaran'].'/'.$file_nama, file_get_contents($luaran['file']->getRealPath())); Storage::disk('static')->put('simpkm/luaran/'.$luaran['jenis_luaran'].'/'.$file_nama, file_get_contents($luaran['file']->getRealPath()));
......
...@@ -107,6 +107,15 @@ class MonevController extends Controller ...@@ -107,6 +107,15 @@ class MonevController extends Controller
// //
$pro = $request->except('_token'); $pro = $request->except('_token');
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$proposal = MonevInternal::with(['rProposal'])->find($pro['monev_id']); $proposal = MonevInternal::with(['rProposal'])->find($pro['monev_id']);
$file_nama = $proposal->rProposal->rPeriode->nama.'_'.$proposal->rProposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension(); $file_nama = $proposal->rProposal->rPeriode->nama.'_'.$proposal->rProposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension();
......
...@@ -70,7 +70,7 @@ class ProposalController extends Controller ...@@ -70,7 +70,7 @@ class ProposalController extends Controller
$kelompok = Kelompok::where('created_user', auth()->user()->id) $kelompok = Kelompok::where('created_user', auth()->user()->id)
->where('periode_id', $periode->periode_id) ->where('periode_id', $periode->periode_id)
->where('status', '0') ->where('kirim', '1')
->first(); ->first();
if(is_null($kelompok)){ if(is_null($kelompok)){
...@@ -101,6 +101,15 @@ class ProposalController extends Controller ...@@ -101,6 +101,15 @@ class ProposalController extends Controller
// //
$proposal = $request->except('_token'); $proposal = $request->except('_token');
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$periode = Periode::where('status', 1)->first(); $periode = Periode::where('status', 1)->first();
$uuid = Str::uuid(); $uuid = Str::uuid();
...@@ -171,10 +180,18 @@ class ProposalController extends Controller ...@@ -171,10 +180,18 @@ class ProposalController extends Controller
{ {
// //
$proposal = $request->except('_token'); $proposal = $request->except('_token');
// dd($proposal);
$this->validate($request,
[
'file' => 'mimes:pdf|max:5000'
], [
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$pro = Proposal::with(['rPeriode'])->find($id); $pro = Proposal::with(['rPeriode'])->find($id);
if(is_null($proposal['file'])){ if(!isset($proposal['file'])){
$file_nama = $pro->upload_dokumen; $file_nama = $pro->upload_dokumen;
} else { } else {
// Storage::disk('static')->delete('simpkm/proposal/'.$pro->rPeriode->nama.'/'.$pro->upload_dokumen); // Storage::disk('static')->delete('simpkm/proposal/'.$pro->rPeriode->nama.'/'.$pro->upload_dokumen);
......
...@@ -130,6 +130,15 @@ class SeleksiController extends Controller ...@@ -130,6 +130,15 @@ class SeleksiController extends Controller
// //
$pro = $request->except('_token'); $pro = $request->except('_token');
$this->validate($request,
[
'file' => 'required|mimes:pdf|max:5000'
], [
'file.required' => 'Tidak ada file yang di upload',
'file.mimes' => 'File harus pdf',
'file.max' => 'File tidak boleh lebih dari 5 mb',
]);
$proposal = Proposal::with(['rPeriode'])->find($pro['proposal_id']); $proposal = Proposal::with(['rPeriode'])->find($pro['proposal_id']);
$file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension(); $file_nama = $proposal->rPeriode->nama.'_'.$proposal->proposal_id.'.'.$pro['file']->getClientOriginalExtension();
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</div> </div>
</form> </form>
<br> <br>
<table id="datatable" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;"> <table id="datatable" class="table table-bordered dt-responsive" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead> <thead>
<tr> <tr>
<th>No</th> <th>No</th>
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
<h5 class="font-size-16">Upload File : </h5> <h5 class="font-size-16">Upload File : </h5>
<p> <p>
<input type="file" name="file" class="form-control" id="input-file"> <input type="file" name="file" class="form-control" id="input-file">
@if ($errors->has('file')) <span class="text-danger">{{ $errors->first('file') }}</span> @endif
</p> </p>
<div class="col-12"> <div class="col-12">
<h5 class="font-size-16">Keterangan : </h5> <h5 class="font-size-16">Keterangan : </h5>
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<div class="row mb-3" class="dropzone"> <div class="row mb-3" class="dropzone">
<label for="kode" class="col-sm-2 col-form-label">Upload Revisi Proposal</label> <label for="kode" class="col-sm-2 col-form-label">Upload Revisi Proposal</label>
<div class="col-sm-10"> <div class="col-sm-10">
@if ($errors->has('file')) <span class="text-danger">{{ $errors->first('file') }}</span> @endif
<input type="file" name="file" class="form-control" id="input-file"> <input type="file" name="file" class="form-control" id="input-file">
<iframe id="view-pdf" width="80%" height="80%" src="" frameborder="0"></iframe> <iframe id="view-pdf" width="80%" height="80%" src="" frameborder="0"></iframe>
</div> </div>
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<div class="row mb-3" class="dropzone"> <div class="row mb-3" class="dropzone">
<label for="kode" class="col-sm-2 col-form-label">Upload Proposal</label> <label for="kode" class="col-sm-2 col-form-label">Upload Proposal</label>
<div class="col-sm-10"> <div class="col-sm-10">
@if ($errors->has('file')) <span class="text-danger">{{ $errors->first('file') }}</span> @endif
<input type="file" name="file" class="form-control" id="input-file"> <input type="file" name="file" class="form-control" id="input-file">
<iframe id="view-pdf" width="80%" height="80%" frameborder="0" src="{{ $proposal ? 'https://statik.unesa.ac.id/simpkm/proposal/'.$proposal->rPeriode->nama.'/'.$proposal->upload_dokumen : '' }} "></iframe> <iframe id="view-pdf" width="80%" height="80%" frameborder="0" src="{{ $proposal ? 'https://statik.unesa.ac.id/simpkm/proposal/'.$proposal->rPeriode->nama.'/'.$proposal->upload_dokumen : '' }} "></iframe>
</div> </div>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<div class="row mb-3" class="dropzone"> <div class="row mb-3" class="dropzone">
<label for="kode" class="col-sm-2 col-form-label">Upload Revisi Proposal</label> <label for="kode" class="col-sm-2 col-form-label">Upload Revisi Proposal</label>
<div class="col-sm-10"> <div class="col-sm-10">
@if ($errors->has('file')) <span class="text-danger">{{ $errors->first('file') }}</span> @endif
<input type="file" name="file" class="form-control" id="input-file"> <input type="file" name="file" class="form-control" id="input-file">
<iframe id="view-pdf" width="80%" height="80%" src="" frameborder="0"></iframe> <iframe id="view-pdf" width="80%" height="80%" src="" frameborder="0"></iframe>
</div> </div>
......
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