branch aku jah deh
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user