Commit b778ecfa by Siti Aisah

fix api satuan pendidikan

parent 5fb4ff53
...@@ -24,11 +24,14 @@ public function create(){ ...@@ -24,11 +24,14 @@ 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') $url = file_get_contents("http://siakadu.unesa.ac.id/api/get_univ");
->where('soft_delete', 0) $universitas = json_decode($url, true);
->whereNotNull('nm_lemb')
->orderBy('id_sp') // $universitas = DB::connection('siakadu')->table('satuan_pendidikan')
->get(); // ->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');
...@@ -206,25 +209,25 @@ public function store(Request $request) { ...@@ -206,25 +209,25 @@ public function store(Request $request) {
$registrasi->save(); $registrasi->save();
$generatedVa = $this->generateVa($multipartData); // $generatedVa = $this->generateVa($multipartData);
$arrResponse = json_decode($generatedVa, true); // $arrResponse = json_decode($generatedVa, true);
$registrasi->status_va = $arrResponse['BTNresponse']; // $registrasi->status_va = $arrResponse['BTNresponse'];
$registrasi->tagihan = $totalHarga; // $registrasi->tagihan = $totalHarga;
$registrasi->nomor_va = $arrResponse['BTNVirtualAccount']; // $registrasi->nomor_va = $arrResponse['BTNVirtualAccount'];
$registrasi->save(); // $registrasi->save();
if($arrResponse['BTNresponse'] != 'Request has been processed successfully'){ // if($arrResponse['BTNresponse'] != 'Request has been processed successfully'){
DB::rollBack(); // DB::rollBack();
Log::error('---'); // Log::error('---');
Log::error($multipartData); // Log::error($multipartData);
Log::error($arrResponse['BTNresponse']); // Log::error($arrResponse['BTNresponse']);
Log::error('---'); // Log::error('---');
return redirect()->route('user.create') // return redirect()->route('user.create')
->with('error', 'Data failed to save'); // ->with('error', 'Data failed to save');
} // }
DB::commit(); DB::commit();
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<select class="form-control select" id="instansi" name="instansi"placeholder=""> <select class="form-control select" id="instansi" name="instansi"placeholder="">
<option value="" selected>- Pilih -</option> <option value="" selected>- Pilih -</option>
@foreach ($universitas as $univ) @foreach ($universitas as $univ)
<option value="{{ $univ->nm_lemb }}">{{ $univ->nm_lemb }}</option> <option value="{{ $univ['nm_lemb'] }}">{{ $univ['nm_lemb'] }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
......
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