Commit 48be2283 by Triyah Fatmawati

Add data satuan pendidikan siakadu

parent ed9c1b88
...@@ -23,6 +23,11 @@ public function create(){ ...@@ -23,6 +23,11 @@ public function create(){
$kegiatan = Kegiatan::orderBy('id')->get(); $kegiatan = Kegiatan::orderBy('id')->get();
$konferensi = Konferensi::get(); $konferensi = Konferensi::get();
$date = Date('Y-m-d'); $date = Date('Y-m-d');
$universitas = DB::connection('siakadu')->table('satuan_pendidikan')
->where('soft_delete', 0)
->whereNotNull('nm_lemb')
->orderBy('id_sp')
->get();
// $lastKode = Registrasi::query()->whereDate('created_at', $date)->max('kode_registrasi'); // $lastKode = Registrasi::query()->whereDate('created_at', $date)->max('kode_registrasi');
// $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1); // $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1);
// $tgldaftar = Carbon::now()->format('d-m-Y'); // $tgldaftar = Carbon::now()->format('d-m-Y');
...@@ -32,6 +37,7 @@ public function create(){ ...@@ -32,6 +37,7 @@ public function create(){
$data = [ $data = [
'kegiatan' => $kegiatan, 'kegiatan' => $kegiatan,
'konferensi' => $konferensi, 'konferensi' => $konferensi,
'universitas' => $universitas
// 'kode_registrasi' => $kode_registrasi // 'kode_registrasi' => $kode_registrasi
]; ];
...@@ -134,7 +140,7 @@ public function preview(Request $request){ ...@@ -134,7 +140,7 @@ public function preview(Request $request){
Log::error($e); Log::error($e);
DB::rollBack(); DB::rollBack();
return redirect()->back() return redirect()->route('user.create')
->with('error', 'Data failed to save'); ->with('error', 'Data failed to save');
} }
} }
...@@ -208,7 +214,7 @@ public function store(Request $request) { ...@@ -208,7 +214,7 @@ public function store(Request $request) {
Log::error($arrResponse['BTNresponse']); Log::error($arrResponse['BTNresponse']);
Log::error('---'); Log::error('---');
return redirect()->back() return redirect()->route('user.create')
->with('error', 'Data failed to save'); ->with('error', 'Data failed to save');
} }
......
...@@ -93,6 +93,18 @@ ...@@ -93,6 +93,18 @@
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
], ],
'siakadu' => [
'driver' => 'pgsql',
'host' => '192.168.0.204',
'port' => '5432',
'database' => 'siakadu3',
'username' => 'postgres',
'password' => 'dB5i@kADUunes@@@!!',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
], ],
/* /*
......
...@@ -57,7 +57,13 @@ ...@@ -57,7 +57,13 @@
<div class="form-group" @if ($errors->has('instansi')) has-error @endif> <div class="form-group" @if ($errors->has('instansi')) has-error @endif>
<label>Instansi</label> <label>Instansi</label>
<div class="input-group"> <div class="input-group">
<input type="text" id="instansi" name="instansi" class="form-control number" required="true" placeholder="" value="{{ old('instansi')}}"> {{-- <input type="text" id="instansi" name="instansi" class="form-control number" required="true" placeholder="" value="{{ old('instansi')}}"> --}}
<select class="form-control select" id="instansi" name="instansi"placeholder="">
<option value="" selected>- Pilih -</option>
@foreach ($universitas as $univ)
<option value="{{ $univ->nm_lemb }}">{{ $univ->nm_lemb }}</option>
@endforeach
</select>
</div> </div>
@if ($errors->has('instansi')) @if ($errors->has('instansi'))
<label id="login-error" class="error" for="instansi" style="color: red">{{$errors->first('instansi')}}</label> <label id="login-error" class="error" for="instansi" style="color: red">{{$errors->first('instansi')}}</label>
...@@ -150,6 +156,13 @@ ...@@ -150,6 +156,13 @@
@push('js') @push('js')
<script> <script>
$(document).ready(function () {
//change selectboxes to selectize mode to be searchable
$("#instansi").select2();
});
</script>
<script>
function cekKegiatan(id){ function cekKegiatan(id){
var value = document.getElementById(id).value; var value = document.getElementById(id).value;
if(value == '498633a9-082c-4a4a-9dbd-e20b678ec15e'){ if(value == '498633a9-082c-4a4a-9dbd-e20b678ec15e'){
...@@ -165,7 +178,7 @@ function cekKegiatan(id){ ...@@ -165,7 +178,7 @@ function cekKegiatan(id){
konferensi.required = true; konferensi.required = true;
} }
} }
</script> </script>
<script> <script>
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
<!-- Sweet Alert --> <!-- Sweet Alert -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.6.9/sweetalert2.min.js"></script>
<!-- Load jQuery (required for Select2) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Load Select2 CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" />
</head> </head>
<body> <body>
...@@ -95,6 +100,9 @@ ...@@ -95,6 +100,9 @@
<script src="{{asset('assets/js/page/modules-toastr.js')}}"></script> <script src="{{asset('assets/js/page/modules-toastr.js')}}"></script>
<script src="{{asset('assets/js/page/modules-datatables.js')}}"></script> <script src="{{asset('assets/js/page/modules-datatables.js')}}"></script>
<!-- Load Select2 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
<script> <script>
function logout() function logout()
{ {
......
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