// ->selectRaw(" round((ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_1) + ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_2 )) / 2, 2) as rata ")
// ->skip($start)
// ->take($rowperpage)
// ->get();
$records=collect(DB::select("select *, ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_1) nilai_1, ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_2) nilai_2, round((ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_1) + ambil_jumlah_penilaian_seleksi(reviewer_proposal_id_2 )) / 2, 2) as rata from vw_daftar_proposal('".$statementGlobal.$statement."') ORDER BY ".$columnName." ".$columnSortOrder))
->skip($start)
->take($rowperpage)
->get();
->take($rowperpage);
$data_arr=array();
foreach($recordsas$record){
...
...
@@ -112,7 +118,7 @@ class DaftarProposalController extends Controller
@@ -71,36 +71,36 @@ class DaftarSeleksiController extends Controller
$searchValue=strtoupper($search_arr['value']);// Search value
// Total records
$statement=" AND (UPPER(JUDUL) LIKE '%".$searchValue."%') ";
$statement=" AND (UPPER(JUDUL) LIKE ''%".$searchValue."%'') ";
// $statementGlobal = " 1=1 AND (NIDN_REVIEWER_ID_1 = '".$noidentitas."' OR NIDN_REVIEWER_ID_2 = '".$noidentitas."')";
$statementGlobal=" 1=1 ";
$statementGlobal=" ";
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."')";
$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."')";
$statementGlobal.=" AND (ambil_data_reviewer_proposal ( ''".$noidentitas."'', proposal_id, ''2'' ) = ''".$status."'')";
}
if($tahun!="0")
{
$statementGlobal.=" AND PERIODE = '".$tahun."'";
$statementGlobal.=" AND PERIODE = ''".$tahun."''";
}
// $totalRecords = DaftarProposal::select('count(1) as allcount')->whereRaw($statementGlobal)->count();
$totalRecords=collect(DB::select("select 1 as allcount from vw_daftar_proposal('".$noidentitas."') where ".$statementGlobal))->count();
$totalRecords=collect(DB::select("select 1 as allcount from vw_daftar_proposal('".$statementGlobal."', '".$noidentitas."') "))->count();
// $totalRecordswithFilter = DaftarProposal::select('count(1) as allcount')->whereRaw($statementGlobal.$statement)->count();
$totalRecordswithFilter=collect(DB::select("select 1 as allcount from vw_daftar_proposal('".$noidentitas."') WHERE ".$statementGlobal.$statement))->count();
$totalRecordswithFilter=collect(DB::select("select 1 as allcount from vw_daftar_proposal('".$statementGlobal.$statement."', '".$noidentitas."') "))->count();
// echo "select 1 as allcount from vw_daftar_proposal('".$statementGlobal.$statement."', '".$noidentitas."')"; exit;
@@ -108,7 +108,7 @@ class DaftarSeleksiController extends Controller
// ->skip($start)
// ->take($rowperpage)
// ->get();
$records=collect(DB::select("select * from vw_daftar_proposal('".$noidentitas."') WHERE ".$statementGlobal.$statement." ORDER BY ".$columnName." ".$columnSortOrder))
$records=collect(DB::select("select * from vw_daftar_proposal('".$statementGlobal.$statement."', '".$noidentitas."') ORDER BY ".$columnName." ".$columnSortOrder))