9943ec892e
- Add basic blade components based on already existing element on app - Add module to view online transaction trail, serve as debugger - Add module to review arrahn transaction vs billplz transaction, serve as debugger - Fix tetapan/payable-ujrah-branches error on api response - Add arrahn pay portal api url link in config. The billplz data is query from there
73 lines
2.0 KiB
PHP
73 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Support\Arr;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
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 = 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);
|
|
|
|
$days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
|
|
$except_users_email = [
|
|
'azmeer@pkb.net.my',
|
|
'amran@pkb.net.my',
|
|
'bukhari@pkb.net.my',
|
|
];
|
|
|
|
$operasi_users = User::where('cawangan', 'operasi')
|
|
->where('roles', 'operasi')
|
|
->whereNotIn('email', $except_users_email)
|
|
->get(['id', 'name', 'no_telefon']);
|
|
|
|
return view('tetapan.unsold-commodity-notifications', compact('api_url', 'auth_user', 'settings', 'operasi_users', 'days'));
|
|
}
|
|
}
|