Commit 752dd786 by Novan Bagus Setiawan

perhitungan reviewer pertahun

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