add middleware nilai seleksi

parent f5057285
...@@ -32,7 +32,7 @@ class DaftarSeleksiController extends Controller ...@@ -32,7 +32,7 @@ class DaftarSeleksiController extends Controller
public function __construct() public function __construct()
{ {
$this->middleware('auth'); $this->middleware('auth');
$this->middleware('nilai.seleksi-internal', ['only' => ['edit', 'update']]);
$this->middleware(function ($request, $next) { $this->middleware(function ($request, $next) {
$this->rBiodata = Auth::user()->rBiodata; $this->rBiodata = Auth::user()->rBiodata;
...@@ -161,7 +161,7 @@ class DaftarSeleksiController extends Controller ...@@ -161,7 +161,7 @@ class DaftarSeleksiController extends Controller
if($status_administrasi != 0) if($status_administrasi != 0)
{ {
if($status_nilai == 0) if($status_nilai == 1)
{ {
if($urut == '1') if($urut == '1')
$aksi = '<h4>'.$nilai_1.'</h4>'; $aksi = '<h4>'.$nilai_1.'</h4>';
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace App\Http; namespace App\Http;
use App\Http\Middleware\NilaiSeleksiInternal;
use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel class Kernel extends HttpKernel
...@@ -66,5 +67,6 @@ class Kernel extends HttpKernel ...@@ -66,5 +67,6 @@ class Kernel extends HttpKernel
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class, 'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
'nilai.seleksi-internal' => NilaiSeleksiInternal::class
]; ];
} }
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
class NilaiSeleksiInternal
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
$id = $request->route('seleksi_internal');
$biodata = Auth::user()->rBiodata;
$noidentitas = $biodata->noidentitas;
$proposal_id = decrypt($id);
$status_nilai = DB::select("select ambil_data_reviewer_proposal('".$noidentitas."', '".$proposal_id."', '2')")[0]->ambil_data_reviewer_proposal;
$status_administrasi = DB::select("select ambil_data_reviewer_proposal('".$noidentitas."', '".$proposal_id."', '3')")[0]->ambil_data_reviewer_proposal;
if($status_administrasi != 0)
{
if($status_nilai != 1)
{
if($status_administrasi != '2')
return $next($request);
}
}
return redirect()->back();
}
}
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<tr class="table-light"> <tr class="table-light">
<td> <td>
<input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}"> <input type="hidden" name="jenis_penilaian_id[]" value="{{ $val->jenis_penilaian_monev_id }}">
<span>{{ $val->nama }}</span> <span>{{ $val->nama }} {{ $val->bobot }}</span>
</td> </td>
<td> <td>
<select name="skor[]" class="hitung_skor" data-id="{{ $val->jenis_penilaian_monev_id }}"> <select name="skor[]" class="hitung_skor" data-id="{{ $val->jenis_penilaian_monev_id }}">
...@@ -146,6 +146,8 @@ ...@@ -146,6 +146,8 @@
@section('js') @section('js')
<script> <script>
// sum();
$(function(){ $(function(){
$('#input-file').change(function(){ $('#input-file').change(function(){
var input = this; var input = this;
...@@ -157,7 +159,7 @@ ...@@ -157,7 +159,7 @@
$('.hitung_skor').on('change', function() { $('.hitung_skor').on('change', function() {
var id = $(this).attr("data-id"); var id = $(this).attr("data-id");
var val = $(this).find(":checked").val(); var val = $(this).find(":checked").val();
var bobot = $('#varBobot-'+id).text(); var bobot = 1;
var nilai = val * bobot; var nilai = val * bobot;
$('#varNilai-'+id).text(nilai); $('#varNilai-'+id).text(nilai);
...@@ -167,8 +169,8 @@ ...@@ -167,8 +169,8 @@
function sum(){ function sum(){
var sum = 0; var sum = 0;
$('.clsNilai').each(function () { $('.hitung_skor').each(function () {
sum += Number($(this).text()); sum += Number($(this).val());
}); });
$('#varTotalNilai').text(sum); $('#varTotalNilai').text(sum);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="universitas-negeri-surabaya" content="custom" /> <meta name="universitas-negeri-surabaya" content="custom" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Sistem Informasi Manajemen Program Kreativitas Mahasiswa"> <meta name="description" content="Sistem Informasi Manajemen Program Mahasiswa Wirausaha">
<meta name="author" content="PPTI Unesa Surabaya"> <meta name="author" content="PPTI Unesa Surabaya">
<meta name="keywords" content="sistem, informasi, pkm, program, kreativitas, mahasiswa, unesa"> <meta name="keywords" content="sistem, informasi, pkm, program, kreativitas, mahasiswa, unesa">
<meta name="language" content="id"> <meta name="language" content="id">
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<meta name="geo.position" content="-7.300818;112.672689"> <meta name="geo.position" content="-7.300818;112.672689">
<meta name="geo.placename" content="Surabaya"> <meta name="geo.placename" content="Surabaya">
<meta name="geo.region" content="Indonesia"> <meta name="geo.region" content="Indonesia">
<title>SIM PMW UNESA | Sistem Informasi Manajemen Program Kreativitas Mahasiswa</title> <title>SIM PMW UNESA | Sistem Informasi Manajemen Program Mahasiswa Wirausaha</title>
<!-- App favicon --> <!-- App favicon -->
<link rel="shortcut icon" href="{{ asset('theme/images/favicon.ico') }}"> <link rel="shortcut icon" href="{{ asset('theme/images/favicon.ico') }}">
......
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