change to api
This commit is contained in:
@@ -45,7 +45,11 @@ class CustomersController extends Controller
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$customer_info = $customers_info[0];
|
||||
if(sizeof($customers_info)!= 0){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
|
||||
$search = true;
|
||||
if($customer_info){
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\HargaEmas;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class HargaEmasController extends Controller
|
||||
{
|
||||
@@ -13,7 +16,9 @@ class HargaEmasController extends Controller
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$auth_user = Auth::user();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$harga_emas = HargaEmas::all();
|
||||
return view('harga_emas.index',compact('harga_emas'));
|
||||
return view('harga_emas.index',compact('harga_emas','cawangan_info'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,14 @@ class MarhunController extends Controller
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
public function index(Request $request){
|
||||
$norujukan = $request->norujukan;
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$jemas = Http::get(config('api.url') . '/api/jemas/'. $auth_user['cawangan'])->json();
|
||||
$hargaemas = Http::get(config('api.url') . '/api/harga_emas')->json();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
return view('marhun.index',compact('cawangan_info'));
|
||||
return view('marhun.index',compact('cawangan_info','norujukan','jemas','hargaemas'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user