Commit 6411a7dd by novanbagus

update reviewer sorting

parent 28bbc94a
...@@ -39,13 +39,19 @@ class DaftarSeleksiController extends Controller ...@@ -39,13 +39,19 @@ class DaftarSeleksiController extends Controller
public function index() public function index()
{ {
return view('backend.reviewer.seleksi.index')->withTitle('Daftar Proposal Seleksi Internal'); $periode = Periode::query()->get();
return view('backend.reviewer.seleksi.index', compact('periode'))->withTitle('Daftar Proposal Seleksi Internal');
} }
/* AJAX request */ /* AJAX request */
public function getData(Request $request){ public function getData(Request $request){
$noidentitas = $this->rBiodata->noidentitas; $noidentitas = $this->rBiodata->noidentitas;
// parameter
$administrasi = $request->get('administrasi');
$status = $request->get('status');
$tahun= $request->get('tahun');
## Read value ## Read value
$draw = $request->get('draw'); $draw = $request->get('draw');
$start = $request->get("start"); $start = $request->get("start");
...@@ -62,9 +68,29 @@ class DaftarSeleksiController extends Controller ...@@ -62,9 +68,29 @@ class DaftarSeleksiController extends Controller
$searchValue = strtoupper($search_arr['value']); // Search value $searchValue = strtoupper($search_arr['value']); // Search value
// Total records // Total records
$statement = " AND (UPPER(JUDUL) LIKE '%".$searchValue."%') ";
$statementGlobal = " 1=1 AND (NIDN_REVIEWER_ID_1 = '".$noidentitas."' OR NIDN_REVIEWER_ID_2 = '".$noidentitas."')"; $statementGlobal = " 1=1 AND (NIDN_REVIEWER_ID_1 = '".$noidentitas."' OR NIDN_REVIEWER_ID_2 = '".$noidentitas."')";
if($administrasi != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$administrasi = $administrasi - 1;
$statementGlobal .= " AND (ambil_data_reviewer_proposal ( '".$noidentitas."', proposal_id, '3' ) = '".$administrasi."')";
}
if($status != "0")
{
// dikurang 1 karena di view mulai dari 0 sedangkan 0 itu menunggu persetujuan
$status = $status - 1;
$statementGlobal .= " AND (ambil_data_reviewer_proposal ( '".$noidentitas."', proposal_id, '2' ) = '".$status."')";
}
if($tahun != "0")
{
$statementGlobal .= " AND PERIODE = '".$tahun."'";
}
$totalRecords = DaftarProposal::select('count(1) as allcount')->whereRaw($statementGlobal)->count(); $totalRecords = DaftarProposal::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$statement = " AND (UPPER(JUDUL) LIKE '%".$searchValue."%') ";
$totalRecordswithFilter = DaftarProposal::select('count(1) as allcount') $totalRecordswithFilter = DaftarProposal::select('count(1) as allcount')
->whereRaw($statementGlobal.$statement)->count(); ->whereRaw($statementGlobal.$statement)->count();
...@@ -99,7 +125,7 @@ class DaftarSeleksiController extends Controller ...@@ -99,7 +125,7 @@ class DaftarSeleksiController extends Controller
$status_administrasi = DB::select("select ambil_data_reviewer_proposal('".$noidentitas."', '".$proposal_id."', '3')")[0]->ambil_data_reviewer_proposal; $status_administrasi = DB::select("select ambil_data_reviewer_proposal('".$noidentitas."', '".$proposal_id."', '3')")[0]->ambil_data_reviewer_proposal;
$proposal = '<a href="'.$url.'" target="_blank" class="btn btn-primary btn-sm waves-effect waves-light" role="button"><i class="fas fa-search"></i></a>'; $proposal = '<a href="'.$url.'" target="_blank" class="btn btn-primary btn-sm waves-effect waves-light" role="button"><i class="fas fa-search"></i></a>';
if($status_nilai > 0 ||$status_administrasi == '2') if($status_nilai > 0 || $status_administrasi == '2')
$status = '<span class="badge bg-success">Sudah dinilai</span>'; $status = '<span class="badge bg-success">Sudah dinilai</span>';
else else
$status = '<span class="badge bg-danger">Belum dinilai</span>'; $status = '<span class="badge bg-danger">Belum dinilai</span>';
......
...@@ -31,6 +31,48 @@ ...@@ -31,6 +31,48 @@
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
{!! csrf_field() !!}
<div class="row">
<div class="col-md-4">
<div class="row">
<label class="col-sm-3 col-form-label">Adminis : </label>
<div class="col-sm-6">
<select class="form-select select2" name="reqAdministrasi" id="reqAdministrasi">
<option value="0">Semua</option>
<option value="1">Menunggu Penilaian</option>
<option value="2">Lolos</option>
<option value="3">Tidak Lolos</option>
</select>
</div>
</div>
</div>
<div class="col-md-4">
<div class="row">
<label class="col-sm-3 col-form-label">Status : </label>
<div class="col-sm-6">
<select class="form-select select2" name="reqStatus" id="reqStatus">
<option value="0">Semua</option>
<option value="2">Sudah dinilai</option>
<option value="3">Belum dinilai</option>
</select>
</div>
</div>
</div>
<div class="col-md-4">
<div class="row">
<label class="col-sm-3 col-form-label">Tahun : </label>
<div class="col-sm-6">
<select class="form-select select2" name="reqTahun" id="reqTahun">
<option value="0">Semua</option>
@foreach ($periode as $res)
<option value="{{ $res->nama }}">{{ $res->nama }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<br>
<table id="example" class="table table-bordered dt-responsive wrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;"> <table id="example" class="table table-bordered dt-responsive wrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead> <thead>
<tr> <tr>
...@@ -63,7 +105,13 @@ ...@@ -63,7 +105,13 @@
processing: true, processing: true,
serverSide: true, serverSide: true,
ajax: { ajax: {
"url" : "{{route('reviewer.getDaftarSeleksi')}}" "url" : "{{route('reviewer.getDaftarSeleksi')}}",
"data" : function ( data )
{
data.administrasi = $("#reqAdministrasi").val();
data.status = $("#reqStatus").val();
data.tahun = $("#reqTahun").val();
}
}, },
columns: [ columns: [
{ data: 'proposal_id' }, { data: 'proposal_id' },
...@@ -83,6 +131,10 @@ ...@@ -83,6 +131,10 @@
} }
] ]
}); });
$('#reqAdministrasi, #reqStatus, #reqTahun').change(function(){
oTable.draw();
});
}); });
function confirmFinal(reqId, reqStatus) function confirmFinal(reqId, reqStatus)
......
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