Merge branch 'release/split' of https://bitbucket.org/arrahn-pkb/arrahn-portal into kopkb
This commit is contained in:
+18
-4
@@ -1,10 +1,12 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:Her7qzZ/iDiuEBFfMZVnN8fMDOJvOZ8mmg2quO+L2ck=
|
||||
APP_KEY=base64:42429JS6yzOce6gW3d+c59GBL9cJw6D5vqhWv9h7nx8=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
API_URL=http://host.docker.internal:8874
|
||||
API_LELONG_URL=http://host.docker.internal:8096
|
||||
APP_URL=http://pay.localhost
|
||||
API_URL=http://apiv2.localhost
|
||||
API_URL_KOOP=http://apiv3.localhost
|
||||
API_LELONG_URL=http://lelong.localhost
|
||||
API_VERIFY=false
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL=debug
|
||||
@@ -51,3 +53,15 @@ PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
BILLPLZ_PRODUCTION_API_KEY="f3e82fe1-a422-4660-97f0-65cc59ff6c47"
|
||||
BILLPLZ_PRODUCTION_X_SIGNATURE="S-alZUbzmD2_TF3vmrRqgehQ"
|
||||
BILLPLZ_PRODUCTION_COLLECTION_ID="5aosv2dg"
|
||||
|
||||
BILLPLZ_SANDBOX_API_KEY="abecfd0c-98d8-4635-abc2-2fcba8c60c11"
|
||||
BILLPLZ_SANDBOX_X_SIGNATURE="S-GWr7z03XjAhqPsFfu_H5nQ"
|
||||
BILLPLZ_SANDBOX_COLLECTION_ID="z0r4kjhi"
|
||||
|
||||
BILLPLZ_SANDBOX_KOPKB_API_KEY="abecfd0c-98d8-4635-abc2-2fcba8c60c11"
|
||||
BILLPLZ_SANDBOX_KOPKB_X_SIGNATURE="S-GWr7z03XjAhqPsFfu_H5nQ"
|
||||
BILLPLZ_SANDBOX_KOPKB_COLLECTION_ID="uae40muk"
|
||||
|
||||
@@ -4,6 +4,7 @@ APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
API_URL=http://api_arrahn.test
|
||||
API_URL_KOOP=http://api_arrahn_v3.test
|
||||
API_LELONG_URL=https://niklah.arrahn.com.my
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
@@ -51,3 +52,15 @@ PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
BILLPLZ_PRODUCTION_API_KEY="f3e82fe1-a422-4660-97f0-65cc59ff6c47"
|
||||
BILLPLZ_PRODUCTION_X_SIGNATURE="S-alZUbzmD2_TF3vmrRqgehQ"
|
||||
BILLPLZ_PRODUCTION_COLLECTION_ID="5aosv2dg"
|
||||
|
||||
BILLPLZ_SANDBOX_API_KEY="abecfd0c-98d8-4635-abc2-2fcba8c60c11"
|
||||
BILLPLZ_SANDBOX_X_SIGNATURE="S-GWr7z03XjAhqPsFfu_H5nQ"
|
||||
BILLPLZ_SANDBOX_COLLECTION_ID="z0r4kjhi"
|
||||
|
||||
BILLPLZ_SANDBOX_KOPKB_API_KEY="abecfd0c-98d8-4635-abc2-2fcba8c60c11"
|
||||
BILLPLZ_SANDBOX_KOPKB_X_SIGNATURE="S-GWr7z03XjAhqPsFfu_H5nQ"
|
||||
BILLPLZ_SANDBOX_KOPKB_COLLECTION_ID="uae40muk"
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\PersonalCarts;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class DeleteCarts extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'carts:delete';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Delete all carts';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try{
|
||||
|
||||
$deleted = PersonalCarts::query()->delete();
|
||||
Log::info("$deleted carts have been deleted.");
|
||||
$this->info("$deleted carts have been deleted.");
|
||||
}catch(\Exception $e){
|
||||
Log::error('Error deleting carts: ' . $e->getMessage());
|
||||
$this->error('Error deleting carts: ' . $e->getMessage());
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\PersonalCarts;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class DeleteCartsHourly extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'carts:hourlydelete';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Soft Delete all carts hourly';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try{
|
||||
$oneHourAgo = Carbon::now()->subHour();
|
||||
$deleted = PersonalCarts::where('created_at', '<', $oneHourAgo)->delete();
|
||||
Log::info('carts hourly have been deleted.');
|
||||
$this->info('carts have been deleted.');
|
||||
}catch(\Exception $e){
|
||||
Log::error('Error deleting hourly carts: ' . $e->getMessage());
|
||||
$this->error('Error deleting hourly carts: ' . $e->getMessage());
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -40,11 +40,18 @@ class UpdateTransactionMaster extends Command
|
||||
public function handle()
|
||||
{
|
||||
$updateOnline = Http::arrahn()->get('/api/transaction/online/update')->json();
|
||||
$updateOnline_Koop = Http::arrahn_koop()->get('/api/transaction/online/update')->json();
|
||||
|
||||
if($updateOnline == 'success'){
|
||||
return 0;
|
||||
}else{
|
||||
Log::error('Update transaction master failed');
|
||||
Log::error('PKB::Update transaction master failed');
|
||||
}
|
||||
|
||||
if($updateOnline_Koop == 'success'){
|
||||
return 0;
|
||||
}else{
|
||||
Log::error('KOOP::Update transaction master failed');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use App\Models\TransactionOnlineStatus;
|
||||
use App\Services\BillplzService;
|
||||
use App\Services\OnlineTransactionLoggerService;
|
||||
use Billplz\Base\Bill;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
@@ -15,8 +17,7 @@ class UpdateUnsuccess extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'update:unsuccess';
|
||||
|
||||
protected $signature = 'update:unsuccess {--type=1}';
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
@@ -29,18 +30,36 @@ class UpdateUnsuccess extends Command
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle(BillplzService $billplzService)
|
||||
public function handle()
|
||||
{
|
||||
$type = $this->option('type');
|
||||
|
||||
$getFailedOnlineTransaction = fn() => Http::arrahn()->get('/api/transaction/online/unsuccessful')->json();
|
||||
if($type == '1'){
|
||||
$getFailedOnlineTransaction = fn() => Http::arrahn()->get('/api/transaction/online/unsuccessful')->json();
|
||||
$FailedBillplzID = array_map(fn($x) => $x['billplz_id'], $getFailedOnlineTransaction());
|
||||
$this->resolve_payment($FailedBillplzID,CompanyStatus::COM_PKB);
|
||||
}else{
|
||||
$getFailedOnlineTransaction_Koop = fn() => Http::arrahn_koop()->get('/api/transaction/online/unsuccessful')->json();
|
||||
$FailedBillplzID_Koop = array_map(fn($x) => $x['billplz_id'], $getFailedOnlineTransaction_Koop());
|
||||
$this->resolve_payment($FailedBillplzID_Koop,CompanyStatus::COM_KOOPPKB);
|
||||
}
|
||||
|
||||
$FailedBillplzID = array_map(fn($x) => $x['billplz_id'], $getFailedOnlineTransaction());
|
||||
}
|
||||
public function resolve_payment($FailedBillplzID,$company)
|
||||
{
|
||||
$billplzService = new BillplzService($company);
|
||||
|
||||
if(sizeof($FailedBillplzID) < 0){
|
||||
return;
|
||||
}
|
||||
|
||||
$billplzUpdatedTransactionStatus = array_map(fn($x) => $billplzService->getTransactionByBillId($x), $FailedBillplzID);
|
||||
if($company == CompanyStatus::COM_PKB){
|
||||
$companyID = 'PKB';
|
||||
}else{
|
||||
$companyID = 'KOPKB';
|
||||
}
|
||||
|
||||
$billplzUpdatedTransactionStatus = array_map(fn($x) => $billplzService->getTransactionByBillId($x,$companyID), $FailedBillplzID);
|
||||
|
||||
$getCompletedBillplzTransaction = function() use($billplzUpdatedTransactionStatus){
|
||||
|
||||
@@ -59,7 +78,13 @@ class UpdateUnsuccess extends Command
|
||||
];
|
||||
|
||||
try {
|
||||
$response = Http::arrahn()->put('/api/transaction/online/unsuccesfull/update', $transactionData);
|
||||
|
||||
$CallableHttp = $company == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$response = $CallableHttp->put('/api/transaction/online/unsuccesfull/update', $transactionData);
|
||||
|
||||
OnlineTransactionLoggerService::logs($transaction['bill_id'], $transactionData, $response, TransactionOnlineStatus::UPDATE_UNSUCCESSFUL_TRANSACTION );
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\PaymentRequest;
|
||||
use App\Models\CompanyStatus;
|
||||
use App\Models\PersonalCarts;
|
||||
use App\Models\TransactionOnlineStatus;
|
||||
use App\Services\BillplzService;
|
||||
use Carbon\Carbon;
|
||||
@@ -13,22 +15,83 @@ use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Money\Money;
|
||||
use App\Services\OnlineTransactionLoggerService;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use PDF;
|
||||
|
||||
class BayaranController extends Controller
|
||||
{
|
||||
public $CallableHttp;
|
||||
|
||||
public function PembayaranAction(PaymentRequest $request)
|
||||
{
|
||||
$request->validated();
|
||||
|
||||
$arraybayar = $this->setUpahTawarruq($request->getPembiayaanFromNorujukan());
|
||||
$exist_carts = $this->checkCarts();
|
||||
$exist_carts = optional($exist_carts)->toArray();
|
||||
|
||||
return view('includes.bayaran.pembayaransag', compact('arraybayar'));
|
||||
if($exist_carts){
|
||||
/* Do Have Carts. */
|
||||
$list_pkb = json_decode($exist_carts['list_pkb'],true);
|
||||
$list_koop = json_decode($exist_carts['list_koop'],true);
|
||||
|
||||
if($this->checkSAG($list_pkb, 'PKB')){
|
||||
$this->removeCartsInternal();
|
||||
return redirect()->route('buffer');
|
||||
}
|
||||
|
||||
if($this->checkSAG($list_koop, 'KOPKB')){
|
||||
$this->removeCartsInternal();
|
||||
return redirect()->route('buffer');
|
||||
}
|
||||
|
||||
if($exist_carts['status_pkb'] == 'PENDING') $list_pkb = ($list_pkb) ? $this->setUpahTawarruq($list_pkb) : []; else $list_pkb = [];
|
||||
if($exist_carts['status_koop'] == 'PENDING') $list_koop = ($list_koop) ? $this->setUpahTawarruq($list_koop) : []; else $list_koop = [];
|
||||
|
||||
if (empty($list_pkb) && empty($list_koop)) {
|
||||
$this->removeCartsInternal();
|
||||
return redirect()->route('buffer');
|
||||
}
|
||||
|
||||
}else{
|
||||
/* Doesn't Have Carts. First Timer */
|
||||
$request->validated();
|
||||
|
||||
if(isset($request->redirect_trolley)){
|
||||
return redirect()->route('buffer');
|
||||
}
|
||||
|
||||
$arraybayar = $this->setUpahTawarruq($request->getPembiayaanFromNorujukan());
|
||||
|
||||
$list_pkb = array_filter(array_map(function ($x){
|
||||
return ($x['tag_syarikat'] == CompanyStatus::COM_PKB) ? $x : null;
|
||||
},$arraybayar));
|
||||
|
||||
$list_koop = array_filter(array_map(function ($x){
|
||||
return ($x['tag_syarikat'] == CompanyStatus::COM_KOOPPKB) ? $x : null;
|
||||
},$arraybayar));
|
||||
|
||||
$personal_carts = new PersonalCarts();
|
||||
$personal_carts->ic_no = Auth::user()->icno;
|
||||
$personal_carts->list_koop = json_encode($list_koop);
|
||||
$personal_carts->list_pkb = json_encode($list_pkb);
|
||||
$personal_carts->status_pkb = ($list_pkb) ? 'PENDING' : 'NONE';
|
||||
$personal_carts->status_koop = ($list_koop) ? 'PENDING' : 'NONE';
|
||||
$personal_carts->user_id = Auth::user()->id;
|
||||
$personal_carts->save();
|
||||
}
|
||||
|
||||
return view('includes.bayaran.pembayaransag', compact('list_pkb','list_koop'));
|
||||
}
|
||||
|
||||
public function PembayaranEngine(Request $request, BillplzService $billplzService)
|
||||
public function PembayaranEngine(Request $request)
|
||||
{
|
||||
['email' => $customerEmail, 'notel' => $customerPhoneNumber, 'name' => $customerName, 'icno' => $customerIcno] = auth()->user()->toArray();
|
||||
|
||||
#Validate the request
|
||||
$error = $this->validateRequest($request);
|
||||
if ($error) {
|
||||
return redirect()->route('buffer')->with(['errorvalidate' => $error]);
|
||||
}
|
||||
|
||||
$bayaranArrahn = array_filter($request->txtjenisbayaran, fn($x) => $x == 'arrahn');
|
||||
$bayaranOthers = array_filter($request->txtjenisbayaran, fn($x) => $x != 'arrahn');
|
||||
|
||||
@@ -62,9 +125,14 @@ class BayaranController extends Controller
|
||||
return Money::MYR($sum())->add($billPlzTransactionFee);
|
||||
};
|
||||
|
||||
$bill = $billplzService->createBill([$customerEmail, $customerPhoneNumber, $customerName, $getPaymentSum()]);
|
||||
$company = strtoupper($request->txtcompany);
|
||||
$billplzService = new BillplzService($company);
|
||||
$bill = $billplzService->createBill([$customerEmail, $customerPhoneNumber, $customerName, $getPaymentSum()],$company);
|
||||
|
||||
$isRecordTransactionSuccess = $this->recordTransaction($paymentArray, $bill);
|
||||
Session::put('company', $company);
|
||||
$this->serviceCallHttp($company);
|
||||
|
||||
$isRecordTransactionSuccess = $this->recordTransaction($paymentArray, $bill,$company);
|
||||
|
||||
if ($isRecordTransactionSuccess) {
|
||||
session([
|
||||
@@ -76,12 +144,12 @@ class BayaranController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function recordTransaction($paymentArray, $bill)
|
||||
public function recordTransaction($paymentArray, $bill,$company = 'PKB')
|
||||
{
|
||||
['name' => $customerName, 'icno' => $customerIcno] = auth()->user()->toArray();
|
||||
|
||||
$getlatestNoSiri = function () {
|
||||
$previous_siri = Http::arrahn()->get('/api/online/transaction')->json();
|
||||
$previous_siri = $this->CallableHttp->get('/api/online/transaction')->json();
|
||||
if ($previous_siri) {
|
||||
return $previous_siri['nosiri'] + 1;
|
||||
} else {
|
||||
@@ -95,10 +163,13 @@ class BayaranController extends Controller
|
||||
return 'APKB' . $day . $month . $year . sprintf('%08d', $getlatestNoSiri());
|
||||
};
|
||||
|
||||
$serviceCallable = $company == 'PKB'
|
||||
? fn(Pool $pool) => $pool->arrahn()
|
||||
: fn(Pool $pool) => $pool->arrahn_koop();
|
||||
try {
|
||||
Http::pool(
|
||||
fn(Pool $pool) => collect($paymentArray)->map(
|
||||
fn($payment) => $pool->arrahn()->post('/api/online/transaction', [
|
||||
fn($payment) => $serviceCallable($pool)->post('/api/online/transaction', [
|
||||
'nokp' => $customerIcno,
|
||||
'reference_no' => $generateTransactionReferenceNumber(),
|
||||
'nosiri' => $getlatestNoSiri(),
|
||||
@@ -122,7 +193,7 @@ class BayaranController extends Controller
|
||||
}
|
||||
|
||||
try {
|
||||
$response = Http::arrahn()
|
||||
$response = $this->CallableHttp
|
||||
->put('/api/transaction/online/tagportal', [
|
||||
'billplz_id' => $bill['id'],
|
||||
])
|
||||
@@ -142,11 +213,12 @@ class BayaranController extends Controller
|
||||
|
||||
public function ResitBayaran(Request $request)
|
||||
{
|
||||
$this->serviceCallHttp(Session::get('company'));
|
||||
$payment_details = $request->payment;
|
||||
|
||||
$kpbaru = Auth::User()->icno;
|
||||
|
||||
$customer = Http::arrahn()
|
||||
$customer = $this->CallableHttp
|
||||
->get('/api/customers/' . $kpbaru)
|
||||
->json();
|
||||
$customer_details = $customer;
|
||||
@@ -155,31 +227,77 @@ class BayaranController extends Controller
|
||||
$current = new Carbon();
|
||||
$date = $current->toDateTimeString();
|
||||
|
||||
$cawangan_info = Http::arrahn()
|
||||
$cawangan_info = $this->CallableHttp
|
||||
->get('/api/cawangan/' . $payment_details['kodcaw'])
|
||||
->json();
|
||||
$cawangan = Http::arrahn()
|
||||
$cawangan = $this->CallableHttp
|
||||
->get('/api/cawangan/detail/' . $payment_details['kodcaw'])
|
||||
->json();
|
||||
$cawangan_detail = $cawangan[0];
|
||||
$nama_cawangan = $cawangan_info['details_caw'];
|
||||
|
||||
$gadai_details = Http::arrahn()
|
||||
$gadai_details = $this->CallableHttp
|
||||
->get('/api/gadai/norujukan/' . $payment_details['norujukan'])
|
||||
->json();
|
||||
$gadai = $gadai_details[0][0];
|
||||
|
||||
return view('pembayaran.resit.resitportal', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai'));
|
||||
$company = Session::get('company');
|
||||
|
||||
return view('pembayaran.resit.resitportal', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai','company'));
|
||||
}
|
||||
|
||||
public function callback(Request $request, BillplzService $billplzService)
|
||||
public function generateResit(Request $request)
|
||||
{
|
||||
$this->serviceCallHttp($request->company);
|
||||
|
||||
$kpbaru = Auth::User()->icno;
|
||||
|
||||
$customer = $this->CallableHttp
|
||||
->get('/api/customers/' . $kpbaru)
|
||||
->json();
|
||||
$customer_details = $customer;
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$date = $current->toDateTimeString();
|
||||
|
||||
$payment_details = $this->CallableHttp
|
||||
->get('/api/transaction/online/express', ['billplz_id' => $request->billplzid,'norujukan' => $request->norujukan])
|
||||
->json();
|
||||
|
||||
$cawangan_info = $this->CallableHttp
|
||||
->get('/api/cawangan/' . $payment_details['kodcaw'])
|
||||
->json();
|
||||
$cawangan = $this->CallableHttp
|
||||
->get('/api/cawangan/detail/' . $payment_details['kodcaw'])
|
||||
->json();
|
||||
$cawangan_detail = $cawangan[0];
|
||||
$nama_cawangan = $cawangan_info['details_caw'];
|
||||
|
||||
$gadai_details = $this->CallableHttp
|
||||
->get('/api/gadai/norujukan/' . $payment_details['norujukan'])
|
||||
->json();
|
||||
$gadai = $gadai_details[0][0];
|
||||
|
||||
// Load a view and pass data to it
|
||||
if($request->jenis == 'pdf'){
|
||||
$pdf = PDF::loadView('pembayaran.resit.resitpdf', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai'));
|
||||
return $pdf->stream('resit_pembayaran.pdf');
|
||||
}else{
|
||||
return view('pembayaran.resit.resitpdf', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function callback(Request $request)
|
||||
{
|
||||
$billplzService = new BillplzService(Session::get('company'));
|
||||
$data = $billplzService->webhook($request->toArray());
|
||||
|
||||
$isBillUnpaid = $data['paid'] !== true;
|
||||
|
||||
if ($isBillUnpaid) {
|
||||
Http::arrahn()->put('/api/online/transaction', [
|
||||
$this->CallableHttp->put('/api/online/transaction', [
|
||||
'billplz_id' => $data['id'],
|
||||
'status' => 'UNSUCCESSFUL',
|
||||
'paid_at' => null,
|
||||
@@ -188,29 +306,43 @@ class BayaranController extends Controller
|
||||
return response(200);
|
||||
}
|
||||
|
||||
Http::arrahn()->put('/api/online/transaction', [
|
||||
$this->CallableHttp->put('/api/online/transaction', [
|
||||
'billplz_id' => $data['id'],
|
||||
'status' => 'PAID',
|
||||
'paid_at' => $data['paid_at']->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
|
||||
$column_updated = (Session::get('company') == 'PKB') ? 'status_pkb' : 'status_koop';
|
||||
$value_paid = 'PAID';
|
||||
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status_pkb', 'PENDING')
|
||||
->orWhere('status_koop', 'PENDING');
|
||||
})
|
||||
->update([
|
||||
$column_updated => $value_paid,
|
||||
]);
|
||||
|
||||
return response(200);
|
||||
}
|
||||
|
||||
public function response(Request $request, BillplzService $billplzService)
|
||||
public function response(Request $request)
|
||||
{
|
||||
$billplzService = new BillplzService(Session::get('company'));
|
||||
$data = $billplzService->redirect($request->toArray());
|
||||
|
||||
$this->serviceCallHttp($billplzService->company);
|
||||
$isBillUnpaid = $data['paid'] !== true;
|
||||
|
||||
if ($isBillUnpaid) {
|
||||
Http::arrahn()->put('/api/online/transaction', [
|
||||
$this->CallableHttp->put('/api/online/transaction', [
|
||||
'billplz_id' => $data['id'],
|
||||
'status' => 'UNSUCCESSFUL',
|
||||
'status' => 'NOT PAID',
|
||||
'paid_at' => null,
|
||||
]);
|
||||
|
||||
$transactionOnline = Http::arrahn()
|
||||
$transactionOnline = $this->CallableHttp
|
||||
->get('/api/transaction/online/login', [
|
||||
'billplz_id' => $data['id'],
|
||||
])
|
||||
@@ -219,18 +351,33 @@ class BayaranController extends Controller
|
||||
return redirect()->route('pay.failed');
|
||||
}
|
||||
|
||||
Http::arrahn()->put('/api/online/transaction', [
|
||||
$this->CallableHttp->put('/api/online/transaction', [
|
||||
'billplz_id' => $data['id'],
|
||||
'status' => 'PAID',
|
||||
'paid_at' => $data['paid_at']->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
|
||||
$transactionOnline = Http::arrahn()
|
||||
$column_updated = (Session::get('company') == 'PKB') ? 'status_pkb' : 'status_koop';
|
||||
$value_paid = 'PAID';
|
||||
$column_payment_updated = (Session::get('company') == 'PKB') ? 'payment_pkb' : 'payment_koop';
|
||||
|
||||
$transactionOnline = $this->CallableHttp
|
||||
->get('/api/transaction/online/login', [
|
||||
'billplz_id' => $data['id'],
|
||||
])
|
||||
->json();
|
||||
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status_pkb', 'PENDING')
|
||||
->orWhere('status_koop', 'PENDING');
|
||||
})
|
||||
->update([
|
||||
$column_updated => $value_paid,
|
||||
$column_payment_updated => json_encode($transactionOnline)
|
||||
]);
|
||||
|
||||
return redirect()->route('pay.success', [
|
||||
'transactionOnline' => $transactionOnline,
|
||||
]);
|
||||
@@ -238,23 +385,76 @@ class BayaranController extends Controller
|
||||
|
||||
public function successPayment(Request $request)
|
||||
{
|
||||
$this->serviceCallHttp(Session::get('company'));
|
||||
$transactionOnline = $request->transactionOnline;
|
||||
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status_pkb', 'PENDING')
|
||||
->orWhere('status_koop', 'PENDING');
|
||||
})
|
||||
->first();
|
||||
|
||||
$exist_carts = optional($exist_carts)->toArray();
|
||||
|
||||
if(!$exist_carts){
|
||||
$paid_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status_pkb', 'PAID')
|
||||
->where('status_koop', 'PAID');
|
||||
})
|
||||
->first();
|
||||
$paid_carts = optional($paid_carts)->toArray();
|
||||
if($paid_carts){
|
||||
|
||||
$trans_pkb = json_decode($paid_carts['payment_pkb'],true);
|
||||
$trans_koop = json_decode($paid_carts['payment_koop'],true);
|
||||
|
||||
$trans_pkb = array_map(function ($item) {
|
||||
$item['tag_syarikat'] = CompanyStatus::COM_PKB;
|
||||
return $item;
|
||||
}, $trans_pkb);
|
||||
|
||||
$trans_koop = array_map(function ($item) {
|
||||
$item['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
return $item;
|
||||
}, $trans_koop);
|
||||
|
||||
$transactionOnline = array_merge($trans_pkb,$trans_koop);
|
||||
|
||||
$arraycawangan = array_map(
|
||||
fn($x) => $x['tag_syarikat'] == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
->get('/api/cawangan/detail/' . $x['kodcaw'])
|
||||
->json()[0]
|
||||
: Http::arrahn_koop()
|
||||
->get('/api/cawangan/detail/' . $x['kodcaw'])
|
||||
->json()[0],
|
||||
$transactionOnline
|
||||
);
|
||||
|
||||
|
||||
return view('pembayaran.result.berjayaportal', compact('transactionOnline', 'arraycawangan','exist_carts'));
|
||||
}
|
||||
}
|
||||
|
||||
$arraygadai = array_map(
|
||||
fn($x) => Http::arrahn()
|
||||
fn($x) => $this->CallableHttp
|
||||
->get('/api/gadai/norujukan/' . $x['norujukan'])
|
||||
->json()[0][0],
|
||||
$transactionOnline,
|
||||
);
|
||||
|
||||
$arraycawangan = array_map(
|
||||
fn($x) => Http::arrahn()
|
||||
fn($x) => $this->CallableHttp
|
||||
->get('/api/cawangan/detail/' . $x['kodcaw'])
|
||||
->json()[0],
|
||||
$transactionOnline,
|
||||
);
|
||||
|
||||
return view('pembayaran.result.berjayaportal', compact('transactionOnline', 'arraycawangan', 'arraygadai'));
|
||||
return view('pembayaran.result.berjayaportal', compact('transactionOnline', 'arraycawangan', 'arraygadai','exist_carts'));
|
||||
}
|
||||
|
||||
public function failedPayment()
|
||||
@@ -270,7 +470,7 @@ class BayaranController extends Controller
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$belum_tebus = Http::arrahn()
|
||||
$belum_tebus = $this->CallableHttp
|
||||
->get('/api/customers/' . $auth_user['icno'] . '/gadai/' . 'belum_tebus')
|
||||
->json();
|
||||
|
||||
@@ -302,7 +502,11 @@ class BayaranController extends Controller
|
||||
|
||||
$getUpahTawarruqPerPembiayaan = function ($x) use ($getJenisKeuntungan) {
|
||||
$jenisKeuntungan = $getJenisKeuntungan($x);
|
||||
$upahTawarruq = Http::arrahn()
|
||||
$CallableHttp = $x['tag_syarikat'] == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$upahTawarruq = $CallableHttp
|
||||
->get('/api/upahtawarruq/' . $x['kodcaw'] . '/' . $x['norujukan'], ['jeniskeuntungan' => $jenisKeuntungan])
|
||||
->json();
|
||||
|
||||
@@ -319,4 +523,180 @@ class BayaranController extends Controller
|
||||
|
||||
return array_map($getUpahTawarruqPerPembiayaan, $pembiayaan);
|
||||
}
|
||||
|
||||
public function checkCarts(){
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status_pkb', 'PENDING')
|
||||
->orWhere('status_koop', 'PENDING');
|
||||
})
|
||||
->first();
|
||||
|
||||
return $exist_carts;
|
||||
}
|
||||
|
||||
public function UserCheckCarts(Request $request){
|
||||
if($request->ajax() || $request->expectsJson()){
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status_pkb', 'PENDING')
|
||||
->orWhere('status_koop', 'PENDING');
|
||||
})
|
||||
->first();
|
||||
|
||||
return response()->json($exist_carts);
|
||||
}else{
|
||||
return redirect()->route('buffer');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function removeCarts(Request $request){
|
||||
if($request->ajax() || $request->expectsJson()){
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->first();
|
||||
|
||||
if ($exist_carts) {
|
||||
$exist_carts->delete();
|
||||
}
|
||||
|
||||
return response()->json($exist_carts);
|
||||
}else{
|
||||
return redirect()->route('buffer');
|
||||
}
|
||||
}
|
||||
|
||||
public function serviceCallHttp($company){
|
||||
$this->CallableHttp = $company == 'PKB'
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
}
|
||||
|
||||
private function checkSAG($list_sag, $company)
|
||||
{
|
||||
$CallableHttp = $company == 'PKB'
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
foreach ($list_sag as $x) {
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api-lelong.url') . '/api/portalApi', ['norujukan' => $x['norujukan']])
|
||||
->json();
|
||||
|
||||
$array_gadai = $CallableHttp->get('/api/gadai/norujukan/' . $x['norujukan'])->json();
|
||||
$isdisabled = $CallableHttp->get('/portal/searchsagonline/', ['norujukan' => $x['norujukan']])->json();
|
||||
|
||||
if ($array_lelong['lelong'] != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($isdisabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sizeof($array_gadai) != 0) {
|
||||
$array_gadai = $array_gadai[0][0];
|
||||
if ($array_gadai['sttebus'] == 'T' || $array_gadai['sttebus'] == 'L') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function removeCartsInternal(){
|
||||
$exist_carts = PersonalCarts::where('ic_no', Auth::user()->icno)
|
||||
->where('user_id', Auth::user()->id)
|
||||
->first();
|
||||
|
||||
if ($exist_carts) {
|
||||
$exist_carts->delete();
|
||||
}
|
||||
|
||||
return $exist_carts;
|
||||
}
|
||||
|
||||
private function validateRequest($request)
|
||||
{
|
||||
$CallableHttp = $request->txtcompany == 'pkb'
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
if (
|
||||
!is_array($request->txtnorujukanhidden) ||
|
||||
!is_array($request->txtbayaranhidden) ||
|
||||
!is_array($request->txtkodcawhidden) ||
|
||||
count($request->txtnorujukanhidden) !== count($request->txtbayaranhidden) ||
|
||||
count($request->txtnorujukanhidden) !== count($request->txtkodcawhidden)
|
||||
) {
|
||||
Log::error('Jumlah bayaran, norujukan dan kod cawangan tidak sepadan.', [
|
||||
'txtnorujukanhidden' => $request->txtnorujukanhidden,
|
||||
'txtbayaranhidden' => $request->txtbayaranhidden,
|
||||
'txtkodcawhidden' => $request->txtkodcawhidden,
|
||||
]);
|
||||
return 'Sila Pilih Sekali Lagi.';
|
||||
}
|
||||
|
||||
foreach ($request->txtnorujukanhidden as $index => $x) {
|
||||
$array_gadai = $CallableHttp->get('/api/gadai/norujukan/' . $request->txtkodcawhidden[$index] . '/' . $x)->json();
|
||||
|
||||
if (empty($array_gadai)) {
|
||||
Log::error('norujukan tidak dijumpai.', [
|
||||
'norujukan' => $x,
|
||||
'kodcaw' => $request->txtkodcawhidden[$index],
|
||||
]);
|
||||
|
||||
return 'Sila Pilih Sekali lagi. Dan pastikan salah satu sahaja dipilih untuk ruangan PKB dan KOPKB.';
|
||||
}
|
||||
|
||||
$array_gadai = $array_gadai[0];
|
||||
if (in_array($array_gadai['sttebus'], ['T', 'L'])) {
|
||||
Log::error('Norujukan sudah ditebus.', [
|
||||
'norujukan' => $x,
|
||||
'kodcaw' => $request->txtkodcawhidden[$index],
|
||||
]);
|
||||
return 'Norujukan' . $x . ' sudah ditebus.';
|
||||
}else{
|
||||
$payment = (float) $request->txtbayaranhidden[$index];
|
||||
$remain_loan = (float) $array_gadai['bakipjm'];
|
||||
$nm = (float) $array_gadai['nilaimarhun'];
|
||||
$profit = 0;
|
||||
|
||||
$jenisKeuntungan = $array_gadai['tagbaru'] == '1' ? 'onepercent' : 'asal';
|
||||
|
||||
$upahTawarruq = $CallableHttp
|
||||
->get('/api/upahtawarruq/' . $array_gadai['kodcaw'] . '/' . $array_gadai['norujukan'], ['jeniskeuntungan' => $jenisKeuntungan])
|
||||
->json();
|
||||
|
||||
if ($jenisKeuntungan == 'onepercent') {
|
||||
$profit = $upahTawarruq['keuntungan'] + $upahTawarruq['ujrah'];
|
||||
}
|
||||
|
||||
if ($jenisKeuntungan == 'asal') {
|
||||
$profit = $upahTawarruq;
|
||||
}
|
||||
|
||||
$item = ($remain_loan - ($nm * 0.1) + $profit);
|
||||
|
||||
if ($payment > $item) {
|
||||
return 'Baki Pembiayaan tidak boleh kurang 10% daripada Nilai Marhun!';
|
||||
} else if ($payment < $profit && $profit !== 0.00) {
|
||||
return 'Bayaran tidak boleh kurang daripada keuntungan semasa!';
|
||||
}
|
||||
else if ($payment == 0.00 && $profit == 0.00) {
|
||||
return 'Bayaran tidak boleh dalam nilai 0.00';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,15 +2,39 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use App\Services\BillplzService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BillplzController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request, BillplzService $billplzService)
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
$billIdArray = json_decode($request->bill_ids);
|
||||
return $billplzService->getBills($billIdArray);
|
||||
|
||||
$billplz_ids = json_decode($request->bill_ids, true);
|
||||
|
||||
$account_own_by_PKB = array_filter($billplz_ids, fn($x) => $x['account_own_by'] == 'PKB');
|
||||
$account_own_by_KOPKB = array_filter($billplz_ids, fn($x) => $x['account_own_by'] == 'KOOP');
|
||||
|
||||
$bill_ids_PKB = array_map(fn($x) => $x['bill_id'], $account_own_by_PKB);
|
||||
$bill_ids_PKB = array_values($bill_ids_PKB);
|
||||
|
||||
$bill_ids_KOPKB = array_map(fn($x) => $x['bill_id'], $account_own_by_KOPKB);
|
||||
$bill_ids_KOPKB = array_values($bill_ids_KOPKB);
|
||||
|
||||
$getBillDetailFromBillplz = function($company_code, $bill_ids) {
|
||||
$billplzService = new BillplzService($company_code);
|
||||
return $billplzService->getBills($bill_ids);
|
||||
};
|
||||
|
||||
$billDetailsKOPKB = $getBillDetailFromBillplz('KOPKB', $bill_ids_KOPKB);
|
||||
$billDetailsPKB = $getBillDetailFromBillplz('PKB', $bill_ids_PKB);
|
||||
|
||||
return [
|
||||
'KOPKB' => $billDetailsKOPKB,
|
||||
'PKB' => $billDetailsPKB,
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,26 +2,41 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use App\Services\BillplzService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BillplzTransactionReviewController extends Controller
|
||||
{
|
||||
public function index(Request $request, BillplzService $billplzService)
|
||||
public function index(Request $request)
|
||||
{
|
||||
$date = $request->date ?? Carbon::now()->toDateString();
|
||||
|
||||
$billplzTransactionReview = $billplzService->getBillplzTransactionReview($date);
|
||||
$companyMapping = [
|
||||
'PKB',
|
||||
'KOPKB',
|
||||
];
|
||||
|
||||
return response()->json($billplzTransactionReview, 200);
|
||||
$billplzTransactionReview = array_map(function($company_code) use($date){
|
||||
$billplzService = new BillplzService($company_code);
|
||||
return $billplzService->getBillplzTransactionReview($date)->toArray();
|
||||
}, $companyMapping);
|
||||
|
||||
return response()->json(array_merge(...$billplzTransactionReview), 200);
|
||||
}
|
||||
|
||||
public function show(Request $request, BillplzService $billplzService)
|
||||
public function show(Request $request)
|
||||
{
|
||||
$date = $request->date ?? Carbon::now()->toDateString();
|
||||
$companyMapping = [
|
||||
'PKB',
|
||||
'KOPKB',
|
||||
];
|
||||
|
||||
$billplzTransactionReview = $billplzService->getBillplzTransactionReviewByBillId($request->bill_id);
|
||||
$billplzTransactionReview = array_map(function($company_code) use($request){
|
||||
$billplzService = new BillplzService($company_code);
|
||||
return $billplzService->getBillplzTransactionReviewByBillId($request->bill_id)->toArray();
|
||||
}, $companyMapping);
|
||||
|
||||
return response()->json($billplzTransactionReview, 200);
|
||||
}
|
||||
|
||||
@@ -30,11 +30,30 @@ class HomeController extends Controller
|
||||
{
|
||||
$homeUrl = route('home');
|
||||
$authUser = Auth::user();
|
||||
$customerInfo = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
|
||||
['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
$responses = Http::pool(fn ($pool) => [
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
]);
|
||||
|
||||
$customer_pkb = $responses[0]->json();
|
||||
$customer_koop = $responses[1]->json();
|
||||
|
||||
$customerLelong = $this->getCustomerInfoLelong($authUser['icno']);
|
||||
|
||||
// ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
$customer_gadai = array_merge(
|
||||
$customer_pkb['gadai'] ?? [],
|
||||
$customer_koop['gadai'] ?? []
|
||||
);
|
||||
|
||||
$customer_lelong = array_merge(
|
||||
$customer_pkb['lelong'] ?? [],
|
||||
$customer_koop['lelong'] ?? []
|
||||
);
|
||||
|
||||
// only get lelong that is harga jualan that is not null or 0
|
||||
$customer_lelong = array_filter($customer_lelong, fn($x) => $x['hargajualan'] != null && $x['hargajualan'] != 0);
|
||||
@@ -49,7 +68,7 @@ class HomeController extends Controller
|
||||
|
||||
$bilangan = sizeof($customer_gadai) + sizeOf($customer_lelong);
|
||||
|
||||
return view('includes.buffer', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'homeUrl'));
|
||||
return view('includes.buffer', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'homeUrl','customerLelong'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,11 +81,31 @@ class HomeController extends Controller
|
||||
$pembiayaan = $this->pembiayaanService->getPembiayaan($request->filter);
|
||||
|
||||
$authUser = Auth::user();
|
||||
$customerInfo = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
|
||||
['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
$responses = Http::pool(fn ($pool) => [
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
|
||||
$pool->withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']]),
|
||||
]);
|
||||
|
||||
$customer_pkb = $responses[0]->json();
|
||||
$customer_koop = $responses[1]->json();
|
||||
|
||||
|
||||
$customerLelong = $this->getCustomerInfoLelong($authUser['icno']);
|
||||
// ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
|
||||
$customer_gadai = array_merge(
|
||||
$customer_pkb['gadai'] ?? [],
|
||||
$customer_koop['gadai'] ?? []
|
||||
);
|
||||
|
||||
$customer_lelong = array_merge(
|
||||
$customer_pkb['lelong'] ?? [],
|
||||
$customer_koop['lelong'] ?? []
|
||||
);
|
||||
|
||||
// only get lelong that is harga jualan that is not null or 0
|
||||
$customer_lelong = array_filter($customer_lelong, fn($x) => $x['hargajualan'] != null && $x['hargajualan'] != 0);
|
||||
@@ -81,6 +120,33 @@ class HomeController extends Controller
|
||||
|
||||
$bilangan = sizeof($customer_gadai) + sizeOf($customer_lelong);
|
||||
|
||||
return view('includes.home', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'pembiayaan'));
|
||||
return view('includes.home', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'pembiayaan','customerLelong'));
|
||||
}
|
||||
|
||||
private function getCustomerInfoLelong($icno){
|
||||
$customerLelong = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info/lelong', ['ic' => $icno])
|
||||
->json();
|
||||
|
||||
$customerLelongKoop = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info/lelong', ['ic' => $icno])
|
||||
->json();
|
||||
|
||||
// Extract data with null safety
|
||||
$bakiLelong = isset($customerLelong['success']) && $customerLelong['success']
|
||||
? ($customerLelong['data']['bakilelong'] ?? 0) : 0;
|
||||
$rugiLelong = isset($customerLelong['success']) && $customerLelong['success']
|
||||
? ($customerLelong['data']['rugilelong'] ?? 0) : 0;
|
||||
|
||||
$bakiKoop = isset($customerLelongKoop['success']) && $customerLelongKoop['success']
|
||||
? ($customerLelongKoop['data']['bakilelong'] ?? 0) : 0;
|
||||
$rugiKoop = isset($customerLelongKoop['success']) && $customerLelongKoop['success']
|
||||
? ($customerLelongKoop['data']['rugilelong'] ?? 0) : 0;
|
||||
|
||||
// Calculate totals
|
||||
$totalBakiLelong = $bakiLelong + $bakiKoop;
|
||||
$totalRugiLelong = $rugiLelong + $rugiKoop;
|
||||
|
||||
return ['rugilelong' => $totalRugiLelong, 'bakilelong' => $totalBakiLelong];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use App\Models\LelongBid;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -30,17 +31,29 @@ class InformationController extends Controller
|
||||
{
|
||||
$auth_user = Auth::User();
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$pembiayaansemasa = [];
|
||||
if(isset($CustomerInfo['gadai']))
|
||||
{
|
||||
$pembiayaansemasa = $CustomerInfo['gadai'];
|
||||
if(isset($customer_pkb['gadai'])){
|
||||
$pembiayaansemasa = array_map(function ($pkb) {
|
||||
$pkb['tag_syarikat'] = CompanyStatus::COM_PKB;
|
||||
return $pkb;
|
||||
}, $customer_pkb['gadai']);
|
||||
}
|
||||
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lelong){
|
||||
if(isset($customer_koop['gadai'])){
|
||||
$array_koop = array_map(function ($koop) {
|
||||
$koop['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
return $koop;
|
||||
}, $customer_koop['gadai']);
|
||||
$pembiayaansemasa = array_merge($pembiayaansemasa,$array_koop);
|
||||
}
|
||||
|
||||
if(isset($customer_pkb['lelong'])){
|
||||
if(sizeof($customer_pkb['lelong']) > 0){
|
||||
foreach($customer_pkb['lelong'] as $index=>$lelong){
|
||||
$customer_pkb['lelong'][$index]['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url') . '/api/portalApi',['norujukan' => $lelong['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
@@ -48,13 +61,35 @@ class InformationController extends Controller
|
||||
}
|
||||
|
||||
if($array_lelong['lelong'] !== null){
|
||||
$CustomerInfo['lelong'][$index] = collect($lelong)->merge($array_lelong['lelong'])->toArray();
|
||||
$array_lelong['lelong']['tag_syarikat'] = CompanyStatus::COM_PKB;
|
||||
$customer_pkb['lelong'][$index] = collect($lelong)->merge($array_lelong['lelong'])->toArray();
|
||||
}
|
||||
}
|
||||
$pembiayaansemasa = collect($pembiayaansemasa)->merge($CustomerInfo['lelong']);
|
||||
$pembiayaansemasa = $pembiayaansemasa->toArray();
|
||||
$pembiayaansemasa = collect($pembiayaansemasa)->merge($customer_pkb['lelong']);
|
||||
$pembiayaansemasa = $pembiayaansemasa->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer_koop['lelong'])){
|
||||
if(sizeof($customer_koop['lelong']) > 0){
|
||||
foreach($customer_koop['lelong'] as $index=>$lelong){
|
||||
$customer_koop['lelong'][$index]['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url_koop') . '/api/portalApi',['norujukan' => $lelong['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($array_lelong['lelong'] !== null){
|
||||
$array_lelong['lelong']['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
$customer_koop['lelong'][$index] = collect($lelong)->merge($array_lelong['lelong'])->toArray();
|
||||
}
|
||||
}
|
||||
$pembiayaansemasa = collect($pembiayaansemasa)->merge($customer_koop['lelong']);
|
||||
$pembiayaansemasa = $pembiayaansemasa->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json($pembiayaansemasa,200);
|
||||
// return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa'));
|
||||
}
|
||||
@@ -63,14 +98,16 @@ class InformationController extends Controller
|
||||
{
|
||||
$auth_user = Auth::User();
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$melebihi6bulan = [];
|
||||
|
||||
if(isset($CustomerInfo['gadai']))
|
||||
if(isset($customer_pkb['gadai']))
|
||||
{
|
||||
foreach($CustomerInfo['gadai'] as $index=>$gadai)
|
||||
foreach($customer_pkb['gadai'] as $index=>$gadai)
|
||||
{
|
||||
$gadai['tag_syarikat'] = CompanyStatus::COM_PKB;
|
||||
if($gadai['tempoh'] >= 6)
|
||||
{
|
||||
array_push($melebihi6bulan,$gadai);
|
||||
@@ -78,6 +115,21 @@ class InformationController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer_koop['gadai']))
|
||||
{
|
||||
foreach($customer_koop['gadai'] as $index=>$gadai)
|
||||
{
|
||||
$gadai['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
|
||||
if($gadai['tempoh'] >= 6)
|
||||
{
|
||||
array_push($melebihi6bulan,$gadai);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json($melebihi6bulan,200);
|
||||
// return view('includes.information.melebihi6bulan',compact('melebihi6bulan'));
|
||||
}
|
||||
@@ -86,12 +138,13 @@ class InformationController extends Controller
|
||||
{
|
||||
$auth_user = Auth::User();
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$lelong = [];
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lel){
|
||||
if(isset($customer_pkb['lelong'])){
|
||||
if(sizeof($customer_pkb['lelong']) > 0){
|
||||
foreach($customer_pkb['lelong'] as $index=>$lel){
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url') . '/api/portalApi',['norujukan' => $lel['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
@@ -99,11 +152,31 @@ class InformationController extends Controller
|
||||
}
|
||||
|
||||
if($array_lelong['lelong'] !== null){
|
||||
$CustomerInfo['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
||||
$array_lelong['lelong']['tag_syarikat'] = CompanyStatus::COM_PKB;
|
||||
$customer_pkb['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
||||
}
|
||||
}
|
||||
$lelong = collect($lelong)->merge($CustomerInfo['lelong']);
|
||||
$lelong = $lelong->toArray();
|
||||
$lelong = collect($lelong)->merge($customer_pkb['lelong']);
|
||||
$lelong = $lelong->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer_koop['lelong'])){
|
||||
if(sizeof($customer_koop['lelong']) > 0){
|
||||
foreach($customer_koop['lelong'] as $index=>$lel){
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url') . '/api/portalApi',['norujukan' => $lel['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($array_lelong['lelong'] !== null){
|
||||
$array_lelong['lelong']['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
$customer_koop['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
||||
}
|
||||
}
|
||||
$lelong = collect($lelong)->merge($customer_koop['lelong']);
|
||||
$lelong = $lelong->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,22 +154,31 @@ class SemakController extends Controller
|
||||
return view('resit.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran'));
|
||||
}
|
||||
|
||||
public function resit($id)
|
||||
public function resit($id,$company)
|
||||
{
|
||||
|
||||
$setapi = $company == 1
|
||||
? config('api.url')
|
||||
: config('api.url_koop');
|
||||
|
||||
$totaltransaction = 0;
|
||||
|
||||
$transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/id/'. $id)->json();
|
||||
$transaction = Http::withOptions(['verify' => config('app.api_verify')])->get($setapi . '/api/transaction/id/'. $id)->json();
|
||||
|
||||
if(sizeof($transaction) != 0)
|
||||
$transaction = $transaction[0];
|
||||
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $transaction['norujukan'])->json();
|
||||
if($transaction['nokp'] != Auth::user()->icno)
|
||||
{
|
||||
return response('not allowed', 403);
|
||||
}
|
||||
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get($setapi . '/api/gadai/norujukan/'. $transaction['norujukan'])->json();
|
||||
|
||||
if(sizeof($gadai) != 0)
|
||||
$gadai = $gadai[0][0];
|
||||
|
||||
$customers_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
$customers_info = Http::withOptions(['verify' => config('app.api_verify')])->get($setapi . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
@@ -16,12 +16,9 @@ class TacController extends Controller
|
||||
$tac = tacportal::where([['icno',$request->icno],['tac_no',$request->tac]])->get()->toArray();
|
||||
|
||||
if($tac){
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/customers/' . $request->icno)->json();
|
||||
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/poskod/' . $CustomerInfo['poskod'])->json();
|
||||
$daerah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/daerah/' . $poskod['koddaerah'])->json();
|
||||
$negeri =Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/negeri/' . $poskod['kodnegeri'])->json();
|
||||
|
||||
return response(['status' => 1, 'customerinfo' => $CustomerInfo,'namadaerah' => $daerah['namadaerah'],'namanegeri' => $negeri['negeri']]);
|
||||
$request->session()->put('registerlog_tac_entered', true);
|
||||
$DetailsCustomer = $this->getCustomerData($request->icno, true);
|
||||
return response(['status' => 1, 'customerinfo' => $DetailsCustomer['customerinfo'],'namadaerah' => $DetailsCustomer['daerah']['namadaerah'],'namanegeri' => $DetailsCustomer['negeri']['negeri']]);
|
||||
}else{
|
||||
return response(['status' => 0]);
|
||||
}
|
||||
@@ -64,7 +61,7 @@ class TacController extends Controller
|
||||
return response(['message' => true]);
|
||||
}
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/customers/' . $request->icno)->json();
|
||||
$CustomerInfo = $this->getCustomerData($request->icno, false);
|
||||
|
||||
if($CustomerInfo)
|
||||
{
|
||||
@@ -98,7 +95,7 @@ class TacController extends Controller
|
||||
}
|
||||
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/customers/' . $request->icno)->json();
|
||||
$CustomerInfo = $this->getCustomerData($request->icno, false);
|
||||
|
||||
if($CustomerInfo)
|
||||
{
|
||||
@@ -175,5 +172,32 @@ class TacController extends Controller
|
||||
return implode('',$num);
|
||||
}
|
||||
|
||||
private function getCustomerData($icno,$details = false){
|
||||
$CustomerInfo_PKB = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/customers/' . $icno)->json();
|
||||
$CustomerInfo_KOOPKB = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/api/customers/' . $icno)->json();
|
||||
|
||||
if($CustomerInfo_KOOPKB){
|
||||
if($details == true){
|
||||
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/poskod/' . $CustomerInfo_KOOPKB['poskod'])->json();
|
||||
$daerah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/daerah/' . $poskod['koddaerah'])->json();
|
||||
$negeri =Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/negeri/' . $poskod['kodnegeri'])->json();
|
||||
return ['customerinfo' => $CustomerInfo_KOOPKB,'poskod' => $poskod,'daerah' => $daerah,'negeri' => $negeri];
|
||||
}
|
||||
$CustomerInfo = $CustomerInfo_KOOPKB;
|
||||
}else if($CustomerInfo_PKB){
|
||||
if($details == true){
|
||||
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') . '/api/poskod/' . $CustomerInfo_PKB['poskod'])->json();
|
||||
$daerah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/api/daerah/' . $poskod['koddaerah'])->json();
|
||||
$negeri =Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/api/negeri/' . $poskod['kodnegeri'])->json();
|
||||
return ['customerinfo' => $CustomerInfo_PKB,'poskod' => $poskod,'daerah' => $daerah,'negeri' => $negeri];
|
||||
}
|
||||
$CustomerInfo = $CustomerInfo_PKB;
|
||||
}else{
|
||||
$CustomerInfo = null;
|
||||
}
|
||||
|
||||
return $CustomerInfo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
@@ -62,5 +63,8 @@ class Kernel extends HttpKernel
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'logauth' => \App\Http\Middleware\LogViewerPassword::class,
|
||||
'registerauth' => \App\Http\Middleware\RegisterLog::class,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LogViewerPassword
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$isAuthenticated = $request->session()->get('logviewer_authenticated');
|
||||
$authenticatedAt = $request->session()->get('logviewer_authenticated_at');
|
||||
|
||||
if (!$isAuthenticated) {
|
||||
return redirect()->route('log-login');
|
||||
}
|
||||
|
||||
if(now()->diffInMinutes($authenticatedAt) > env('LOGVIEWER_SESSION_MINUTES', 10)) {
|
||||
$request->session()->forget(['logviewer_authenticated', 'logviewer_authenticated_at']);
|
||||
return redirect()->route('log-login')->with('error', 'Session expired. Please log in again.');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RegisterLog
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$isEntered = $request->all();
|
||||
$isAuthenticated = $request->session()->pull('registerlog_tac_entered');
|
||||
|
||||
$sizeofData = count($isEntered);
|
||||
|
||||
if($isAuthenticated == false || $sizeofData == 0) {
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
use Illuminate\Session\TokenMismatchException;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
@@ -11,7 +12,19 @@ class VerifyCsrfToken extends Middleware
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
|
||||
protected $except = [
|
||||
'/pembayaran/backend'
|
||||
];
|
||||
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
try {
|
||||
return parent::handle($request, $next);
|
||||
} catch (TokenMismatchException $e) {
|
||||
// Redirect to login page if CSRF token is invalid
|
||||
return redirect()->route('login')->with('logsemula', 'Sesi anda telah tamat. Sila log masuk semula.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Http\Controllers\InformationController;
|
||||
use App\Models\CompanyStatus;
|
||||
use App\Rules\PaymentRules\CawanganPermitUjrahPayment;
|
||||
use App\Rules\PaymentRules\NorujukanBukanFasa2;
|
||||
use App\Rules\PaymentRules\NorujukanContractNotExceed12Month;
|
||||
@@ -53,9 +54,33 @@ class PaymentRequest extends FormRequest
|
||||
|
||||
public function getPembiayaanFromNorujukan()
|
||||
{
|
||||
$norujukanList = json_decode($this->totalSagInCartInput);
|
||||
if(null !== $this->input('redirect_trolley') && $this->input('redirect_trolley') == 'trolley'){
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_map(fn($x) => Http::arrahn()->get('/api/gadai/norujukan/' . $x)->json()[0][0], $norujukanList);
|
||||
$norujukanList = json_decode($this->totalSagInCartInput);
|
||||
$syarikatList = json_decode($this->listSyarikatinCartInput);
|
||||
|
||||
$filterByStatus = function ($status) use ($norujukanList, $syarikatList) {
|
||||
return array_filter(
|
||||
array_map(function ($sag, $index) use ($syarikatList, $status) {
|
||||
if (isset($syarikatList[$index]) && $syarikatList[$index] == $status) {
|
||||
$HttpRequest = $status == CompanyStatus::COM_PKB ? Http::arrahn() : Http::arrahn_koop();
|
||||
$array_temp = $HttpRequest->get('/api/gadai/norujukan/' . $sag)->json()[0][0] ?? null;
|
||||
$array_temp['tag_syarikat'] = $status;
|
||||
return $array_temp;
|
||||
}
|
||||
return null;
|
||||
}, $norujukanList, array_keys($norujukanList))
|
||||
);
|
||||
};
|
||||
|
||||
$list_pkb = $filterByStatus(CompanyStatus::COM_PKB);
|
||||
$list_koop = $filterByStatus(CompanyStatus::COM_KOOPPKB);
|
||||
|
||||
$array_merged_list = array_merge($list_pkb,$list_koop);
|
||||
return $array_merged_list;
|
||||
// return array_map(fn($x) => Http::arrahn()->get('/api/gadai/norujukan/' . $x)->json()[0][0], $norujukanList);
|
||||
}
|
||||
|
||||
public function getPembiayaanAkanDilelong()
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CompanyStatus extends Model
|
||||
{
|
||||
const COM_PKB = 1;
|
||||
const COM_KOOPPKB = 2;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PersonalCarts extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'personal_carts';
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $casts = [
|
||||
'list_pkb' => 'array',
|
||||
'list_koop' => 'array',
|
||||
];
|
||||
|
||||
protected $guarded = [
|
||||
'id',
|
||||
'ic_no',
|
||||
'list_pkb',
|
||||
'list_koop',
|
||||
'status_pkb',
|
||||
'status_koop',
|
||||
'payment_pkb',
|
||||
'payment_koop',
|
||||
'user_id',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
];
|
||||
|
||||
public $timestamps = true;
|
||||
}
|
||||
@@ -29,10 +29,20 @@ class AppServiceProvider extends ServiceProvider
|
||||
return Http::withOptions(['verify' => config('app.api_verify')])->baseUrl(config('api.url'));
|
||||
});
|
||||
|
||||
Http::macro('arrahn_koop', function () {
|
||||
return Http::withOptions(['verify' => config('app.api_verify')])->baseUrl(config('api.url_koop'));
|
||||
});
|
||||
|
||||
PendingRequest::macro('arrahn', function () {
|
||||
$this->options['verify'] = config('app.api_verify');
|
||||
$this->baseUrl(config('api.url'));
|
||||
return $this;
|
||||
});
|
||||
|
||||
PendingRequest::macro('arrahn_koop', function () {
|
||||
$this->options['verify'] = config('app.api_verify');
|
||||
$this->baseUrl(config('api.url_koop'));
|
||||
return $this;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class NorujukanTidakAkanDilelong implements Rule
|
||||
$tarikhLelong = Carbon::parse($x->t_lelong);
|
||||
$currentDate = Carbon::now();
|
||||
|
||||
if ($currentDate->gte($tarikhLelong->subDays(3))) {
|
||||
if ($currentDate->gte($tarikhLelong->subDays(2))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use Illuminate\Http\Client\Pool;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -14,17 +15,21 @@ class BayaranHistoryService
|
||||
$this->norujukan = $norujukan;
|
||||
}
|
||||
|
||||
public function getBayaranHistory()
|
||||
public function getBayaranHistory($tagsyarikat)
|
||||
{
|
||||
$bayaranHistory = Http::arrahn()->get('/api/transaction/'. $this->norujukan)->json();
|
||||
$CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$formatBayaranHistoryData = function ($x) {
|
||||
$bayaranHistory = $CallableHttp->get('/api/transaction/'. $this->norujukan)->json();
|
||||
|
||||
$formatBayaranHistoryData = function ($x) use($tagsyarikat) {
|
||||
if (sizeof($x) === 0) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$formatDate = fn($x) => Carbon::parse($x)->format('d/m/Y');
|
||||
$setResitAnsuranLink = fn($x) => route("resit.ansuran", $x);
|
||||
$setResitAnsuranLink = fn($x) => route("resit.ansuran", ['id' => $x, 'company' => $tagsyarikat]);
|
||||
|
||||
return array_map(function ($y) use ($formatDate, $setResitAnsuranLink) {
|
||||
$y['created_at'] = $formatDate($y['created_at']);
|
||||
|
||||
+127
-24
@@ -6,6 +6,8 @@ use App\Models\TransactionOnlineStatus;
|
||||
use Billplz\Client;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class BillplzService
|
||||
{
|
||||
@@ -14,24 +16,14 @@ class BillplzService
|
||||
public $callbackUrl;
|
||||
public $paymentTitle;
|
||||
public $redirectUrl;
|
||||
public $company;
|
||||
|
||||
public function __construct()
|
||||
public function __construct(string $company)
|
||||
{
|
||||
$appEnvironment = config('app.env');
|
||||
$billplzConfig = $appEnvironment == 'production' ? config('services.billplz.production') : config('services.billplz.sandbox');
|
||||
|
||||
$client = Client::make($billplzConfig['api_key'], $billplzConfig['x_signature']);
|
||||
$client->useVersion('v4');
|
||||
|
||||
if ($appEnvironment != 'production') {
|
||||
$client->useSandbox();
|
||||
}
|
||||
|
||||
$this->callbackUrl = route('pay.callback');
|
||||
$this->redirectUrl = ['redirect_url' => route('pay.paymentStatus')];
|
||||
$this->paymentTitle = "Pembayaran Ansuran";
|
||||
$this->config = $billplzConfig;
|
||||
$this->client = $client;
|
||||
$this->company = $company;
|
||||
$this->setupBillplzClient($company);
|
||||
$this->setupUrls();
|
||||
$this->paymentTitle = config('services.billplz.paymentTitle');
|
||||
}
|
||||
|
||||
public function getCollections()
|
||||
@@ -39,8 +31,9 @@ class BillplzService
|
||||
return $this->client->collection()->all()->toArray();
|
||||
}
|
||||
|
||||
public function createBill(array $data)
|
||||
public function createBill(array $data,string $company)
|
||||
{
|
||||
|
||||
$composed_data = [
|
||||
$this->config['collection_id'],
|
||||
...$data,
|
||||
@@ -94,6 +87,8 @@ class BillplzService
|
||||
|
||||
public function webhook($request)
|
||||
{
|
||||
// $this->setCompany(Session::get('company'));
|
||||
// $this->setupBillplzClient($this->company);
|
||||
try {
|
||||
$response = $this->client->webhook($request);
|
||||
|
||||
@@ -114,7 +109,14 @@ class BillplzService
|
||||
$billplzID = collect($arrahnTransactions)->pluck('billplz_id')->unique()->values();
|
||||
|
||||
$billplzTransactions = collect($billplzID)->map(function ($billId) {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
try {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
->filter(function ($transaction) {
|
||||
return $transaction !== [];
|
||||
})
|
||||
->map(function ($data) {
|
||||
$latestTransaction = reset($data['transactions']) == false ? [] : reset($data['transactions']);
|
||||
@@ -131,7 +133,14 @@ class BillplzService
|
||||
$billplzID = collect([$billId]);
|
||||
|
||||
$billplzTransactions = collect($billplzID)->map(function ($billId) {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
try {
|
||||
return $this->client->transaction()->get($billId)->toArray();
|
||||
} catch (\Exception $e) {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
->filter(function ($transaction) {
|
||||
return $transaction !== [];
|
||||
})
|
||||
->map(function ($data) {
|
||||
$latestTransaction = reset($data['transactions']) == false ? [] : reset($data['transactions']);
|
||||
@@ -145,13 +154,21 @@ class BillplzService
|
||||
|
||||
public function getArrahnTransactions($queryData)
|
||||
{
|
||||
$query_all = [];
|
||||
|
||||
if(isset($queryData['date'])){
|
||||
return Http::arrahn()->get('/api/transaction/online/query', ['date' => $queryData['date']])->json();
|
||||
$pkb_query = Http::arrahn()->get('/api/transaction/online/query', ['date' => $queryData['date']])->json();
|
||||
$koop_query = Http::arrahn_koop()->get('/api/transaction/online/query', ['date' => $queryData['date']])->json();
|
||||
$query_all = array_merge($pkb_query,$koop_query);
|
||||
}
|
||||
|
||||
if(isset($queryData['billId'])){
|
||||
return Http::arrahn()->get('/api/transaction/online/query', ['billId' => $queryData['billId']])->json();
|
||||
$pkb_query = Http::arrahn()->get('/api/transaction/online/query', ['billId' => $queryData['billId']])->json();
|
||||
$koop_query = Http::arrahn_koop()->get('/api/transaction/online/query', ['billId' => $queryData['billId']])->json();
|
||||
$query_all = array_merge($pkb_query,$koop_query);
|
||||
}
|
||||
|
||||
return $query_all;
|
||||
}
|
||||
|
||||
public function getBillplzTransactionReview($date)
|
||||
@@ -194,6 +211,15 @@ class BillplzService
|
||||
return $data;
|
||||
});
|
||||
|
||||
|
||||
$summarizedBillplzTransactions = $summarizedBillplzTransactions
|
||||
->filter(function($x){
|
||||
return $x['billplz_latest_transaction'] !== null;
|
||||
})
|
||||
->filter(function($x){
|
||||
return array_key_exists('completed_at', $x['billplz_latest_transaction']);
|
||||
});
|
||||
|
||||
return $summarizedBillplzTransactions;
|
||||
}
|
||||
|
||||
@@ -237,10 +263,24 @@ class BillplzService
|
||||
return $summarizedBillplzTransactions;
|
||||
}
|
||||
|
||||
public function getTransactionByBillId($billId)
|
||||
public function getTransactionByBillId($billId,$company)
|
||||
{
|
||||
$appEnvironment = config('app.env');
|
||||
|
||||
$billplzEnvironments = [
|
||||
'PKB' => ($appEnvironment === 'production') ? config('services.billplz.production') : config('services.billplz.sandbox'),
|
||||
'KOPKB' => ($appEnvironment === 'production') ? config('services.billplz.production_kopkb') : config('services.billplz.sandbox_kopkb'),
|
||||
];
|
||||
|
||||
$billplzConfig = $appEnvironment === 'production'
|
||||
? ($billplzEnvironments[$company] ?? config('services.billplz.production'))
|
||||
: ($billplzEnvironments[$company] ?? config('services.billplz.sandbox'));
|
||||
|
||||
$client = Client::make($billplzConfig['api_key'], ($this->isBase64($billplzConfig['x_signature'])) ? $billplzConfig['x_signature'] : base64_encode($billplzConfig['x_signature']));
|
||||
$client->useVersion('v4');
|
||||
|
||||
try {
|
||||
return $this->client->bill()->transaction($billId)->toArray();
|
||||
return $client->bill()->transaction($billId)->toArray();
|
||||
} catch (\Throwable $th) {
|
||||
logger()->error('Error when querying billplz id : ' . $billId);
|
||||
logger()->error($th->getMessage());
|
||||
@@ -250,6 +290,69 @@ class BillplzService
|
||||
|
||||
public function getBills($billIds)
|
||||
{
|
||||
return array_map(fn($x) => $this->client->bill()->get($x)->toArray(), $billIds);
|
||||
return array_map(function($x){
|
||||
try{
|
||||
return $this->client->bill()->get($x)->toArray();
|
||||
}catch(\Exception $e){
|
||||
return [];
|
||||
}
|
||||
}, $billIds);
|
||||
}
|
||||
|
||||
protected function setupBillplzClient($company)
|
||||
{
|
||||
$appEnvironment = config('app.env');
|
||||
|
||||
$billplzEnvironments = [
|
||||
'PKB' => ($appEnvironment === 'production') ? config('services.billplz.production') : config('services.billplz.sandbox'),
|
||||
'KOPKB' => ($appEnvironment === 'production') ? config('services.billplz.production_kopkb') : config('services.billplz.sandbox_kopkb'),
|
||||
];
|
||||
|
||||
$billplzConfig = $appEnvironment === 'production'
|
||||
? ($billplzEnvironments[$company] ?? config('services.billplz.production'))
|
||||
: ($billplzEnvironments[$company] ?? config('services.billplz.sandbox'));
|
||||
|
||||
$client = Client::make($billplzConfig['api_key'], ($this->isBase64($billplzConfig['x_signature'])) ? $billplzConfig['x_signature'] : base64_encode($billplzConfig['x_signature']));
|
||||
$client->useVersion('v4');
|
||||
|
||||
if ($appEnvironment !== 'production') {
|
||||
$client->useSandbox();
|
||||
}
|
||||
|
||||
$this->config = $billplzConfig;
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
protected function setupUrls()
|
||||
{
|
||||
$this->callbackUrl = route('pay.callback');
|
||||
$this->redirectUrl = ['redirect_url' => route('pay.paymentStatus')];
|
||||
}
|
||||
|
||||
protected function isBase64($string) {
|
||||
if($this->isBase64UrlSafe($string)){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (preg_match('/^[A-Za-z0-9+\/=]+$/', $string)) {
|
||||
return base64_encode(base64_decode($string, true)) === $string;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function isBase64UrlSafe($string) {
|
||||
// Convert URL-safe Base64 to standard Base64
|
||||
$standardBase64 = str_replace(['-', '_'], ['+', '/'], $string);
|
||||
|
||||
// Add padding if necessary
|
||||
$remainder = strlen($standardBase64) % 4;
|
||||
if ($remainder > 0) {
|
||||
$standardBase64 .= str_repeat('=', 4 - $remainder);
|
||||
}
|
||||
|
||||
// Attempt to decode the string
|
||||
$decoded = base64_decode($standardBase64, true);
|
||||
|
||||
return $decoded !== false; // Return true if it successfully decodes
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class MarhunService
|
||||
@@ -12,14 +13,18 @@ class MarhunService
|
||||
$this->norujukan = $norujukan;
|
||||
}
|
||||
|
||||
public function getMarhunDetails()
|
||||
public function getMarhunDetails($tagsyarikat)
|
||||
{
|
||||
$getMarhunDetails = function ($x) {
|
||||
return Http::arrahn()->get('/api/marhun/' . $x)->json();
|
||||
$CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$getMarhunDetails = function ($x) use($CallableHttp) {
|
||||
return $CallableHttp->get('/api/marhun/' . $x)->json();
|
||||
};
|
||||
|
||||
$getMarhunTypeFullName = function ($code) {
|
||||
return Http::arrahn()->get('/api/jemas/nama_marhun', ['marhun' => $code['marhun']])->json()['descpt'];
|
||||
$getMarhunTypeFullName = function ($code) use($CallableHttp) {
|
||||
return $CallableHttp->get('/api/jemas/nama_marhun', ['marhun' => $code['marhun']])->json()['descpt'];
|
||||
};
|
||||
|
||||
$formatMarhunDetailData = function ($x) use($getMarhunTypeFullName) {
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Http\Controllers\InformationController;
|
||||
use App\Models\CompanyStatus;
|
||||
use Illuminate\Http\Client\Pool;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PembiayaanService
|
||||
{
|
||||
@@ -23,6 +25,9 @@ class PembiayaanService
|
||||
}
|
||||
|
||||
$pembiayaan = array_filter($getPembiayaan(), fn($x) => $x->hargajualan != null || $x->hargajualan != 0);
|
||||
// $pembiayaan_filter = array_filter($getPembiayaan(),fn($x) => $x->tag_syarikat == CompanyStatus::COM_PKB);
|
||||
// $pembiayaan_koop = array_filter($getPembiayaan(),fn($x) => $x->tag_syarikat == CompanyStatus::COM_PKB);
|
||||
|
||||
$pembiayaan = $this->setUpahTawarruq($pembiayaan);
|
||||
$pembiayaan = $this->formatPembiayaanData($pembiayaan);
|
||||
$pembiayaan = $this->checkPembiayaanPaymentDisabled($pembiayaan);
|
||||
@@ -44,7 +49,12 @@ class PembiayaanService
|
||||
|
||||
$getUpahTawarruqPerPembiayaan = function ($x) use ($getJenisKeuntungan) {
|
||||
$jenisKeuntungan = $getJenisKeuntungan($x);
|
||||
$upahTawarruq = Http::arrahn()->get('/api/upahtawarruq/' . $x->kodcaw . '/' . $x->norujukan, ['jeniskeuntungan' => $jenisKeuntungan])->json();
|
||||
|
||||
$CallableHttp = $x->tag_syarikat == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$upahTawarruq = $CallableHttp->get('/api/upahtawarruq/' . $x->kodcaw . '/' . $x->norujukan, ['jeniskeuntungan' => $jenisKeuntungan])->json();
|
||||
|
||||
if ($jenisKeuntungan == 'onepercent') {
|
||||
$x->upah_tawarruq = $upahTawarruq['keuntungan'] + $upahTawarruq['ujrah'];
|
||||
@@ -62,7 +72,10 @@ class PembiayaanService
|
||||
|
||||
private function formatPembiayaanData($pembiayaan)
|
||||
{
|
||||
$allCawangan = Http::arrahn()->get('/api/cawangan')->json();
|
||||
$arrahnCawangan = Http::arrahn()->get('/api/cawangan')->json();
|
||||
$arrahnKoopCawangan = Http::arrahn_koop()->get('/api/cawangan')->json();
|
||||
|
||||
$allCawangan = array_merge($arrahnCawangan, $arrahnKoopCawangan);
|
||||
|
||||
$setCawanganFullName = function ($pembiayaan) use ($allCawangan) {
|
||||
$cawangan = array_filter($allCawangan, fn($x) => $x['kodcaw'] === $pembiayaan->kodcaw);
|
||||
@@ -100,36 +113,51 @@ class PembiayaanService
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
public function getMarhunModalData($norujukan)
|
||||
public function getMarhunModalData($norujukan,$tagsyarikat)
|
||||
{
|
||||
|
||||
$gadaianDetails = Http::arrahn()->get('/api/gadai/norujukan/' . $norujukan)->json()[0][0];
|
||||
try{
|
||||
$CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$attachCawanganName = function ($x) use ($gadaianDetails) {
|
||||
$x['cawangan_name'] = Http::arrahn()->get('/api/cawangan/detail/' . $gadaianDetails['kodcaw'])->json()[0]['cawangan'];
|
||||
return $x;
|
||||
};
|
||||
$gadaianDetails = $CallableHttp->get('/api/gadai/norujukan/' . $norujukan)->json()[0][0];
|
||||
|
||||
$gadaianDetails = $attachCawanganName($gadaianDetails);
|
||||
$attachCawanganName = function ($x) use ($gadaianDetails,$CallableHttp) {
|
||||
$x['cawangan_name'] = $CallableHttp->get('/api/cawangan/detail/' . $gadaianDetails['kodcaw'])->json()[0]['cawangan'];
|
||||
return $x;
|
||||
};
|
||||
|
||||
$marhunDetails = MarhunService::from($norujukan)->getMarhunDetails();
|
||||
$gadaianDetails = $attachCawanganName($gadaianDetails);
|
||||
|
||||
$bayaranHistoryDetails = BayaranHistoryService::from($norujukan)->getBayaranHistory();
|
||||
$marhunDetails = MarhunService::from($norujukan)->getMarhunDetails($tagsyarikat);
|
||||
|
||||
$bayaranHistoryDetails = BayaranHistoryService::from($norujukan)->getBayaranHistory($tagsyarikat);
|
||||
|
||||
|
||||
return [
|
||||
'gadaianDetails' => $gadaianDetails,
|
||||
'marhunDetails' => $marhunDetails,
|
||||
'bayaranHistoryDetails' => $bayaranHistoryDetails,
|
||||
];
|
||||
return [
|
||||
'gadaianDetails' => $gadaianDetails,
|
||||
'marhunDetails' => $marhunDetails,
|
||||
'bayaranHistoryDetails' => $bayaranHistoryDetails,
|
||||
];
|
||||
}catch(\Exception $e){
|
||||
Log::debug('norujukan:' . $norujukan);
|
||||
Log::debug('tagsyarikat:' . $tagsyarikat);
|
||||
Log::debug('error message:' . $e->getMessage());
|
||||
return [
|
||||
'gadaianDetails' => [],
|
||||
'marhunDetails' => [],
|
||||
'bayaranHistoryDetails' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
private function getNorujukanRecentlyAttemptPayment($norujukanList)
|
||||
{
|
||||
$getRecentlyAttemptPayment = function () use ($norujukanList) {
|
||||
return Http::pool(function (Pool $pool) use ($norujukanList) {
|
||||
foreach ($norujukanList as $norujukan) {
|
||||
$pool->get(config('api.url') . '/portal/searchsagonline/', ['norujukan' => $norujukan]);
|
||||
foreach ($norujukanList as $list) {
|
||||
$pool->get(($list['tag_syarikat'] == CompanyStatus::COM_PKB ? config('api.url') : config('api.url_koop')) . '/portal/searchsagonline/', ['norujukan' => $list['norujukan']]);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -151,17 +179,20 @@ class PembiayaanService
|
||||
|
||||
private function checkPembiayaanPaymentDisabled($pembiayaan)
|
||||
{
|
||||
$norujukanList = array_map(fn($x) => $x->norujukan, $pembiayaan);
|
||||
$norujukanList = array_map(fn($x) => [
|
||||
'tag_syarikat' => $x->tag_syarikat,
|
||||
'norujukan' => $x->norujukan,
|
||||
], $pembiayaan);
|
||||
|
||||
$norujukanRecentlyAttemptPayment = $this->getNorujukanRecentlyAttemptPayment($norujukanList);
|
||||
|
||||
$getPembiayaanAkanDilelong = fn() => (new InformationController())->pembiayaanakandilelong()->getData();
|
||||
|
||||
$isCurrentDateGreaterThanEqual3DaysBeforeLelong = function ($x) {
|
||||
$isCurrentDateGreaterThanEqual2DaysBeforeLelong = function ($x) {
|
||||
$tarikhLelong = Carbon::parse($x->t_lelong);
|
||||
$currentDate = Carbon::now();
|
||||
|
||||
if ($currentDate->gte($tarikhLelong->subDays(3))) {
|
||||
if ($currentDate->gte($tarikhLelong->subDays(2))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -169,7 +200,7 @@ class PembiayaanService
|
||||
|
||||
};
|
||||
|
||||
$pembiayaanAkanDilelong = array_filter($getPembiayaanAkanDilelong(), $isCurrentDateGreaterThanEqual3DaysBeforeLelong);
|
||||
$pembiayaanAkanDilelong = array_filter($getPembiayaanAkanDilelong(), $isCurrentDateGreaterThanEqual2DaysBeforeLelong);
|
||||
|
||||
$norujukanAkanDilelong = array_map(fn($x) => $x->norujukan, $pembiayaanAkanDilelong);
|
||||
|
||||
@@ -189,6 +220,7 @@ class PembiayaanService
|
||||
$kodCawanganBranchesNotPermitPaymentUjrah = array_map(fn($x) => $x['kodcaw'], $branchesNotPermitPaymentUjrah);
|
||||
|
||||
$isNorujukanPaymentRecentlyAttempted = function ($x) use ($norujukanRecentlyAttemptPayment) {
|
||||
$norujukanRecentlyAttemptPayment = array_column($norujukanRecentlyAttemptPayment, 'norujukan');
|
||||
return in_array($x->norujukan, $norujukanRecentlyAttemptPayment);
|
||||
};
|
||||
|
||||
@@ -240,7 +272,15 @@ class PembiayaanService
|
||||
return in_array($x->norujukan, $norujukanExcludeList);
|
||||
};
|
||||
|
||||
return array_map(function ($x) use ($isNorujukanPaymentRecentlyAttempted, $isNorujukanAkanDilelong, $isNorujukanIsInFasa2, $isCawanganNotPermitUjrahPayment, $checkExcludePaymentList) {
|
||||
$isCawanganVersion2 = function ($x){
|
||||
|
||||
if($x->tag_syarikat == 1 && $x->kodcaw != 'KB1'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
return array_map(function ($x) use ($isNorujukanPaymentRecentlyAttempted, $isNorujukanAkanDilelong, $isNorujukanIsInFasa2, $isCawanganNotPermitUjrahPayment, $checkExcludePaymentList,$isCawanganVersion2) {
|
||||
|
||||
$x->disabled_payment = false;
|
||||
|
||||
@@ -250,6 +290,7 @@ class PembiayaanService
|
||||
|| $isNorujukanPaymentRecentlyAttempted($x)
|
||||
|| $isCawanganNotPermitUjrahPayment($x)
|
||||
|| $checkExcludePaymentList($x)
|
||||
|| $isCawanganVersion2($x)
|
||||
) {
|
||||
$x->disabled_payment = true;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.3|^8.0",
|
||||
"barryvdh/laravel-dompdf": "*",
|
||||
"fideloper/proxy": "^4.4",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
@@ -15,6 +16,7 @@
|
||||
"laravel/framework": "^8.40",
|
||||
"laravel/tinker": "^2.5",
|
||||
"laravel/ui": "^3.3",
|
||||
"milon/barcode": "^12.0",
|
||||
"php-http/discovery": "^1.19",
|
||||
"php-http/guzzle7-adapter": "^1.0",
|
||||
"php-http/message": "^1.16",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'url' => env('API_LELONG_URL', 'https://niklah.arrahn.com.my')
|
||||
'url' => env('API_LELONG_URL', 'https://niklah.arrahn.com.my'),
|
||||
'url_koop' => env('API_LELONG_URL_KOOP', 'https://niklah.arrahn.com.my')
|
||||
];
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'url' => env('API_URL'),
|
||||
'url' => env('API_URL', 'https://api2.arrahn.com.my'),
|
||||
'url_koop' => env('API_URL_KOOP', 'https://api3.arrahn.com.my'),
|
||||
];
|
||||
|
||||
@@ -161,6 +161,7 @@ return [
|
||||
Illuminate\Translation\TranslationServiceProvider::class,
|
||||
Illuminate\Validation\ValidationServiceProvider::class,
|
||||
Illuminate\View\ViewServiceProvider::class,
|
||||
Milon\Barcode\BarcodeServiceProvider::class,
|
||||
|
||||
/*
|
||||
* Package Service Providers...
|
||||
@@ -229,9 +230,12 @@ return [
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'DNS1D' => Milon\Barcode\Facades\DNS1DFacade::class,
|
||||
'DNS2D' => Milon\Barcode\Facades\DNS2DFacade::class,
|
||||
|
||||
],
|
||||
|
||||
'api_verify' => env('API_VERIFY',true),
|
||||
|
||||
|
||||
];
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
'default' => env('LOG_CHANNEL', 'daily'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
+13
-2
@@ -31,15 +31,26 @@ return [
|
||||
],
|
||||
|
||||
'billplz' => [
|
||||
'paymentTitle' => 'Pembayaran Ansuran',
|
||||
'production' => [
|
||||
'api_key' => env('BILLPLZ_PRODUCTION_API_KEY', 'f3e82fe1-a422-4660-97f0-65cc59ff6c47'),
|
||||
'x_signature' => env('BILLPLZ_PRODUCTION_X_SIGNATURE', 'S-alZUbzmD2_TF3vmrRqgehQ'),
|
||||
'collection_id' => env('BILLPLZ_SANDBOX_COLLECTION_ID', '5aosv2dg'),
|
||||
'collection_id' => env('BILLPLZ_PRODUCTION_COLLECTION_ID', '5aosv2dg'),
|
||||
],
|
||||
'production_kopkb' => [
|
||||
'api_key' => env('BILLPLZ_PRODUCTION_KOPKB_API_KEY', 'fb81e895-f307-4c9c-b43d-0b55033ee479'),
|
||||
'x_signature' => env('BILLPLZ_PRODUCTION_KOPKB_X_SIGNATURE', 'afdb4035f1fe7f53cfdf3668765235f2714ee2ad6211c287a6ee52d170cb52b9b9e87d795213a9b4ede2de14076cdf2ced351343692194a28b0c23adfe3087bb'),
|
||||
'collection_id' => env('BILLPLZ_PRODUCTION_KOPKB_COLLECTION_ID', '93mzsttm'),
|
||||
],
|
||||
'sandbox' => [
|
||||
'api_key' => env('BILLPLZ_SANDBOX_API_KEY', 'abecfd0c-98d8-4635-abc2-2fcba8c60c11'),
|
||||
'x_signature' => env('BILLPLZ_SANDBOX_X_SIGNATURE', 'S-GWr7z03XjAhqPsFfu_H5nQ'),
|
||||
'collection_id' => env('BILLPLZ_PRODUCTION_COLLECTION_ID', 'z0r4kjhi'),
|
||||
'collection_id' => env('BILLPLZ_SANDBOX_COLLECTION_ID', 'z0r4kjhi'),
|
||||
],
|
||||
'sandbox_kopkb' => [
|
||||
'api_key' => env('BILLPLZ_SANDBOX_KOPKB_API_KEY', '4b9218fd-04fb-4338-a067-982e6730d160'),
|
||||
'x_signature' => env('BILLPLZ_SANDBOX_KOPKB_X_SIGNATURE', '0ac6e5438cf729754bb819860ed7de6d87d79b0d183212bf10581fca39a4c2d992697b605a706118032af37d31a85fed6637ff1233c56e6d2421bc22cca9d710'),
|
||||
'collection_id' => env('BILLPLZ_SANDBOX_KOPKB_COLLECTION_ID', 'uae40muk'),
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCartsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('personal_carts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('ic_no');
|
||||
$table->json('list_pkb');
|
||||
$table->json('list_koop');
|
||||
$table->json('payment_pkb')->nullable();
|
||||
$table->json('payment_koop')->nullable();
|
||||
$table->enum('status_pkb', ['PENDING', 'PAID','NONE']);
|
||||
$table->enum('status_koop', ['PENDING', 'PAID','NONE']);
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('personal_carts');
|
||||
}
|
||||
}
|
||||
Vendored
+2
@@ -1,4 +1,6 @@
|
||||
function loadingbtn(){
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
loader.classList.remove('d-none');
|
||||
$.notifyClose();
|
||||
// $(this).unbind("click");
|
||||
$('#background').css('display', 'block');
|
||||
|
||||
Vendored
+134
@@ -0,0 +1,134 @@
|
||||
// let checked_rad = () =>{
|
||||
function checked_rad(){
|
||||
const radios = document.querySelectorAll('input[name="radpembayaran"]');
|
||||
// let rad_payment = document.getElementById('radpembayaran');
|
||||
let btn_payment = document.getElementById('bayarsbmt');
|
||||
let btn_payment_phone = document.getElementById('bayarsbmt-phone');
|
||||
|
||||
|
||||
if(radios.checked){
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
}else{
|
||||
/* Make default checked */
|
||||
let radpkb = document.getElementById('pkb');
|
||||
let radkopkb = document.getElementById('kopkb');
|
||||
|
||||
if (radpkb && !radpkb.checked) {
|
||||
selected_radiopkb(radpkb);
|
||||
return;
|
||||
}
|
||||
|
||||
if(radkopkb && !radkopkb.checked){
|
||||
selected_radiokopkb(radkopkb);
|
||||
return;
|
||||
}
|
||||
|
||||
btn_payment.disabled = true;
|
||||
btn_payment_phone.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let selected_radiopkb = (radpkb) => {
|
||||
radpkb.setAttribute('checked', 'checked');
|
||||
radpkb.dispatchEvent(new Event('change'));
|
||||
radpkb.focus();
|
||||
}
|
||||
|
||||
let selected_radiokopkb = (radkopkb) => {
|
||||
radkopkb.setAttribute('checked', 'checked');
|
||||
radkopkb.dispatchEvent(new Event('change'));
|
||||
radkopkb.focus();
|
||||
}
|
||||
|
||||
const radios = document.querySelectorAll('input[name="radpembayaran"]');
|
||||
|
||||
radios.forEach((radio) => {
|
||||
radio.addEventListener('change', function () {
|
||||
let btn_payment = document.getElementById('bayarsbmt');
|
||||
let btn_payment_phone = document.getElementById('bayarsbmt-phone');
|
||||
let content1 = document.getElementById('divpkb');
|
||||
let content2 = document.getElementById('divkopkb');
|
||||
let whole_total = document.getElementById('spanjumlah');
|
||||
let whole_total_phone = document.getElementById('spanjumlah-phone');
|
||||
let inputs = document.querySelectorAll(`#div${this.value} input[type="number"]`);
|
||||
let values = Array.from(inputs).map(input => parseFloat(input.value) || 0).reduce((sum,value) => sum + value, 0);
|
||||
|
||||
if (this.checked) {
|
||||
if(this.value == 'kopkb'){
|
||||
let inputsdisabled = document.querySelectorAll(`#divpkb input:not([type="radio"])`);
|
||||
let inputenabled = document.querySelectorAll(`#divkopkb input`);
|
||||
inputsdisabled.forEach(input => {
|
||||
input.disabled = true;
|
||||
});
|
||||
inputenabled.forEach(input =>{
|
||||
input.disabled = false;
|
||||
});
|
||||
content1?.classList.add('blurred');
|
||||
content2?.classList.remove('blurred');
|
||||
|
||||
if(values != 0){
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
|
||||
}else{
|
||||
btn_payment.disabled = true;
|
||||
btn_payment_phone.disabled = true;
|
||||
}
|
||||
whole_total.innerHTML = formatter.format(values + 1);
|
||||
whole_total_phone.innerHTML = formatter.format(values + 1);
|
||||
|
||||
|
||||
}else{
|
||||
let inputsdisabled = document.querySelectorAll(`#divkopkb input:not([type="radio"])`);
|
||||
let inputenabled = document.querySelectorAll(`#divpkb input`);
|
||||
|
||||
inputsdisabled.forEach(input => {
|
||||
input.disabled = true;
|
||||
});
|
||||
inputenabled.forEach(input =>{
|
||||
input.disabled = false;
|
||||
});
|
||||
content2?.classList.add('blurred');
|
||||
content1?.classList.remove('blurred');
|
||||
|
||||
if(values != 0){
|
||||
btn_payment.disabled = false;
|
||||
btn_payment_phone.disabled = false;
|
||||
}else{
|
||||
btn_payment.disabled = true;
|
||||
btn_payment_phone.disabled = true;
|
||||
}
|
||||
whole_total.innerHTML = formatter.format(values + 1);
|
||||
whole_total_phone.innerHTML = formatter.format(values + 1);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
let deleteCarts = () => {
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
if(loader)
|
||||
loader.classList.remove('d-none');
|
||||
|
||||
fetch('/deletecarts', {method: 'GET', headers: {'Content-Type': 'application/json','Accept': 'application/json'}})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('HTTP error ' + response.status);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
if (data) {
|
||||
redirect_home();
|
||||
}
|
||||
})
|
||||
.catch(error => console.error(error));
|
||||
}
|
||||
|
||||
let redirect_home = () => {
|
||||
window.location.href = redirect_home_var;
|
||||
}
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
async function fetchCartCount() {
|
||||
try {
|
||||
const response = await fetch('/showcarts-available', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch cart count');
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
let totalcount = 0;
|
||||
totalcount += (data.status_koop === 'PENDING') ? 1 : 0;
|
||||
totalcount += (data.status_pkb === 'PENDING') ? 1 : 0;
|
||||
const cartCount = totalcount || 0;
|
||||
|
||||
updateCartCount(cartCount);
|
||||
} catch (error) {
|
||||
console.error('Error fetching cart count:', error);
|
||||
updateCartCount(0);
|
||||
}
|
||||
}
|
||||
|
||||
function updateCartCount(itemCount) {
|
||||
const cartCountElement = document.getElementById('cart-count');
|
||||
const ahrefRedirect = document.getElementById('a-redirect');
|
||||
|
||||
if (itemCount > 0) {
|
||||
cartCountElement.textContent = itemCount;
|
||||
cartCountElement.classList.remove('d-none');
|
||||
} else {
|
||||
cartCountElement.textContent = '';
|
||||
cartCountElement.classList.add('d-none');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function redirectTrolley() {
|
||||
const cartCountElement = document.getElementById('cart-count');
|
||||
if(cartCountElement.textContent == 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
let form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = routetrolley;
|
||||
|
||||
let csrfInput = document.createElement('input');
|
||||
csrfInput.type = 'hidden';
|
||||
csrfInput.name = '_token';
|
||||
csrfInput.value = csrftoken;
|
||||
form.appendChild(csrfInput);
|
||||
|
||||
let redirectInput = document.createElement('input');
|
||||
redirectInput.type = 'hidden';
|
||||
redirectInput.name = 'redirect_trolley';
|
||||
redirectInput.value = 'trolley';
|
||||
form.appendChild(redirectInput);
|
||||
document.body.appendChild(form);
|
||||
|
||||
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
loader.classList.remove('d-none');
|
||||
|
||||
form.submit();
|
||||
}
|
||||
|
||||
fetchCartCount();
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
|
||||
<div class="text-center mt-3" style="margin: 0% 10%;">
|
||||
<a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">BAYARAN PANTAS (SPARE)</a href="#">
|
||||
{{-- <a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">BAYARAN PANTAS (SPARE)</a href="#"> --}}
|
||||
</div>
|
||||
<p class="text-sm text-center">
|
||||
<a href="{{ route('auth.registerfirst') }}">Pertama Kali</a>
|
||||
|
||||
@@ -24,8 +24,20 @@
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-xs-6 col-xl-6">
|
||||
<div class="form-group {{ $errors->has('password') ? ' has-danger' : '' }}">
|
||||
<div class="form-group {{ $errors->has('password') ? ' has-danger' : '' }}" style="position: relative;">
|
||||
<input type="password" placeholder="Katalaluan" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" id="login-password" name="password" required aria-required="true">
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('login-password', 'eyeIcon-login-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-login-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" style="display: block;margin-top:-10px !important;" role="alert">
|
||||
@@ -109,5 +121,17 @@
|
||||
slides[slideIndex - 1].style.display = "block";
|
||||
setTimeout(showSlides, 10000); // Change image every 2 seconds
|
||||
}
|
||||
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -45,11 +45,23 @@
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-danger' : '' }}">
|
||||
<div class="input-group input-group-alternative">
|
||||
<div class="input-group input-group-alternative" style="position: relative;">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
|
||||
</div>
|
||||
<input class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="{{ __('Password') }}" type="password" value="secret" required>
|
||||
<input class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" id="password" name="password" placeholder="{{ __('Password') }}" type="password" value="secret" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password', 'eyeIcon-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" style="display: block;" role="alert">
|
||||
@@ -86,4 +98,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -16,8 +16,20 @@
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-6" style="position: relative;">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password', 'eyeIcon-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -46,4 +58,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -117,7 +117,7 @@ Sekiranya wujud di dalam fail 'SPAM', tukar emel kepada 'NOT SPAM' terlebih dahu
|
||||
<button type="submit" class="btn bg-gradient-dark w-100 my-4 mb-2" style="background: #4A4E59;" onclick="showLoading()">Tetap Semula Kata Laluan</button>
|
||||
</div>
|
||||
<div class="text-center mt-3" style="margin: 0% 10%;">
|
||||
<a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">Bayaran Pantas (SPARE)</a href="#">
|
||||
{{-- <a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">Bayaran Pantas (SPARE)</a href="#"> --}}
|
||||
</div>
|
||||
<p class="text-sm text-center">
|
||||
|
||||
|
||||
@@ -19,8 +19,20 @@
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<div class="input-group input-group-outline {{ $errors->has('password') ? ' has-danger' : '' }}">
|
||||
<div class="input-group input-group-outline {{ $errors->has('password') ? ' has-danger' : '' }}" style="position: relative;">
|
||||
<input id="password" onKeyUp="checkPasswordStrength();" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="{{ __('Password') }}" type="password" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password', 'eyeIcon-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -31,11 +43,22 @@
|
||||
<small>{{ __('password strength') }}: <span class="text-muted font-weight-700" id="password-strength-status">none</span></small>
|
||||
</div>
|
||||
|
||||
<div class="input-group input-group-outline my-3">
|
||||
<div class="input-group input-group-outline my-3" style="position: relative;">
|
||||
<div class="input-group input-group-alternative">
|
||||
|
||||
<input class="form-control" placeholder="{{ __('Confirm Password') }}" type="password" name="password_confirmation" required>
|
||||
<input class="form-control" id="password_confirmation" placeholder="{{ __('Confirm Password') }}" type="password" name="password_confirmation" required>
|
||||
</div>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password_confirmation', 'eyeIcon-password_confirmation')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password_confirmation" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
@@ -68,6 +91,18 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
<!-- Control Center for Material UI Kit: parallax effects, scripts for the example pages etc -->
|
||||
<!-- Google Maps Plugin -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script>
|
||||
{{-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script> --}}
|
||||
<!-- <script src="{{ asset('assets/js/material-kit/material-kit.min.js?v=3.0.0') }}" type="text/javascript"></script> -->
|
||||
|
||||
<script>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
|
||||
<div class="text-center mt-3" style="margin: 0% 10%;">
|
||||
<a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">BAYARAN PANTAS (SPARE)</a href="#">
|
||||
{{-- <a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">BAYARAN PANTAS (SPARE)</a href="#"> --}}
|
||||
</div>
|
||||
<p class="text-sm text-center">
|
||||
<a href="{{ route('login') }}">Log Masuk</a>
|
||||
|
||||
@@ -45,11 +45,23 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6 form-group{{ $errors->has('password') ? ' has-danger' : '' }}">
|
||||
<div class="input-group ">
|
||||
<div class="input-group" style="position: relative;">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
|
||||
</div>
|
||||
<input id="password" onKeyUp="checkPasswordStrength();" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ __('Password') }}" type="password" name="password" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password', 'eyeIcon-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" style="display: block;" role="alert">
|
||||
@@ -58,11 +70,23 @@
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-6 form-group">
|
||||
<div class="input-group ">
|
||||
<div class="input-group" style="position: relative;">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
|
||||
</div>
|
||||
<input name="password_confirmation" class="form-control" placeholder="{{ __('Confirm Password') }}" type="password" required>
|
||||
<input name="password_confirmation" id="password_confirmation" class="form-control" placeholder="{{ __('Confirm Password') }}" type="password" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password_confirmation', 'eyeIcon-password_confirmation')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password_confirmation" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -212,6 +236,18 @@
|
||||
setTimeout(showSlides, 10000); // Change image every 2 seconds
|
||||
}
|
||||
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- END : LOGIN PAGE 5-2 -->
|
||||
<!--[if lt IE 9]>
|
||||
|
||||
@@ -31,8 +31,20 @@
|
||||
@endif
|
||||
|
||||
<!-- password -->
|
||||
<div class="input-group input-group-outline {{ $errors->has('password') ? ' has-danger' : '' }}">
|
||||
<div class="input-group input-group-outline {{ $errors->has('password') ? ' has-danger' : '' }}" style="position: relative;">
|
||||
<input id="password" onKeyUp="checkPasswordStrength();" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ __('Kata Laluan') }}" type="password" name="password" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password', 'eyeIcon-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" style="display: block;" role="alert">
|
||||
@@ -44,8 +56,20 @@
|
||||
</div>
|
||||
|
||||
<!-- confirmation password -->
|
||||
<div class="input-group input-group-outline mb-3">
|
||||
<input name="password_confirmation" class="form-control" placeholder="{{ __('Sahkan Kata Laluan') }}" type="password" required>
|
||||
<div class="input-group input-group-outline mb-3" style="position: relative;">
|
||||
<input name="password_confirmation" id="password_confirmation" class="form-control" placeholder="{{ __('Sahkan Kata Laluan') }}" type="password" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility('password_confirmation', 'eyeIcon-password_confirmation')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-password_confirmation" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -178,5 +202,17 @@
|
||||
// slides[slideIndex - 1].style.display = "block";
|
||||
// setTimeout(showSlides, 10000); // Change image every 2 seconds
|
||||
// }
|
||||
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,29 @@
|
||||
@props([
|
||||
'title' => '',
|
||||
'subtitle' => '',
|
||||
'icon' => '',
|
||||
'iconState' => 'info',
|
||||
'cardBackgroundState' => 'white',
|
||||
'link' => '#',
|
||||
])
|
||||
|
||||
<div class="col-xl-3 col-lg-6" >
|
||||
<div class="card card-stats mb-4 mb-xl-0 {{ 'bg-'.$cardBackgroundState}}">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h6 class="card-title text-uppercase mb-0 {{ $cardBackgroundState == 'white' ? 'text-muted' : 'text-white' }}">{{ $title }}</h6>
|
||||
<span class="h5 font-weight-bold mb-0 {{ $cardBackgroundState == 'white' ? 'text-black' : 'text-white' }}">{{ $subtitle }}</span>
|
||||
</div>
|
||||
<div class="col-auto text-center">
|
||||
<a href="{{ $link }}">
|
||||
<div class="icon icon-shape bg-{{ $iconState }} rounded-circle shadow text-center">
|
||||
<i class="{{ $icon }}"></i>
|
||||
</div>
|
||||
</a>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -10,10 +10,90 @@
|
||||
.card-header {
|
||||
padding: 1rem !important;
|
||||
}
|
||||
.blurred {
|
||||
filter: blur(2px); /* Apply a blur effect */
|
||||
opacity: 0.5; /* Slight transparency */
|
||||
/*pointer-events: none; */
|
||||
}
|
||||
|
||||
input[type="number"]::-webkit-outer-spin-button,
|
||||
input[type="number"]::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) { /* Target screens smaller than tablets */
|
||||
.sticky-footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: white; /* Adjust to match your theme */
|
||||
height:100px;
|
||||
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Optional shadow for better visibility */
|
||||
padding: 10px; /* Add some padding for spacing */
|
||||
z-index: 1000; /* Ensure it stays above other content */
|
||||
text-align: center; /* Center align buttons */
|
||||
}
|
||||
|
||||
.sticky-footer .btn {
|
||||
width: 45%; /* Ensure buttons fit well side-by-side */
|
||||
margin: 0 5px; /* Add spacing between buttons */
|
||||
}
|
||||
|
||||
.loader-arrahn {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.loader-arrahn img {
|
||||
width: 100px; /* Image size */
|
||||
}
|
||||
|
||||
.loader-arrahn:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
border-radius: 50%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.overlay-arrahn {
|
||||
position: fixed;
|
||||
z-index: 9998;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
<script>let redirect_home_var="{{ route('buffer') }}";</script>
|
||||
|
||||
<title>Bayar SAG | Portal Pelanggan</title>
|
||||
<div class="container">
|
||||
<div>
|
||||
|
||||
<div id="load-arrahn" class="d-none">
|
||||
<div class="overlay-arrahn"></div>
|
||||
<div class="loader-arrahn text-center">
|
||||
<img src="{{ asset('argon/img/brand/ar-rahn-take-2.gif') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form name="formpayment" method="post" action="{{ route('payment.engine') }}">
|
||||
@csrf
|
||||
@@ -27,46 +107,38 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10 col-sm-12">
|
||||
<div class="d-md-flex">
|
||||
<div class="col-sm-12 col-md-9">
|
||||
@if($list_pkb)
|
||||
<div class="col-md-11 col-sm-12 mb-4" id="divpkb">
|
||||
<div class="card shadow">
|
||||
<div class="card-header mb-4 bg-dark border-0">
|
||||
<div class="card-header mb-4 bg-dark border-0" onclick="document.getElementById('pkb').click()">
|
||||
<div class="row align-items-center">
|
||||
<div class="d-flex">
|
||||
<h4 class="text-white" style="margin-right: 1%;">Pembayaran</h4>
|
||||
<i class="fas fa-clipboard-list fa-2x text-white"></i>
|
||||
<h4 class="text-white" style="margin-right: 1%;">PKB</h4>
|
||||
<div class="ms-auto">
|
||||
<small class="text-white mr-2 font-weight-bold d-none d-md-inline">*sila tick di sini untuk memilih bayaran.</small>
|
||||
<input type="radio" id="pkb" name="radpembayaran" value="pkb" class="ms-auto" style="width: 30px; height: 30px;" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form">
|
||||
<div style="overflow-x: auto;">
|
||||
<table class="table align-items-left" id="selepas_tawarruq" style="width: 100%;">
|
||||
<thead class="thead-light">
|
||||
<!-- <div style="margin-bottom: 15px; text-align: left;">
|
||||
<i class="text-danger" style="font-size:12px;">Klik 'Klik Di Sini' untuk Pilihan Bayaran</i><br>
|
||||
<i class="text-danger" style="font-size:12px;">Amaun Semasa -> Amaun Keuntungan Semasa Sahaja.</i><br>
|
||||
<i class="text-danger" style="font-size:12px;">Amaun Lain -> Amaun Ansuran Pembiayaan & Amaun Keuntungan Semasa, Sila Masukkan Amaun</i>
|
||||
</div> -->
|
||||
<tr style="text-align: center;">
|
||||
<!-- <th width="10%">No</th> -->
|
||||
<th width="10%">No <br>Rujukan</th>
|
||||
<th width="10%">No Rujukan</th>
|
||||
<th width="10%">Tarikh Akhir</th>
|
||||
<th width="10%">Bayaran</th>
|
||||
<th width="10%">Baki <br>Pembiayaan</th>
|
||||
<!-- <th width="10%">Pembiayaan Asal</th>
|
||||
<th width="10%">Tempoh</th> -->
|
||||
|
||||
<th width="10%">Baki Pembiayaan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php $counter = 1;$jenisbayaran = 'tawarruq'; $totalupahasal = 1; $errorcount = 0; @endphp
|
||||
@foreach($arraybayar as $index=>$bayar)
|
||||
@foreach($list_pkb as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] != '')
|
||||
<tbody class="list" style="text-align: center;">
|
||||
<tr>
|
||||
<!-- <td>
|
||||
{{ $counter }}
|
||||
</td> -->
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
@@ -96,38 +168,17 @@
|
||||
}
|
||||
|
||||
@endphp
|
||||
<!-- <td>
|
||||
|
||||
<select name="sltbayaran" value="{{ old('sltbayaran') ? old('sltbayaran') : '' }}" class="form-control mb-2" data-upah="{{ $upahtawarruq }}" data-jenis="tawarruq" style="text-align: center; border: revert;">
|
||||
<option selected disabled></option>
|
||||
<option value="fixed">Amaun Semasa</option>
|
||||
<option value="otheramount">Amaun Lain</option>
|
||||
</select>
|
||||
|
||||
<input type="text" value="{{ old('txtbayarantawarruq') ? old('txtbayarantawarruq') : '' }}" data-bakipjm="{{ $bayar['bakipjm'] }}" data-taglel="{{ $bayar['taglel'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-jenis="tawarruq" name="txtbayarantawarruq" class="form-control txtbayaran" style="text-align: center; border: outset;" />
|
||||
<input type="hidden" name="txtbayaranhidden[]" class="bayaran" style="text-align: center;" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" style="text-align: center;" />
|
||||
</td>-->
|
||||
<td><input name="txtbayarantawarruq" type="number" step="0.01" value="{{ sprintf('%0.2f', $upahtawarruq) }}" class="form-control" style="text-align: center; border: outset;" data-bakipjm="{{ $bayar['bakipjm'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-taglel="{{ $bayar['taglel'] }}">
|
||||
<td><input name="txtbayarantawarruq" type="number" step="0.01" value="{{ sprintf('%0.2f', $upahtawarruq) }}" class="form-control" style="text-align: center; border: outset; -moz-appearance: textfield;-webkit-appearance: none;appearance: none;" data-bakipjm="{{ $bayar['bakipjm'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-taglel="{{ $bayar['taglel'] }}">
|
||||
<input type="hidden" name="txtbayaranhidden[]" value="{{ $upahtawarruq }}" class="bayaran" style="text-align: center;" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtcompany" value="pkb"/>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input style="border: none; text-align: center;" type="text" value="{{ number_format($bayar['bakipjm'],2) }}" class="bakibaru" readonly>
|
||||
</td>
|
||||
|
||||
<!-- <td>
|
||||
{{ number_format($bayar['pinjaman'],2) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $bayar['tempoh'] }}
|
||||
</td> -->
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
@php $counter++; @endphp
|
||||
@@ -138,54 +189,197 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-6">
|
||||
<label style="text-transform: uppercase; text-align: center;"><strong>Fi Pengurusan</strong></label>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<span class="text-primary"><strong>RM<span>1.00</span></strong></span>
|
||||
<span class="text-danger d-none" id="spanamarankosong">*Jangan biarkan kotak bayaran ditinggalkan kosong, Sila masukkan amaun!</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($list_koop)
|
||||
<div class="col-md-11 col-sm-12" id="divkopkb">
|
||||
<div class="card shadow">
|
||||
<div class="card-header mb-4 bg-dark border-0" onclick="document.getElementById('kopkb').click()">
|
||||
<div class="row align-items-center">
|
||||
<div class="d-flex">
|
||||
<h4 class="text-white" style="margin-right: 1%;">KOPKB</h4>
|
||||
<div class="ms-auto">
|
||||
<small class="text-white mr-2 font-weight-bold d-none d-md-inline">*sila tick di sini untuk memilih bayaran.</small>
|
||||
<input type="radio" id="kopkb" name="radpembayaran" value="kopkb" class="ms-auto" style="width: 30px; height: 30px;" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-6">
|
||||
<label style="text-transform: uppercase; text-align: center;"><strong>Jumlah Keseluruhan</strong></label>
|
||||
<div class="form">
|
||||
<div style="overflow-x: auto;">
|
||||
<table class="table align-items-left" id="selepas_tawarruq_koop" style="width: 100%;">
|
||||
<thead class="thead-light">
|
||||
<tr style="text-align: center;">
|
||||
<th width="10%">No <br>Rujukan</th>
|
||||
<th width="10%">Tarikh Akhir</th>
|
||||
<th width="10%">Bayaran</th>
|
||||
<th width="10%">Baki <br>Pembiayaan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php $counter = 1;$jenisbayaran = 'tawarruq'; $totalupahasal = 1; $errorcount = 0; @endphp
|
||||
@foreach($list_koop as $index=>$bayar)
|
||||
@if($bayar['hargajualan'] != '')
|
||||
<tbody class="list" style="text-align: center;">
|
||||
<tr>
|
||||
<td>
|
||||
{{ $bayar['norujukan'] }}
|
||||
</td>
|
||||
@php
|
||||
|
||||
$t_matang = strtotime($bayar['t_matang']);
|
||||
$t_akhir = date("d/m/Y", $t_matang);
|
||||
|
||||
if($bayar['lelong_tawarruq'] == 0)
|
||||
{
|
||||
$t_matang = strtotime($bayar['t_matang1']);
|
||||
$t_akhir = date("d/m/Y", $t_matang);
|
||||
}
|
||||
@endphp
|
||||
<td>
|
||||
{{ $t_akhir }}
|
||||
</td>
|
||||
@php
|
||||
$upahtawarruq = $bayar['upah_tawarruq'];
|
||||
$upahtawarruq = floatval(str_replace(',','',$upahtawarruq));
|
||||
|
||||
$totalupahasal = $totalupahasal + $upahtawarruq;
|
||||
|
||||
|
||||
if(floatval($upahtawarruq) == 0){
|
||||
$errorcount++;
|
||||
}
|
||||
|
||||
@endphp
|
||||
<td><input name="txtbayarantawarruq" type="number" step="0.01" value="{{ sprintf('%0.2f', $upahtawarruq) }}" class="form-control" style="text-align: center; border: outset;" data-bakipjm="{{ $bayar['bakipjm'] }}" data-upah="{{ $upahtawarruq }}" data-nm="{{ $bayar['nilaimarhun'] }}" data-taglel="{{ $bayar['taglel'] }}">
|
||||
<input type="hidden" name="txtbayaranhidden[]" value="{{ $upahtawarruq }}" class="bayaran" style="text-align: center;" />
|
||||
<input type="hidden" name="txtjenisbayaran[]" value="{{ $jenisbayaran }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}" style="text-align: center;" />
|
||||
<input type="hidden" name="txtcompany" value="kopkb"/>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input style="border: none; text-align: center;" type="text" value="{{ number_format($bayar['bakipjm'],2) }}" class="bakibaru" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<span class="text-primary"><strong>RM<span id="spanjumlah">{{ number_format($totalupahasal,2) }}</span></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span class="text-danger d-none" id="spanamarankosong">*Jangan biarkan kotak bayaran ditinggalkan kosong, Sila masukkan amaun!</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
<div class="col-md-10 col-sm-12">
|
||||
</div>
|
||||
<div class="d-none d-sm-none d-md-block col-xl-3">
|
||||
<div class="col-md-12">
|
||||
<div class="card shadow">
|
||||
<div class="form" style="text-align: center;">
|
||||
<div class="card-header mb-4 bg-dark border-0">
|
||||
<div class="row align-items-center">
|
||||
<div class="d-flex">
|
||||
<h4 class="text-white" style="margin-right: 1%;">Pembayaran</h4>
|
||||
<i class="ms-auto fas fa-shopping-cart fa-2x text-white"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-8">
|
||||
<label style="text-transform: uppercase; text-align: center;"><strong>Fi Pengurusan</strong></label>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="text-primary"><strong>RM<span>1.00</span></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row pb-4 font-weight-light">
|
||||
<div class="col-8">
|
||||
<label style="text-transform: uppercase; text-align: center;"><strong>Jumlah Keseluruhan</strong></label>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="text-primary"><strong>RM<span id="spanjumlah">1.00</span></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="d-flex justify-content-between col-12 mt-3 align-self-end"> -->
|
||||
<div class="d-flex justify-content-center col-12 mt-3 align-self-end">
|
||||
<a href="{{ route('home') }}" type="button" class="btn btn-danger">Batal</a>
|
||||
<!-- <button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button> -->
|
||||
@if($totalupahasal == 1.00 || $errorcount > 0)
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
@else
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" onclick="loadingbtn();">Bayar</button>
|
||||
@endif
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<div class="card shadow">
|
||||
<div class="form" style="text-align: center;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="d-flex justify-content-between col-12 mt-3 align-self-end"> -->
|
||||
<div class="d-flex justify-content-center col-12 mt-3 align-self-end">
|
||||
<a onclick="deleteCarts()" type="button" class="cursor-pointer btn btn-danger">Batal</a>
|
||||
<!-- <button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button> -->
|
||||
@if($totalupahasal == 1.00 || $errorcount > 0)
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
@else
|
||||
<button type="submit" id="bayarsbmt" class="btn btn-primary" onclick="loadingbtn();">Bayar</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<small>*sila klik bayar untuk transaksi bayaran berikutnya.</small>
|
||||
<!-- Sticky Footer for Mobile View -->
|
||||
<div class="sticky-footer d-sm-block d-md-none">
|
||||
<div>
|
||||
<div class="d-sm-flex">
|
||||
<div class="font-weight-light small d-flex">
|
||||
<div class="col-3">
|
||||
<label style="text-transform: uppercase; text-align: center;font-size: 10px;"><strong>Fi Pengurusan</strong></label>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<span class="text-primary"><strong>RM<span>1.00</span></strong></span>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<label style="text-transform: uppercase; text-align: center;font-size: 10px;"><strong>Jumlah Keseluruhan</strong></label>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<span class="text-primary"><strong>RM<span id="spanjumlah-phone">1.00</span></strong></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="">
|
||||
<a onclick="deleteCarts()" type="button" class="cursor-pointer btn btn-danger">Batal</a>
|
||||
@if($totalupahasal == 1.00 || $errorcount > 0)
|
||||
<button type="submit" id="bayarsbmt-phone" class="btn btn-primary" disabled onclick="loadingbtn();">Bayar</button>
|
||||
@else
|
||||
<button type="submit" id="bayarsbmt-phone" class="btn btn-primary" onclick="loadingbtn();">Bayar</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script src="{{ asset('js/miscellaneous/cart.js') }}?v={{ filemtime(public_path('js/miscellaneous/cart.js')) }}"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
/*check radio button enabled*/
|
||||
checked_rad();
|
||||
|
||||
$(window).keydown(function(event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
@@ -193,13 +387,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#selepas_tawarruq > tbody > tr').each(function() {
|
||||
$(this).find("td:gt(0)").each(function() {
|
||||
// console.log($(this).html());
|
||||
console.log($("input[name=txtbayarantawarruq]").val());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
@@ -235,6 +422,23 @@
|
||||
"pagingType": "simple",
|
||||
"paging": false
|
||||
|
||||
});
|
||||
|
||||
var selepastawarruq_kooptable = $('#selepas_tawarruq_koop').DataTable({
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
language: {
|
||||
'paginate': {
|
||||
'previous': '<span class="fas fa-backward"></span>',
|
||||
'next': '<span class="fas fa-forward"></span>'
|
||||
}
|
||||
},
|
||||
"scrollX": true,
|
||||
"pageLength": 10,
|
||||
"pagingType": "simple",
|
||||
"paging": false
|
||||
|
||||
});
|
||||
// var selepastawarruqtable = $('#ringkasan_bayaran').DataTable({
|
||||
// "bLengthChange": false,
|
||||
@@ -270,37 +474,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name=txtbayaranarrahn]").change(function(e) {
|
||||
|
||||
let upah = $(this).data('upah');
|
||||
let pinjaman = $(this).data('pinjaman');
|
||||
let jenis = $(this).data('jenis');
|
||||
let nm = $(this).data('nm');
|
||||
let taglel = $(this).data('taglel');
|
||||
|
||||
let bayar = Number(this.value);
|
||||
|
||||
let errorlebih = nm - (nm * 0.1);
|
||||
|
||||
if (bayar > parseFloat(errorlebih)) {
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
Swal.fire(
|
||||
'Amaran!',
|
||||
'Baki Pembiayaan tidak boleh kurang 10% daripada Nilai Marhun',
|
||||
'error'
|
||||
)
|
||||
$(this).val(upah);
|
||||
$(this).closest('tr').find('.bayaran').val(upah);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).closest('tr').find('.bayaran').val(this.value);
|
||||
calculateall(jenis, taglel);
|
||||
|
||||
});
|
||||
|
||||
|
||||
$("input[name=txtbayarantawarruq]").change(function(e) {
|
||||
// $("input[name=txtbayarantawarruq]").click(function(e) {
|
||||
@@ -392,30 +565,43 @@
|
||||
var sumtawarruq = 0;
|
||||
var sum = 0;
|
||||
var counterrorbayar = 0;
|
||||
var selectedRadio = document.querySelector('input[name="radpembayaran"]:checked');
|
||||
|
||||
$('#belum_tawarruq').find('input[name=txtbayaranarrahn]').each(function() {
|
||||
sumarrahn += parseFloat(this.value) || 0;
|
||||
if (!selectedRadio) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
if(selectedRadio.value == 'kopkb'){
|
||||
$('#selepas_tawarruq_koop').find('input[name=txtbayarantawarruq]').each(function(index) {
|
||||
|
||||
});
|
||||
var bayaranselepas = (this.value * 100) / 10;
|
||||
// bayaranselepas = Math.round(bayaranselepas);
|
||||
bayaranselepas = bayaranselepas / 10;
|
||||
|
||||
$('#selepas_tawarruq').find('input[name=txtbayarantawarruq]').each(function(index) {
|
||||
$('#spantransaksi' + (index + 1)).text(formatter.format(bayaranselepas));
|
||||
|
||||
var bayaranselepas = (this.value * 100) / 10;
|
||||
// bayaranselepas = Math.round(bayaranselepas);
|
||||
bayaranselepas = bayaranselepas / 10;
|
||||
sumtawarruq += parseFloat(bayaranselepas) || 0;
|
||||
|
||||
$('#spantransaksi' + (index + 1)).text(formatter.format(bayaranselepas));
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#selepas_tawarruq').find('input[name=txtbayarantawarruq]').each(function(index) {
|
||||
|
||||
sumtawarruq += parseFloat(bayaranselepas) || 0;
|
||||
var bayaranselepas = (this.value * 100) / 10;
|
||||
// bayaranselepas = Math.round(bayaranselepas);
|
||||
bayaranselepas = bayaranselepas / 10;
|
||||
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
});
|
||||
$('#spantransaksi' + (index + 1)).text(formatter.format(bayaranselepas));
|
||||
|
||||
sumtawarruq += parseFloat(bayaranselepas) || 0;
|
||||
|
||||
if (this.value <= 0 || this.value == '') {
|
||||
counterrorbayar++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
sum = sumarrahn + sumtawarruq;
|
||||
sum = (sum * 100) / 10;
|
||||
@@ -425,14 +611,18 @@
|
||||
if (counterrorbayar > 0) {
|
||||
$('#spanamarankosong').removeClass("d-none");
|
||||
$("#bayarsbmt").prop('disabled', true);
|
||||
$("#bayarsbmt-phone").prop('disabled', true);
|
||||
|
||||
} else {
|
||||
$('#spanamarankosong').addClass("d-none");
|
||||
$("#bayarsbmt").prop('disabled', false);
|
||||
$("#bayarsbmt-phone").prop('disabled', false);
|
||||
}
|
||||
|
||||
$("#spanbayaranarrahn").text(sumarrahn.toFixed(2));
|
||||
$("#spanbayarantawarruq").text(sumtawarruq.toFixed(2));
|
||||
$('#spanjumlah').text(formatter.format(sum + 1));
|
||||
$('#spanjumlah-phone').text(formatter.format(sum + 1));
|
||||
}
|
||||
|
||||
if (document.addEventListener) {
|
||||
@@ -450,7 +640,8 @@
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var inputs = document.querySelectorAll('input[name="txtbayarantawarruq"]');
|
||||
|
||||
var inputs = document.querySelectorAll('input[name="txtbayarantawarruq"]:not([disabled])');
|
||||
|
||||
Array.from(inputs).forEach(function(input) {
|
||||
var timer;
|
||||
@@ -458,9 +649,9 @@
|
||||
input.addEventListener('input', function() {
|
||||
|
||||
const stringHasPoint = input.value.indexOf('.') !== -1;
|
||||
const stringHasMoreThanTwoDecimal = input.value.split('.')[1].length > 2;
|
||||
const lastDecimalIsNotZeroOrFive = input.value.split('.')[1].slice(-1) !== '0' && input.value.split('.')[1].slice(-1) !== '5';
|
||||
const stringHasTwoDecimalNumber = input.value.split('.')[1].length === 2;
|
||||
const stringHasMoreThanTwoDecimal = (stringHasPoint) ? input.value.split('.')[1].length > 2 : false;
|
||||
const lastDecimalIsNotZeroOrFive = (stringHasPoint) ? input.value.split('.')[1].slice(-1) !== '0' && input.value.split('.')[1].slice(-1) !== '5' : false;
|
||||
const stringHasTwoDecimalNumber = (stringHasPoint) ? input.value.split('.')[1].length === 2 : false;
|
||||
|
||||
if (stringHasPoint && stringHasMoreThanTwoDecimal) {
|
||||
input.value = input.value.split('.')[0] + '.' + input.value.split('.')[1].substring(0, 2);
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$koskeuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json();
|
||||
$koskeuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'],['jeniskeuntungan' => ($bt['tagbaru'] == 1) ? 'onepercent' : 'asal'])->json();
|
||||
$keuntungan_1bln = $bt['pinjaman'] * ($bt['kadarupah'] / 100);
|
||||
$ten_percent = floatval($bt['nilaimarhun']) * 0.1;
|
||||
$baki_pinjaman = floatval($bt['bakipjm']);
|
||||
@@ -194,7 +194,6 @@
|
||||
let berat = $(e).data('berat');
|
||||
let nm = $(e).data('nm');
|
||||
|
||||
console.log(pinjaman,upah12,bakipjm,berat,nm);
|
||||
|
||||
$('#pembiayaan').text('RM ' + pinjaman);
|
||||
$('#bpembiayaan').text('RM ' + bakipjm);
|
||||
|
||||
@@ -151,6 +151,16 @@
|
||||
</script>
|
||||
@enderror
|
||||
|
||||
@if (session('errorvalidate'))
|
||||
<script>
|
||||
Swal.fire(
|
||||
"Pembayaran Gagal.",
|
||||
"{{ session('errorvalidate') }}",
|
||||
'error'
|
||||
)
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if (\Session::has('error'))
|
||||
<script>
|
||||
Swal.fire(
|
||||
|
||||
@@ -693,7 +693,6 @@ var hargaemastable = $('#harga_emas').DataTable({
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
namacawangan = data[0].namacaw;
|
||||
console.log(namacawangan);
|
||||
namacawangan = namacawangan.toLowerCase().substring(8).replace(/\b[a-z]/g, function(value) {
|
||||
return value.toUpperCase();
|
||||
});
|
||||
@@ -835,7 +834,6 @@ var hargaemastable = $('#harga_emas').DataTable({
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
for(i in data){
|
||||
datalelong.push(data[i]);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,57 @@
|
||||
@section('content')
|
||||
<title>Home | Portal Pelanggan</title>
|
||||
|
||||
<style>
|
||||
@keyframes marquee {
|
||||
0% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.marquee-div-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 9999;
|
||||
background: linear-gradient(90deg, #dc3545, #fd7e14);
|
||||
padding: 10px 0;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.marquee-text-display {
|
||||
display: inline-block;
|
||||
padding-left: 100%;
|
||||
animation: marquee 30s linear infinite;
|
||||
color: white;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* Add padding to body to prevent content from hiding under marquee */
|
||||
body {
|
||||
padding-top: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="marquee-div-container">
|
||||
<div class="marquee-container" style="overflow: hidden; white-space: nowrap;">
|
||||
<div class="marquee-text marquee-text-display">
|
||||
⚠️ Tuan/Puan diminta hadir ke cawangan Ar-Rahn bagi pembayaran keuntungan SAG terpilih kerana transaksi tidak dapat dilakukan melalui ArRahnPay buat sementara waktu susulan kerja penaiktarafan sistem ⚠️
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="load-arrahn" class="d-none">
|
||||
<div class="overlay-arrahn"></div>
|
||||
<div class="loader-arrahn text-center">
|
||||
<img src="{{ asset('argon/img/brand/ar-rahn-take-2.gif') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-n9 top-0">
|
||||
<x-dashboard-card
|
||||
title="Jum. Pembiayaan Semasa"
|
||||
@@ -61,6 +112,17 @@
|
||||
</script>
|
||||
@enderror
|
||||
|
||||
@if (session('errorvalidate'))
|
||||
<script>
|
||||
Swal.fire(
|
||||
"Pembayaran Gagal.",
|
||||
"{{ session('errorvalidate') }}",
|
||||
'error'
|
||||
)
|
||||
</script>
|
||||
@endif
|
||||
|
||||
|
||||
@if (\Session::has('error'))
|
||||
<script>
|
||||
Swal.fire(
|
||||
@@ -83,6 +145,21 @@
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<div class="d-flex justify-content-center mb-4">
|
||||
<x-dashboard-card-small
|
||||
title="Baki Lelong"
|
||||
:subtitle="number_format($customerLelong['bakilelong'] ?? 0, 2)"
|
||||
icon="fas fa-chart-bar"
|
||||
iconState="danger"
|
||||
/>
|
||||
<x-dashboard-card-small
|
||||
title="Rugi Lelong"
|
||||
:subtitle="number_format($customerLelong['rugilelong'] ?? 0, 2)"
|
||||
icon="fas fa-chart-bar"
|
||||
iconState="warning"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@if (request()->get('filter') == 'pembiayaan-akan-dilelong')
|
||||
<x-dashboard-notification>
|
||||
<x-dashboard-notification.item content="1. Sekiranya Lelongan Anda Dalam Tempoh Kontrak Lanjutan (Mencapai 12 Bulan), Urusan Penebusan Hanya Dibenarkan Di Kaunter Cawangan Selewatnya-lewatnya 3 Hari Sebelum Tarikh Lelong." />
|
||||
@@ -137,27 +214,29 @@
|
||||
});
|
||||
|
||||
let totalSagInCart = [];
|
||||
|
||||
let updateSagInCart = function(norujukan){
|
||||
|
||||
let totaltagSyarikat = [];
|
||||
let updateSagInCart = function(norujukan,syarikat){
|
||||
let isNorujukanIsAlreadyInCart = totalSagInCart.includes(norujukan);
|
||||
|
||||
if(isNorujukanIsAlreadyInCart){
|
||||
totalSagInCart = totalSagInCart.filter(x => x != norujukan);
|
||||
}
|
||||
let index = totalSagInCart.indexOf(norujukan);
|
||||
totalSagInCart = totalSagInCart.filter(x => x != norujukan);
|
||||
totaltagSyarikat.splice(index, 1);
|
||||
}
|
||||
|
||||
if(! isNorujukanIsAlreadyInCart){
|
||||
totalSagInCart.push(norujukan);
|
||||
totaltagSyarikat.push(syarikat);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Add event listener to checkboxes to update total count customer wants to pay
|
||||
$('#main-table').on('input', 'input[type="checkbox"][name="chkboxsag[]"]', function(el) {
|
||||
let norujukan = el.target.dataset.norujukan;
|
||||
let tagsyarikat = el.target.dataset.syarikat;
|
||||
let isNorujukanIsChecked = el.target.checked;
|
||||
|
||||
updateSagInCart(norujukan);
|
||||
updateSagInCart(norujukan,tagsyarikat);
|
||||
|
||||
document.getElementById('totalsag').innerHTML = totalSagInCart.length;
|
||||
});
|
||||
@@ -172,8 +251,77 @@
|
||||
totalSagInCartInput.value = JSON.stringify(totalSagInCart);
|
||||
event.target.appendChild(totalSagInCartInput);
|
||||
|
||||
event.target.submit();
|
||||
let listSyarikatinCartInput = document.createElement('input');
|
||||
listSyarikatinCartInput.type = 'hidden';
|
||||
listSyarikatinCartInput.name = 'listSyarikatinCartInput';
|
||||
listSyarikatinCartInput.value = JSON.stringify(totaltagSyarikat);
|
||||
event.target.appendChild(listSyarikatinCartInput);
|
||||
|
||||
(async () => {
|
||||
const cartsAvailable = await checkCarts();
|
||||
if (!cartsAvailable || (typeof cartsAvailable === 'object' && Object.keys(cartsAvailable).length === 0)) {
|
||||
// console.log('No carts available or an error occurred.');
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
loader.classList.remove('d-none');
|
||||
event.target.submit();
|
||||
return;
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: "Troli Anda Masih Ada Lagi?",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: "Pergi Ke Troli",
|
||||
denyButtonText: `Buang Troli`,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
}).then((result) => {
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
loader.classList.remove('d-none');
|
||||
if (result.isDenied) {
|
||||
let remove_carts = fetch('/deletecarts', {method: 'GET', headers: {'Content-Type': 'application/json','Accept': 'application/json'}})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('HTTP error ' + response.status);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.catch(error => console.error(error));
|
||||
|
||||
}
|
||||
event.target.submit();
|
||||
});
|
||||
|
||||
})();
|
||||
});
|
||||
|
||||
const checkCarts = async () => {
|
||||
try {
|
||||
const response = await fetch('/showcarts-available', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('HTTP error ' + response.status);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error('Error fetching carts:', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('pageshow', (event) => {
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
if (loader) {
|
||||
loader.classList.add('d-none');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
<!-- <div style="text-align: center;"><img src="{{ asset('/argon/img/brand/arrahnpay3.png') }}" style="text-align: center;"></div> -->
|
||||
<h6 style="text-align: center; margin-bottom: 10%;">Log Masuk</h6>
|
||||
|
||||
@if(session('logsemula'))
|
||||
<div class="alert alert-primary text-center font-weight-bold" style="font-size: 13px;color:white;">
|
||||
{{ session('logsemula') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form role="#" method="post" enctype="multipart/form-data" class="login-form" novalidate="novalidate">
|
||||
@csrf
|
||||
<div class="input-group input-group-outline my-3 {{ $errors->has('email') ? ' has-danger' : '' }}">
|
||||
@@ -24,8 +30,41 @@
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<div class="input-group input-group-outline mb-3">
|
||||
<input placeholder="Kata Laluan" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" type="password" name="password" id="login-password">
|
||||
<div class="input-group input-group-outline mb-3 position-relative">
|
||||
<input
|
||||
placeholder="Kata Laluan"
|
||||
class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}"
|
||||
type="password"
|
||||
name="password"
|
||||
id="login-password"
|
||||
autocomplete="current-password"
|
||||
style="padding-right: 2.5rem;"
|
||||
>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
|
||||
onclick="togglePasswordVisibility()"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon" xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="#6c757d" viewBox="0 0 16 16" style="transition: fill 0.2s; pointer-events: none;">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z"/>
|
||||
<path id="eyeIconInner" d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0"/>
|
||||
</svg>
|
||||
</span>
|
||||
<script>
|
||||
function togglePasswordVisibility() {
|
||||
const passwordInput = document.getElementById('login-password');
|
||||
const eyeIcon = document.getElementById('eyeIcon');
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" style="display: block;margin-top:-10px !important;" role="alert">
|
||||
@@ -41,7 +80,7 @@
|
||||
<button type="submit" class="btn bg-gradient-dark w-100 my-4 mb-2" onclick="loadingbtn();this.disabled=true;this.form.submit();" style="background: #4A4E59;">Masuk</button>
|
||||
</div>
|
||||
<div class="text-center mt-3" style="margin: 0% 10%;">
|
||||
<a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">Bayaran Pantas (SPARE)</a href="#">
|
||||
{{-- <a href="https://spare.arrahn.com.my/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">Bayaran Pantas (SPARE)</a href="#"> --}}
|
||||
<!-- <a href="http://e-arrahn.test/pembayaransegera" id="buttonspare" title="Pembayaran Pantas SPARE" style="color: #12B652; border: 1px solid #12B652;" class="btn my-4 mb-2" target="_blank">Bayaran Pantas (SPARE)</a href="#"> -->
|
||||
</div>
|
||||
<p class="text-sm text-center">
|
||||
|
||||
@@ -71,12 +71,9 @@
|
||||
|
||||
<!-- Control Center for Material UI Kit: parallax effects, scripts for the example pages etc -->
|
||||
<!-- Google Maps Plugin -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script>
|
||||
{{-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script> --}}
|
||||
<script src="{{ asset('assets/js/material-kit/material-kit.min.js?v=3.0.0') }}" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
<script>
|
||||
if (document.getElementsByClassName('page-header')) {
|
||||
window.onscroll = debounce(function() {
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
<link href="{{ asset('css/nucleo-icons.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('css/nucleo-svg.css') }}" rel="stylesheet">
|
||||
|
||||
<script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script>
|
||||
{{-- <script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script> --}}
|
||||
|
||||
<link href="{{ asset('css/nucleo-svg.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('argon') }}/vendor/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<link href="{{ asset('argon/css/dataTables.bootstrap4.min.css') }}" rel="stylesheet">
|
||||
<script src="{{ asset('argon') }}/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
@@ -61,6 +64,42 @@
|
||||
opacity: 0.8;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.loader-arrahn {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.loader-arrahn img {
|
||||
width: 100px; /* Image size */
|
||||
}
|
||||
|
||||
.loader-arrahn:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
border-radius: 50%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.overlay-arrahn {
|
||||
position: fixed;
|
||||
z-index: 9998;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -1,66 +1,51 @@
|
||||
<!-- <div class="container position-sticky z-index-sticky top-0">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<nav class="navbar navbar-expand-lg position-absolute top-0 z-index-3 w-100 shadow-none my-3 navbar-transparent ">
|
||||
<div class="container">
|
||||
<a class="navbar-brand text-white " href="#home" rel="tooltip" title="Designed and Coded by Creative Tim" data-placement="bottom">
|
||||
MOHAMAD HAFIZUDDIN BIN HANAFI
|
||||
</a>
|
||||
<button class="navbar-toggler shadow-none ms-2" type="button" data-bs-toggle="collapse" data-bs-target="#navigation" aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon mt-2">
|
||||
<span class="navbar-toggler-bar bar1"></span>
|
||||
<span class="navbar-toggler-bar bar2"></span>
|
||||
<span class="navbar-toggler-bar bar3"></span>
|
||||
</span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse w-100 pt-3 pb-2 py-lg-0 ms-lg-12 ps-lg-5" id="navigation">
|
||||
<ul class="navbar-nav navbar-nav-hover ms-auto">
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="#rekodpembelian">
|
||||
<i class="fa fa-list-alt me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Senarai Rekod Gadaian & Tebusan">Rekod Pembelian</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="#pemabayaran">
|
||||
<i class="fa fa-money me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Transaksi Pembayaran Upah">Pembayaran</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="#tebus">
|
||||
<i class="fa fa-exchange me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Tebus Marhun">Tebus</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="#analisa">
|
||||
<i class="fa fa-line-chart me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Analisa Marhun">Analisa</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="#analisa">
|
||||
<i class="fa fa-microchip me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Function Seterusnya">Next</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="portalprofile">
|
||||
<i class="fa fa-user me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Tetapan Profile">Profil</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item my-auto ms-3 ms-lg-0">
|
||||
<a href="loginportal" class="btn btn-sm bg-white mb-0 me-1 mt-2 mt-md-0">Log out</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<style>
|
||||
.loader-arrahn {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.loader-arrahn img {
|
||||
width: 100px; /* Image size */
|
||||
}
|
||||
|
||||
.loader-arrahn:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
border-radius: 50%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.overlay-arrahn {
|
||||
position: fixed;
|
||||
z-index: 9998;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script> let routetrolley = '{{ route("payment.action") }}';let csrftoken = '{{ csrf_token() }}';</script>
|
||||
<script src="{{ asset('js/miscellaneous/navigation-trolley.js') }}"></script>
|
||||
|
||||
<div id="load-arrahn" class="d-none">
|
||||
<div class="overlay-arrahn"></div>
|
||||
<div class="loader-arrahn text-center">
|
||||
<img src="{{ asset('argon/img/brand/ar-rahn-take-2.gif') }}">
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="container position-sticky z-index-sticky top-0">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -78,24 +63,6 @@
|
||||
</button>
|
||||
<div class="collapse navbar-collapse pt-3 pb-2 py-lg-0 w-100" id="navigation">
|
||||
<ul class="navbar-nav navbar-nav-hover ms-auto">
|
||||
{{-- <li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="{{ route('semaksag') }}">
|
||||
<i class="fa fa-list-alt me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Senarai Rekod Gadaian & Tebusan">Rekod Pembelian</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="{{ route('pembayaransag') }}">
|
||||
<i class="fa fa-money me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Transaksi Pembayaran Upah">Pembayaran</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="{{ route('analisa.index') }}">
|
||||
<i class="fa fa-line-chart me-1"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Analisa Marhun">Analisa</p>
|
||||
</a>
|
||||
</li> --}}
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a class="nav-link nav-link-icon me-2" href="{{ route('profile.edit') }}">
|
||||
<i class="fa fa-user me-1"></i>
|
||||
@@ -108,6 +75,12 @@
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Manual Pengguna">Manual Pengguna</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ms-lg-auto">
|
||||
<a id="a-redirect" class="nav-link nav-link-icon me-2 cursor-pointer" onclick="redirectTrolley()">
|
||||
<i class="fa fa-shopping-cart"></i>
|
||||
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Troli">Troli <span id="cart-count" class="badge bg-danger ms-1">0</span></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item my-auto ms-3 ms-lg-0">
|
||||
<a href="{{ route('logout') }}" class="btn btn-sm bg-white border mb-0 me-1 mt-2 mt-md-0" onclick="event.preventDefault();document.getElementById('logout-form').submit();">
|
||||
<span>{{ __('LOG KELUAR') }}</span>
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
<td>
|
||||
<input type="checkbox" name="chkboxsag[]" value="{{ $data->norujukan }}"
|
||||
id="sag-{{ $loop->iteration }}" data-norujukan="{{ $data->norujukan }}"
|
||||
{{ $data->disabled_payment ? 'disabled' : '' }} />
|
||||
data-syarikat="{{ $data->tag_syarikat }}" {{ $data->disabled_payment ? 'disabled' : '' }} />
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="marhun-detail-link">
|
||||
<span class="text-sm text-info">{{ $data->norujukan }}</span>
|
||||
<input type="hidden" name="tag_syarikat" value="{{ $data->tag_syarikat }}"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ $data->t_lelong_formatted }}</td>
|
||||
|
||||
@@ -12,16 +12,18 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
{{-- {{ dd($pembiayaan) }} --}}
|
||||
@foreach ($pembiayaan as $data)
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="chkboxsag[]" value="{{ $data->norujukan }}"
|
||||
id="sag-{{ $loop->iteration }}" data-norujukan="{{ $data->norujukan }}"
|
||||
{{ $data->disabled_payment ? 'disabled' : '' }} />
|
||||
data-syarikat="{{ $data->tag_syarikat }}" {{ $data->disabled_payment ? 'disabled' : '' }} />
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="marhun-detail-link">
|
||||
<span class="text-sm text-info">{{ $data->norujukan }}</span>
|
||||
<input type="hidden" name="tag_syarikat" value="{{ $data->tag_syarikat }}"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="hide-xs">{{ $data->tempoh }}</td>
|
||||
|
||||
@@ -117,9 +117,21 @@
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="form-group{{ $errors->has('old_password') ? ' has-danger' : '' }} input-group input-group-static mb-4">
|
||||
<div class="form-group{{ $errors->has('old_password') ? ' has-danger' : '' }} input-group input-group-static mb-4" style="position: relative;">
|
||||
<label class="form-control-label" for="input-current-password">{{ __('Kata Laluan Semasa') }}</label>
|
||||
<input type="password" name="old_password" id="input-current-password" class="form-control form-control-alternative{{ $errors->has('old_password') ? ' is-invalid' : '' }}" placeholder="Kata laluan Semasa" value="" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-50 translate-middle-y d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: calc(100% - 26px); display: flex; align-items: center; box-shadow: none;"
|
||||
onclick="togglePasswordVisibility('input-current-password', 'eyeIcon-current-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-current-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
@if ($errors->has('old_password'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -130,9 +142,21 @@
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-danger' : '' }} input-group input-group-static mb-4">
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-danger' : '' }} input-group input-group-static mb-4" style="position: relative;">
|
||||
<label class="form-control-label" for="input-password">{{ __('Kata Laluan Baharu') }}</label>
|
||||
<input type="password" name="password" id="input-password" class="form-control form-control-alternative{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="Masukkan kata laluan baharu" value="" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-50 translate-middle-y d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: calc(100% - 26px); display: flex; align-items: center; box-shadow: none;"
|
||||
onclick="togglePasswordVisibility('input-password', 'eyeIcon-new-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-new-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -140,9 +164,21 @@
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group input-group input-group-static mb-4">
|
||||
<div class="form-group input-group input-group-static mb-4" style="position: relative;">
|
||||
<label class="form-control-label" for="input-password-confirmation">{{ __('Sahkan Kata Laluan Baharu') }}</label>
|
||||
<input type="password" name="password_confirmation" id="input-password-confirmation" class="form-control form-control-alternative" placeholder="Mengesahkan kata laluan baharu" value="" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-50 translate-middle-y d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: calc(100% - 26px); display: flex; align-items: center; box-shadow: none;"
|
||||
onclick="togglePasswordVisibility('input-password-confirmation', 'eyeIcon-confirm-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-confirm-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -171,4 +207,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -234,7 +234,6 @@
|
||||
let berat = $(e).data('berat');
|
||||
let nm = $(e).data('nm');
|
||||
|
||||
console.log(pinjaman,upah12,bakipjm,berat,nm);
|
||||
|
||||
$('#pembiayaan').text('RM ' + pinjaman);
|
||||
$('#bpemb').text('RM ' + bakipjm);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<!-- Control Center for Material UI Kit: parallax effects, scripts for the example pages etc -->
|
||||
<!-- Google Maps Plugin -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script>
|
||||
{{-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script> --}}
|
||||
<script src="{{ asset('assets/js/material-kit/material-kit.min.js?v=3.0.0') }}" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Log Viewer Login</title>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: sans-serif;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
padding: 2rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 8px;
|
||||
background-color: white;
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[type="password"] {
|
||||
padding: 0.5rem;
|
||||
width: 100%;
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: red;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-container">
|
||||
<h2>Masukkan Kata Laluan Untuk Akses</h2>
|
||||
|
||||
@if (session('error'))
|
||||
<p class="error">{{ session('error') }}</p>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('log-login') }}">
|
||||
@csrf
|
||||
<input type="password" name="password" placeholder="Kata Laluan" required />
|
||||
<button type="submit">Masuk</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<link href="{{ asset('css/customportal.css') }}" rel="stylesheet">
|
||||
|
||||
<div id="marhunLoader" class="loader" style="display: none;"></div>
|
||||
{{-- <div id="marhunLoader" class="loader" style="display: none;"></div> --}}
|
||||
|
||||
<div class="modal animate__animated animate__bounceInDown" id="marhunModal">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered">
|
||||
@@ -208,20 +208,18 @@
|
||||
|
||||
@push('additional_js_scripts')
|
||||
<script>
|
||||
const showMarhunDetailModal = async function(event) {
|
||||
|
||||
const showMarhunDetailModal = async function (event, tagsyarikat) {
|
||||
event.preventDefault();
|
||||
|
||||
document.getElementById('marhunLoader').style.display = 'flex';
|
||||
const norujukan = event.target.innerHTML;
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
loader.classList.remove('d-none');
|
||||
|
||||
try {
|
||||
const response = await fetch(`/api/pembiayaan-modal-data/${norujukan}/${tagsyarikat}`);
|
||||
const data = await response.json();
|
||||
|
||||
const data = await fetch('/api/pembiayaan-modal-data/' + norujukan).then(x => x.json());
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
const formatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 2 });
|
||||
|
||||
$('#pembiayaan').text('RM' + formatter.format(data.gadaianDetails.pinjaman));
|
||||
$('#bpembiayaan').text('RM' + formatter.format(data.gadaianDetails.bakipjm));
|
||||
@@ -238,21 +236,20 @@
|
||||
$('#pinjaman_modal').val(data.gadaianDetails.pinjaman);
|
||||
$('#marhunModal').modal('show');
|
||||
|
||||
const table_bayaran_history = $('#tablehistorybayaran').DataTable();
|
||||
const table_marhun = $('#biasa').DataTable();
|
||||
|
||||
$('#tablehistorybayaran').DataTable().clear().destroy();
|
||||
let table_bayaran_history = $('#tablehistorybayaran').DataTable();
|
||||
|
||||
$('#biasa').DataTable().clear().destroy();
|
||||
let table_marhun = $('#biasa').DataTable();
|
||||
|
||||
table_bayaran_history.clear();
|
||||
data.bayaranHistoryDetails.forEach((x, index) => {
|
||||
table_bayaran_history.row.add([
|
||||
index + 1,
|
||||
x.created_at,
|
||||
`RM ${x.duit_masuk} <a target='_blank' href="${x.resit_ansuran_link}" class='btn btn-info btn-sm'><span class='fas fa-print'></span></a>`,
|
||||
]).draw(false)
|
||||
`RM ${x.duit_masuk} <a target='_blank' href="${x.resit_ansuran_link}" class='btn btn-info btn-sm'><span class='fas fa-print'></span></a>`,
|
||||
]);
|
||||
});
|
||||
table_bayaran_history.draw();
|
||||
|
||||
table_marhun.clear();
|
||||
data.marhunDetails.forEach((x, index) => {
|
||||
table_marhun.row.add([
|
||||
index + 1,
|
||||
@@ -260,16 +257,14 @@
|
||||
x.berat,
|
||||
x.karat,
|
||||
`RM ${formatter.format(x.n_marhun)}`,
|
||||
x.nota
|
||||
]).draw(false)
|
||||
x.nota,
|
||||
]);
|
||||
});
|
||||
|
||||
document.getElementById('marhunLoader').style.display = 'none';
|
||||
|
||||
table_marhun.draw();
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
// Hide loader in case of error
|
||||
document.getElementById('marhunLoader').style.display = 'none';
|
||||
} finally {
|
||||
loader.classList.add('d-none');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -277,7 +272,11 @@
|
||||
|
||||
|
||||
$('#main-table').on('click', 'a.marhun-detail-link', function(e) {
|
||||
showMarhunDetailModal(e)
|
||||
const loader = document.getElementById('load-arrahn');
|
||||
loader.classList.remove('d-none');
|
||||
|
||||
const tag_syarikat = $(this).find('input[name="tag_syarikat"]').val();
|
||||
showMarhunDetailModal(e,tag_syarikat)
|
||||
});
|
||||
|
||||
});
|
||||
@@ -290,5 +289,5 @@
|
||||
document.querySelector('#marhunModal').addEventListener('hidden.bs.modal', function(e) {
|
||||
document.querySelector('#marhunModal .modal-header a[aria-controls="pills-marhun"]').click();
|
||||
});
|
||||
</script>')
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -467,7 +467,7 @@
|
||||
<script src="../assets/vendor/jquery.scrollbar/jquery.scrollbar.min.js"></script>
|
||||
<script src="../assets/vendor/jquery-scroll-lock/dist/jquery-scrollLock.min.js"></script>
|
||||
<!-- Optional JS -->
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script>
|
||||
{{-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDTTfWur0PDbZWPr7Pmq8K3jiDp0_xUziI"></script> --}}
|
||||
<!-- Argon JS -->
|
||||
<script src="../assets/js/argon.js?v=1.2.0"></script>
|
||||
</body>
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$upahtawarruq = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
|
||||
$upahtawarruq = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'],['jeniskeuntungan' => ($bayar['tagbaru'] == 1) ? 'onepercent' : 'asal'])->json();
|
||||
@endphp
|
||||
{{ $upahtawarruq }}
|
||||
</td>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ config('app.name') }} | Pembayaran Berjaya</title>
|
||||
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
|
||||
|
||||
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
|
||||
|
||||
|
||||
<style>
|
||||
.card_shadow{
|
||||
box-shadow:0 0 6px 0 rgb(0 0 0 / 20%);
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
hr.dashed {
|
||||
border-top: 1px dashed;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="font-family: Arial, sans-serif; font-size: 12px; margin: 20px;">
|
||||
<div style="text-align: center; margin-bottom: 20px;">
|
||||
<img src="{{ asset('argon') }}/img/brand/arrahnlogo.png" height="50" alt="Logo Ar Rahn" />
|
||||
<img src="{{ asset('argon') }}/img/brand/nama.png" height="50" alt="Logo Ar Rahn" />
|
||||
</div>
|
||||
<div style="margin-bottom: 10px;">
|
||||
<small>Pelanggan yang dihargai,</small>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<small>Terima kasih kerana menggunakan perkhidmatan kami.</small>
|
||||
</div>
|
||||
<hr />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>Status Bayaran</div>
|
||||
<div style="color: #4BB543;">Berjaya</div>
|
||||
</div>
|
||||
<hr style="border-style: dashed;" />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>ID Transaksi</div>
|
||||
<div>{{ $payment_details['reference_no'] }}</div>
|
||||
</div>
|
||||
<hr style="border-style: dashed;" />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>No. Surat Akuan Gadai</div>
|
||||
<div>{{ $payment_details['norujukan'] }}</div>
|
||||
</div>
|
||||
<hr style="border-style: dashed;" />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>Nama Pelanggan</div>
|
||||
<div>{{ $payment_details['customer_name'] }}</div>
|
||||
</div>
|
||||
<hr style="border-style: dashed;" />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>Tarikh Transaksi</div>
|
||||
@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $payment_details['tarikh'] );
|
||||
$formattedweddingdate = $myDateTime->format('d/m/Y');
|
||||
@endphp
|
||||
<div>{{ $formattedweddingdate . ' ' . $payment_details['masa'] }}</div>
|
||||
</div>
|
||||
<hr style="border-style: dashed;" />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
||||
<div>Jumlah Bayaran</div>
|
||||
<div>RM {{ number_format($payment_details['total_payment'], 2) }}</div>
|
||||
</div>
|
||||
@if($gadai['hargajualan'] == 0)
|
||||
<hr style="border-style: dashed;" />
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px; color: red;">
|
||||
<div>Tarikh Lanjutan</div>
|
||||
<div>31/12/2021</div>
|
||||
</div>
|
||||
@endif
|
||||
<hr />
|
||||
<div style="color: red; margin-bottom: 10px;">
|
||||
<small>Sebarang pembayaran akan dikemaskini selepas <b>1 Jam</b> sebaik pembayaran dilakukan</small>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<small>Nota: Resit ini adalah cetakan komputer dan tandatangan tidak diperlukan.</small>
|
||||
</div>
|
||||
<div style="text-align: center; margin-top: 20px;">
|
||||
<small><b>{{ $cawangan_detail['namacaw'] }}</b></small><br />
|
||||
<small>{{ $cawangan_detail['alamat1'] . ' ' . $cawangan_detail['alamat2'] }}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.print();
|
||||
setTimeout(function () {
|
||||
window.close();
|
||||
}, 100);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -126,12 +126,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 text-center" id="rem">
|
||||
<a class="btn btn-primary"onclick="loadingbtn();" href="{{ route('home') }}">Kembali Muka Hadapan</a>
|
||||
<button class="btn btn-primary" onclick="cetakresit()">Cetak Resit</button>
|
||||
<form method="POST" name="generateresit" action="{{ route('resit.pdf') }}" target="_blank" id="myForm">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 text-center" id="rem">
|
||||
@csrf
|
||||
<input type="hidden" name="billplzid" value="{{ $payment_details['billplz_id'] }}">
|
||||
<input type="hidden" name="norujukan" value="{{ $payment_details['norujukan'] }}">
|
||||
<input type="hidden" name="company" value="{{ $company }}">
|
||||
<input type="hidden" name="jenis" value="pdf">
|
||||
<a class="btn btn-primary"onclick="loadingbtn();" href="{{ route('home') }}">Kembali Muka Hadapan</a>
|
||||
<button class="btn btn-primary" onclick="cetakresit()">Cetak Resit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -139,13 +146,11 @@
|
||||
<script>
|
||||
|
||||
function cetakresit()
|
||||
{
|
||||
let hiding = document.getElementById("rem");
|
||||
{
|
||||
let form = document.getElementById("myForm");
|
||||
|
||||
hiding.style.display = "none";
|
||||
window.print();
|
||||
hiding.style.display = "block";
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -36,10 +36,46 @@
|
||||
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||
|
||||
|
||||
<center>
|
||||
<span class="far fa-check-circle fa-6x" style="color:green;"></span>
|
||||
<h4 class="text-success mt-1 mb-1">Pembayaran Berjaya</h4>
|
||||
@if($exist_carts)
|
||||
<span class="text-dark">
|
||||
Terima kasih atas pembayaran! Anda akan dibawa ke troli dalam masa <span id="remaining">10</span> saat.
|
||||
</span>
|
||||
<script>
|
||||
let remainingElement = document.getElementById('remaining');
|
||||
let remainingSeconds = parseInt(remainingElement.textContent, 10);
|
||||
|
||||
const remaining_countdown = () => {
|
||||
if (remainingSeconds > 0) {
|
||||
remainingSeconds--;
|
||||
remainingElement.textContent = remainingSeconds;
|
||||
} else {
|
||||
clearInterval(interval);
|
||||
let form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = '{{ route("payment.action") }}';
|
||||
|
||||
let csrfInput = document.createElement('input');
|
||||
csrfInput.type = 'hidden';
|
||||
csrfInput.name = '_token';
|
||||
csrfInput.value = '{{ csrf_token() }}';
|
||||
form.appendChild(csrfInput);
|
||||
|
||||
let redirectInput = document.createElement('input');
|
||||
redirectInput.type = 'hidden';
|
||||
redirectInput.name = 'redirect_trolley';
|
||||
redirectInput.value = 'trolley';
|
||||
form.appendChild(redirectInput);
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
|
||||
const interval = setInterval(remaining_countdown, 1000);
|
||||
</script>
|
||||
@endif
|
||||
<div class="row mb-4" style="margin-top:10px;">
|
||||
<div class="col-12 text-dark"><small>*Sebarang pembayaran akan dikemaskini selepas <b>1 Jam</b></small></div>
|
||||
</div>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$koskeuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json();
|
||||
$koskeuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'],['jeniskeuntungan' => ($bt['tagbaru'] == 1) ? 'onepercent' : 'asal'])->json();
|
||||
$keuntungan_1bln = $bt['pinjaman'] * ($bt['kadarupah'] / 100);
|
||||
$ten_percent = floatval($bt['nilaimarhun']) * 0.1;
|
||||
$baki_pinjaman = floatval($bt['bakipjm']);
|
||||
|
||||
@@ -55,7 +55,8 @@
|
||||
}
|
||||
|
||||
#nosiri {
|
||||
text-align: right;
|
||||
text-align: left;
|
||||
padding-left: 13px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
@@ -67,8 +68,16 @@
|
||||
}
|
||||
|
||||
#title p {
|
||||
/*
|
||||
width: 700px;
|
||||
font-size: 13px;
|
||||
vertical-align: text-top; */
|
||||
height: 30px;
|
||||
vertical-align: text-top;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-family: "Times New Roman", Times, serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#details {
|
||||
@@ -88,13 +97,23 @@
|
||||
}
|
||||
#details td {
|
||||
width: 25%;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
|
||||
#detail {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#detail td {
|
||||
text-align: justify; /
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#note {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -103,6 +122,17 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
#detail {
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
}
|
||||
.custom-box {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<table style="width:100%;">
|
||||
<tr>
|
||||
@@ -124,11 +154,22 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="nosiri">
|
||||
<p>Tarikh Cetak: {{$tarikh_cetak}}</p>
|
||||
<p>No Siri: {{$nosiri}}</p>
|
||||
</div>
|
||||
</td>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="margin-left: 15px;">
|
||||
@php
|
||||
echo '<img src="data:image/png;base64,' .
|
||||
DNS1D::getBarcodePNG($gadai_details['norujukan'], 'C128', 1, 30) .
|
||||
'" alt="barcode" />';
|
||||
@endphp
|
||||
</div>
|
||||
<div id="nosiri">
|
||||
<p>Tarikh Cetak: {{$tarikh_cetak}}</p>
|
||||
<p>No Siri: {{$nosiri}}</p>
|
||||
<p>Cetakan: Ar-Rahn Pay</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div class="grid-container flex-print" style="margin-bottom: 10px;">
|
||||
@@ -171,39 +212,36 @@
|
||||
|
||||
<table id="details" style="margin-top:20px; width:100%;">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Saya seperti nama di atas, ingin memaklumkan kepada Ar-Rahn Koperasi Permodalan Kelantan Berhad
|
||||
bagi Cawangan {{ $cawangan_detail['namacaw'] }}, bahawa saya tidak dapat hadir untuk melakukan transaksi:
|
||||
</td>
|
||||
</tr>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span>
|
||||
<th><input type="checkbox"></td>
|
||||
<th>Penyelesaian Penuh</td>
|
||||
</span>
|
||||
Saya seperti nama di atas, ingin memaklumkan kepada Ar-Rahn Koperasi Permodalan Kelantan Berhad
|
||||
bagi Cawangan {{ $cawangan_detail['namacaw'] }}, bahawa saya tidak dapat hadir untuk melakukan transaksi:
|
||||
</td>
|
||||
<!-- <td colspan="2">
|
||||
<span>
|
||||
<th><input type="checkbox"></td>
|
||||
<th>Penyelesaian Penuh dan Permohonan Pembiayaan Baru</td>
|
||||
</span>
|
||||
</td> -->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:20px;">
|
||||
<tr>
|
||||
<td colspan="2">1. Saya melantik nama dibawah sebagai wakil bagi pihak saya untuk transaksi sebagaimana di atas. Maklumat wakil adalah seperti berikut:</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="detail" style="margin-top:10px;">
|
||||
<tr>
|
||||
<td colspan="2">2. Saya mengaku tidak akan membuat apa-apa Tuntutan @ Ganti Rugi atas kebarangkalian @ kerugian yang berlaku disebabkan perlantikan wakil bagi apa-apa transaksi sebagai wakil saya.
|
||||
<td >
|
||||
<input type="checkbox" id="agree-box" class="custom-box"><strong>Penyelesaian Penuh</strong>
|
||||
<input type="checkbox" id="agree-box" class="custom-box"><strong>Penyelesaian Penuh dan Permohonan Pembiayaan Baru</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:20px;">
|
||||
<table id="details" style="margin-top:20px; width:100%;">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
1. Saya melantik nama dibawah sebagai wakil bagi pihak saya untuk transaksi sebagaimana di atas. Maklumat wakil adalah seperti
|
||||
berikut:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">2. Saya mengaku tidak akan membuat apa-apa Tuntutan @ Ganti Rugi atas kebarangkalian @
|
||||
kerugian yang berlaku disebabkan perlantikan wakil bagi apa-apa transaksi sebagai wakil saya.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:10px;">
|
||||
<tr>
|
||||
<th style="width: 180px">Nama </td>
|
||||
<td>:</td>
|
||||
@@ -228,16 +266,16 @@
|
||||
|
||||
<table id="details" style="margin-top:10px; width: 100%; text-align: left;">
|
||||
<tr>
|
||||
<th style="width: 33%;">Tandatangan Pelanggan</th>
|
||||
<th style="width: 33%;">Tandatangan Wakil</th>
|
||||
<th style="width: 33%; height:50px;">Tandatangan Pelanggan</th>
|
||||
<th style="width: 33%; height:50px;">Tandatangan Wakil</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 10px;">
|
||||
<td style="padding: 10px; height:50px;" >
|
||||
___________________________________<br>
|
||||
Nama : {{$customer_detail['nama']}}<br>
|
||||
Tarikh :
|
||||
</td>
|
||||
<td style="padding: 10px;">
|
||||
<td style="padding: 10px; height:50px;">
|
||||
___________________________________<br>
|
||||
Nama : <br>
|
||||
Tarikh :
|
||||
@@ -247,10 +285,10 @@
|
||||
|
||||
<table id="details" style="margin-top:10px; width: 100%; text-align: left;">
|
||||
<tr>
|
||||
<th style="width: 33%;">Tandatangan Pengurus Cawangan</th>
|
||||
<th style="width: 33%; height:50px;">Tandatangan Pengurus Cawangan</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 10px;">
|
||||
<td style="padding: 10px; height:50px;">
|
||||
___________________________________<br>
|
||||
Nama : <br>
|
||||
Tarikh :
|
||||
@@ -262,13 +300,12 @@
|
||||
|
||||
<div id="note">
|
||||
<p>*Penting:</p>
|
||||
<p> a) Sila lampirkan bersama:</p>
|
||||
<p> a) Sila lampirkan bersama:</p>
|
||||
<p> i. Salinan kad pengenalan diri pelanggan dan kad pengenalan diri wakil yang dilantik.</p>
|
||||
<p> ii. SAG asal pelanggan</p>
|
||||
<p> b) Pastikan tandatangan pelanggan adalah sama dengan tandatangan di Surat Akuan Gadai.</p>
|
||||
<p> b) Pastikan tandatangan pelanggan di dalam Surat Perlantikan Wakil ini adalah sama dengan tandatangan di Surat Akuan Gadai.</p>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -98,9 +98,21 @@
|
||||
@endif
|
||||
|
||||
<div class="pl-lg-4">
|
||||
<div class="form-group{{ $errors->has('old_password') ? ' has-danger' : '' }}">
|
||||
<div class="form-group{{ $errors->has('old_password') ? ' has-danger' : '' }}" style="position: relative;">
|
||||
<label class="form-control-label" for="input-current-password">{{ __('Current Password') }}</label>
|
||||
<input type="password" name="old_password" id="input-current-password" class="form-control form-control-alternative{{ $errors->has('old_password') ? ' is-invalid' : '' }}" placeholder="{{ __('Current Password') }}" value="" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-50 translate-middle-y d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: calc(100% - 26px); display: flex; align-items: center; box-shadow: none;"
|
||||
onclick="togglePasswordVisibility('input-current-password', 'eyeIcon-current-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-current-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
@if ($errors->has('old_password'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -108,9 +120,21 @@
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-danger' : '' }}">
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-danger' : '' }}" style="position: relative;">
|
||||
<label class="form-control-label" for="input-password">{{ __('New Password') }}</label>
|
||||
<input type="password" name="password" id="input-password" class="form-control form-control-alternative{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ __('New Password') }}" value="" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-50 translate-middle-y d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: calc(100% - 26px); display: flex; align-items: center; box-shadow: none;"
|
||||
onclick="togglePasswordVisibility('input-password', 'eyeIcon-new-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-new-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -118,9 +142,21 @@
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group" style="position: relative;">
|
||||
<label class="form-control-label" for="input-password-confirmation">{{ __('Confirm New Password') }}</label>
|
||||
<input type="password" name="password_confirmation" id="input-password-confirmation" class="form-control form-control-alternative" placeholder="{{ __('Confirm New Password') }}" value="" required>
|
||||
<span
|
||||
class="input-group-text border-0 position-absolute end-0 top-50 translate-middle-y d-flex align-items-center"
|
||||
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: calc(100% - 26px); display: flex; align-items: center; box-shadow: none;"
|
||||
onclick="togglePasswordVisibility('input-password-confirmation', 'eyeIcon-confirm-password')"
|
||||
tabindex="0"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
<svg id="eyeIcon-confirm-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
|
||||
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
|
||||
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
@@ -137,4 +173,18 @@
|
||||
|
||||
{{-- @include('layouts.footers.auth') --}}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function togglePasswordVisibility(inputId, iconId) {
|
||||
const passwordInput = document.getElementById(inputId);
|
||||
const eyeIcon = document.getElementById(iconId);
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
eyeIcon.setAttribute('fill', '#12B652');
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
eyeIcon.setAttribute('fill', '#6c757d');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
+1
-1
@@ -25,4 +25,4 @@ Route::get('/billplz', BillplzController::class);
|
||||
Route::get('/billplz-transaction-review', [BillplzTransactionReviewController::class, 'index']);
|
||||
Route::get('/billplz-transaction-review/{bill_id}', [BillplzTransactionReviewController::class, 'show']);
|
||||
|
||||
Route::get('/pembiayaan-modal-data/{norujukan}', [PembiayaanService::class, 'getMarhunModalData']);
|
||||
Route::get('/pembiayaan-modal-data/{norujukan}/{tagsyarikat}', [PembiayaanService::class, 'getMarhunModalData']);
|
||||
|
||||
+33
-7
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Rap2hpoutre\LaravelLogViewer\LogViewerController;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
@@ -13,9 +14,9 @@ use Illuminate\Support\Facades\Route;
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/test', function(){
|
||||
return view('testconfig');
|
||||
});
|
||||
// Route::get('/test', function(){
|
||||
// return view('testconfig');
|
||||
// });
|
||||
|
||||
Route::get('/email', function () {
|
||||
return view('/email/test');
|
||||
@@ -52,13 +53,35 @@ Route::get('/bayarsag', function () {
|
||||
return view('/includes/bayaran/pembayaransag');
|
||||
});
|
||||
|
||||
Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index']);
|
||||
|
||||
if (app()->environment('local')) {
|
||||
|
||||
Route::middleware(['logauth'])->get('logs', [LogViewerController::class, 'index'])
|
||||
->name('log-viewer');
|
||||
|
||||
Route::post('/log-login', function (Request $request) {
|
||||
if ($request->input('password') === env('LOGVIEWER_PASSWORD', '12345')) {
|
||||
$request->session()->put('logviewer_authenticated', true);
|
||||
$request->session()->put('logviewer_authenticated_at', now());
|
||||
return redirect()->route('log-viewer');
|
||||
}
|
||||
|
||||
return redirect()->route('log-login')->with('error', 'Katalaluan Salah!');
|
||||
});
|
||||
|
||||
Route::get('/log-login', function () {
|
||||
return view('logs.login');
|
||||
})->name('log-login');
|
||||
}
|
||||
|
||||
|
||||
Route::get('/', [App\Http\Controllers\HomeController::class, 'buffer'])->name('buffer');
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
|
||||
Auth::routes(['verify' => true]);
|
||||
Route::middleware('registerauth')->get('/register', [App\Http\Controllers\Auth\RegisterController::class, 'showRegistrationForm'])->name('register');
|
||||
Route::post('/register', [App\Http\Controllers\Auth\RegisterController::class, 'register']);
|
||||
|
||||
Auth::routes(['register'=> false,'verify' => true]);
|
||||
|
||||
|
||||
Route::group(['middleware' => 'auth'], function () {
|
||||
@@ -101,7 +124,7 @@ Route::group(['middleware' => 'auth','verified'], function () {
|
||||
Route::get('/penyata/summaryarrahn/{kodcaw}/{norujukan}', 'App\Http\Controllers\SemakController@PenyataSummaryUpah')->name('penyata.summaryupah');
|
||||
|
||||
Route::get('/resit/tebus/{kodcaw}/{norujukan}',['as'=>'resit.tebus','uses'=>'App\Http\Controllers\SemakController@resittebus']);
|
||||
Route::get('/resit/{id}',['as'=>'resit.ansuran','uses'=>'App\Http\Controllers\SemakController@resit']);
|
||||
Route::get('/resit/{id}/{company}',['as'=>'resit.ansuran','uses'=>'App\Http\Controllers\SemakController@resit']);
|
||||
|
||||
|
||||
|
||||
@@ -119,6 +142,9 @@ Route::group(['middleware' => 'auth','verified'], function () {
|
||||
Route::put('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']);
|
||||
Route::get('/cust/print.suratwakil/{kodcaw}/{norujukan}',['as'=>'cust.print.suratwakil','uses'=>'App\Http\Controllers\ProfileController@printSuratWakil']);
|
||||
|
||||
Route::post('/generate-resit', 'App\Http\Controllers\BayaranController@generateResit')->name('resit.pdf');
|
||||
Route::get('/showcarts-available','App\Http\Controllers\BayaranController@UserCheckCarts')->name('checkcarts');
|
||||
Route::get('/deletecarts','App\Http\Controllers\BayaranController@removeCarts')->name('removecarts');
|
||||
});
|
||||
|
||||
Route::get('/requestic', 'App\Http\Controllers\TacController@requestKadPengenalan')->name('requestic');
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user