Commit 056bb2e7 by Alfiro Pratama

fp to fpsi

fix tambah reviewer
parent c0d02d2c
...@@ -69,9 +69,10 @@ class InseoHelper ...@@ -69,9 +69,10 @@ class InseoHelper
'fakultas ilmu olahraga' => 'FIKK', 'fakultas ilmu olahraga' => 'FIKK',
'fiK' => 'FIKK', 'fiK' => 'FIKK',
'fak. ilmu olahraga' => 'FIKK', 'fak. ilmu olahraga' => 'FIKK',
'fikk' => 'FIKK',
'ilmu keolahragaan dan kesehatan' => 'FIKK', 'ilmu keolahragaan dan kesehatan' => 'FIKK',
'feb' => 'FEB',
'ekonomi' => 'FEB', 'ekonomi' => 'FEB',
'fakultas ekonomi' => 'FEB', 'fakultas ekonomi' => 'FEB',
'fe' => 'FEB', 'fe' => 'FEB',
...@@ -87,14 +88,21 @@ class InseoHelper ...@@ -87,14 +88,21 @@ class InseoHelper
'ilmu sosial dan ilmu politik' => 'FISIPOL', 'ilmu sosial dan ilmu politik' => 'FISIPOL',
'kedokteran' => 'FK', 'kedokteran' => 'FK',
'fk' => 'FK',
'psikologi' => 'FPsi',
'fpsi' => 'FPsi',
'psikologi' => 'FP', 'fh' => 'FH',
'hukum' => 'FH', 'hukum' => 'FH',
'ilmu hukum' => 'FH', 'ilmu hukum' => 'FH',
'fkp' => 'FKP', 'fkp' => 'FKP',
'kampus unesa magetan' => 'PSDKU Magetan', 'kampus unesa magetan' => 'PSDKU Magetan',
'kampus 5 universitas negeri surabaya' => 'PSDKU Magetan',
'kampus 5' => 'PSDKU Magetan',
'kampus 5 unesa' => 'PSDKU Magetan',
]; ];
return $fak; return $fak;
......
...@@ -78,7 +78,7 @@ class DashboardController extends Controller ...@@ -78,7 +78,7 @@ class DashboardController extends Controller
$item->nm_lemb = 'FK'; $item->nm_lemb = 'FK';
} }
if (strtolower($item->nm_lemb) === 'fpsi') { if (strtolower($item->nm_lemb) === 'fpsi') {
$item->nm_lemb = 'FP'; $item->nm_lemb = 'FPsi';
} }
if (strtolower($item->nm_lemb) === 'psdku') { if (strtolower($item->nm_lemb) === 'psdku') {
$item->nm_lemb = "PSDKU\nMagetan"; $item->nm_lemb = "PSDKU\nMagetan";
......
...@@ -18,6 +18,7 @@ use App\Traits\LoginTrait; ...@@ -18,6 +18,7 @@ use App\Traits\LoginTrait;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Controllers\Authentication\LoginController; use App\Http\Controllers\Authentication\LoginController;
use App\Helpers\InseoHelper;
use Exception; use Exception;
class ReviewerController extends Controller class ReviewerController extends Controller
...@@ -143,7 +144,14 @@ class ReviewerController extends Controller ...@@ -143,7 +144,14 @@ class ReviewerController extends Controller
$data['id_sdm'] = $request->input('id_sdm'); $data['id_sdm'] = $request->input('id_sdm');
$data['nama'] = $request->input('nama'); $data['nama'] = $request->input('nama');
$data['nidn'] = $request->input('nidn'); $data['nidn'] = $request->input('nidn');
$data['fakultas'] = $request->input('fakultas'); $fakInput = $request->input('fakultas');
$fakMap = InseoHelper::singkatan_fakultas();
$fakKey = strtolower(trim((string) $fakInput));
if ($fakKey !== '' && array_key_exists($fakKey, $fakMap)) {
$data['fakultas'] = $fakMap[$fakKey];
} else {
$data['fakultas'] = $fakInput;
}
$data['prodi'] = $request->input('prodi'); $data['prodi'] = $request->input('prodi');
// BACKUP NVN // BACKUP NVN
// $data['created_user'] = Auth::user()->name; // $data['created_user'] = Auth::user()->name;
...@@ -262,7 +270,7 @@ class ReviewerController extends Controller ...@@ -262,7 +270,7 @@ class ReviewerController extends Controller
$result[$i]['fakultas'] = $value['namaparentsatker']; $result[$i]['fakultas'] = $value['namaparentsatker'];
$result[$i]['prodi'] = $xyz; $result[$i]['prodi'] = $xyz;
$result[$i]['tipe'] = 'Internal'; $result[$i]['tipe'] = 'Internal';
$result[$i]['id_sdm'] = $value['nidn']; $result[$i]['id_sdm'] = $value['nidn'] ?? $value['nuptk'];
$i++; $i++;
} }
......
...@@ -8,6 +8,7 @@ use URL; ...@@ -8,6 +8,7 @@ use URL;
use Auth; use Auth;
use Uuid; use Uuid;
use Alert; use Alert;
use App\Helpers\InseoHelper;
use Crypt; use Crypt;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use App\Models\Periode; use App\Models\Periode;
...@@ -150,7 +151,14 @@ class ReviewerMonevController extends Controller ...@@ -150,7 +151,14 @@ class ReviewerMonevController extends Controller
$data['id_sdm'] = $request->input('id_sdm'); $data['id_sdm'] = $request->input('id_sdm');
$data['nama'] = $request->input('nama'); $data['nama'] = $request->input('nama');
$data['nidn'] = $request->input('nidn'); $data['nidn'] = $request->input('nidn');
$data['fakultas'] = $request->input('fakultas'); $fakInput = $request->input('fakultas');
$fakMap = InseoHelper::singkatan_fakultas();
$fakKey = strtolower(trim((string) $fakInput));
if ($fakKey !== '' && array_key_exists($fakKey, $fakMap)) {
$data['fakultas'] = $fakMap[$fakKey];
} else {
$data['fakultas'] = $fakInput;
}
$data['prodi'] = $request->input('prodi'); $data['prodi'] = $request->input('prodi');
// BACKUP NVN // BACKUP NVN
// $data['created_user'] = Auth::user()->name; // $data['created_user'] = Auth::user()->name;
...@@ -230,10 +238,10 @@ class ReviewerMonevController extends Controller ...@@ -230,10 +238,10 @@ class ReviewerMonevController extends Controller
} }
$result[$i]['nm_sdm'] = $value['namalengkap']; $result[$i]['nm_sdm'] = $value['namalengkap'];
$result[$i]['nidn'] = $value['nidn']; $result[$i]['nidn'] = $value['nidn'] ?? $value['nuptk'];
$result[$i]['fakultas'] = $value['namaparentsatker']; $result[$i]['fakultas'] = $value['namaparentsatker'];
$result[$i]['prodi'] = $xyz; $result[$i]['prodi'] = $xyz;
$result[$i]['id_sdm'] = $value['nidn']; $result[$i]['id_sdm'] = $value['nidn'] ?? $value['nuptk'];
$i++; $i++;
} }
......
...@@ -226,9 +226,9 @@ ...@@ -226,9 +226,9 @@
// Change FP to FPsi for display only // Change FP to FPsi for display only
if (Array.isArray(label)) { if (Array.isArray(label)) {
return label.map(line => line === 'FP' ? 'FPsi' : line); return label.map(line => line === 'FPsi' ? 'FPsi' : line);
} else { } else {
return label === 'FP' ? 'FPsi' : label; return label === 'FPsi' ? 'FPsi' : label;
} }
}); });
......
@extends('layouts.master') @extends('layouts.master')
@section('css')
<style>
/* SweetAlert2 di atas modal Bootstrap (backdrop modal ~1055) */
.swal2-container {
z-index: 20000 !important;
}
</style>
@endsection
@section('title') @section('title')
Dashboard Dashboard
@endsection @endsection
...@@ -202,26 +211,40 @@ ...@@ -202,26 +211,40 @@
}); });
function createManageBtn() { function createManageBtn() {
return '<button id="manageBtn" type="button" class="btn btn-success btn-sm">Tambah</button>'; return '<button type="button" class="btn btn-success btn-sm btn-tambah-reviewer">Tambah</button>';
} }
$('#example1 tbody').on('click', 'button', function () { $('#example1 tbody').on('click', 'button.btn-tambah-reviewer', function () {
var data = oTable1.row($(this).parents('tr')).data(); var $tr = $(this).closest('tr');
var row = oTable1.row($tr);
if ($tr.hasClass('child')) {
row = oTable1.row($tr.prev());
}
var data = row.data();
if (!data) {
return;
}
Swal.fire({ Swal.fire({
title: "Apakah Anda Yakin?", title: "Apakah Anda Yakin?",
text: "Anda akan menambahkan reviewer ini!", text: "Anda akan menambahkan reviewer ini!",
icon: "warning", icon: "warning",
showCancelButton: !0, showCancelButton: true,
confirmButtonText: "Ya, Tambah data!", confirmButtonText: "Ya, Tambah data!",
cancelButtonText: "Tidak, Kembali!", cancelButtonText: "Tidak, Kembali!",
confirmButtonClass: "btn btn-success mt-2", confirmButtonClass: "btn btn-success mt-2",
cancelButtonClass: "btn btn-danger ms-2 mt-2", cancelButtonClass: "btn btn-danger ms-2 mt-2",
buttonsStyling: !1, buttonsStyling: false,
allowOutsideClick: !1, allowOutsideClick: false,
showLoaderOnConfirm: true showLoaderOnConfirm: true,
}).then((result) => { didOpen: function () {
if (result.value){ var el = document.querySelector('.swal2-container');
if (el) {
el.style.zIndex = '20000';
}
}
}).then(function (result) {
if (result.isConfirmed) {
$.ajax({ $.ajax({
url:'{{url("/operator/seleksi-internal-reviewer")}}', url:'{{url("/operator/seleksi-internal-reviewer")}}',
type:'POST', type:'POST',
...@@ -236,19 +259,15 @@ ...@@ -236,19 +259,15 @@
dataType: "JSON", dataType: "JSON",
}) })
.done(function(response){ .done(function(response){
swal.fire(response.status, response.message, response.status).then(function(){ Swal.fire(response.status, response.message, response.status).then(function(){
oTable.ajax.reload(); location.reload();
}); });
}) })
.fail(function(){ .fail(function(){
swal.fire('Oops...', 'Something went wrong with ajax !', 'error'); Swal.fire('Oops...', 'Something went wrong with ajax !', 'error');
}); });
} }
else });
{
swal.fire('Batal!', 'Data batal ditambahkan.', 'error');
}
})
}); });
}); });
...@@ -258,16 +277,16 @@ ...@@ -258,16 +277,16 @@
title: "Apakah Anda Yakin?", title: "Apakah Anda Yakin?",
text: "Anda akan menghapus data ini!", text: "Anda akan menghapus data ini!",
icon: "warning", icon: "warning",
showCancelButton: !0, showCancelButton: true,
confirmButtonText: "Ya, Hapus data!", confirmButtonText: "Ya, Hapus data!",
cancelButtonText: "Tidak, Kembali!", cancelButtonText: "Tidak, Kembali!",
confirmButtonClass: "btn btn-success mt-2", confirmButtonClass: "btn btn-success mt-2",
cancelButtonClass: "btn btn-danger ms-2 mt-2", cancelButtonClass: "btn btn-danger ms-2 mt-2",
buttonsStyling: !1, buttonsStyling: false,
allowOutsideClick: !1, allowOutsideClick: false,
showLoaderOnConfirm: true showLoaderOnConfirm: true
}).then((result) => { }).then(function (result) {
if (result.value){ if (result.isConfirmed){
$.ajax({ $.ajax({
url:'{{url("/operator/seleksi_internal_reviewer/")}}/' +reqId, url:'{{url("/operator/seleksi_internal_reviewer/")}}/' +reqId,
type:'DELETE', type:'DELETE',
...@@ -277,20 +296,15 @@ ...@@ -277,20 +296,15 @@
dataType: "JSON", dataType: "JSON",
}) })
.done(function(response){ .done(function(response){
swal.fire(response.info, response.message, response.status).then(function(){ Swal.fire(response.info, response.message, response.status).then(function(){
location.reload(); location.reload();
}); });
}) })
.fail(function(){ .fail(function(){
swal.fire('Oops...', 'Something went wrong with ajax !', 'error'); Swal.fire('Oops...', 'Something went wrong with ajax !', 'error');
}); });
} }
else });
{
swal.fire('Batal!', 'Data batal dihapus.', 'error');
}
})
} }
</script> </script>
......
@extends('layouts.master') @extends('layouts.master')
@section('css')
<style>
.swal2-container {
z-index: 20000 !important;
}
</style>
@endsection
@section('title') @section('title')
Dashboard Dashboard
@endsection @endsection
...@@ -187,26 +195,40 @@ ...@@ -187,26 +195,40 @@
}); });
function createManageBtn() { function createManageBtn() {
return '<button id="manageBtn" type="button" class="btn btn-success btn-sm">Tambah</button>'; return '<button type="button" class="btn btn-success btn-sm btn-tambah-reviewer">Tambah</button>';
} }
$('#example1 tbody').on('click', 'button', function () { $('#example1 tbody').on('click', 'button.btn-tambah-reviewer', function () {
var data = oTable1.row($(this).parents('tr')).data(); var $tr = $(this).closest('tr');
var row = oTable1.row($tr);
if ($tr.hasClass('child')) {
row = oTable1.row($tr.prev());
}
var data = row.data();
if (!data) {
return;
}
Swal.fire({ Swal.fire({
title: "Apakah Anda Yakin?", title: "Apakah Anda Yakin?",
text: "Anda akan menambahkan reviewer ini!", text: "Anda akan menambahkan reviewer ini!",
icon: "warning", icon: "warning",
showCancelButton: !0, showCancelButton: true,
confirmButtonText: "Ya, Tambah data!", confirmButtonText: "Ya, Tambah data!",
cancelButtonText: "Tidak, Kembali!", cancelButtonText: "Tidak, Kembali!",
confirmButtonClass: "btn btn-success mt-2", confirmButtonClass: "btn btn-success mt-2",
cancelButtonClass: "btn btn-danger ms-2 mt-2", cancelButtonClass: "btn btn-danger ms-2 mt-2",
buttonsStyling: !1, buttonsStyling: false,
allowOutsideClick: !1, allowOutsideClick: false,
showLoaderOnConfirm: true showLoaderOnConfirm: true,
}).then((result) => { didOpen: function () {
if (result.value){ var el = document.querySelector('.swal2-container');
if (el) {
el.style.zIndex = '20000';
}
}
}).then(function (result) {
if (result.isConfirmed) {
$.ajax({ $.ajax({
url:'{{url("/operator/monev-internal-reviewer")}}', url:'{{url("/operator/monev-internal-reviewer")}}',
type:'POST', type:'POST',
...@@ -222,19 +244,15 @@ ...@@ -222,19 +244,15 @@
dataType: "JSON", dataType: "JSON",
}) })
.done(function(response){ .done(function(response){
swal.fire(response.status, response.message, response.status).then(function(){ Swal.fire(response.status, response.message, response.status).then(function(){
oTable.ajax.reload(); location.reload();
}); });
}) })
.fail(function(){ .fail(function(){
swal.fire('Oops...', 'Something went wrong with ajax !', 'error'); Swal.fire('Oops...', 'Something went wrong with ajax !', 'error');
}); });
} }
else });
{
swal.fire('Batal!', 'Data batal ditambahkan.', 'error');
}
})
}); });
}); });
...@@ -244,16 +262,22 @@ ...@@ -244,16 +262,22 @@
title: "Apakah Anda Yakin?", title: "Apakah Anda Yakin?",
text: "Anda akan menghapus data ini!", text: "Anda akan menghapus data ini!",
icon: "warning", icon: "warning",
showCancelButton: !0, showCancelButton: true,
confirmButtonText: "Ya, Hapus data!", confirmButtonText: "Ya, Hapus data!",
cancelButtonText: "Tidak, Kembali!", cancelButtonText: "Tidak, Kembali!",
confirmButtonClass: "btn btn-success mt-2", confirmButtonClass: "btn btn-success mt-2",
cancelButtonClass: "btn btn-danger ms-2 mt-2", cancelButtonClass: "btn btn-danger ms-2 mt-2",
buttonsStyling: !1, buttonsStyling: false,
allowOutsideClick: !1, allowOutsideClick: false,
showLoaderOnConfirm: true showLoaderOnConfirm: true,
}).then((result) => { didOpen: function () {
if (result.value){ var el = document.querySelector('.swal2-container');
if (el) {
el.style.zIndex = '20000';
}
}
}).then(function (result) {
if (result.isConfirmed){
$.ajax({ $.ajax({
url:'{{url("/operator/seleksi_internal_reviewer/")}}/' +reqId, url:'{{url("/operator/seleksi_internal_reviewer/")}}/' +reqId,
type:'DELETE', type:'DELETE',
...@@ -263,20 +287,15 @@ ...@@ -263,20 +287,15 @@
dataType: "JSON", dataType: "JSON",
}) })
.done(function(response){ .done(function(response){
swal.fire(response.info, response.message, response.status).then(function(){ Swal.fire(response.info, response.message, response.status).then(function(){
location.reload(); location.reload();
}); });
}) })
.fail(function(){ .fail(function(){
swal.fire('Oops...', 'Something went wrong with ajax !', 'error'); Swal.fire('Oops...', 'Something went wrong with ajax !', 'error');
}); });
} }
else });
{
swal.fire('Batal!', 'Data batal dihapus.', 'error');
}
})
} }
</script> </script>
......
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