61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Session;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Support\Arr;
|
|
|
|
class TetapanController extends Controller
|
|
{
|
|
|
|
public function home(){
|
|
|
|
$auth_user = Auth::user();
|
|
|
|
return view('tetapan.home',compact('auth_user'));
|
|
}
|
|
|
|
public function index(){
|
|
$api_url = config('api.url');
|
|
$auth_user = Auth::user();
|
|
|
|
return view('tetapan.index',compact('api_url','auth_user'));
|
|
}
|
|
|
|
public function margin(){
|
|
$api_url = config('api.url');
|
|
$auth_user = Auth::user();
|
|
|
|
return view('tetapan.margin',compact('api_url','auth_user'));
|
|
}
|
|
|
|
public function payableUjrahBranches()
|
|
{
|
|
$api_url = config('api.url');
|
|
$auth_user = Auth::user();
|
|
|
|
$payable_cawangan = json_decode( Http::get(config('api.url').'/api/payable-ujrah-branches')->json() );
|
|
return view('tetapan.payable-ujrah-branches',compact('api_url','auth_user', 'payable_cawangan'));
|
|
}
|
|
|
|
|
|
public function unsoldCommodityNotification()
|
|
{
|
|
$api_url = config('api.url');
|
|
$auth_user = Auth::user();
|
|
|
|
$settings = Http::get(config('api.url').'/api/settings/unsold-commodity-notifications')->json();
|
|
|
|
$key = Arr::pluck($settings, 'key');
|
|
$values = Arr::pluck($settings, 'value');
|
|
$settings = array_combine($key, $values);
|
|
|
|
return view('tetapan.unsold-commodity-notifications',compact('api_url','auth_user', 'settings'));
|
|
}
|
|
}
|