Commit 3a97d299 by Novan Bagus Setiawan

perubahan jenis pkm

parent 9d9e9568
...@@ -13,6 +13,7 @@ use App\Models\Jenis; ...@@ -13,6 +13,7 @@ use App\Models\Jenis;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use App\Models\Periode; use App\Models\Periode;
use App\Models\Proposal;
use App\Models\Reviewer; use App\Models\Reviewer;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\DaftarProposal; use App\Models\DaftarProposal;
...@@ -172,6 +173,25 @@ class DaftarProposalController extends Controller ...@@ -172,6 +173,25 @@ class DaftarProposalController extends Controller
</select> </select>
</td>'; </td>';
$jenis = Jenis::where("status_hapus", '0')
->get();
$opt = '';
foreach ($jenis as $key => $value) {
$selected = "";
if($value->jenis_id == $jenis_id)
$selected = 'selected';
$opt .= '<option value="'.Crypt::encrypt($proposal_id.'###'.$value->jenis_id).'" '.$selected.'>'.$value->nama.'</option>';
}
$pil_jenis_pkm = '<td class="table-action">
<select class="form-control select2 jenis">
'.$opt.'
</select>
</td>';
if($status_final == '1') if($status_final == '1')
{ {
$aksi = '<span class="badge bg-success">Lolos</span>'; $aksi = '<span class="badge bg-success">Lolos</span>';
...@@ -191,7 +211,7 @@ class DaftarProposalController extends Controller ...@@ -191,7 +211,7 @@ class DaftarProposalController extends Controller
$data_arr[] = array( $data_arr[] = array(
"proposal_id" => $proposal_id, "proposal_id" => $proposal_id,
"kode" => $kode, "kode" => $kode,
"jenis_pkm" => $jenis_pkm, "jenis_pkm" => $pil_jenis_pkm,
"judul" => $judul, "judul" => $judul,
"dospem" => $dospem, "dospem" => $dospem,
"reviewer_1" => $pilihan_1, "reviewer_1" => $pilihan_1,
...@@ -540,6 +560,17 @@ class DaftarProposalController extends Controller ...@@ -540,6 +560,17 @@ class DaftarProposalController extends Controller
} }
} }
public function change_jenis(Request $request)
{
$isi = Crypt::decrypt($request->input('data'));
$arrData = explode('###', $isi);
$reqProposalId = $arrData[0]?:'';
$reqJenisId = $arrData[1]?:'';
$delete = Proposal::where('proposal_id', $reqProposalId)->update(['jenis_id'=>$reqJenisId]);
}
public function cetak_daftar_proposal(Request $request) public function cetak_daftar_proposal(Request $request)
{ {
ini_set('max_execution_time', 0); ini_set('max_execution_time', 0);
......
...@@ -231,6 +231,25 @@ ...@@ -231,6 +231,25 @@
}); });
}); });
$('#example tbody').on('change', '.jenis', function () {
var isi = this.value;
$.ajax({
url:'{{url("/operator/seleksi-internal-proposal-jenis")}}',
type:'POST',
data:{
"_token": "{{ csrf_token() }}",
"data": isi,
},
dataType: "JSON",
})
.done(function(response){
swal.fire('sukses', 'Jenis PKM Berhasil diubah', 'success').then(function(){
// oTable.ajax.reload();
// location.reload();
});
})
});
function confirmFinal(reqId, reqStatus) function confirmFinal(reqId, reqStatus)
{ {
if(reqStatus == '1') if(reqStatus == '1')
......
...@@ -172,6 +172,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () { ...@@ -172,6 +172,7 @@ Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
// SELEKSI INTERNAL // SELEKSI INTERNAL
Route::resource('seleksi_internal_reviewer', ReviewerController::class); Route::resource('seleksi_internal_reviewer', ReviewerController::class);
Route::resource('seleksi-internal-proposal', DaftarProposalController::class); Route::resource('seleksi-internal-proposal', DaftarProposalController::class);
Route::post('seleksi-internal-proposal-jenis', [DaftarProposalController::class, 'change_jenis'])->name('seleksi-internal-proposal-jenis');
Route::get('/seleksi-internal-reviewer-approval/{id}/{status}', [DaftarProposalController::class, 'approval'])->name('seleksi-internal.approval'); Route::get('/seleksi-internal-reviewer-approval/{id}/{status}', [DaftarProposalController::class, 'approval'])->name('seleksi-internal.approval');
Route::get('getDaftarProposal', [DaftarProposalController::class, 'getData'])->name('getDaftarProposal'); Route::get('getDaftarProposal', [DaftarProposalController::class, 'getData'])->name('getDaftarProposal');
Route::get('cetak-daftar-proposal', [DaftarProposalController::class, 'cetak_daftar_proposal'])->name('cetak-daftar-proposal'); Route::get('cetak-daftar-proposal', [DaftarProposalController::class, 'cetak_daftar_proposal'])->name('cetak-daftar-proposal');
......
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