Commit 752dd786 by Novan Bagus Setiawan

perhitungan reviewer pertahun

parent d1f7f15c
......@@ -24,13 +24,18 @@ class ReviewerController extends Controller
use LoginTrait;
public function index()
{
return view('backend.operator.reviewer.index')->withTitle('Reviewer Seleksi Internal');
$periode = Periode::query()->get();
return view('backend.operator.reviewer.index', compact('periode'))->withTitle('Reviewer Seleksi Internal');
}
/* AJAX request */
public function getData(Request $request){
$jenis_monev_id = 'ba11c2b5-d65d-4360-9717-98e4fa9b9188';
$tahun= $request->get('tahun');
if($tahun == '0')
$tahun = '0';
## Read value
$draw = $request->get('draw');
......@@ -61,7 +66,7 @@ class ReviewerController extends Controller
$records = Reviewer::orderBy($columnName,$columnSortOrder)
->whereRaw($statementGlobal.$statement)
->select('reviewer.*')
->selectRaw("ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '1', '".$jenis_monev_id."', '0') jumlah_harus_review, ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '1', '".$jenis_monev_id."', '1') jumlah_sudah_review")
->selectRaw("ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '1', '".$jenis_monev_id."', '0', '".$tahun."') jumlah_harus_review, ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '1', '".$jenis_monev_id."', '1', '".$tahun."') jumlah_sudah_review")
->skip($start)
->take($rowperpage)
->get();
......
......@@ -10,21 +10,24 @@ use Uuid;
use Alert;
use Crypt;
use GuzzleHttp\Client;
use App\Models\Reviewer;
use App\Models\Periode;
use App\Models\Reviewer;
use App\Models\JenisMonev;
use App\Traits\LoginTrait;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Traits\LoginTrait;
class ReviewerMonevController extends Controller
{
use LoginTrait;
public function index($id)
{
$periode = Periode::query()->get();
$jenis_monev = JenisMonev::select('nama')->where('jenis_monev_id', Crypt::decrypt($id))->first();
$data = [
'id'=> $id
'id'=> $id,
'periode'=> $periode
];
return view('backend.operator.reviewer.monev', compact('data'))->withTitle('Reviewer '.$jenis_monev->nama);
}
......@@ -33,6 +36,10 @@ class ReviewerMonevController extends Controller
public function getDataMonev(Request $request){
$jenis_monev_id = Crypt::decrypt($request->get('jenis_monev_id'));
$tahun= $request->get('tahun');
if($tahun == '0')
$tahun = '0';
## Read value
$draw = $request->get('draw');
......@@ -67,7 +74,7 @@ class ReviewerMonevController extends Controller
$records = Reviewer::orderBy($columnName,$columnSortOrder)
->whereRaw($statementGlobal.$statement)
->select('reviewer.*')
->selectRaw("ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '2', '".$jenis_monev_id."', '0') jumlah_harus_review, ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '2', '".$jenis_monev_id."', '1') jumlah_sudah_review")
->selectRaw("ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '2', '".$jenis_monev_id."', '0', '".$tahun."') jumlah_harus_review, ambil_jumlah_reviewer_info_review(reviewer.reviewer_id, '2', '".$jenis_monev_id."', '1', '".$tahun."') jumlah_sudah_review")
->skip($start)
->take($rowperpage)
->get();
......
......@@ -28,6 +28,7 @@
</button>
</div>
</div>
</div>
</div>
<!-- end page title -->
......@@ -38,6 +39,23 @@
<div class="col-12">
<div class="card">
<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">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 }}" @php if($res->nama == date('Y')) echo 'selected'; @endphp>{{ $res->nama }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<br>
<table id="example" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
......@@ -113,7 +131,11 @@
processing: true,
serverSide: true,
ajax: {
"url" : "{{route('operator.getReviewer')}}"
"url" : "{{route('operator.getReviewer')}}",
"data" : function ( data )
{
data.tahun = $("#reqTahun").val();
}
},
columns: [
{ data: 'reviewer_id' },
......@@ -133,6 +155,10 @@
]
});
$('#reqTahun').change(function(){
oTable.draw();
});
var oTable1 = $('#example1').DataTable({
paging: true,
searching: true,
......
......@@ -12,6 +12,7 @@
@php
$reqId = $data['id'];
$periode = $data['periode'];
@endphp
@section('contents')
......@@ -42,6 +43,23 @@
<div class="col-12">
<div class="card">
<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">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 }}" @php if($res->nama == date('Y')) echo 'selected'; @endphp>{{ $res->nama }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<br>
<table id="example" class="table table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
<thead>
......@@ -110,6 +128,7 @@
"data" : function ( data )
{
data.jenis_monev_id = '{{ $reqId }}';
data.tahun = $("#reqTahun").val();
}
},
columns: [
......@@ -130,6 +149,10 @@
]
});
$('#reqTahun').change(function(){
oTable.draw();
});
var oTable1 = $('#example1').DataTable({
paging: true,
searching: true,
......
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