branch aku jah deh

This commit is contained in:
hafifierahman
2021-01-05 09:55:06 +08:00
parent b533e2de7d
commit c7704e0741
26 changed files with 3082 additions and 475 deletions
@@ -374,4 +374,57 @@ class PenebusanController extends Controller
return response()->json($updatemarhun,200);
}
//Wakil Function - Jangan kacau saya nak makan kacang ni!!!!!!
public function getfirstWakil()
{
$auth_user = Auth::user();
$getfirstwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'])->json();
if(sizeof($getfirstwakil) != 0)
return $getfirstwakil[0]['NOWAKIL'];
else
return $getfirstwakil;
}
public function getWakil(Request $request)
{
$auth_user = Auth::user();
$getwakil = Http::get(config('api.url') . '/api/getwakil/'. $auth_user['cawangan'] . '/' . $request->wakil)->json();
if(sizeof($getwakil) > 0)
return $getwakil[0];
else
return 'no-data';
}
public function createWakil(Request $request)
{
$auth_user = Auth::user();
$createwakil = Http::post(config('api.url') . '/api/createwakil/'. $auth_user['cawangan'] . '/' . $request->icno,[
'nopelanggan' => $request->nopelanggan,
'nowakil' => $request->nowakil,
'nama' => $request->nama,
'hubungan' => $request->hubungan,
'alamat' => $request->alamat,
'telefon' => $request->telefon,
'nota' => $request->nota
])->json();
if($createwakil)
return 1;
else
return 0;
}
}