add jenis

parent 56ea712a
......@@ -3,6 +3,7 @@
namespace App\Http\Controllers\User;
use App\Http\Controllers\Controller;
use App\Models\Biodata;
use Illuminate\Http\Request;
class PenelitianSumberDanaController extends Controller
......@@ -87,8 +88,17 @@ class PenelitianSumberDanaController extends Controller
$data['nama'] = $request->nama;
$data['keanggotaan'] = $request->keanggotaan;
$data['prodi'] = $request->prodi;
$data['nidn'] = $request->nidn;
$data['name'] = $request->name;
$data['nidn'] = encrypt($request->nidn);
$dosen = Biodata::query()->where('nidn', $request->nidn)->first();
if (!is_null($dosen) && $request->name == 'dosen') {
$data['name'] = $request->name;
$data['jenis'] = encrypt($dosen->jenis);
} elseif (is_null($dosen) && $request->name == 'non_dosen') {
$data['name'] = $request->name;
$data['jenis'] = encrypt('l');
}
return view('user.penelitiansumber.row_anggota', $data);
}
......
......@@ -10,5 +10,5 @@ class Biodata extends Model
use HasFactory;
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', 'jenis'];
}
......@@ -38,6 +38,7 @@ class BiodataRepository
$data['nidn'] = $isdm[0]->nidn ? $isdm[0]->nidn : $isdm[0]->nip;
$data['fakultas'] = $isdm[0]->namahomebase;
$data['prodi'] = $isdm[0]->namasatker;
$data['jenis'] = $isdm[0]->isdosen ? 'd' : 't';
return $data;
}
......
......@@ -6,6 +6,7 @@
@if ($name == 'non_dosen')
<input type="text" name="{{ $name }}[{{ $no }}][institusi]" value="{{ $prodi }}" hidden>
@endif
<input type="text" name="{{ $name }}[{{ $no }}][jenis]" value="{{ encrypt($jenis) }}" hidden>
</td>
<td class="text-center"><span class="text-success"><input type="text" name="{{ $name }}[{{ $no }}][peran]" value="{{ $keanggotaan }}" hidden> {{ $keanggotaan }}</span></td>
</tr>
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