Commit b4a9b1cc by Triyah Fatmawati

Get data univ api

parent fd38e85b
...@@ -24,11 +24,17 @@ public function create(){ ...@@ -24,11 +24,17 @@ 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) $dataUniv = json_decode($this->getDataUniv(), true);
->whereNotNull('nm_lemb') foreach($dataUniv as $univ){
->orderBy('id_sp') if($univ['id_wil'] != '999999'){
->get(); $universitas[] = [
'id_sp' => $univ['id_sp'],
'nm_lemb' => $univ['nm_lemb']
];
}
}
// $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');
...@@ -270,6 +276,13 @@ private function generateVa($multipartData) ...@@ -270,6 +276,13 @@ private function generateVa($multipartData)
return $response->getBody()->getContents(); return $response->getBody()->getContents();
} }
private function getDataUniv(){
$client = new Client();
$response = $client->request('GET', 'https://siakadu.unesa.ac.id/api/get_univ');
return $response->getBody()->getContents();
}
public function addFormKegiatan(Request $request) public function addFormKegiatan(Request $request)
{ {
$data['kegiatan'] = Kegiatan::get(); $data['kegiatan'] = Kegiatan::get();
......
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