Commit b778ecfa by Siti Aisah

fix api satuan pendidikan

parent 5fb4ff53
......@@ -24,11 +24,14 @@ public function create(){
$kegiatan = Kegiatan::orderBy('id')->get();
$konferensi = Konferensi::get();
$date = Date('Y-m-d');
$universitas = DB::connection('siakadu')->table('satuan_pendidikan')
->where('soft_delete', 0)
->whereNotNull('nm_lemb')
->orderBy('id_sp')
->get();
$url = file_get_contents("http://siakadu.unesa.ac.id/api/get_univ");
$universitas = json_decode($url, true);
// $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');
// $nourut = sprintf("%05s", ((int) substr($lastKode, -5))+1);
// $tgldaftar = Carbon::now()->format('d-m-Y');
......@@ -206,25 +209,25 @@ public function store(Request $request) {
$registrasi->save();
$generatedVa = $this->generateVa($multipartData);
$arrResponse = json_decode($generatedVa, true);
$registrasi->status_va = $arrResponse['BTNresponse'];
$registrasi->tagihan = $totalHarga;
$registrasi->nomor_va = $arrResponse['BTNVirtualAccount'];
// $generatedVa = $this->generateVa($multipartData);
// $arrResponse = json_decode($generatedVa, true);
// $registrasi->status_va = $arrResponse['BTNresponse'];
// $registrasi->tagihan = $totalHarga;
// $registrasi->nomor_va = $arrResponse['BTNVirtualAccount'];
$registrasi->save();
// $registrasi->save();
if($arrResponse['BTNresponse'] != 'Request has been processed successfully'){
DB::rollBack();
Log::error('---');
Log::error($multipartData);
Log::error($arrResponse['BTNresponse']);
Log::error('---');
// if($arrResponse['BTNresponse'] != 'Request has been processed successfully'){
// DB::rollBack();
// Log::error('---');
// Log::error($multipartData);
// Log::error($arrResponse['BTNresponse']);
// Log::error('---');
return redirect()->route('user.create')
->with('error', 'Data failed to save');
}
// return redirect()->route('user.create')
// ->with('error', 'Data failed to save');
// }
DB::commit();
......
......@@ -68,7 +68,7 @@
<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>
<option value="{{ $univ['nm_lemb'] }}">{{ $univ['nm_lemb'] }}</option>
@endforeach
</select>
</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