Commit 323e99cd by Farendi Giotivano R.P

Merge branch 'master' of http://git.unesa.ac.id/farendi/simlitabmas into master

parents c24f98cd 7d059620
...@@ -12,6 +12,7 @@ class GetDataController extends Controller ...@@ -12,6 +12,7 @@ class GetDataController extends Controller
{ {
try { try {
$biodata = Biodata::query()->where('nidn', $request->nidn)->first(); $biodata = Biodata::query()->where('nidn', $request->nidn)->first();
$biodata->id = encrypt($biodata->id);
return response()->json($biodata); return response()->json($biodata);
} catch (Exception $ex) { } catch (Exception $ex) {
......
...@@ -14,7 +14,6 @@ class PenelitianSumberDanaController extends Controller ...@@ -14,7 +14,6 @@ class PenelitianSumberDanaController extends Controller
*/ */
public function index() public function index()
{ {
//
return view('user.penelitiansumber.index'); return view('user.penelitiansumber.index');
} }
...@@ -25,63 +24,72 @@ class PenelitianSumberDanaController extends Controller ...@@ -25,63 +24,72 @@ class PenelitianSumberDanaController extends Controller
*/ */
public function create() public function create()
{ {
//
return view('user.penelitiansumber.create'); return view('user.penelitiansumber.create');
} }
/** /**
* Store a newly created resource in storage. * Store a newly created resource in storage.
* *
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function store(Request $request) public function store(Request $request)
{ {
// dd($request->all());
} }
/** /**
* Display the specified resource. * Display the specified resource.
* *
* @param int $id * @param int $id
*
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function show($id) public function show($id)
{ {
//
} }
/** /**
* Show the form for editing the specified resource. * Show the form for editing the specified resource.
* *
* @param int $id * @param int $id
*
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function edit($id) public function edit($id)
{ {
//
} }
/** /**
* Update the specified resource in storage. * Update the specified resource in storage.
* *
* @param \Illuminate\Http\Request $request
* @param int $id * @param int $id
*
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
//
} }
/** /**
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param int $id * @param int $id
*
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function destroy($id) public function destroy($id)
{ {
// }
public function getRowAnggota(Request $request)
{
$data['no'] = $request->no;
$data['nama'] = $request->nama;
$data['keanggotaan'] = $request->keanggotaan;
$data['prodi'] = $request->prodi;
$data['nidn'] = $request->nidn;
$data['name'] = $request->name;
return view('user.penelitiansumber.row_anggota', $data);
} }
} }
...@@ -9,5 +9,6 @@ class Biodata extends Model ...@@ -9,5 +9,6 @@ class Biodata extends Model
{ {
use HasFactory; use HasFactory;
protected $table = 'biodata'; protected $table = 'biodata';
public $incrementing = false;
protected $fillable = ['id', 'user_id', 'nip', 'nidn', 'name', 'fakultas', 'prodi', 'telephone', 'phone', 'email', 'web', 'userid_created', 'userid_updated']; protected $fillable = ['id', 'user_id', 'nip', 'nidn', 'name', 'fakultas', 'prodi', 'telephone', 'phone', 'email', 'web', 'userid_created', 'userid_updated'];
} }
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
$menu = 'dashboard'; $menu = 'dashboard';
@endphp @endphp
<div class="account-settings-container layout-top-spacing"> <div class="account-settings-container layout-top-spacing">
<form action="{{ route('penelitiansumber.store') }}" method="POST">
@csrf
<div class="account-content"> <div class="account-content">
<div class="scrollspy-example" data-spy="scroll" data-target="#account-settings-scroll" data-offset="-100"> <div class="scrollspy-example" data-spy="scroll" data-target="#account-settings-scroll" data-offset="-100">
<div class="row"> <div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 layout-spacing"> <div class="col-xl-12 col-lg-12 col-md-12 layout-spacing">
<form id="contact" class="section contact"> <div id="contact" class="section contact">
<div class="info"> <div class="info">
<h5 class="">Data Penelitian Sumber Dana Non Kemenristek/BRIN</h5> <h5 class="">Data Penelitian Sumber Dana Non Kemenristek/BRIN</h5>
<div class="row"> <div class="row">
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label>Judul</label> <label>Judul</label>
<textarea class="form-control" id="judul" placeholder="Judul" rows="3"></textarea> <textarea class="form-control" name="data[judul]" id="judul" placeholder="Judul" rows="3"></textarea>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label>Jenis Penelitian</label> <label>Jenis Penelitian</label>
<select class="form-control" id="kategori"> <select name="data[jenis]" class="form-control" id="kategori">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option>Norway</option>
<option>Canada</option> <option>Canada</option>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label>Bidang Penelitian</label> <label>Bidang Penelitian</label>
<select class="form-control" id="kategori"> <select name="data[bidang]" class="form-control" id="kategori">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option>Norway</option>
<option>Canada</option> <option>Canada</option>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label>Tujuan Sosial Ekonomi</label> <label>Tujuan Sosial Ekonomi</label>
<select class="form-control" id="kategori"> <select name="data[tujuan]" class="form-control" id="kategori">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option>Norway</option>
<option>Canada</option> <option>Canada</option>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label>Sumber Dana</label> <label>Sumber Dana</label>
<select class="form-control" id="sumber_dana"> <select name="data[sumberdana]" class="form-control" id="sumber_dana">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option>Norway</option>
<option>Canada</option> <option>Canada</option>
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label>Institusi Sumber Dana</label> <label>Institusi Sumber Dana</label>
<select class="form-control" id="institusi"> <select name="data[institusi]" class="form-control" id="institusi">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option>Norway</option>
<option>Canada</option> <option>Canada</option>
...@@ -113,18 +113,18 @@ ...@@ -113,18 +113,18 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label>Jumlah Dana</label> <label>Jumlah Dana</label>
<input type="text" class="form-control mb-4" id="jumlah_dana" placeholder="Jumlah Dana"> <input name="data[jumlah_dana]" type="text" class="form-control mb-4" id="jumlah_dana" placeholder="Jumlah Dana">
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</form>
</div> </div>
<div class="col-xl-12 col-lg-12 col-md-12 layout-spacing"> <div class="col-xl-12 col-lg-12 col-md-12 layout-spacing">
<form id="general-info" class="section general-info"> <div id="general-info" class="section general-info">
<div class="info"> <div class="info">
<h6 class="">Personil Dosen</h6> <h6 class="">Personil Dosen</h6>
<div class="row"> <div class="row">
...@@ -142,69 +142,43 @@ ...@@ -142,69 +142,43 @@
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody id="table_dosen_nidn">
<tr>
<td>Shaun Park</td>
<td>10/08/2020</td>
<td>320</td>
<td class="text-center"><span class="text-success">Complete</span></td>
<td class="text-center"></td>
</tr>
<tr>
<td>Alma Clarke</td>
<td>11/08/2020</td>
<td>420</td>
<td class="text-center"><span class="text-secondary">Pending</span></td>
<td class="text-center"></td>
</tr>
<tr>
<td>Xavier</td>
<td>12/08/2020</td>
<td>130</td>
<td class="text-center"><span class="text-info">In progress</span></td>
<td class="text-center"></td>
</tr>
<tr>
<td>Vincent Carpenter</td>
<td>13/08/2020</td>
<td>260</td>
<td class="text-center"><span class="text-danger">Canceled</span></td>
<td class="text-center"></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group mb-4"> <div class="input-group mb-4">
<input type="text" class="form-control" placeholder="NIDN" aria-label="nidn"> <input type="text" class="form-control" id="input_dosen_nidn" placeholder="NIDN" aria-label="nidn">
<div class="input-group-append"> <div class="input-group-append">
<button class="btn btn-info" type="button">Cek</button> <button type="button" onclick="checkNidn('dosen_nidn')" class="btn btn-info" type="button">Cek</button>
</div> </div>
</div> </div>
<div class="form-row mb-4"> <div class="form-row mb-4">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputEmail4">Nama Dosen</label> <label for="inputEmail4">Nama Dosen</label>
<input type="text" class="form-control" id="namadosen"> <input type="text" class="form-control" id="nama_dosen_nidn">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputPassword4">Program Studi</label> <label for="inputPassword4">Program Studi</label>
<input type="text" class="form-control" id="programstudi"> <input type="text" class="form-control" id="prodi_dosen_nidn">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<div class="form-group"> <div class="form-group">
<label>Keanggotaan</label> <label>Keanggotaan</label>
<select class="form-control" id="institusi"> <select class="form-control" id="keanggotaan_dosen_nidn">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option value="norway">Norway</option>
<option>Canada</option> <option value="canada">Canada</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<input type="text" id="dosen_nidn" value="" hidden>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<button id="multiple-messages" class="btn btn-primary">Save Changes</button> <button type="button" onclick="saveDosen('dosen_nidn')" id="multiple-messages" class="btn btn-primary">Save Changes</button>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -212,11 +186,10 @@ ...@@ -212,11 +186,10 @@
</div> </div>
</div> </div>
</div> </div>
</form>
</div> </div>
<div class="col-xl-12 col-lg-12 col-md-12 layout-spacing"> <div class="col-xl-12 col-lg-12 col-md-12 layout-spacing">
<form id="general-info" class="section general-info"> <div id="general-info" class="section general-info">
<div class="info"> <div class="info">
<h6 class="">Personil Non Dosen</h6> <h6 class="">Personil Non Dosen</h6>
<div class="row"> <div class="row">
...@@ -229,64 +202,33 @@ ...@@ -229,64 +202,33 @@
<tr> <tr>
<th>No</th> <th>No</th>
<th>Nama</th> <th>Nama</th>
<th>Program Studi</th> <th>Institusi</th>
<th class="text-center">Keanggotaan</th> <th class="text-center">Keanggotaan</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody id="table_non_dosen_nip">
<tr>
<td>Shaun Park</td>
<td>10/08/2020</td>
<td>320</td>
<td class="text-center"><span class="text-success">Complete</span></td>
<td class="text-center"></td>
</tr>
<tr>
<td>Alma Clarke</td>
<td>11/08/2020</td>
<td>420</td>
<td class="text-center"><span class="text-secondary">Pending</span></td>
<td class="text-center"></td>
</tr>
<tr>
<td>Xavier</td>
<td>12/08/2020</td>
<td>130</td>
<td class="text-center"><span class="text-info">In progress</span></td>
<td class="text-center"></td>
</tr>
<tr>
<td>Vincent Carpenter</td>
<td>13/08/2020</td>
<td>260</td>
<td class="text-center"><span class="text-danger">Canceled</span></td>
<td class="text-center"></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group mb-4"> <div class="input-group mb-4">
<input type="text" class="form-control" placeholder="NIDN" aria-label="nidn"> <input type="text" class="form-control" placeholder="Nomor Identitas" aria-label="nidn" id="non_dosen_nip">
<div class="input-group-append">
<button class="btn btn-info" type="button">Cek</button>
</div>
</div> </div>
<div class="form-row mb-4"> <div class="form-row mb-4">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputEmail4">Nama Dosen</label> <label for="inputEmail4">Nama</label>
<input type="text" class="form-control" id="namadosen"> <input type="text" class="form-control" id="nama_non_dosen_nip">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="inputPassword4">Program Studi</label> <label for="inputPassword4">Institusi</label>
<input type="text" class="form-control" id="programstudi"> <input type="text" class="form-control" id="prodi_non_dosen_nip">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<div class="form-group"> <div class="form-group">
<label>Keanggotaan</label> <label>Keanggotaan</label>
<select class="form-control" id="institusi"> <select class="form-control" id="keanggotaan_non_dosen_nip">
<option>Penelitian Dasar</option> <option>Penelitian Dasar</option>
<option>Norway</option> <option>Norway</option>
<option>Canada</option> <option>Canada</option>
...@@ -296,7 +238,8 @@ ...@@ -296,7 +238,8 @@
<div class="form-group col-md-6"> <div class="form-group col-md-6">
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<button id="multiple-messages" class="btn btn-primary">Save Changes</button> <button onclick="saveNonDosen('non_dosen_nip')" type="button" id="multiple-messages" class="btn btn-primary">Save Changes</button>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -304,9 +247,9 @@ ...@@ -304,9 +247,9 @@
</div> </div>
</div> </div>
</div> </div>
</form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -317,6 +260,7 @@ ...@@ -317,6 +260,7 @@
<button id="multiple-messages" class="btn btn-primary">Save Changes</button> <button id="multiple-messages" class="btn btn-primary">Save Changes</button>
</div> </div>
</div> </div>
</form>
</div> </div>
@endsection @endsection
...@@ -324,4 +268,50 @@ ...@@ -324,4 +268,50 @@
@section('js') @section('js')
<script src="{{ url('theme/plugins/apex/apexcharts.min.js') }} "></script> <script src="{{ url('theme/plugins/apex/apexcharts.min.js') }} "></script>
<script src="{{ url('theme/assets/js/dashboard/dash_2.js') }} "></script> <script src="{{ url('theme/assets/js/dashboard/dash_2.js') }} "></script>
<script>
var iDosen = 1;
var iNonDosen = 1;
function checkNidn(id){
var value = $('#input_'+id).val();
var request = $.ajax({
url: "{{ route('get-biodata') }}",
type: "get",
dataType: "json",
data: {nidn:value},
success: function(result){
$('#nama_'+id).val(result['name']);
$('#prodi_'+id).val(result['prodi']);
$('#'+id).val(result['nidn']);
// var r = JSON.parse(result);
// alert(result['name']);
}
})
}
function saveDosen(id){
saveChange(id, 'dosen', iDosen++);
}
function saveNonDosen(id){
saveChange(id, 'non_dosen', iNonDosen++);
}
function saveChange(id, name, no){
var nama = $('#nama_'+id).val();
var prodi = $('#prodi_'+id).val();
var nidn = $('#'+id).val();
var keanggotaan = $('#keanggotaan_'+id).val();
var request = $.ajax({
url: "{{ route('get-row-anggota') }}",
type: "get",
dataType: "html",
data: {nama:nama, prodi:prodi, nidn:nidn, keanggotaan:keanggotaan, name:name, no:no},
success: function(result){
$('#table_'+id).append(result);
}
})
}
</script>
@endsection @endsection
<tr>
<td><input type="text" name="{{ $name }}[{{ $no }}][nidn]" value="{{ $nidn }}" hidden> {{ $no }}</td>
<td>{{ $nama }}</td>
<td>
{{ $prodi }}
@if ($name == 'non_dosen')
<input type="text" name="{{ $name }}[{{ $no }}][institusi]" value="{{ $prodi }}" hidden>
@endif
</td>
<td class="text-center"><span class="text-success"><input type="text" name="{{ $name }}[{{ $no }}][peran]" value="{{ $keanggotaan }}" hidden> {{ $keanggotaan }}</span></td>
</tr>
...@@ -34,7 +34,8 @@ Route::get('login', [LoginController::class, 'index'])->name('login'); ...@@ -34,7 +34,8 @@ Route::get('login', [LoginController::class, 'index'])->name('login');
Route::get('sso/{email}/{sessionid}', [LoginController::class, 'sso']); Route::get('sso/{email}/{sessionid}', [LoginController::class, 'sso']);
Route::middleware(['auth:sanctum', 'verified'])->group(function () { Route::middleware(['auth:sanctum', 'verified'])->group(function () {
Route::get('/get-biodata', [GetDataController::class, 'getBiodata']); Route::get('/get-biodata', [GetDataController::class, 'getBiodata'])->name('get-biodata');
Route::get('/get-row-anggota', [PenelitianSumberDanaController::class, 'getRowAnggota'])->name('get-row-anggota');
}); });
Route::group(['middleware' => ['auth:sanctum', 'verified']], function () { Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {
......
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